bpm91
Advanced OT User
- Joined
- May 23, 2019
- Messages
- 1,021
- Solutions
- 7
- Reaction score
- 163
- Location
- Brazil
- YouTube
- caruniawikibr
Hey guys, I'm trying to make the bridge do and undo when pulling levers, but it doesn't create the floor, the lever moves
LUA:
function onUse(cid, item, frompos, item2, topos)
gatepos1 = {x=32426, y=32201, z=14, stackpos=1}
getgate1 = getThingfromPos(gatepos1)
gatepos2 = {x=32426, y=32202, z=14, stackpos=1}
getgate2 = getThingfromPos(gatepos2)
switchpos1 = {x=32428, y=32198, z=14}
switchpos2 = {x=32428, y=32203, z=14}
if item.itemid == 1946 then
doCreateItem(1284,1,gatepos1)
doCreateItem(1284,1,gatepos2)
doTransformItem(getTileItemById(switchpos1, 1946).uid,1945)
doTransformItem(getTileItemById(switchpos2, 1946).uid,1945)
elseif item.itemid == 1945 then
doRemoveItem(1284,1,gatepos1)
doRemoveItem(1284,1,gatepos2)
doTransformItem(getTileItemById(switchpos1, 1945).uid,1946)
doTransformItem(getTileItemById(switchpos2, 1945).uid,1946)
else
doPlayerSendCancel(cid,"Sorry not possible.")
end
return 1
end