I'm trying to do script for game which replaces avalible function with created function. So this is my LUA code:
function ifEmotePlayed(playerName, emoteID)
if emoteID == 0 then
print(playerName.." is dancing!")
end
end
return
function eventEmotePlayed(playerName, emoteID)
end
Exactly thing i want to do is to replace eventEmotePlayed function with ifEmotePlayed function likely
function ifEmotePlayed(playerName, emoteID)
if emoteID==0 then
print(playerName.." is dancing!")
end
end
Instead of
function eventEmotePlayed(playerName, emoteID)
if emoteID==0 then
print(playerName.." is dancing!")
end
end
Does anyone know how to do it?
local foo = function() print('first') end foo = function() print('second') end? That replaces foo with the second function definition.eventEmotePlayed = ifEmotePlayed