I'm trying to do that every 15 minutes the boss is creator more if he already has a boss with that name in place he does not do another
Code:
local config = {
monsterName = 'Ferumbras',
bossPosition = Position(33384, 31282, 6),
centerPosition = Position(33384, 31282, 6),
rangeX = 50,
rangeY = 50
}
local function checkBoss(centerPosition, rangeX, rangeY, bossName)
local spectators, spec = Game.getSpectators(centerPosition, false, false, rangeX, rangeX, rangeY, rangeY)
for i = 1, #spectators do
spec = spectators[i]
if spec:isMonster() then
if spec:getName() == bossName then
return true
end
end
end
return false
end
function onThink(interval, lastExecution)
if checkBoss(config.centerPosition, config.rangeX, config.rangeY, config.monsterName) then
return false
end
local boss =
Game.createMonster(config.monsterName, config.bossPosition, true, true)
boss:setReward(true)
return true
end