Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.
If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!
Now, what are you waiting for? Join the community now!
options:
# MAX ACHIEVABLE PRESTIGE
# SET TO -1 FOR NO LIMIT
max-prestige: 5
function retrievePrestige(p: player) :: number:
metadata tag "prt" of {_p} is set:
return metadata tag "prt" of {_p}
stop
byte tag "PRT" of nbt compound of {_p} is set:
set metadata tag "prt" of {_p} to byte tag "PRT" of nbt compound of {_p}
delete byte tag "PRT" of nbt compound of {_p}
else:
set metadata tag "prt" of {_p} to 0
return metadata tag "prt" of {_p}
command /giveprestigeitem <player=%player%>:
permission: *
trigger:
give arg-1 book named "&b+1 PRESTIGE"
command /prestige <player=%player%>:
trigger:
set {_n} to name of arg-1
arg-1 is player:
set {_n} to "Your"
set {_p} to metadata tag "prt" of arg-1
if metadata tag "prt" of arg-1 is not set:
set {_p} to 0
send "&f&l%{_n}% &r&bprestige is &7%{_p}%"
on leave:
set byte tag "PRT" of nbt compound of player to metadata tag "prt" of player
on unload:
loop all players:
set byte tag "PRT" of nbt compound of loop-player to metadata tag "prt" of loop-player
on join:
if byte tag "PRT" of nbt compound of player is not set:
set byte tag "PRT" of nbt compound of player to 0
set metadata tag "prt" of player to byte tag "PRT" of nbt compound of player
delete byte tag "PRT" of nbt compound of player
on load:
loop all players:
if byte tag "PRT" of nbt compound of loop-player is not set:
set byte tag "PRT" of nbt compound of loop-player to 0
set metadata tag "prt" of loop-player to byte tag "PRT" of nbt compound of loop-player
delete byte tag "PRT" of nbt compound of loop-player
on right click:
name of 1 of player's tool contains "&b+1 PRESTIGE":
set {_d} to metadata tag "prt" of player
{@max-prestige} > {_d}:
set metadata tag "prt" of player to 1+{_d}
remove 1 of player's tool from player
broadcast "&f&l%player's name% &r&breedemed +1 Prestige!"
else:
send "&bYou have hit the max Prestige!" to player
is there any skript addons I need for this?AppleScript:options: # MAX ACHIEVABLE PRESTIGE # SET TO -1 FOR NO LIMIT max-prestige: 5 function retrievePrestige(p: player) :: number: metadata tag "prt" of {_p} is set: return metadata tag "prt" of {_p} stop byte tag "PRT" of nbt compound of {_p} is set: set metadata tag "prt" of {_p} to byte tag "PRT" of nbt compound of {_p} delete byte tag "PRT" of nbt compound of {_p} else: set metadata tag "prt" of {_p} to 0 return metadata tag "prt" of {_p} command /giveprestigeitem <player=%player%>: permission: * trigger: give arg-1 book named "&b+1 PRESTIGE" command /prestige <player=%player%>: trigger: set {_n} to name of arg-1 arg-1 is player: set {_n} to "Your" set {_p} to metadata tag "prt" of arg-1 if metadata tag "prt" of arg-1 is not set: set {_p} to 0 send "&f&l%{_n}% &r&bprestige is &7%{_p}%" on leave: set byte tag "PRT" of nbt compound of player to metadata tag "prt" of player on unload: loop all players: set byte tag "PRT" of nbt compound of loop-player to metadata tag "prt" of loop-player on join: if byte tag "PRT" of nbt compound of player is not set: set byte tag "PRT" of nbt compound of player to 0 set metadata tag "prt" of player to byte tag "PRT" of nbt compound of player delete byte tag "PRT" of nbt compound of player on load: loop all players: if byte tag "PRT" of nbt compound of loop-player is not set: set byte tag "PRT" of nbt compound of loop-player to 0 set metadata tag "prt" of loop-player to byte tag "PRT" of nbt compound of loop-player delete byte tag "PRT" of nbt compound of loop-player on right click: name of 1 of player's tool contains "&b+1 PRESTIGE": set {_d} to metadata tag "prt" of player {@max-prestige} > {_d}: set metadata tag "prt" of player to 1+{_d} remove 1 of player's tool from player broadcast "&f&l%player's name% &r&breedemed +1 Prestige!" else: send "&bYou have hit the max Prestige!" to player
Alright, thank you hunSkBee is necessary due to the use of byte tags and nbt compounds.
add &f&l[&b&l%metadata tag "prt" of player%&r&f&l] to the start of the chatFormat optionsQuestion: how would I put this to show in chat? Just so people can flex their prestiges so it doesn't feel like a lost function with no use (even tho there is a way to check the prestiges)
set chat format to "%player's prefix%%player's displayname%&f: %message%"
set player's displayname to "%player's displayname% &7{&6%metadata tag "prt" of player%&7}"