Svira
Member
- Joined
- Jan 27, 2008
- Messages
- 213
- Solutions
- 7
- Reaction score
- 22
The problem is that after a few BOSS the script stops and doesn't create any more monsters without error.
The boss name cannot be defined because it is fetched from the table, there are more than 50 of them
Part of choise boss:
part onKill:
No engine error
The boss name cannot be defined because it is fetched from the table, there are more than 50 of them
Part of choise boss:
Lua:
local boss = configBosses[bossIndex]
local bossName = boss.bossName
Game.createMonster(bossName, configRoom.centerRoom, true, true)
part onKill:
Lua:
local BossDeath = CreatureEvent('BossDeath')
function BossDeath.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
local playerPosition = creature:getPosition()
local topLeftCorner = Position(976, 59, 6)
local bottomRightCorner = Position(990, 73, 6)
if playerPosition:isInRange(topLeftCorner, bottomRightCorner) then
Game.broadcastMessage(creature:getName() .. ' has been killed. The boss room was cleaned and the boss was spawned in few sec.', MESSAGE_EVENT_ADVANCE)
addEvent(startBossRoom, 3000)
else
end
return true
end
BossDeath:register()
No engine error