Lava Titan
Developer
Hi, I'm having an issue in stopping addEvent if I move:
This is a simple countdown function, it's triggered by stepIn on a tile, now my issue is that if I change position the countdown continues..
I also tried with storages but it didn't work
Lua:
local function countdown(number, position, fromPosition, thingPos, msgx)
local count = number
for time = 1, number do
if getThingPos(cid).x == 998 and getThingPos(cid).y == 995 and getThingPos(cid).z == 5 then
addEvent(doSendAnimatedText, time * 1000, thingPos, count > 1 and count.."" or msgx .."", count < 30 and TEXTCOLOR_RED or TEXTCOLOR_GREEN)
count = count -1
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You moved, timer was canceled.")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
end
count = number
end
This is a simple countdown function, it's triggered by stepIn on a tile, now my issue is that if I change position the countdown continues..
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition)
countdown(timeInside, position, fromPosition, getThingPos(cid), "Timeout!")
return true
end
I also tried with storages but it didn't work
Last edited: