I have this code and i want to make it more efficient / shorter
yeah-
yeah-
Code:
function extraCheck(p: player):
{@Emojis} = true:
{_p} has permission "{@Perm}.admin":
replace all ":skull:" with "☠" in {m}
replace all "<3" with "{@NoPermColor}❤&f" in {m}
replace all ":sob:" with "☹" in {m}
replace all ":sad:" with "☹" in {m}
replace all ":(" with "☹" in {m}
replace all "D:" with "☹" in {m}
replace all ":happy:" with "☺" in {m}
replace all ":D" with "☺" in {m}
{@Pings} = true:
clear {pinged::%{_p}%'s uuid::*}
{_p} has permission "{@Perm}.pinggroups":
{m} contains "@dead" or "@dead kids" or "@deadkids":
add "Dead Players" to {pinged::%{_p}%'s uuid::*}
replace all "@dead" with "&b@dead&f" in {m}
replace all "&b@dead&fkids" with "&b@deadkids&f" in {m}
replace all "&b@dead&f kids" with "&b@dead kids&f" in {m}
play sound "{@Sound1}" to {dead::*}
send actionbar "&bYou were pinged by %{_p}%" to {dead::*}
{m} contains "@alive" or "@alive kids" or "@alivekids":
add "Alive Players" to {pinged::%{_p}%'s uuid::*}
replace all "@alive" with "&b@alive&f" in {m}
replace all "&b@alive&fkids" with "&b@alivekids&f" in {m}
replace all "&b@alive&f kids" with "&b@alive kids&f" in {m}
play sound "{@Sound1}" to {alive::*}
send actionbar "&bYou were pinged by %{_p}%" to {alive::*}
{m} contains "@all" or "@everyone" or "@kids":
clear {pinged::%{_p}%'s uuid::*}
add "Everyone" to {pinged::%{_p}%'s uuid::*}
replace all "@all" with "&b@all&f" in {m}
replace all "@everyone" with "&b@everyone&f" in {m}
replace all "@kids" with "&b@kids&f" in {m}
play sound "{@Sound1}" to all players
send actionbar "&bYou were pinged by %{_p}%" to all players
{_p} has permission "{@Perm}.pingplayer":
loop all players:
if loop-player does not have permission "{@Perm}.pingbypass":
{m} contains loop-player's display name:
replace all loop-player's display name with "&b@%loop-player's display name%&f" in {m}
add loop-player to {pinged::%{_p}%'s uuid::*}
replace all "@&b@%loop-player's display name%" with "&b@%loop-player's display name%" in {m}
size of {pinged::%{_p}%'s uuid::*} > 0:
send actionbar "&bPinged %{pinged::%{_p}%'s uuid::*}%!" to {_p}