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

Random Boss Spawn at a certain time

therrax

Member
Joined
Jul 12, 2012
Messages
262
Solutions
1
Reaction score
11
Hi
info: TFS 1.0
I'm looking for a script that create one of x Bosses in a specific place at a specific time.

For example:
Bosses: Ghazbaran, Morgaroth, Orshabaal
Spawn position: x =1000 y=1000 z=7
Time:22:00
At 22:00 one is shown in spawn position

Thanks ;)
 
globalevents.xml
Code:
<globalevent name="Bosses" time="22:00:00" script="bosses.lua" />

bosses.lua
Code:
local pos = Position(1000, 1000, 7)
local bosses = {"Ghazbaran", "Morgaroth", "Orshabaal"}

function onTime(interval)
     local boss = bosses[math.random(#bosses)]
     Game.createMonster(boss, pos)
     for _, player in ipairs(Game.getPlayers()) do
         player:sendTextMessage(MESSAGE_STATUS_WARNING, boss.." has spawned.")
     end
     return true
end
 
Code:
local pos = {x = 1000, y = 1000, z = 7}
local bosses = {"Ghazbaran", "Morgaroth", "Orshabaal"}

function onTimer(interval)
     local boss = bosses[math.random(#bosses)]
     doCreateMonster(boss, pos)
     doBroadcastMessage(boss.." has spawned.", MESSAGE_STATUS_WARNING)
     return true
end
 
Back
Top