Lua:
local config = {
monsterName = 'demon',
centerPosition = Position(33653, 32907, 15),
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
local test = CreatureEvent("test")
function test.onDeath(creature, target)
if not creature:isMonster() or creature:hasBeenSummoned() or creature:isPlayer() then
return true
end
if checkBoss(config.centerPosition, config.rangeX, config.rangeY, config.monsterName) then
return true
end
Game.createMonster('demon', Position(33652, 32908, 15))
return true
end
test:register()
I have a problem with this script when the monster dies it will create the demon this is working.
what I would like to do is in respawn it has 4 creatures when the 4 are killed the demon would be created