• 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!

Spawn monsters globalevents

vexler222

Active Member
Joined
Apr 22, 2012
Messages
714
Solutions
15
Reaction score
46
Hi, i try to spawn monsters on the time X, in position X and my "script" work but i don't knowy why i got errors in consol when demons spawned?
tfs 1.3 version 8.6

Code:
boss_name = "Demon"
function onThink()
        Game.createMonster(boss_name, Position(1000, 1005, 7))
end


error:
Code:
[Error - GlobalEvents::think] Failed to execute event: spawn
 
Solution
maybe this script will help u i found in my pc just change name of monster and area posyion
Code:
local BOSSaa = "Abyssador" -- boss name
local BOSS_POSaa = {x = 33087, y = 31908, z = 12} -- boss spawn  
local roomaa = {fromx = 33076, tox = 33100, fromy = 31898, toy = 31924, z = 12} -- boss room

function onThink(interval, lastExecution)
local bossaa = 0
for x = roomaa.fromx, roomaa.tox do
for y = roomaa.fromy, roomaa.toy do
for z = roomaa.z, roomaa.z do

creatureaa = {x = x, y = y, z = z}
mobaa = getTopCreature(creatureaa).uid

    if getCreatureName(mobaa) == BOSSaa then
        bossaa = 1
    end
end
end
end

if bossaa == 1 then
end

if bossaa == 0 then
        Game.createMonster(BOSSaa, BOSS_POSaa)
end

return true
end
Lua:
function onThink(interval, lastExecution)
local boss_name = "Demon" -- boss name
local position= {x = 1000, y = 1000, z = 7}
        Game.createMonster(boss_name , position)
return TRUE
end
 
Lua:
function onThink(interval, lastExecution)
local boss_name = "Demon" -- boss name
local position= {x = 1000, y = 1000, z = 7}
        Game.createMonster(boss_name , position)
return TRUE
end

thanks, btw how to block spawn if in range 5sqm still is monster?
 
maybe this script will help u i found in my pc just change name of monster and area posyion
Code:
local BOSSaa = "Abyssador" -- boss name
local BOSS_POSaa = {x = 33087, y = 31908, z = 12} -- boss spawn  
local roomaa = {fromx = 33076, tox = 33100, fromy = 31898, toy = 31924, z = 12} -- boss room

function onThink(interval, lastExecution)
local bossaa = 0
for x = roomaa.fromx, roomaa.tox do
for y = roomaa.fromy, roomaa.toy do
for z = roomaa.z, roomaa.z do

creatureaa = {x = x, y = y, z = z}
mobaa = getTopCreature(creatureaa).uid

    if getCreatureName(mobaa) == BOSSaa then
        bossaa = 1
    end
end
end
end

if bossaa == 1 then
end

if bossaa == 0 then
        Game.createMonster(BOSSaa, BOSS_POSaa)
end

return true
end
 
Solution
Back
Top