Spoking
Oldschool Developer
- Joined
- Sep 4, 2007
- Messages
- 434
- Reaction score
- 34
Hello,
I can't figure out why my script is not working, so if there is anyone here that knows, please post.
You have to pull 3 switches, and once that is done, a ladder appears.
If the switches aren't ID 1946, remove the ladder if there is a ladder.
I can't figure out why my script is not working, so if there is anyone here that knows, please post.
Code:
local ladderpos = {x=1000, y=1000, z=7}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local a, b, c =
getTileItemById({x=999, y=999, z=7}, 1946).uid,
getTileItemById({x=1000, y=999, z=7}, 1946).uid,
getTileItemById({x=1001, y=999, z=7}, 1946).uid
if item.itemid == 1945 then
doTransformItem(item.uid,item.itemid+1)
if 0<a and 0<b and 0<c then
local v = getTileItemById(ladderpos, 1386).uid
if v < 1 then
doCreateItem(1386, 1, ladderpos)
end
end
elseif item.itemid == 1946 then
local v = getTileItemById(ladderpos, 1386).uid
doTransformItem(item.uid,item.itemid-1)
if 0>a or 0>b or 0>c and v>0 then
doRemoveItem(v)
end
end
end
You have to pull 3 switches, and once that is done, a ladder appears.
If the switches aren't ID 1946, remove the ladder if there is a ladder.