bpm91
Intermediate OT User
- Joined
- May 23, 2019
- Messages
- 881
- Solutions
- 7
- Reaction score
- 122
- Location
- Brazil
- YouTube
- caruniawikibr
Hi guys, I'm trying to create a script to remove the walls with levers. Could anyone tell me how to improve this here?
Lua:
function onUse(cid, item, frompos, item2, topos)
gatepos1 = {x = 32862, y = 32556, z = 11, stackpos=1}
gatepos2 = {x = 32863, y = 32556, z = 11, stackpos=1}
gatepos3 = {x = 32864, y = 32556, z = 11, stackpos=1}
gatepos4 = {x = 32865, y = 32556, z = 11, stackpos=1}
getgate = getThingfromPos(gatepos) --posição da parede
if item.actionid == 2999 and item.itemid == 1945 then --primeira alavanca inicial
doRemoveItem(getgate.uid,1) -- remove a parade
doCreateItem(355,1,gatepos1)
doCreateItem(355,1,gatepos2)
doCreateItem(355,1,gatepos3)
doCreateItem(355,1,gatepos4) --piso em baixo da parede
doTransformItem(item.uid,item.itemid+1)
elseif item.actionid == 2999 and item.itemid == 1946 then --segunda alavanca cria a parede
doCreateItem(1050,1,gatepos1)
doCreateItem(1050,1,gatepos2)
doCreateItem(1050,1,gatepos3)
doCreateItem(1050,1,gatepos4) --parede--
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry not possible.")
end
return 1
end