Hi guys.
I need to create an infinite script with a x seconds delay.
I have already tried (just for testing):
But it still does not work, because the diff is shared on every NPC I think.
I need to script an NPC, which spams a spell every x seconds/millis. In C++ it's easy, but I assume that in Eluna it's easier.
If someone has something like this, I would be grateful.
I need to create an infinite script with a x seconds delay.
I have already tried (just for testing):
Code:
local function init(event, creature, diff)
if(cooldown <= 0) then
creature:SendUnitYell(diff, 0)
cooldown = 5000
else
cooldown = cooldown - diff
end
end
RegisterCreatureEvent(npcId, 7, init)
But it still does not work, because the diff is shared on every NPC I think.
I need to script an NPC, which spams a spell every x seconds/millis. In C++ it's easy, but I assume that in Eluna it's easier.
If someone has something like this, I would be grateful.