LucasFerraz
Systems Analyst
Why this script do not work?
LUA:
function onUse(cid,item,frompos,item2,topos)
player = getPlayerPosition(cid)
tesoro = {x=32346, y=32947, z=7}
if player.x == tesoro.x and player.y == tesoro.y and player.z == tesoro.z then
doPlayerAddItem(cid,2152,50)
doPlayerRemoveItem(cid,5706,1)
doCreatureSay(cid, "Treasure found yo-ho!", TALKTYPE_ORANGE_1)
elseif player.x < tesoro.x and player.y == tesoro.y and player.z == tesoro.z then
doCreatureSay(cid, "Treasure is to the west.", TALKTYPE_ORANGE_1)
elseif player.y > tesoro.y and player.x == tesoro.y and player.z == tesoro.z then
doCreatureSay(cid, "Treasure is to the north.", TALKTYPE_ORANGE_1)
elseif player.y < tesoro.y and player.x == tesoro.y and player.z == tesoro.z then
doCreatureSay(cid, "Treasure is to the south.", TALKTYPE_ORANGE_1)
elseif player.x > tesoro.x and player.y == tesoro.y and player.z == tesoro.z then
doCreatureSay(cid, "Treasure is to the east.", TALKTYPE_ORANGE_1)
elseif player.x < tesoro.x and player.y > tesoro.y == tesoro.y and player.z == tesoro.z then
doCreatureSay(cid, "Treasure is to the north-east.", TALKTYPE_ORANGE_1)
elseif player.x > tesoro.x and player.y > tesoro.y == tesoro.y and player.z == tesoro.z then
doCreatureSay(cid, "Treasure is to the north-west.", TALKTYPE_ORANGE_1)
elseif player.x < tesoro.x and player.y < tesoro.y == tesoro.y and player.z == tesoro.z then
doCreatureSay(cid, "Treasure is to the south-east.", TALKTYPE_ORANGE_1)
elseif player.x > tesoro.x and player.y < tesoro.y == tesoro.y and player.z == tesoro.z then
doCreatureSay(cid, "Treasure is to the south-west.", TALKTYPE_ORANGE_1)
end
end