Why don't this script remove the teleport at the ending? What do I do wrong? Everything works except that the teleport wont dissapear when you pull the 1946 lever.
Code:
function onUse(cid, item, frompos, item2, topos)
thingpos = {x=2944, y=2499, z=9, stackpos=1}
getthing = getThingfromPos(thingpos)
tile1 = {x=2935, y=2523, z=9, stackpos=1} --change tilepos
gettile1 = getThingfromPos(tile1)
local npos = {x=2971, y=2518, z=9}
if item.uid == 2012 and item.itemid == 1945 and getthing.itemid == 2639 then
doTransformItem(item.uid,item.itemid+1)
doCreateTeleport(1387, npos, tile1)
elseif item.uid == 2012 and item.itemid == 1946 and getthing.itemid == 2639 then
local getTeleport = getThingfromPos(tile1)
if getTeleport.itemid == TELEPORT_ITEMID then
doRemoveItem(getTeleport.uid)
doTransformItem(item.uid,item.itemid-1)
end
end
end
Last edited: