Exedion
Active Member
- Joined
- Jun 11, 2007
- Messages
- 628
- Reaction score
- 30
Hi! i get this function from @Evil Hero in another thread but dont work, here is the error in the tfs console
and here is the function
i use otclient, thanks in advanced
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/custom/animatedtest.lua:onUse
attempt to index a nil value
stack traceback:
[C]: at 0x7ff7a1d6bf90
[C]: in function 'addPosition'
data/global.lua:106: in function <data/global.lua:103>
and here is the function
Code:
function sendAnimatedText(pos, text, color)
animatedText = NetworkMessage()
animatedText:addByte(0x84)
animatedText: addPosition (heading)
animatedText:addString(text)
animatedText: addByte (color)
local list = Game.getSpectators(pos, false, true)
for _, player in pairs(list) do
if player:getClient().os >= CLIENTOS_OTCLIENT_LINUX then
animatedText:sendToPlayer(player)
else
print("cannot send animated text to player: ".. player:getName() .." due to the fact that he does not use OTClient.")
end
end
animatedText:reset()
end
i use otclient, thanks in advanced