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
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();
Add tojavascript_placeholder.yml
check_afk:
file: check_afk.js
The text was updated successfully, but these errors were encountered:
Return Custom Afk Output
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!%javascript_check_afk%
Javascript Code:
check_afk.js
Commented Javascript Code:
check_afk.js
Add to
javascript_placeholder.yml
The text was updated successfully, but these errors were encountered: