Ahilphino
Excellent OT User
- Joined
- Jun 5, 2013
- Messages
- 1,667
- Solutions
- 1
- Reaction score
- 726
Code:
function onStepIn(cid, item, position, fromPosition)
local diagonalCheck = (fromPosition.y - position.y) - (fromPosition.x - position.x)
if diagonalCheck == -1 or diagonalCheck == 1 then
print("nice u are walking in straight line and not diagonal")
end
return true
end
ok so this is working and everything but my solution seems a bit messy.
I just want an easy way to check if the player is walking diagonally or not. Right now it works as it should, but maybe there's some better way to check it. Just wondering. Thanks !
Last edited: