xardas33
New Member
- Joined
- Jan 28, 2010
- Messages
- 83
- Reaction score
- 0
Hello guys. Can you help me with edit my script? I used script on two levers and i want to do this:
When I switch first lever, second lever with same ID (action, unique) automatically switches too. How to do that ? Or if I switch second lever, first switches automatically too. (switches back too)
Here is my script:
When I switch first lever, second lever with same ID (action, unique) automatically switches too. How to do that ? Or if I switch second lever, first switches automatically too. (switches back too)
Here is my script:
Code:
function onUse(cid, item, frompos, item2, topos)
bridge1 = {x=32099, y=32205, z=8, stackpos=1}
getbridge1 = getThingfromPos(bridge1)
bridge2 = {x=32100, y=32205, z=8}
getbridge2 = getThingfromPos(bridge2)
bridge3 = {x=32101, y=32205, z=8, stackpos=1}
getbridge3 = getThingfromPos(bridge3)
if item.actionid == 60002 and item.itemid == 1946 then
doCreateItem(4645,1,bridge1)
doCreateItem(351,1,bridge1)
doCreateItem(4666,1,bridge2)
doCreateItem(4647,1,bridge3)
doCreateItem(351,1,bridge3)
doTransformItem(item.uid,item.itemid-1)
elseif item.actionid == 60002 and item.itemid == 1945 then
doRemoveItem(getbridge1.uid,1)
doCreateItem(5770,1,bridge1)
doRemoveItem(getbridge2.uid,1)
doCreateItem(5770,1,bridge2)
doRemoveItem(getbridge3.uid,1)
doCreateItem(5770,1,bridge3)
doTransformItem(item.uid,item.itemid+1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
end