• 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!

Solved [tfs 1.0] Automatic Zombie event

samuelav3

Member
Joined
Aug 18, 2014
Messages
95
Reaction score
5
hey friends as I do for the zombie event starts at a specific time
17:00 hrs
and teleport too pls
globalevents.xml
Code:
<globalevent name="zombie" interval="900000"" script="zombie_think.lua"/>
    <globalevent name="Teleport Automatic" interval="900000" event="script" value="teleportautomatico.lua"/>
 
What do you want exactly?
If you want the event to start at 17:00, then change interval="900000" to
Code:
time="17:00:00"
And change function onThink to function onTime in the Lua script.
 
mmm doesnt work it
Code:
    <globalevent name="zombie" time="17:30:00" script="zombie_think.lua"/>
    <globalevent name="Teleport Automatico" time="17:30:00" event="script" value="teleportautomatico.lua"/>


zombie_think.lua
Code:
    dofile('data/zombie_system.lua')

function onTime(interval, lastExecution, thinkInterval)
    if ze_started == false then
        ze_started = true
        print("Zombie Event has started & waiting for players to join! Min: "..ze_min_players.."/"..ze_max_players..".")
        broadcastMessage("The Zombie Event has started! You have "..ze_wait_minutes.." minutes to join!", MESSAGE_STATUS_WARNING)
        addEvent(startZombie, ze_wait_minutes * 60 * 1000)
    end
    return true
end

teleportautomatico.lua
Code:
local config =
{
        day = "Monday","TUESDAY","Wednesday","THURSDAY","Friday","SATURDAY","Sunday",
        pos = {x=32366, y=32235, z=7},
        topos = {x=32520, y=32360, z=8},
        time = 5, -- tempo que o teleport ira sumir em minutos
        msg_open = "Portal to Zombien event on thais temple.",
        msg_close = "Portal to Zombie event is close."
}


local function DelTp()
        local t = getTileItemById(config.pos, 1387)
        if t then
                doRemoveItem(t.uid, 1)
                doSendMagicEffect(config.pos, CONST_ME_POFF)
        end
end


function onTime()
      
        if (os.date("%A") == config.day) then
                doCreateTeleport(1387, config.topos, config.pos)
                doBroadcastMessage(config.msg_open)
                addEvent(DelTp, config.time*60*1000)
                addEvent(doBroadcastMessage, config.time*60*1000, config.msg_close)
        end


        return true
end
 
<globalevent name="zombie" time="05:35:00" script="zombie_think.lua"/>
<globalevent name="Teleport Automatico" time="05:35:00" script="teleportautomatico.lua"/>
this?nothing happens
 
Do you have errors? You can add print under the main function (onTime) to see if the script loads.
Code:
print("script load test")
 
Did you edited the right script, saved and reloaded or restart?
Because function onTime is in the script you posted.
 
Back
Top