Loremaster7
New Member
- Joined
- Oct 16, 2017
- Messages
- 29
- Reaction score
- 4
Hello, friends i want a lever to remove another lever, but when I restart it again, do not miss the unique ID
Script lever 1:
function onUse(cid, item, frompos, item2, topos)
wall1 = {x=389, y=379, z=13, stackpos=1}
getwall1 = getThingfromPos(wall1)
lever = 1946
if item.uid == 6001 and item.itemid == 1945 then
doRemoveItem(getwall1.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 6001 and item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
doCreateItem(1946, 1, wall1)
doItemSetAttribute(doCreateItem(lever, 1, wall1), "uid", 6002)
end
return 1
end
*******
Script lever 2:
function onUse(cid, item, frompos, item2, topos)
wall1 = {x=388, y=378, z=13, stackpos=1}
getwall1 = getThingfromPos(wall1)
lever = 1945
if item.uid == 6002 and item.itemid == 1946 then
doRemoveItem(getwall1.uid,1)
doTransformItem(item.uid,item.itemid-1)
elseif item.uid == 6002 and item.itemid == 1945 then
doTransformItem(item.uid,item.itemid+1)
doCreateItem(1945,1,wall1)
doItemSetAttribute(doCreateItem(lever, 1, wall1), "uid", 6001)
end
return 1
end
*******
Actions ID's:
<action uniqueid="6001" script="leverA.lua" />
<action uniqueid="6002" script="leverB.lua" />
********
The two levers remove each one, one...
Example:
A remove B
B remove A
Two levers...
Help! Please...
This script working 50% because in Otserver have a bug... The lever doubles ...
My server is OTX 7.72!
Script lever 1:
function onUse(cid, item, frompos, item2, topos)
wall1 = {x=389, y=379, z=13, stackpos=1}
getwall1 = getThingfromPos(wall1)
lever = 1946
if item.uid == 6001 and item.itemid == 1945 then
doRemoveItem(getwall1.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 6001 and item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
doCreateItem(1946, 1, wall1)
doItemSetAttribute(doCreateItem(lever, 1, wall1), "uid", 6002)
end
return 1
end
*******
Script lever 2:
function onUse(cid, item, frompos, item2, topos)
wall1 = {x=388, y=378, z=13, stackpos=1}
getwall1 = getThingfromPos(wall1)
lever = 1945
if item.uid == 6002 and item.itemid == 1946 then
doRemoveItem(getwall1.uid,1)
doTransformItem(item.uid,item.itemid-1)
elseif item.uid == 6002 and item.itemid == 1945 then
doTransformItem(item.uid,item.itemid+1)
doCreateItem(1945,1,wall1)
doItemSetAttribute(doCreateItem(lever, 1, wall1), "uid", 6001)
end
return 1
end
*******
Actions ID's:
<action uniqueid="6001" script="leverA.lua" />
<action uniqueid="6002" script="leverB.lua" />
********
The two levers remove each one, one...
Example:
A remove B
B remove A
Two levers...
Help! Please...
This script working 50% because in Otserver have a bug... The lever doubles ...
My server is OTX 7.72!
Last edited: