• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Open and close door on monday

Sigoles

Discord: @sigoles
Joined
Nov 20, 2015
Messages
1,209
Solutions
2
Reaction score
154
Hello, someone can make an script for open door on monday and others days stay closed with action 1001?

thanks

TFS 1.2 ;)
 
Solution
untested
LUA:
local doorPos = Position(x, y, z)
local doorId = {open = xxxx, closed = yyyy} -- xxxx for open id, yyyy for closed id
local aid = 1001

function onTime()
    local tile = Tile(doorPos)
    if tile then
        if os.date("%A") == "Monday" then
            local door = tile:getItemById(doorId.closed)
            if door then
                door:transform(doorId.open)
                door:setActionId(0)
            end
        else
            local door = tile:getItemById(doorId.open)
            if door then
                door:transform(doorId.closed)
                door:setActionId(aid)
            end
        end
    end
    return true
end
untested
LUA:
local doorPos = Position(x, y, z)
local doorId = {open = xxxx, closed = yyyy} -- xxxx for open id, yyyy for closed id
local aid = 1001

function onTime()
    local tile = Tile(doorPos)
    if tile then
        if os.date("%A") == "Monday" then
            local door = tile:getItemById(doorId.closed)
            if door then
                door:transform(doorId.open)
                door:setActionId(0)
            end
        else
            local door = tile:getItemById(doorId.open)
            if door then
                door:transform(doorId.closed)
                door:setActionId(aid)
            end
        end
    end
    return true
end
 
Solution
Back
Top