Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- #Toggles the changing of the chat display name with the /nick command.
- #Default: true
- #Accepts: boolean (true/false, yes/no, on/off)
- changeChatNick: true
- #Toggles the changing of the tablist display name with the /nick command.
- #Default: true
- #Accepts: boolean (true/false, yes/no, on/off)
- changeTablistNick: true
- #Toggles the changing of the nametag (above head) display name with the /nick command.
- #Default: true
- #Accepts: boolean (true/false, yes/no, on/off)
- changeAboveHeadNick: true
- #Function RemoveColors:
- #Removes the color which the specified permission holder (command sender) doesn't have permission for from a text.
- #Parameters:
- #{_input} = text to remove the colors.
- #{_permission-holder} = the player whose permissions will be checked.
- #Example:
- #can be seen below.
- function removeColors(input: text, permission-holder: command sender) :: text:
- set {_colors::*} to integers from 0 to 9 and split "abcdefonmrkl" by ""
- set {_input-characters::*} to {_input} split by ""
- loop {_colors::*}:
- if {_input} contains "&%loop-value%":
- if {_permission-holder} doesn't have permission "nick.color.&%loop-value%" or "nick.color.all":
- loop {_input-characters::*}:
- if loop-value-2 is "&":
- set {_next-index} to loop-index-2 parsed as integer + 1
- if {_input-characters::%{_next-index}%} is "%loop-value-1%":
- clear {_input-characters::%loop-index-2%} and {_input-characters::%{_next-index}%}
- set {_output} to join {_input-characters::*} by ""
- return colored {_output}
- function getTrimmedUUIDfromName(player: text) :: text:
- set {_uuid} to {_player} parsed as offline player's uuid
- set {_trimmed-uuid-parts::*} to {_uuid} split by "-"
- return join {_trimmed-uuid-parts::*} by ""
- #skQuery function getSkin:
- #First of all and to clarify things, why skQuery functions? Well, Skript functions don't allow delayed code when something is returned.
- #That means it won't wait for the request to finish to return and as I'm using Reqn + Skript-JSON now, it'll not return anything.
- #Parameters:
- #Parameter 1 = the player who we will get the skin from.
- #Examples:
- #Can be seen below.
- func "getSkin":
- set {_player} to parameter 1
- if "%{skin-cache::%{_player}%}%" is "{""signature"":"""",""value"":""""}":
- delete {skin-cache::%{_player}%}
- if {skin-cache::%{_player}%} isn't set:
- set {_trimmed-uuid} to getTrimmedUUIDfromName({_player})
- send request to "https://api.mineskin.org/generate/user/%{_trimmed-uuid}%"
- map json last response's body to {_skin-api::*}
- set {skin-cache::%{_player}%} to skin with value {_skin-api::data::texture::value} signature {_skin-api::data::texture::signature}
- set transient "skinOutput" to {skin-cache::%{_player}%}
- $ access
- set {_skin} to transient "skinOutput"
- return
- on join:
- wait 3 ticks
- if {skinStorage::%player's uuid%} is set:
- set player's displayed skin to {skinStorage::%player's uuid%}
- if {nickStorage::%player's uuid%} is set:
- if {@changeChatNick} = true:
- set player's display name to {nickStorage::%player's uuid%}
- if {@changeTablistNick} = true:
- set player's mundosk tablist name to {nickStorage::%player's uuid%}
- if {@changeAboveHeadNick} = true:
- set player's nametag to {nickStorage::%player's uuid%}
- command /nick1 [<text>]:
- permission: nick.change
- permission message: <light red>You don<grey>'<light red>t have permission for this.
- executable by: players
- usage: /nick1 [new nick]
- description: Changes your above head,tablist and/or chat nick.
- trigger:
- if argument is set:
- set {_match} to uncolored (colored argument)
- if length of {_match} is less than 16:
- set {nickStorage::%sender's uuid%} to removeColors(argument, sender)
- if {@changeChatNick} is true:
- set sender's display name to {nickStorage::%sender's uuid%}
- if {@changeTablistNick} is true:
- set sender's mundosk tablist name to {nickStorage::%sender's uuid%}
- if {@changeAboveHeadNick} is true:
- set sender's nametag to {nickStorage::%sender's uuid%}
- send "<light green>Your name has been set to <grey>""%colored argument%<grey>"""
- else:
- send "<light green>The nickname can<grey>'<light red>t be less than <orange>4<light red> characters or greater than <orange>16<light red> and doesn<grey>'<light red>t accept any kind of special characters<grey>."
- else:
- if {@changeChatNick} = true:
- set sender's display name to sender's name
- if {@changeTablistNick} = true:
- set sender's mundosk tablist name to sender's name
- if {@changeAboveHeadNick} = true:
- set sender's nametag to sender's name
- send "<light green>Your name has been reset<grey>."
- command /skin <player=%sender%> [<text>]:
- permission: skin.change
- permission message: <light red>You don<grey>'<light red>t have permission for this.
- executable by: players and console
- usage: /skin [player] [ign]
- description: changes your skin to the skin of other person's IGN.
- trigger:
- if arg-2 is set:
- access "getSkin" from arg-2
- wait 1 tick
- if {_skin} is set:
- set arg-1's displayed skin to {_skin}
- set {skinStorage::%arg-1's uuid%} to {_skin}
- send "<light green>Your skin has been set to <orange>%arg-2%<grey>'<light green>s skin<grey>."
- else:
- send "<light red>Invalid IGN<grey>,<light red> try again later or put other IGN<grey>."
- else:
- reset arg-1's displayed skin
- send "<light green>Your skin has been reset<grey>."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement