• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Remove monster after x minutes.

Exoltes

Novia OTserv Developer
Joined
Jul 2, 2009
Messages
563
Reaction score
47
Location
Belgium
I'm working on a 8.54 Open Tibia Server using The Forgotten Server - Version 0.2.7 (Mystic Spirit).

I'm looking for a way to remove a certain monster after 10 minutes.
So whenever this monster spawns or is created due to some ingame event it will 'poof' once 10 minutes have passed.

Anyone knows if this can be done and if so do you have any idea how? :)

Thanks in advance.
 
Thx sorry should of mentioned that i knew this part allready :p

The problem is more that I don't know how to make it check after 10 min and remove it.
Only thing I got in my server so far is that it removes a monster if it allready excists in the server.
 
this is one monster ?

if yes use this code
Code:
addEvent(doRemoveCreature, 10*60*1000, getCreatureByName("Demon")) ---   put here monster name :)
 
Last edited:
I'm not quite sure, but try use
Code:
--- function onUse, onMove, etc
cid = creature:getId()
addEvent(removeAfterTenMinutes, 10*60*1000, cid)

--- function inside addEvent
local function removeAfterTenMinutes(cid)

local creature = Creature(cid)

if creature == nil or creature:isMonster() == nil then
    return true
end

creature:remove()
end

I don't tested it (I don't created script since TFS 0.3.6 :S).

https://github.com/otland/forgottenserver/wiki/Metatable:Creature
 
Back
Top