icekis
Member
- Joined
- Jan 18, 2018
- Messages
- 91
- Reaction score
- 5
I am trying to make a raid from globalevents using date but this script summons two bosses at same time
Could someone help me?
Could someone help me?
Lua:
local raids = {
['Saturday'] = {
['22:28'] = {raidName = 'The Horned Fox', position = Position(2163, 2362, 6)}
}
}
function onThink(interval, lastExecution, thinkInterval)
local day, date = os.date('%A'), getRealDate()
local raidDays = {}
if raids[day] then
raidDays[#raidDays + 1] = raids[day]
end
if raids[date] then
raidDays[#raidDays + 1] = raids[date]
end
if #raidDays == 0 then
return true
end
for i = 1, #raidDays do
local settings = raidDays[i][getRealTime()]
if settings and not settings.alreadyExecuted then
Game.createMonster(settings.raidName, settings.position, true, true)
settings.alreadyExecuted = true
print(">>>> Automatic Raid " .. settings.raidName .. "")
end
end
return true
end