Ecstacy
Mothafuckaaa
Hey,
I got a problem with a script; it won't remove a ladder, even though the UID and ITEMID are found.
This is the script:
In console:
Thanks in advance.
I got a problem with a script; it won't remove a ladder, even though the UID and ITEMID are found.
This is the script:
Lua:
local t = {
leverpos = {x=32888,y=32255,z=12,stackpos=1},
ladderpos={x=32854,y=32321,z=11,stackpos=1},
ladderpos2={x=32854,y=32321,z=11,stackpos=1},
sec = 5
}
function recreate(pos,itemid)
broadcastMessage('The ladder has been created, it will be removed in '..t.sec..' seconds!')
doCreateItem(itemid,1,pos)
end
function onStepIn(cid, item, frompos, item2, topos)
local lever,ladder = getTileThingByPos(t.leverpos),getTileThingByPos(t.ladderpos)
if lever.itemid == 1946 then
if ladder.itemid == 0 then
recreate(t.ladderpos,1386)
addEvent(print,t.sec*1000,'----\n'..getTileThingByPos(t.ladderpos2).itemid..' [uid: '..getTileThingByPos(t.ladderpos2).uid..']')
addEvent(doRemoveItem,t.sec*1000,getTileThingByPos(t.ladderpos2).uid,1)
addEvent(broadcastMessage,t.sec*1000,'The ladder has dissapeared.')
else
doRemoveItem(ladder.uid,1)
doPlayerSendCancel(cid,'The ladder is still there, wait until it dissapears!')
end
else
doPlayerSendCancel(cid,'You haven\'t pulled the switch yet!')
end
return true
end
In console:
Thanks in advance.