0.4
Hi, I am struggling with some think I know its very easy.
I want a way to remove a creature after some time after it has been created.
I have a npc script where summons a creature, and it adds an event that removes it, but if a player kills the creature, obviously returns an error.
So I tried with creaturescripts:
Didn't return any error, but the creature didn't get removed.
I also add the event in the monster xml
How can I make this work?
Thanks.
Hi, I am struggling with some think I know its very easy.
I want a way to remove a creature after some time after it has been created.
I have a npc script where summons a creature, and it adds an event that removes it, but if a player kills the creature, obviously returns an error.
So I tried with creaturescripts:
Lua:
function onThink(creature, interval)
addEvent(function()
if isCreature(cid) then
doRemoveCreature(getCreatureByName("Demon"))
end
end, 4000)
return true
end
Didn't return any error, but the creature didn't get removed.
I also add the event in the monster xml
How can I make this work?
Thanks.