Pretty much if the player says the words it removes the items. The thing is when the player is in the right spot, and is looking the right way, it still returns him to the else
doPlayerSendCancel(cid, "This is not a rock you can remove")
Also, In my console it tells me that the item couldn't be found. Im assuming its stackpos related, but I did try all of them.
doPlayerSendCancel(cid, "This is not a rock you can remove")
Also, In my console it tells me that the item couldn't be found. Im assuming its stackpos related, but I did try all of them.
Lua:
-----------------Rocks------------------
local geo_start_rock = 1304 -- rock id --
--------- players position -------------
local pos = {x = 5231, y = 26071, z = 7}
local pos1 = {x = 5233, y = 26071, z = 7}
local pos2 = {x = 5233, y = 26072, z = 7}
----------------------------------------
local geo_start_rocks = {x = 5232, y = 26071, z = 7, stackpos = 255} -- position of item item want to remove --
----------------------------------------
function onCastSpell(cid, item)
if getPlayerPosition(cid) == pos and getPlayerLookDirection(cid) == 1 then
elseif getPlayerPosition(cid) == pos2 or getPlayerPosition(cid) == pos3 then
if getPlayerStorageValue(cid, geo_start) == 4 then
doPlayerSendCancel(cid, "You do not need to go here anymore.")
return false
end
else
doPlayerSendCancel(cid, "This is not a rock you can remove.")
return false
end
doRemoveItem(getThingFromPos(geo_start_rocks), geo_start_rock, 1)
end