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

TFS 1.X+ MONSTER RESPAWN CLEAN AFTER XXX MINUTES

darknelson

Member
Joined
Jun 19, 2011
Messages
190
Solutions
1
Reaction score
15
HI, IM TRYING TO DO A BOSS ROOM WITH AUTOMATIC SUMMON BY TIME HOUR ON MY SERVER, BUT MY SERVER IS NOT TO MUCH PLAYED SO, I LIKE TO MODIFY THIS SCRIPT FOR MONSTER SUMMONED EXAMPLE, I ALWAYS EVERYDAY SUMMON THE SAME MOSNTEER BY USING ONTIME FUNCTION BUT I DONT WANT MOSNTER GET ACUMULATED ON SERVER ON THE ROOM, SO MY IDEA IS SET A TIME TO CLEAN MONSTER, AFTER 60 MINUTES FOR EXAMPLE JUST BEFORE THE OTHER MONSTER GET RESPAWN, PLEASE HELP ME GUYS

Lua:
local BOSSdd = "Gnomevil" -- boss name
local BOSS_POSdd = {x = 33120, y = 31957, z = 11} -- boss spawn   
local roomdd = {fromx = 33102, tox = 33130, fromy = 31943, toy = 31970, z = 11} -- boss room
local BOSS_GLOBAL_STORAGEdd = 80612 -- dont change
local BOSS_GLOBAL_STORAGE_SUMMONdd = 25103 -- dont change
local TEMPO_RESPdd = 10 * 60 -- em segundos -- respawn time

function onTime()
--function onThink(interval, lastExecution)

local bossdd = 0
for x = roomdd.fromx, roomdd.tox do
for y = roomdd.fromy, roomdd.toy do
for z = roomdd.z, roomdd.z do

creaturedd = {x = x, y = y, z = z}
mobdd = getTopCreature(creaturedd).uid

    if getCreatureName(mobdd) == BOSSdd then
        bossdd = 1
    end
end
end
end

if bossdd == 1 then
end

if bossdd == 0 then
   -- if getGlobalStorageValue(BOSS_GLOBAL_STORAGE) == -1 and getGlobalStorageValue(BOSS_GLOBAL_STORAGE_SUMMON) == 1 then
     --   setGlobalStorageValue(BOSS_GLOBAL_STORAGE, 1)
        Game.createMonster(BOSSdd, BOSS_POSdd)
   -- end
end

return true
end
 
HI, IM TRYING TO DO A BOSS ROOM WITH AUTOMATIC SUMMON BY TIME HOUR ON MY SERVER, BUT MY SERVER IS NOT TO MUCH PLAYED SO, I LIKE TO MODIFY THIS SCRIPT FOR MONSTER SUMMONED EXAMPLE, I ALWAYS EVERYDAY SUMMON THE SAME MOSNTEER BY USING ONTIME FUNCTION BUT I DONT WANT MOSNTER GET ACUMULATED ON SERVER ON THE ROOM, SO MY IDEA IS SET A TIME TO CLEAN MONSTER, AFTER 60 MINUTES FOR EXAMPLE JUST BEFORE THE OTHER MONSTER GET RESPAWN, PLEASE HELP ME GUYS

Lua:
local BOSSdd = "Gnomevil" -- boss name
local BOSS_POSdd = {x = 33120, y = 31957, z = 11} -- boss spawn  
local roomdd = {fromx = 33102, tox = 33130, fromy = 31943, toy = 31970, z = 11} -- boss room
local BOSS_GLOBAL_STORAGEdd = 80612 -- dont change
local BOSS_GLOBAL_STORAGE_SUMMONdd = 25103 -- dont change
local TEMPO_RESPdd = 10 * 60 -- em segundos -- respawn time

function onTime()
--function onThink(interval, lastExecution)

local bossdd = 0
for x = roomdd.fromx, roomdd.tox do
for y = roomdd.fromy, roomdd.toy do
for z = roomdd.z, roomdd.z do

creaturedd = {x = x, y = y, z = z}
mobdd = getTopCreature(creaturedd).uid

    if getCreatureName(mobdd) == BOSSdd then
        bossdd = 1
    end
end
end
end

if bossdd == 1 then
end

if bossdd == 0 then
   -- if getGlobalStorageValue(BOSS_GLOBAL_STORAGE) == -1 and getGlobalStorageValue(BOSS_GLOBAL_STORAGE_SUMMON) == 1 then
     --   setGlobalStorageValue(BOSS_GLOBAL_STORAGE, 1)
        Game.createMonster(BOSSdd, BOSS_POSdd)
   -- end
end

return true
end
Hello, try this:
Lua:
local bossName = "Gnomevil" -- boss name
local bossSpawnPosition = {x = 33120, y = 31957, z = 11} -- boss spawn  
local roomdd = {fromx = 33102, tox = 33130, fromy = 31943, toy = 31970, z = 11} -- boss room
local BOSS_GLOBAL_STORAGEdd = 80612 -- dont change
local BOSS_GLOBAL_STORAGE_SUMMONdd = 25103 -- dont change
local TEMPO_RESPdd = 10 * 60 -- em segundos -- respawn time

function onTime()
--function onThink(interval, lastExecution)

for x = roomdd.fromx, roomdd.tox do
for y = roomdd.fromy, roomdd.toy do
for z = roomdd.z, roomdd.z do

local targetPos = {x = x, y = y, z = z}
local creatureInArea = getTopCreature(targetPos)
if creatureInArea then
    if getCreatureName(creatureInArea.uid) == bossName then
        creatureInArea:remove()
    end
end
end
end
end


        Game.createMonster(bossName, bossSpawnPosition)

return true
end
Written in phone, could not test. I think Will work, dont sure about onTime function. Im at work now. You really need use better variable names.
 
Back
Top