Hello,
I need a script for a lever that replace an item with another, the another item should have a special action id:
a. old item id: 12471 (this item, when I touch the lever should be replaced)
b. new item id: 11759 (this item, when it will be created should have aid=8103)
I make this script:
it works but I need the new item with aid=8103.
The second is: when I touch the lever back the item 11759 should be replaced with the normal 12471 item.
Can someone help me?
I need a script for a lever that replace an item with another, the another item should have a special action id:
a. old item id: 12471 (this item, when I touch the lever should be replaced)
b. new item id: 11759 (this item, when it will be created should have aid=8103)
I make this script:
Code:
[COLOR="navy"]function onUse(cid, item, frompos, item2, topos)
gatepos = {x=1473, y=2656, z=8, stackpos=1}
getgate = getThingfromPos(gatepos)
if item.uid == 8103 and item.itemid == 1945 and getgate.itemid == 12471 then
doCreateItem(11759,1,gatepos)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 8103 and item.itemid == 1946
and getgate.itemid == 11759 then
doCreateItem(12471,1,gatepos)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
end[/COLOR]
it works but I need the new item with aid=8103.
The second is: when I touch the lever back the item 11759 should be replaced with the normal 12471 item.
Can someone help me?