# # Author: Kastien # # RE-CODED VERSION! v3 # # FREE TO EDIT - PLEASE DON´T SAY THIS SKRIPT IT´S YOURS # # # Legendchat TAG: {krank} # # # # Events: # # Details: event-player (player), event-text (player's rank), event-integer (price of the rank) # #evt "on rankup": # broadcast "%event-player% used the command /rankup!" # #evt "on rankup": # if event-text is "Default": # give 1 diamond to player # broadcast "&aYay! %event-player% used my skript!" # # # # YOU CAN REQUEST ME ALMOST ANY SKRIPT IN DISCORD! Kastien#3643! # Depending of the difficulty i can even make it all for free! # # options: OrbGREY: {display:{Name:""Gray (##808080)""},SkullOwner:{Id:""87937323-f57b-4850-be40-afad6e8f1de1"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmExN2U5NzAzN2NlMzUzZjg1ZjVjNjVkZjQzNWQyOTQ0OWE4OGRhNDQ0MmU0MzYxY2Y5OWFiYmUxZjg5MmZiIn19fQ==""}]}}} OrbGREEN: {display:{Name:""Forest green (##228B22)""},SkullOwner:{Id:""a4b65da5-76a0-4e4e-bd6c-4bbc12a10860"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzhkNThhNzY1MWZlZGFlNGMwM2VmZWJjMjI2YzAzZmQ3OTFlYjc0YTEzMmJhYmI5NzRlOGQ4MzhhYzY4ODIifX19""}]}}} OrbRED: {display:{Name:""Maroon (##800000)""},SkullOwner:{Id:""4cce54d1-cf14-4398-9673-95384a6c858c"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQzOWE3MTk1N2NjMWRkNDU0NmY0MTMyOTY1ZWZmYmUzNDI5Yzg4OWIxYzZiYTcyMTJjYjRiOGMwMzU0MGY4In19fQ==""}]}}} VersionID: kRankUP-VersionID=1.0.3 on enable: if file "plugins/kRankUPoficial/ranks.yml" doesn't exists: create file "plugins/kRankUPoficial/ranks.yml" set yml value "Ranks.Default1.Name" of file "plugins/kRankUPoficial/ranks.yml" to "&aDefault I" set yml value "Ranks.Default1.Prefix" of file "plugins/kRankUPoficial/ranks.yml" to "&a[Default I]" set yml value "Ranks.Default1.Cost" of file "plugins/kRankUPoficial/ranks.yml" to 0 set yml value "Ranks.Default1.NBT" of file "plugins/kRankUPoficial/ranks.yml" to "nbt-none" add "say rankup" to yaml list "Ranks.Default1.Execute" of file "plugins/kRankUPoficial/ranks.yml" set yml value "Ranks.Default2.Name" of file "plugins/kRankUPoficial/ranks.yml" to "&bDefault II" set yml value "Ranks.Default2.Prefix" of file "plugins/kRankUPoficial/ranks.yml" to "&b[Default II]" set yml value "Ranks.Default2.Cost" of file "plugins/kRankUPoficial/ranks.yml" to 10000 set yml value "Ranks.Default2.NBT" of file "plugins/kRankUPoficial/ranks.yml" to "nbt-none" add "say rankup" to yaml list "Ranks.Default2.Execute" of file "plugins/kRankUPoficial/ranks.yml" set yml value "Ranks.Default3.Name" of file "plugins/kRankUPoficial/ranks.yml" to "&cDefault III" set yml value "Ranks.Default3.Prefix" of file "plugins/kRankUPoficial/ranks.yml" to "&c[Default III]" set yml value "Ranks.Default3.Cost" of file "plugins/kRankUPoficial/ranks.yml" to 20000 set yml value "Ranks.Default3.NBT" of file "plugins/kRankUPoficial/ranks.yml" to "nbt-none" add "say rankup" to yaml list "Ranks.Default3.Execute" of file "plugins/kRankUPoficial/ranks.yml" if file "plugins/kRankUPoficial/config.yml" doesn't exists: create file "plugins/kRankUPoficial/config.yml" set yml value "Send_Updates" of file "plugins/kRankUPoficial/config.yml" to true set yml value "Enable_RankCHAT" of file "plugins/kRankUPoficial/config.yml" to true set yml value "GUIs.Ranklist.GUIName" of file "plugins/kRankUPoficial/config.yml" to "&8 RANK LIST" set yml value "GUIs.RankUP.GUIName" of file "plugins/kRankUPoficial/config.yml" to "&8 RANK UP" if file "plugins/kRankUPoficial/players.yml" doesn't exists: create file "plugins/kRankUPoficial/players.yml" set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" loop all players: set yml value "Players.%loop-player%.RankNode" of file "plugins/kRankUPoficial/players.yml" to "%{_ranks::1}%" function openNewRanklistPAGE(p: player, pg: integer): set {_name} to yml value "GUIs.Ranklist.GUIName" of file "plugins/kRankUPoficial/config.yml" wait 1 tick open chest with 6 row named coloured {_name} to {_p} wait 1 tick set {_ranknode} to yml value "Players.%{_p}%.RankNode" of file "plugins/kRankUPoficial/players.yml" set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" loop {_ranks::*}: if {_rankget} is true: set {_nextrank} to yml value "Ranks.%loop-value%.Name" of file "plugins/kRankUPoficial/ranks.yml" set {_nextranknode} to loop-value stop loop if loop-value is {_ranknode}: set {_rankget} to true set {_rank} to yml value "Ranks.%{_ranknode}%.Name" of file "plugins/kRankUPoficial/ranks.yml" if {_nextrank} is not set: set {_nextrank} to "&cYou've reached the maximum rank!" format slot 4 of {_p} with skull of {_p} named "&7Personal information" with lore "&bRank:&f %coloured {_rank}%||&bNext Rank:&f %coloured {_nextrank}%||||&bMoney: &f%{_p}'s balance%||" to be unstealable format slot 48 of {_p} with diamond named "&a&lRANKUP" to close then run [make {_p} execute command "rankup"] format slot 49 of {_p} with paper named "&7&lPAGE %{_pg}%" to be unstealable format slot 50 of {_p} with book named "&a&lRANK CHAT" to close then run [make {_p} execute command "rc &aHey there! I'm %{_p}%."] if {_pg} > 1: if ({_pg} - 1) = 1: format slot 2 of {_p} with skull of {_p} with custom nbt "{@OrbGREY}" named "&8&lLAST PAGE" to close then run [openInitialRanklistPAGE({_p})] else if ({_pg} - 1) > 1: format slot 2 of {_p} with skull of {_p} with custom nbt "{@OrbGREY}" named "&8&lLAST PAGE" to close then run [openNewRanklistPAGE({_p}, {_npg})] set {_count} to 0 set {_countn} to 0 loop {Ranks::%{_pg}%::*}: add 1 to {_count} if {_count} = 8: add 2 to {_count} if {_count} < 17: set {_rnbt} to yml value "Ranks.%loop-value%.NBT" of file "plugins/kRankUPoficial/ranks.yml" replace all "nbt-" with "" in {_rnbt} set {_rname} to yml value "Ranks.%loop-value%.Name" of file "plugins/kRankUPoficial/ranks.yml" set {_rprefix} to yml value "Ranks.%loop-value%.Prefix" of file "plugins/kRankUPoficial/ranks.yml" set {_rcost} to yml value "Ranks.%loop-value%.Cost" of file "plugins/kRankUPoficial/ranks.yml" if {_rnbt} is "none": if loop-value is not {_ranknode}: if loop-value is not {_nextranknode}: format slot {_count} + 18 of {_p} with skull of {_p} with custom nbt "{@OrbRED}" named coloured {_rname} to be unstealable else: format slot {_count} + 18 of {_p} with skull of {_p} with custom nbt "{@OrbRED}" named "%coloured {_rname}%&a (NEXT RANK)" with lore "&bPrefix:&f %coloured {_rprefix}%||||&bCost:&f %{_rcost}%||" to be unstealable else: format slot {_count} + 18 of {_p} with skull of {_p} with custom nbt "{@OrbGREEN}" named "%coloured {_rname}%&a (YOUR RANK)" with lore "&bPrefix:&f %coloured {_rprefix}%||" to be unstealable else: if loop-value is not {_ranknode}: if loop-value is {_nextranknode}: format slot {_count} + 18 of {_p} with skull of {_p} with custom nbt "%{_rnbt}%" named "%coloured {_rname}%&a (NEXT RANK)" with lore "&bPrefix:&f %coloured {_rprefix}%||||&bCost:&f %{_rcost}%||" to be unstealable else: format slot {_count} + 18 of {_p} with skull of {_p} with custom nbt "%{_rnbt}%" named coloured {_rname} to be unstealable else: format slot {_count} + 18 of {_p} with skull of {_p} with custom nbt "{@OrbGREEN}" named "%coloured {_rname}%&a (YOUR RANK)" with lore "&bPrefix:&f %coloured {_rprefix}%||" to be unstealable else if {_count} >= 17: set {_nnpg} to {_pg} + 1 format slot 6 of {_p} with skull of {_p} with custom nbt "{@OrbGREY}" named "&a&lNEXT PAGE" to close then run [openNewRanklistPAGE({_p}, {_nnpg})] if {_countn} = 0: clear {Ranks::%{_nnpg}%::*} add 1 to {_countn} add loop-value to {Ranks::%{_nnpg}%::*} function openInitialRanklistPAGE(p: player): set {_name} to yml value "GUIs.Ranklist.GUIName" of file "plugins/kRankUPoficial/config.yml" wait 1 tick open chest with 6 row named coloured {_name} to {_p} wait 1 tick set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" set {_ranknode} to yml value "Players.%{_p}%.RankNode" of file "plugins/kRankUPoficial/players.yml" loop {_ranks::*}: if {_rankget} is true: set {_nextrank} to yml value "Ranks.%loop-value%.Name" of file "plugins/kRankUPoficial/ranks.yml" set {_nextranknode} to loop-value stop loop if loop-value is {_ranknode}: set {_rankget} to true set {_rank} to yml value "Ranks.%{_ranknode}%.Name" of file "plugins/kRankUPoficial/ranks.yml" if {_nextrank} is not set: set {_nextrank} to "&cYou've reached the maximum rank!" format slot 4 of {_p} with skull of {_p} named "&7Personal information" with lore "&bRank:&f %coloured {_rank}%||&bNext Rank:&f %coloured {_nextrank}%||||&bMoney: &f%{_p}'s balance%||" to be unstealable format slot 48 of {_p} with diamond named "&a&lRANKUP" to close then run [make {_p} execute command "rankup"] format slot 49 of {_p} with paper named "&7&lPAGE 1" to be unstealable format slot 50 of {_p} with book named "&a&lRANK CHAT" to close then run [make {_p} execute command "rc &aHey there! I'm %{_p}%."] set {_count} to 0 set {_countn} to 0 loop {_ranks::*}: add 1 to {_count} if {_count} = 8: add 2 to {_count} if {_count} < 17: set {_rnbt} to yml value "Ranks.%loop-value%.NBT" of file "plugins/kRankUPoficial/ranks.yml" replace all "nbt-" with "" in {_rnbt} set {_rname} to yml value "Ranks.%loop-value%.Name" of file "plugins/kRankUPoficial/ranks.yml" set {_rprefix} to yml value "Ranks.%loop-value%.Prefix" of file "plugins/kRankUPoficial/ranks.yml" set {_rcost} to yml value "Ranks.%loop-value%.Cost" of file "plugins/kRankUPoficial/ranks.yml" if {_rnbt} is "none": if loop-value is not {_ranknode}: if loop-value is not {_nextranknode}: format slot {_count} + 18 of {_p} with skull of {_p} with custom nbt "{@OrbRED}" named coloured {_rname} to be unstealable else: format slot {_count} + 18 of {_p} with skull of {_p} with custom nbt "{@OrbRED}" named "%coloured {_rname}%&a (NEXT RANK)" with lore "&bPrefix:&f %coloured {_rprefix}%||||&bCost:&f %{_rcost}%||" to be unstealable else: format slot {_count} + 18 of {_p} with skull of {_p} with custom nbt "{@OrbGREEN}" named "%coloured {_rname}%&a (YOUR RANK)" with lore "&bPrefix:&f %coloured {_rprefix}%||" to be unstealable else: if loop-value is not {_ranknode}: if loop-value is {_nextranknode}: format slot {_count} + 18 of {_p} with skull of {_p} with custom nbt "%{_rnbt}%" named "%coloured {_rname}%&a (NEXT RANK)" with lore "&bPrefix:&f %coloured {_rprefix}%||||&bCost:&f %{_rcost}%||" to be unstealable else: format slot {_count} + 18 of {_p} with skull of {_p} with custom nbt "%{_rnbt}%" named coloured {_rname} to be unstealable else: format slot {_count} + 18 of {_p} with skull of {_p} with custom nbt "{@OrbGREEN}" named "%coloured {_rname}%&a (YOUR RANK)" with lore "&bPrefix:&f %coloured {_rprefix}%||" to be unstealable else if {_count} >= 17: format slot 6 of {_p} with skull of {_p} with custom nbt "{@OrbGREY}" named "&a&lNEXT PAGE" to close then run [openNewRanklistPAGE({_p}, 2)] if {_countn} = 0: clear {Ranks::2::*} add 1 to {_countn} add loop-value to {Ranks::2::*} command /ranks: trigger: openInitialRanklistPAGE(player) command /rankup: trigger: set {_name} to yaml value "GUIs.RankUP.GUIName" of file "plugins/kRankUPoficial/config.yml" wait 1 tick open chest with 3 row named coloured {_name} to player wait 1 tick set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" set {_ranknode} to yml value "Players.%player%.RankNode" of file "plugins/kRankUPoficial/players.yml" loop {_ranks::*}: if {_rankget} is true: set {_nextrank} to yml value "Ranks.%loop-value%.Name" of file "plugins/kRankUPoficial/ranks.yml" set {_nextranknode} to loop-value stop loop if loop-value is {_ranknode}: set {_rankget} to true wait 1 tick set {_rank} to yml value "Ranks.%{_ranknode}%.Name" of file "plugins/kRankUPoficial/ranks.yml" set {_rankcost} to yml value "Ranks.%{_nextranknode}%.Cost" of file "plugins/kRankUPoficial/ranks.yml" if {_nextrank} is not set: set {_nextrank} to "&cYou've reached the maximum rank!" format slot 13 of player with skull of player named "&7Personal information" with lore "&bRank:&f %coloured {_rank}%||&bNext Rank:&f %coloured {_nextrank}%||||&bMoney: &f%player's balance%||||&bRankUP cost:&f %{_rankcost}% $||" to be unstealable if player's balance >= {_rankcost}: format slot 11 of player with skull of player with custom nbt "{@OrbGREEN}" named "&aConfirm RankUP" to close then run [confirmRankUP(player)] else if player's balance < {_rankcost}: format slot 11 of player with skull of player with custom nbt "{@OrbGREY}" named "&7Confirm RankUP" with lore "&c You don't have||&c inough money to rankup" to be unstealable format slot 15 of player with skull of player with custom nbt "{@OrbRED}" named "&cCancel RankUP" to close on enable: loop all players: set {_krankplayer} to yml value "Players.%loop-player%.RankNode" of file "plugins/kRankUPoficial/players.yml" set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" if {_ranks::*} contains {_krankplayer}: set {_pnode} to yml value "Players.%loop-player%.RankNode" of file "plugins/kRankUPoficial/players.yml" set {_pprefix} to yml value "Ranks.%{_pnode}%.Prefix" of file "plugins/kRankUPoficial/ranks.yml" set tag "krank" of loop-player to coloured {_pprefix} else: set yml value "Players.%loop-player%.RankNode" of file "plugins/kRankUPoficial/players.yml" to "%{_ranks::1}%" on join: set {_krankplayer} to yml value "Players.%player%.RankNode" of file "plugins/kRankUPoficial/players.yml" set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" if {_ranks::*} contains {_krankplayer}: set {_pnode} to yml value "Players.%player%.RankNode" of file "plugins/kRankUPoficial/players.yml" set {_pprefix} to yml value "Ranks.%{_pnode}%.Prefix" of file "plugins/kRankUPoficial/ranks.yml" set tag "krank" of player to coloured {_pprefix} else: set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" set yml value "Players.%player%.RankNode" of file "plugins/kRankUPoficial/players.yml" to "%{_ranks::1}%" on join: set {_players::*} to yaml nodes "Players" of file "plugins/kRankUPoficial/players.yml" if {_players::*} contains player: else: set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" set yml value "Players.%player%.RankNode" of file "plugins/kRankUPoficial/players.yml" to "%{_ranks::1}%" on chat: set {_players::*} to yaml nodes "Players" of file "plugins/kRankUPoficial/players.yml" if {_players::*} contains player: else: set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" set yml value "Players.%player%.RankNode" of file "plugins/kRankUPoficial/players.yml" to "%{_ranks::1}%" on chat: set {_krankplayer} to yml value "Players.%player%.RankNode" of file "plugins/kRankUPoficial/players.yml" set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" if {_ranks::*} contains {_krankplayer}: set {_pnode} to yml value "Players.%player%.RankNode" of file "plugins/kRankUPoficial/players.yml" set {_pprefix} to yml value "Ranks.%{_pnode}%.Prefix" of file "plugins/kRankUPoficial/ranks.yml" set tag "krank" of player to coloured {_pprefix} else: set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" set yml value "Players.%player%.RankNode" of file "plugins/kRankUPoficial/players.yml" to "%{_ranks::1}%" on command: if command executor is player: if command is "g", "global", "l", "local" or "tell": set {_krankplayer} to yml value "Players.%player%.RankNode" of file "plugins/kRankUPoficial/players.yml" set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" if {_ranks::*} contains {_krankplayer}: set {_pnode} to yml value "Players.%player%.RankNode" of file "plugins/kRankUPoficial/players.yml" set {_pprefix} to yml value "Ranks.%{_pnode}%.Prefix" of file "plugins/kRankUPoficial/ranks.yml" set tag "krank" of player to coloured {_pprefix} else: set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" set yml value "Players.%player%.RankNode" of file "plugins/kRankUPoficial/players.yml" to "%{_ranks::1}%" on command: if command executor is player: if command is "g", "global", "l", "local" or "tell": set {_players::*} to yaml nodes "Players" of file "plugins/kRankUPoficial/players.yml" if {_players::*} contains player: else: set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" set yml value "Players.%player%.RankNode" of file "plugins/kRankUPoficial/players.yml" to "%{_ranks::1}%" function confirmRankUP(p: player): set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" set {_ranknode} to yml value "Players.%{_p}%.RankNode" of file "plugins/kRankUPoficial/players.yml" loop {_ranks::*}: if {_rankget} is true: set {_nextrank} to yml value "Ranks.%loop-value%.Name" of file "plugins/kRankUPoficial/ranks.yml" set {_nextranknode} to loop-value stop loop if loop-value is {_ranknode}: set {_rankget} to true set yml value "Players.%{_p}%.RankNode" of file "plugins/kRankUPoficial/players.yml" to {_nextranknode} set {_rankcost} to yml value "Ranks.%{_nextranknode}%.Cost" of file "plugins/kRankUPoficial/ranks.yml" set {_rprefix} to yml value "Ranks.%{_nextranknode}%.Prefix" of file "plugins/kRankUPoficial/ranks.yml" set tag "krank" of {_p} to coloured {_rprefix} remove {_rankcost} from {_p}'s balance set {_execute::*} to yaml list "Ranks.%{_nextranknode}%.Execute" of file "plugins/kRankUPoficial/ranks.yml" loop {_execute::*}: set {_cmd} to loop-value replace all "" with "%{_p}%" in {_cmd} replace all "" with coloured {_rprefix} in {_cmd} replace all "" with "%{_rankcost}% $" in {_cmd} make console execute command "%{_cmd}%" command /rc []: trigger: set {_perm} to yml value "Enable_RankCHAT" of file "plugins/kRankUPoficial/config.yml" if {_perm} is true: if arg-1 is set: set {_players::*} to yaml nodes "Players" of file "plugins/kRankUPoficial/players.yml" if {_players::*} contains player: else: set {_ranks::*} to yaml nodes "Ranks" of file "plugins/kRankUPoficial/ranks.yml" set yml value "Players.%player%.RankNode" of file "plugins/kRankUPoficial/players.yml" to "%{_ranks::1}%" set {_pnode} to yml value "Players.%player%.RankNode" of file "plugins/kRankUPoficial/players.yml" set {_prank} to yml value "Ranks.%{_pnode}%.Prefix" of file "plugins/kRankUPoficial/ranks.yml" loop {_players::*}: set {_plnode} to yml value "Players.%loop-value%.RankNode" of file "plugins/kRankUPoficial/players.yml" if {_plnode} = {_pnode}: if loop-value parsed as offline player is not player: send "&a[RC]&r %player's prefix% %player% %coloured {_prank}%&8:&a %coloured arg-1%" to loop-value parsed as offline player send "&a[RC]&r %player's prefix% %player% %coloured {_prank}%&8:&a %coloured arg-1%" else: send "&cInsert a message." else: send "&fCommand not found." on enable: set {_permupdate} to yml value "Send_Updates" of file "plugins/kRankUPoficial/config.yml" if {_permupdate} is true: wait 3 ticks if text from "https://hastebin.com/raw/elopilixaz.ini" is not "{@VersionID}": set {_versionall::*} to text from "https://hastebin.com/raw/elopilixaz.ini" split at "=" set {_versionid} to {_versionall::2} message "&7&m------------------&7[&a&lkRankUP &5&fUpdate&7]&7&m-----------------" to console message "&r " to console message " &cCheck out kRankUP %{_versionid}%!" to console message " &cDownload from here:" to console message "&r " to console message "&fhttps://forums.skunity.com/resources/krankup.697/updates" to console message "&7&m-----------------------------------------------------" to console every 1 hour: set {_permupdate} to yml value "Send_Updates" of file "plugins/kRankUPoficial/config.yml" if {_permupdate} is true: wait 3 ticks if text from "https://hastebin.com/raw/elopilixaz.ini" is not "{@VersionID}": set {_versionall::*} to text from "https://hastebin.com/raw/elopilixaz.ini" split at "=" set {_versionid} to {_versionall::2} message "&7&m------------------&7[&a&lkRankUP &5&fUpdate&7]&7&m-----------------" to console message "&r " to console message " &cCheck out kRankUP %{_versionid}%!" to console message " &cDownload from here:" to console message "&r " to console message "&fhttps://forums.skunity.com/resources/krankup.697/updates" to console message "&7&m-----------------------------------------------------" to console