Tymofek
New Member
Hello!, i made a tiny script so if a player has cetain storage value == 1 then an animated text should come over in a 5 seconds interval.
but... looks like the interval its not working, when i reload global events, the animated text appears, but not anymore. (it should appear on 5 secs and on five secs again for ever!.)
[global events.xml]
[animated.lua]
looks fine but only works when i reload then never.
so i tought i could use the onthing function on creaturescript, but... i dont know how to set up an interval xD.
Thx in advance
but... looks like the interval its not working, when i reload global events, the animated text appears, but not anymore. (it should appear on 5 secs and on five secs again for ever!.)
[global events.xml]
PHP:
<globalevent name="animatedtext" interval="5" script="animated.lua"/>
[animated.lua]
PHP:
function onThink(interval, lastExecution)
for _, name in ipairs(getOnlinePlayers()) do
local cid = getPlayerByName(name)
if getPlayerStorageValue(cid, 4545) == 1 then
doSendMagicEffect(getPlayerPosition(cid),12)
doSendAnimatedText(getPlayerPosition(cid), "LOL!", TEXTCOLOR_BLUE)
end
end
end
looks fine but only works when i reload then never.
so i tought i could use the onthing function on creaturescript, but... i dont know how to set up an interval xD.
Thx in advance