Hi there.
I am trying to do a script that every random ammount of time (3 to 4 secs) repeats some effect.
I've found something like that:
l
and
But i want the interval to be random. Tried with
and also to delete interval from globalexents.xml and change
function onThink(cid, interval, lastExecution) to function onThink(cid, math.random(3000, 4000), lastExecution)
also not working.
Could someone help me, please?
I am trying to do a script that every random ammount of time (3 to 4 secs) repeats some effect.
I've found something like that:
l
PHP:
ocal config = {
positions = {
["1"] = { x = 1074, y = 1059, z = 8 },
},
}
function onThink(cid, interval, lastExecution)
for text, pos in pairs(config.positions) do
doSendMagicEffect(pos, 5)
end
return TRUE
end
and
PHP:
<globalevent name="EffectTiles" interval="2000" event="script" value="effect.lua"/>
But i want the interval to be random. Tried with
PHP:
<globalevent name="EffectTiles" interval="math.random(3000, 4000)" event="script" value="effect.lua"/>
function onThink(cid, interval, lastExecution) to function onThink(cid, math.random(3000, 4000), lastExecution)
also not working.
Could someone help me, please?