Im trying to script a quest where 2 players have to stand on different tiles in order to remove a stone. I made it so if no player is on any tiles, there's a big crystal blocking the way. If 1 player stands on a tile, it transforms to a smaller one. When the 2nd player stands on the other tile, the small crystal will disappear. I can't seem to get the if item:getId(smallcrystal) and item:getId(bigcrystal) to trigger. onStepOut works just fine since I haven't worked on that part yet.
Any ideas on how to get the if functions to trigger? Currently not getting any error messages
Tibia 8.6
TFS 1.3
Any ideas on how to get the if functions to trigger? Currently not getting any error messages
Tibia 8.6
TFS 1.3
Lua:
function onStepIn(cid, item, frompos, item2, topos)
stonepos = {x=133, y=157, z=7, stackpos=1}
getpos = getThingfromPos(stonepos)
text = "Need 1 more player"
texttwo = "Stone placed"
local bigcrystal = Tile(Position(133, 157, 7)):getItemById(8636)
local smallcrystal = Tile(Position(133, 157, 7)):getItemById(8640)
if item.uid == 64120 then
if item:getId(smallcrystal) == 8640 then
doRemoveItem(getpos.uid,1)
doTransformItem(item.uid,item.itemid-1)
doCreatureSay(cid, text, TALKTYPE_ORANGE_1)
else if item:getId(bigcrystal) == 8636 then
doTransformItem(getpos.uid,getpos.itemid+4)
doTransformItem(item.uid,item.itemid-1)
doCreatureSay(cid, text, TALKTYPE_ORANGE_1)
else
doPlayerSendCancel(cid,"Not possible.")
end
end
else
doPlayerSendCancel(cid,"Not possible.")
end
end
function onStepOut(cid, item, frompos, item2, topos)
if item.uid == 64120 then
doCreateItem(8635,1,stonepos)
doTransformItem(item.uid,item.itemid+1)
doCreatureSay(cid, texttwo, TALKTYPE_ORANGE_1)
else
doPlayerSendCancel(cid,"Sorry not possible.")
end
end