Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- p: &a&lRankUp &8»
- pr: &a&lPrestige &8»
- error: &c&lError &8|
- NoPerm: &cYou don't enough permissions to do that.
- Title: &aCongratulations!
- Subtitle: &7You've ranked up to &a&l%{_rank}%
- PresTitle: &aCongratulations!
- PresSubtitle: &7You've Presitged to &a&l%{_pres}%
- RankupMsg: &f&lGG&a! You've ranked up to &f&l%{_rank}%
- RankupBroadcast: &a>&b>&c> &f%{_p}% &aranked up to &f%{_rank}%
- PresMsg: &f&lGG&a! You've Prestiged to &f&l%{_pres}%
- PresBroadcast: &a>&b>&c> &f%{_p}% &aPrestiged to &f%{_pres}%
- PrestigeCost: 5000000
- Particle: heart
- ParticleCount: 50
- Sound: ENTITY_PLAYER_LEVELUP
- function currentRank(p: player) :: text:
- add "Obsidian", "Emerald", "Diamond", "Gold", "Redstone", "Lapis", "Iron", "Coal", "Stone" and "Dirt" to {_ranks::*}
- loop {_ranks::*}:
- {_p} has permission "greatkits.kits.%loop-value%"
- set {_r} to loop-value
- return {_r}
- stop loop
- return "invalid" where [{_r} is not set]
- function rankUp(p: player, rank: text, cost: number, oldrank: text, set: boolean = false):
- set {_pU} to uuid of {_p}
- if {_set} = false:
- set {_pr} to {Prestige::playerdata::%{_pU}%} if {Prestige::playerdata::%{_pU}%} > 0 else 1
- if {_p}'s balance < {_cost}:
- send "{@p} &cYou don't have enough money to rankup to &f%{_rank}%&c. &7&o(Cost: &f$%{_cost}%)&7&o" to {_p}
- set {_cant} to true
- {_cant} is not set
- if {_set} = false:
- remove {_cost} from {_p}'s balance
- add "Obsidian", "Emerald", "Diamond", "Gold", "Redstone", "Lapis", "Iron", "Coal", "Stone" and "Dirt" to {_ranks::*}
- loop {_ranks::*}:
- console command "pex user %{_p}% group remove %loop-value%"
- console command "pex user %{_p}% group add %{_rank}%"
- if {_set} = false:
- send {_p} title "{@Title}" with subtitle "{@Subtitle}" for 3 seconds
- send "{@p} {@RankupMsg}" to {_p}
- send "{@RankupBroadcast}" to all players
- loop all players in radius 50 around {_p}:
- show {@ParticleCount} "{@Particle}" particles at {_p} for loop-player
- play "{@Sound}" to {_p}
- command /ranks:
- trigger:
- send "&a&lRanks list:"
- send "&6Dirt &f= &aFREE « Default Rank"
- send "&7Stone &f= &a$10k"
- send "&8Coal &f= &a$50k"
- send "&fIron &f= &a$150k"
- send "&9Lapis &f= &a$250k"
- send "&cRedstone &f= &a$500k"
- send "&6Gold &f= &a$1 Million"
- send "&bDiamond &f= &a$2.5 Million"
- send "&2Emerald &f= &a$5 Million"
- send "&5Obsidian &f- &a$10 Million"
- stop
- command /rankup [<text>] [<offlineplayer>] [<text>]:
- #permission: rankup.use
- aliases: ru
- trigger:
- if arg-1 is "help":
- if player has permission "rankup.help":
- send "{@p} &a/ru help &8- &7Shows this message."
- send "{@p} &a/ru set <player> <rank> &8- &7Change player's rank."
- send "{@p} &a/ru &8- &7To rankup."
- stop
- else:
- send "{@NoPerm}"
- stop
- if arg-1 is "set":
- if player has permission "rankup.set":
- if arg-2 is set:
- if arg-3 is "Dirt" or "Stone" or "Coal" or "Iron" or "Lapis" or "Redstone" or "Gold" or "Diamond" or "Emerald" or "Obsidian":
- rankUp(arg-2, "%arg-3%", 0, currentRank(arg-2), true)
- send "{@p} &aSuccessfully set &f%arg-2%&a's rank to &f%arg-3%" to player
- send "{@p} &aYour rank has been manually set to &f%arg-3%&a." to arg-2
- stop
- else:
- send "{@error} &cUnknown rank name."
- stop
- else:
- send "{@error} &cMissing player name."
- stop
- else:
- send "{@NoPerm}"
- stop
- if arg-1 is not set:
- if sender is not a player:
- send "{@p} &cThis is a players command!"
- stop
- if sender has permission "greatkits.kits.Obsidian":
- send "{@p} &cYou're at max rank already."
- stop
- add "Obsidian|10000000" to {_ranks::*}
- add "Emerald|5000000" to {_ranks::*}
- add "Diamond|2500000" to {_ranks::*}
- add "Gold|1000000" to {_ranks::*}
- add "Redstone|500000" to {_ranks::*}
- add "Lapis|250000" to {_ranks::*}
- add "Iron|150000" to {_ranks::*}
- add "Coal|50000" to {_ranks::*}
- add "Stone|10000" to {_ranks::*}
- add "Dirt|0" to {_ranks::*}
- loop {_ranks::*}:
- set {_li} to loop-index parsed as integer + 1
- set {_or::*} to split {_ranks::%{_li}%} at "|"
- set {_lv::*} to split loop-value at "|"
- sender has permission "greatkits.kits.%{_or::1}%"
- rankUp(player, {_lv::1}, {_lv::2} parsed as number, {_or::1})
- #delete {_lv::*} and {_or::*}
- stop
- #! it will stop the code if the code above worked otherwise this msg will be sent.
- send "{@p} &cInvalid rank."
- stop
- on join:
- {Prestige::playerdata::%uuid of player%} is not set
- set {Prestige::playerdata::%uuid of player%} to 0
- function prestigeUp(p: player, set: integer = -1):
- set {_pU} to uuid of {_p}
- #remove {@PrestigeCost} from {_p}'s balance
- if {_set} = -1:
- if {_p} doesn't have permission "greatkits.kits.Obsidian":
- send "{@pr} &cYou need to be at rank &5Obsidian &cto Prestige." to {_p}
- set {_cant} to true
- {_cant} is not set
- if {_p}'s balance >= {@PrestigeCost}:
- set {_p}'s balance to 0
- add 1 to {Prestige::playerdata::%{_pU}%}
- console command "pex user %{_p}% group remove Obsidian"
- console command "pex user %{_p}% group add Dirt"
- teleport {_p} to spawn of {_p}'s world
- set {_pres} to {Prestige::playerdata::%{_pU}%}
- send {_p} title "{@PresTitle}" with subtitle "{@PresSubtitle}" for 3 seconds
- send "{@pr} {@PresMsg}" to {_p}
- send "{@PresBroadcast}" to all players
- loop all players in radius 50 around {_p}:
- show {@ParticleCount} "{@Particle}" particles at {_p} for loop-player
- play "{@Sound}" to {_p}
- else:
- send "{@pr} &cYou don't have enough money. &7&o(Cost: &f${@PrestigeCost}&7&o)" to {_p}
- else:
- set {Prestige::playerdata::%{_pU}%} to {_set}
- command /prestige [<text>] [<offlineplayer>] [<integer>]:
- aliases: pres
- trigger:
- if arg-1 is "help":
- if player has permission "prestige.help":
- send "{@pr} &a/pres help &8- &7Shows this message."
- send "{@pr} &a/pres set <player> <number> &8- &7Change player's prestige."
- send "{@pr} &a/pres &8- &7To prestige."
- stop
- else:
- send "{@NoPerm}"
- stop
- if arg-1 is "set":
- if player has permission "prestige.set":
- if arg-2 is set:
- if arg-3 is set:
- prestigeUp(arg-2, arg-3)
- send "{@pr} &aSuccessfully set &f%arg-2%&a's prestige to &f%arg-3%" to player
- send "{@pr} &aYour prestige has been manually set to &f%arg-3%&a." to arg-2
- stop
- else:
- send "{@error} &cMissing Prestige number."
- stop
- else:
- send "{@error} &cMissing player name."
- stop
- else:
- send "{@NoPerm}"
- stop
- else:
- prestigeUp(player)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement