froy
Active Member
- Joined
- Sep 30, 2009
- Messages
- 151
- Solutions
- 3
- Reaction score
- 36
Hi!
Im creating a script where a player would use a saw on the fallen tree and gets teleported 2 squares east.
Now to the problem, if the player would use the saw from eastern side it still would get teleported 2 squares to the east.
Im wondering who I would check if the players position is < or > then X:31930 to decide where the player would teleport.
Any suggestions?
Feel free to use the script that I made for now!
Im creating a script where a player would use a saw on the fallen tree and gets teleported 2 squares east.
Lua:
function onUse(player, item, fromPosition, target, toPosition)
if not target:isItem() then
return false
end
if target:getId() == 5100 then
doRelocate(item:getPosition(),{x = item:getPosition().x + 2, y = item:getPosition().y, z = 07})
Game.sendMagicEffect(item:getPosition(), 13)
return true
end
return
end
Now to the problem, if the player would use the saw from eastern side it still would get teleported 2 squares to the east.
Im wondering who I would check if the players position is < or > then X:31930 to decide where the player would teleport.
Any suggestions?
Feel free to use the script that I made for now!