iurygoncalves
New Member
- Joined
- Aug 14, 2008
- Messages
- 10
- Reaction score
- 0
Why this addevent doesn't work? It teleports just one time but it doesn't take the player teleporting.
function onUse(cid, item, frompos, item2, topos)
local oldPos = getCreaturePosition(cid)
addEvent(playerMove, 100, cid, oldPos)
end
function playerMove(cid)
local newPos = getCreatureLookPosition(cid, oldPos)
if getDistanceBetween(getThingPos(cid), oldPos) == 0 then
local tmp = newPos
tmp.stackpos = 253
if getTileThingByPos({x=newPos.x, y=newPos.y, z=newPos.z}).uid ~= 0 and getTilePzInfo(newPos) == FALSE and isCreature(getThingFromPos(tmp).uid) == FALSE then
doTeleportThing(cid, newPos, false)
doSendMagicEffect(oldPos, CONST_ME_GROUNDSHAKER)
end
end
end
Last edited: