Is there a reason I can only use this script once on TFS 0.3.2
its a addevent to change back a lever. I tryed to make the same script for other levers but is only letting 1 work and ideas?
One will work and all the rest only remove the walls not change lever back.
Thank for any help
its a addevent to change back a lever. I tryed to make the same script for other levers but is only letting 1 work and ideas?
One will work and all the rest only remove the walls not change lever back.
Thank for any help
PHP:
local wall1 = {x=841, y=1061, z=12, stackpos=1}
local wall2 = {x=841, y=1062, z=12, stackpos=1}
local wall3 = {x=841, y=1063, z=12, stackpos=1}
local leverUID = 15014
function onUse(cid, item, frompos, item2, topos)
local getwall1 = getThingfromPos(wall1)
local getwall2 = getThingfromPos(wall2)
local getwall3 = getThingfromPos(wall3)
if item.uid == leverUID and item.itemid == 1945 then
doRemoveItem(getwall1.uid,1)
doRemoveItem(getwall2.uid,1)
doRemoveItem(getwall3.uid,1)
doTransformItem(item.uid,item.itemid+1)
addEvent(resetLever, 1*60*1000)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
end
function resetLever()
local lever = getThing(leverUID)
if lever.itemid == 1946 then
doCreateItem(1025,1,wall1)
doCreateItem(1025,1,wall2)
doCreateItem(1025,1,wall3)
doTransformItem(lever.uid,lever.itemid-1)
end
end
Last edited: