Hello.
I've been following tutorials on Lua scripting and made some of my own with no problems like removing 3 walls with movements.lua and some advanced quests. Anyways..
Failed many many times when trying to make one specific action using a lever/switch.
What I need is a script like this.
You pull a lever.
A magicwall removes and a ladder appears so you can go down.
When you pull it again it add a tile id 407 and put magicwall back to the same place.
This is the default script but I want you guys to add ladder id 428 and when you remove ladder i want tile id 407 to appear or the magicwall will fall down in the ladder hole.
I've been following tutorials on Lua scripting and made some of my own with no problems like removing 3 walls with movements.lua and some advanced quests. Anyways..
Failed many many times when trying to make one specific action using a lever/switch.
What I need is a script like this.
You pull a lever.
A magicwall removes and a ladder appears so you can go down.
When you pull it again it add a tile id 407 and put magicwall back to the same place.
Lua:
function onUse(cid, item, frompos, item2, topos)
gatepos = {x = 32266, y = 31860, z = 11, stackpos = 1}
getgate = getThingfromPos(gatepos)
if item.uid == 9008 and item.itemid == 1945 and getgate.itemid == 1498 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 9008 and item.itemid == 1946 and getgate.itemid == 0 then
doCreateItem(1498,1,gatepos)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Not Possible")
end
return TRUE
end
This is the default script but I want you guys to add ladder id 428 and when you remove ladder i want tile id 407 to appear or the magicwall will fall down in the ladder hole.