#How to get values from placeholders %player_first_join% or %player_first_played% to compare?

1 messages · Page 1 of 1 (latest)

stuck dagger
#

I've created a thread on a github: https://github.com/PlaceholderAPI/Player-Expansion/issues/94
Basically i want to make a requirement so players could get "old player" rank via ExecutableEvents if they played 3 years or more (since first join), but i cant understand how to get proper date values from those placeholders?

GitHub

Hi, i am trying to set a requirement that will check if player joined first time 3 years ago as a minimum, so i can give him "old player" rank automatically with ExecutableEvents plugin, ...

opal crypt
#

it's using unix timestamp

#

basically

#

use a javascript placeholder that gives you unix timestamp. Then do this
%javascript_timestamp% - %player_first_played%

#

to make your life easier

    return Math.floor(Date.now() / 1000); // Convert milliseconds to seconds
}

getUnixTimestamp()```
#

put this in a js placeholder

#

and then, use an equation to convert seconds to years

#

as for the EE event. do the following

i'm not sure how the custom event works, so i'll suggest the loop event.

Make a loop that checks the timer. make a variable in score, to set as boolean. i.e: is-old = false. if the player reaches the 3 year mark, make the event give the player that old player rank. then Set the is-old to true. for the event requirements. Set the requirement to ask is-old is false. If the is-old is false, it will run the event to check whether the player has enough time played. Then set another requirement to check whether the time is above 3 years. if yes, only then the event will run.

For requirement to check is-old, make sure that it stops checking for other requirements if the player has it set as true.

#

i'm kinda ass at explaining, but this should help

#

ping me if you need help in something else

stuck dagger
#

Okay, ill try js placeholder first, will see if i will be able to make it right as you said