Hello, I hope and can help me, I have an error with a script that I found, the function you should realize is that when using a lever remove one gate .. This works fine, but the gate must return to their place in 1 minute, and throws me this error:
I use TFS 1.1

Code:
function onUse(cid, item, frompos, item2, topos)
local gatepos = {x = 1595, y = 959, z = 7, stackpos=1}
local getgate = getThingfromPos(gatepos)
local time = 60
if item.itemid == 1946 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid-1)
doPlayerSendTextMessage(cid,25,"The lever is open, you have one minute.")
addEvent(revive, time*1000)
elseif item.id == 1945 then
doTransformItem(item.uid,item.itemid+1)
end
local function revive()
doCreateItem(9533,1,gatepos)
end
return true
end
I use TFS 1.1
Last edited: