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

Solved Server activated

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 was wondering if it's possible to make something server activated.
What I mean is that I want to create a stairs that is there for 40 minutes and then it transforms into nothing for the next 30 minutes and then again it spawns for 40 minutes. Without needing to be triggered by an action or movement; just by server start-up.

Any ideas are welcome.

Thx in advance.
 
TFS 0.2.7 doesn't have globalevents.
You could create a similar idea in a login script in creaturescripts. With addEvent, set global storage as exhaustion, so it won't run again after someone logs in again and check if it's already there with getTileItemById.
 
Could you get me started, because I was looking into the files I already have in 'creaturescripts' and they don't really get me going.

What I want to make is a change between item id: 10112 and item id: 8324. And lets set the time interval at 1 hour.
 
TFS 0.2.7 doesn't have globalevents.
You could create a similar idea in a login script in creaturescripts. With addEvent, set global storage as exhaustion, so it won't run again after someone logs in again and check if it's already there with getTileItemById.

You can create globalscripts on your own. using onlogin for something that should run all the time but happens at set interval, is just plain stupid.

Exoltes, create an NPC you could name globalevents, use it's onthink function to have the scrips running.
By that, the scripts is readed once every second no matter if there's players or not.

you can use etc.

myaction = 0

if myaction <= os.time() then
--Do my script
myaction = os.time() + 60 --This will posphone next action 1 minute
end



Something like that.
the "myaction = 0" must be outside the onthink script, it should be loaded on the server start. else it will go into a loop there it keep loading your script once every second instead of once every minute
 
Figured out an easier way :)
Created 2 items and made them decay into each other.

items.xml
Code:
    <item id="4332" article="a" name="heap of sand">
        <attribute key="decayTo" value="10112"/>
        <attribute key="duration" value="1968"/>
    </item>
    <item id="10112" article="a" name="stone pile">
        <attribute key="decayTo" value="4332"/>
        <attribute key="duration" value="3384"/>
    </item>
 
Back
Top