Jump to content
  • 0

Variables as Day and Week of the server (Is Thursday, Saturday, Sunday, etc)


Erassus
 Share

Question

Hi, is there a way to have variables in a event to autorun like: Is Saturday? (time of the server) and the event will execute or autorun or be able to do.

 

This will be good for weekly bosses and those things.

 

Thanks in advance for the ideas.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

It's not possible.
1 - Avoid autoruns, an autorun event can make your game so heavy that not even 5 players can connect.
2 - There is an intersect timing system, but it wouldn't help you in this case.
3 - It is only possible with api, in fact it is the easiest way to do it and still make the server light for players.

Link to comment
Share on other sites

  • 0
21 hours ago, Weylon Santana said:

It's not possible.
1 - Avoid autoruns, an autorun event can make your game so heavy that not even 5 players can connect.
2 - There is an intersect timing system, but it wouldn't help you in this case.
3 - It is only possible with api, in fact it is the easiest way to do it and still make the server light for players.

 

Thanks for the reply.

I'm using collision to active some events like doors and those things with variables.

 

Meanwhile i can spawn bosses with time variables like: "It's 2:00 pm" in the conditions, and execution with collision if the players walk in some tile in the map. So i was trying to expand this but weekly, a counter can be made perhaps?

Link to comment
Share on other sites

  • 0

Let me give you an example of how to use the time system.

A system to give daily rewards to the player, you would need a variable to set the server time(var serverTime), another to set the player time (playerTime) and another to set the number of days (daysLogin).

(In parentheses is an example name.)

 

When the player logs in, sets serverTime to time system, compares if playerTime is less than server time(initial value = 0), if day < 8 gives some prize checking the day, and adds 1 in the variable day, and 24h (in ms) in playerTime.
That's it, this is a good way to use.


So every time player logs in , as long as the playerTime value is greater than serverTime he will not receive the prize, and every time he logs the serverTime value will be updated, so when the value of serverTime is greater, it means that the conditional branch will run again, giving the prize, increasing another 24hrs and day+1, when it reaches the 7th day, it will add 1 more leaving the value 8, then the player will no longer receive prizes.

 

If you can adapt this to invoke the boss at the time you want, then you can try, the problem is that the value of serverTime, for what you want, must be constantly updated to always spawn in exatcly hour regardless of the players, for that you must use api with recurring call.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...