vexler222
Active Member
- Joined
- Apr 22, 2012
- Messages
- 714
- Solutions
- 15
- Reaction score
- 46
I have a problem with this script, it creates a boss but a few times even if it isn't dead and then it stops working.
Additionally, how to make the boss appear after the server starts?
Additionally, how to make the boss appear after the server starts?
Code:
local boss_name = "Demodras" -- boss name
local boss_pos = {x = 1491, y = 1100, z = 15} -- boss spawn
local pos_room = {fromx = 1503, tox = 1100, fromy = 1477, toy = 1075, z = 15} -- boss room
function onThink(interval, lastExecution)
local check_boss = 0
for x = pos_room.fromx, pos_room.tox do
for y = pos_room.fromy, pos_room.toy do
for z = pos_room.z, pos_room.z do
creatureaa = {x = x, y = y, z = z}
mob = getTopCreature(creatureaa).uid
if getCreatureName(mob) == boss_name then
check_boss = 1
end
end
end
end
if check_boss == 1 then
end
if check_boss == 0 then
Game.createMonster(boss_name, boss_pos)
end
return true
end