I've look so many sk file, but I could not find the best afk plugin, what I want is make player teleport to a specific afkroom by Skript automatic detect!
here is following I've done with sk, but I don't know how to do the listener when player typed /afk and the sk will gets record a location before player be sent to the afk room, but not cover the Essentials command /back
please help me this ~~~~~~ please ~~
here is following I've done with sk, but I don't know how to do the listener when player typed /afk and the sk will gets record a location before player be sent to the afk room, but not cover the Essentials command /back
code_language.skript:
command /afkset:
permission: op
permission: {@nopermission}
trigger:
set {_loc} to location of player
set {location.of.afk} to location of player # Sets the variable '{location.of.afk}' to where the player is standing
message "&cafkroom> &fyou are set a afk room! to the following coordinates: &e%{_loc}%"
command /afkdel:
permission: op
permission: {@nopermission}
trigger:
set {_loc} to location of player
clear {location.of.afk} # Clears the variable
message "&cSpawn> &fYou are deleted a afkroom, just type '/afkset' to reset it !"
command /afk [<player>]:
permission: afk.tp.other
permission message: {@nopermission}
trigger:
if player has permission "afk.tp.other":
if {location.of.afk} is not set: # If they haven't done /afkset yet, it tells them that they have not
message "&cafkroom> &fthe afk room has not set yet. just type'/setspawn' to set it!."
stop
if arg 1 is not set:
message "&cafkroom> &fPlayer argument missing."
if arg 1 is set:
set {_p} to player
teleport arg 1 to {location.of.afk}
message "&cafkroom> &fYou sent &e%{_p}% &fto the afkroom!."
message "&cafkroom> &fYou are sent to the afkroom !."
else:
teleport player to {location.of.afk}
command /afk:
permission: afk.tp.me
permission message: {@nopermission}
trigger:
set {is.%uuid of player%.afk} to true # Sets the variable to true
broadcast "&e%player%&f is now AFK." # Broadcasts that they are AFK
set {_p} to player
teleport {_p} {location.of.afk}
on any movement: # In other words, whenever the player moves
if {is.%uuid of player%.afk} is true: # Checks if the variable is true
set {is.%uuid of player%.afk} to false # If it is, it sets it to false, as you can see
wait 1 tick
broadcast "&e%player%&f is no longer AFK." # Then, it broadcasts that the player is no longer AFK.
please help me this ~~~~~~ please ~~
Last edited: