Spoking
Oldschool Developer
- Joined
- Sep 4, 2007
- Messages
- 434
- Reaction score
- 34
If you are on the left of the fence, you will teleport to the right on use.
Why is this not working? it's always saying: "positions aren't correct."
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local position = getThingPos(item.uid)
local playerpos = getCreaturePosition(cid)
local pos1 = {position.x - 1, y=position.y, z=position.z}
if pos1 == playerpos then
doTeleportThing(cid, {x=position.x + 1, y=position.y, z=position.z}, true)
doSendMagicEffect(getCreaturePosition(cid), 10)
else
doPlayerSendCancel(cid, "Positions aren't correct.")
end
end
Why is this not working? it's always saying: "positions aren't correct."