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

Lua auto respawn boss every 12 hours needed

equero

New Member
Joined
Feb 22, 2013
Messages
51
Reaction score
1
Hello. I need a script that will automatically spawn the boss every 720 minutes. From on x, y,z coordinates
or something like that.
From 12.00 to 24.00

TFS 0.3.6 8.6
 
So you want it to spawn on exact position or on a random area between 2 positions? and is it every 720 mint or from 12:00 to 24:00?
 
Try this in your globalevents not sure if time can work like this on 0.3.6 or you'll have to create 2 scripts or a raid to spawn it twice.
XML:
<globalevent name="Bosses" time="24:00:00-12:00:00" script="bosses.lua" />
Lua:
local pos = {x = 1000, y = 1000, z = 7}

function onTimer(interval)
     local boss = bossnamehere
     doCreateMonster(boss, pos)
     doBroadcastMessage(boss.." has spawned.", MESSAGE_STATUS_WARNING)
     return true
end
If it didn't work try changing
XML:
time="24:00:00-12:00:00"
to
XML:
time="24:00:00"
 
XML:
<globalevent name="Bosses" time="12:00:00" script="bosses.lua" />
Just change the time to 5 mints from now and wait 5 mints to see.
 
XML:
<globalevent name="Bosses" time="00:05:00" script="bosses.lua" />
Lua:
local pos = {x = 1183, y = 880, z = 7}

function onTimer(interval)
     local boss = Elamazon
     doCreateMonster(boss, pos)
     doBroadcastMessage(boss.." has spawned.", MESSAGE_STATUS_WARNING)
     return true
end
nothing happens still. idk maybe should i add monster in ME first? but I do not see any sense
Post automatically merged:

@M0ustafa
data/globalevents/scripts/bosses.lua:onTimer Description: (luaDoCreateMonster) Monster with name '' not found [Error - GlobalEvent Interface] data/globalevents/scripts/bosses.lua:onTimer Description: data/globalevents/scripts/bosses.lua:6: attempt to concatenate local 'boss' (a nil value) stack traceback: data/globalevents/scripts/bosses.lua:6: in function <data/globalevents/scripts/bosses.lua:3> [Error - GlobalEvents::timer] Couldn't execute event: Bosses
But monster exist.. i have tried to spawn by command /m and he appears
 
Last edited:
Try this
Lua:
local pos = {x = 1183, y = 880, z = 7}

function onTimer(interval)
     local boss = Elamazon
     doCreateMonster("Elamazon", pos, false, true)
     doBroadcastMessage(boss.." has spawned.", MESSAGE_STATUS_WARNING)
     return true
end
 
@M0ustafa nothing happens. no idea
Post automatically merged:

@M0ustafa After idk about 10 mins (in console) i have found same error.

[Error - GlobalEvent Interface]
data/globalevents/scripts/bosses.lua:eek:nTimer
Description: (luaDoCreateMonster) Monster with name '' not found [Error - GlobalEvent Interface] data/globalevents/scripts/bosses.lua:onTimer Description: data/globalevents/scripts/bosses.lua:6: attempt to concatenate local 'boss' (a nil value) stack traceback: data/globalevents/scripts/bosses.lua:6: in function <data/globalevents/scripts/bosses.lua:3>
 
Last edited:
If it still doesn't work then maybe try a raid, data\raids and create a script with this
XML:
<?xml version="1.0" encoding="utf-8"?>
<raid>
    <singlespawn delay="1000" name="Elamazon" x="1183" y="880" z="7" />
    <announce delay="1000" type="event" message="Elamazon has spawned!" />
</raid>
then add this to data\raids\raids.xml
XML:
<raid name="Elamazon" file="Elamazon.xml" interval2="30" margin="1000" enabled="yes"/>
then in data\globalevents\scripts add this
Lua:
function onTime()
    doExecuteRaid(Elamazon)
    return true
end
and in data\globalevents\globalevents.xml add this and change the time to test it.
XML:
<globalevent name="Raid" time="23:59:59" event="script" value="Raidexecute.lua"/>
Or I think you can only add this line without the raid execute Lua script like this.
XML:
<globalevent name="Elamazon" time="20:00:00" event="buffer" value="doExecuteRaid('Elamazon')"/>
 
If it still doesn't work then maybe try a raid, data\raids and create a script with this
XML:
<?xml version="1.0" encoding="utf-8"?>
<raid>
    <singlespawn delay="1000" name="Elamazon" x="1183" y="880" z="7" />
    <announce delay="1000" type="event" message="Elamazon has spawned!" />
</raid>
then add this to data\raids\raids.xml
XML:
<raid name="Elamazon" file="Elamazon.xml" interval2="30" margin="1000" enabled="yes"/>
then in data\globalevents\scripts add this
Lua:
function onTime()
    doExecuteRaid(Elamazon)
    return true
end
and in data\globalevents\globalevents.xml add this and change the time to test it.
XML:
<globalevent name="Raid" time="23:59:59" event="script" value="Raidexecute.lua"/>
Or I think you can only add this line without the raid execute Lua script like this.
XML:
<globalevent name="Elamazon" time="20:00:00" event="buffer" value="doExecuteRaid('Elamazon')"/>

It works o_O
But do i need allways type /raid or only once?
Anyway thank you! @M0ustafa
 
If you added the globalevents line with a specified time then it will do it auto at same time daily.
 
Solution
If you added the globalevents line with a specified time then it will do it auto at same time daily.
But if none kill it i think it will respawn or u have to check if there are monsters in the room or no because if 5 days of respawns means 5 bosses
 
Back
Top