Sueta

EssentialsX /afk command with reason

1.2

Adds /afk command with optional reason (EssentialsX required)

·Plugin

/AFK COMMAND WITH REASON

WARNING: requirements:

Also, players need to have essentials.afk and essentials.me permission.

This skript adds one simple command. It "upgrades" classic Essentials /afk command.
Players can use
/afk command with optional reason!

Usage: /afk [reason]
Example: /afk goes to the toilet
/afk (You don't have to input the reason - executes classic Essentials afk command)

Output with reason:

Copy&Paste the Skript

Source code

With mute check (skript-placeholders extension needed):

#SKRIPT: /AFK command with optional reason (1.2 with muted check)
#Requirements:
# EssentialsX (https://essentialsx.net/) plugin
# skript-placeholders (https://github.com/APickledWalrus/skript-placeholders) extension
#MIT License - feel free to fully edit!
#Made by PetyXbron (https://github.com/petyxbron)
command /afk [<text>]:
description: "Executes EssentialsX afk command but with optional reason"
usage: /afk [reason]
executable by: players
trigger:
set {_isMuted} to placeholder "essentials_is_muted" from player #uses skript-placeholders
if arg-1 is not set:
execute console command "sudo %player% essentials:afk" #uses EssentialsX
stop
if arg-1 is set:
if {_isMuted} is "no": #uses skript-placeholders
execute console command "sudo %player% essentials:me %arg-1%" #uses EssentialsX
execute console command "sudo %player% essentials:afk" #uses EssentialsX
stop

...or you can just download the file and import it to your server!
Without mute check:

#SKRIPT: /AFK command with optional reason (1.2 without muted check)
#Requirements:
# EssentialsX (https://essentialsx.net/) plugin
#MIT License - feel free to fully edit!
#Made by PetyXbron (https://github.com/petyxbron)
command /afk [<text>]:
description: "Executes EssentialsX afk command but with optional reason"
usage: /afk [reason]
executable by: players
trigger:
if arg-1 is not set:
execute console command "sudo %player% essentials:afk" #uses EssentialsX
stop
if arg-1 is set:
execute console command "sudo %player% essentials:me %arg-1%" #uses EssentialsX
execute console command "sudo %player% essentials:afk" #uses EssentialsX
stop

You can also get both Skript versions in this GitHub Gist.
Raw files: afk-1.2-mutecheck.sk, afk-1.2.sk

Similar projects

Plugin →