whiteblXK
Active Member
Hello, I writed simple spell for monsters which quickly repeats the combat, but while continues addEvent monster will die, server is crashed. Why and how to fix that?
I using TFS 1.3
I using TFS 1.3
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 11)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 4)
function onCastSpell(creature, variant)
for i = 1, 5 do
addEvent(function()
if isCreature(creature) then
combat:execute(creature, variant)
end
end, (i * 300))
end
end