knighters god
Active Member
- Joined
- Feb 14, 2009
- Messages
- 166
- Solutions
- 1
- Reaction score
- 40
So I would like some help about a lever that should summon a bridge when you right click it but when you right click the lever again it should remove the bridge. and all that is working is to summon it but the lever is stuck at "1645" instead of changing to "1646".
and some pics about it.



REP++ if help
LUA:
---By Tetra20---
function onUse(cid, item, fromPosition, itemEx, toPosition)
flagpos = {x=827, y=1162, z=7, stackpos=1}
getflag = getThingfromPos(flagpos)
flagpos1 = {x=827, y=1163, z=7, stackpos=1}
getflag1 = getThingfromPos(flagpos1)
flagpos2 = {x=827, y=1164, z=7, stackpos=1}
getflag2 = getThingfromPos(flagpos2)
flagpos3 = {x=827, y=1164, z=7, stackpos=1}
getflag3 = getThingfromPos(flagpos3)
flagpos4 = {x=827, y=1165, z=7, stackpos=1}
getflag4 = getThingfromPos(flagpos4)
flagpos5 = {x=827, y=1166, z=7, stackpos=1}
getflag5 = getThingfromPos(flagpos5)
flagpos6 = {x=827, y=1167, z=7, stackpos=1}
getflag6 = getThingfromPos(flagpos6)
flagpos7 = {x=828, y=1168, z=7, stackpos=1}
getflag7 = getThingfromPos(flagpos7)
flagpos8 = {x=828, y=1167, z=7, stackpos=1}
getflag8 = getThingfromPos(flagpos8)
flagpos9 = {x=828, y=1166, z=7, stackpos=1}
getflag9 = getThingfromPos(flagpos9)
flagpos10 = {x=828, y=1165, z=7, stackpos=1}
getflag10 = getThingfromPos(flagpos10)
flagpos11 = {x=828, y=1164, z=7, stackpos=1}
getflag11 = getThingfromPos(flagpos11)
flagpos12 = {x=828, y=1163, z=7, stackpos=1}
getflag12 = getThingfromPos(flagpos12)
flagpos13 = {x=828, y=1162, z=7, stackpos=1}
getflag13 = getThingfromPos(flagpos13)
if item.uid == 5050 and item.itemid == 1945 then
doCreateItem(1284, 1, {x=827, y=1162, z=7})
doCreateItem(1284, 1, {x=827, y=1163, z=7})
doCreateItem(1284, 1, {x=827, y=1164, z=7})
doCreateItem(1284, 1, {x=827, y=1165, z=7})
doCreateItem(1284, 1, {x=827, y=1166, z=7})
doCreateItem(1284, 1, {x=827, y=1167, z=7})
doCreateItem(1284, 1, {x=827, y=1168, z=7})
doCreateItem(1284, 1, {x=828, y=1168, z=7})
doCreateItem(1284, 1, {x=828, y=1167, z=7})
doCreateItem(1284, 1, {x=828, y=1166, z=7})
doCreateItem(1284, 1, {x=828, y=1165, z=7})
doCreateItem(1284, 1, {x=828, y=1164, z=7})
doCreateItem(1284, 1, {x=828, y=1163, z=7})
doCreateItem(1284, 1, {x=828, y=1162, z=7})
doTransformItem(item.uid, item.itemid +1)
elseif item.uid == 5050 and item.itemid == 1946 then
doRemoveItem(getflag.uid)
doRemoveItem(getflag1.uid)
doRemoveItem(getflag2.uid)
doRemoveItem(getflag3.uid)
doRemoveItem(getflag4.uid)
doRemoveItem(getflag5.uid)
doRemoveItem(getflag6.uid)
doRemoveItem(getflag7.uid)
doRemoveItem(getflag8.uid)
doRemoveItem(getflag9.uid)
doRemoveItem(getflag10.uid)
doRemoveItem(getflag11.uid)
doRemoveItem(getflag12.uid)
doRemoveItem(getflag13.uid)
doTransformItem(item.uid, item.itemid - 1)
end
end
XML:
<action uniqueid="5050" event="script" value="bridge.lua"/>



REP++ if help