You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Return Custom Afk Output - Community Scripts Contribution #57
Description: Check if a player is afk & then return a custom output depending on the boolean.
This script is using the %essentials_afk% placeholder. In simpler terms, this allows you to change the normal yes/no output to something of your choice. Very useful!
// create a variable and name it to whichever you prefer// %essentials_afk% is the placeholder that we'll be changing the output ofvarafk="%essentials_afk%";// create a function with your prefered namefunctioncheckAfk(){// if the afk variable that we created before returns yes (true boolean)// the javascript placeholder will return whichever we set the return output toif(afk=="yes"){return"[AFK]";}// if the afk variable isn't true, it will return a different outputreturn"";}// this calls the function to runcheckAfk();
Activity
iGabyTM commentedon Jan 29, 2022
Wrong, that method is used if you have placeholders like
"%expannsion_" + argument + "%", all the other placeholders are replaced by defaultHLX-DENNIS commentedon Jan 30, 2022
I stand corrected ¯_(ツ)_/¯ Thank you kind sir for the clarification. I've updated the post with the correct information.