I've always had this trouble and I hope someone could help me here.
I got this simple teleport script:
Now, I want it to have to wait x time, before teleporting, example: You step in the tile then after 3 seconds you teleport, and maybe send some effect after each second that passes.
So I'll get something like :
I hope you get what I mean , thanks in advance.
I got this simple teleport script:
Lua:
local temple = {x = 1006, y = 999, z = 7}
shops = {x = 1025, y = 985, z = 7}
function onStepIn(cid, item, pos, fromPos)
if item.itemid == 3188 then
doTeleportThing(cid, shops)
doSendMagicEffect(shops, CONST_ME_MAGIC_GREEN)
elseif item.itemid == 3196 then
doTeleportThing(cid, temple)
doSendMagicEffect(temple, CONST_ME_MAGIC_GREEN)
end
end
Now, I want it to have to wait x time, before teleporting, example: You step in the tile then after 3 seconds you teleport, and maybe send some effect after each second that passes.
So I'll get something like :
Lua:
local temple = {x = 1006, y = 999, z = 7}
shops = {x = 1025, y = 985, z = 7}
function onStepIn(cid, item, pos, fromPos)
if item.itemid == 3188 then
passSecond()
doSendMagicEffect(cid, CONST_ME_POFF)
passSecond()
doSendMagicEffect(cid, CONST_ME_POFF)
passSecond()
doSendMagicEffect(cid, CONST_ME_POFF)
doTeleportThing(cid, shops)
doSendMagicEffect(shops, CONST_ME_MAGIC_GREEN)
elseif item.itemid == 3196 then
doTeleportThing(cid, temple)
doSendMagicEffect(temple, CONST_ME_MAGIC_GREEN)
end
end
I hope you get what I mean , thanks in advance.