• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Action Remove and auto Create Wall in seconds with Lever

dhrsantan

A.K.A Lbakiller
Joined
Nov 27, 2014
Messages
94
Reaction score
10
Location
The netherlands
Credits go to: megachock for the original script.
original topic: http://otland.net/threads/my-first-script-remove-and-auto-create-wall-in-seconds-with-lever.180808/
I just made it possible to disable the timer.

the script:
Code:
local pos = {x = 1018, y = 962, z = 7}
local wall = 1544
local seconds = 0 -- use 0 to disable
local event = 0

local function reset(leverPos)
        local lever = getTileItemById(leverPos, 1946).uid
    doTransformItem(lever, 1945)
    doCreateItem(wall, 1, pos)
        doPlayerSendTextMessage(cid,21,"The pass has been closed!")
end

function onUse(cid, item, fromPosition, itemEx, toPosition)


          if item.itemid == 1945 then
                doRemoveItem(getTileItemById(pos,wall).uid)
                doPlayerSendTextMessage(cid,21,"You have opened the pass, Beware!")
                if seconds > 0 then
                    event = addEvent(reset, seconds * 1000, getThingPos(item.uid))
                end
        doTransformItem(item.uid,item.itemid+1)
    elseif item.itemid == 1946 then
        stopEvent(event)
        doPlayerSendTextMessage(cid,21,"You have closed the pass!")
        doTransformItem(item.uid,item.itemid-1)
        doCreateItem(wall, 1, pos)
end
return true
end
 
Even if you didn't write the script thanks for sharing :)
 
Back
Top