• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

RevScripts onDeath

alcapone

Member
Joined
Jan 13, 2021
Messages
237
Reaction score
18
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
 
Top