SHARE
TWEET

Untitled

a guest May 22nd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. options:
  2.  
  3.     p: &a&lRankUp &8»
  4.     pr: &a&lPrestige &8»
  5.     error: &c&lError &8|
  6.  
  7.     NoPerm: &cYou don't enough permissions to do that.
  8.  
  9.    
  10.     Title: &aCongratulations!
  11.     Subtitle: &7You've ranked up to &a&l%{_rank}%
  12.    
  13.     PresTitle: &aCongratulations!
  14.     PresSubtitle: &7You've Presitged to &a&l%{_pres}%
  15.  
  16.     RankupMsg: &f&lGG&a! You've ranked up to &f&l%{_rank}%
  17.     RankupBroadcast: &a>&b>&c> &f%{_p}% &aranked up to &f%{_rank}%
  18.  
  19.     PresMsg: &f&lGG&a! You've Prestiged to &f&l%{_pres}%
  20.     PresBroadcast: &a>&b>&c> &f%{_p}% &aPrestiged to &f%{_pres}%
  21.  
  22.     PrestigeCost: 5000000
  23.  
  24.     Particle: heart
  25.     ParticleCount: 50
  26.  
  27.     Sound: ENTITY_PLAYER_LEVELUP
  28.  
  29. function currentRank(p: player) :: text:
  30.  
  31.     add "Obsidian", "Emerald", "Diamond", "Gold", "Redstone", "Lapis", "Iron", "Coal", "Stone" and "Dirt" to {_ranks::*}
  32.  
  33.     loop {_ranks::*}:
  34.         {_p} has permission "greatkits.kits.%loop-value%"
  35.         set {_r} to loop-value
  36.         return {_r}
  37.         stop loop
  38.     return "invalid" where [{_r} is not set]
  39.  
  40.  
  41. function rankUp(p: player, rank: text, cost: number, oldrank: text, set: boolean = false):
  42.     set {_pU} to uuid of {_p}
  43.     if {_set} = false:
  44.         set {_pr} to {Prestige::playerdata::%{_pU}%} if {Prestige::playerdata::%{_pU}%} > 0 else 1
  45.         if {_p}'s balance < {_cost}:
  46.             send "{@p} &cYou don't have enough money to rankup to &f%{_rank}%&c. &7&o(Cost: &f$%{_cost}%)&7&o" to {_p}
  47.             set {_cant} to true
  48.     {_cant} is not set
  49.     if {_set} = false:
  50.         remove {_cost} from {_p}'s balance
  51.     add "Obsidian", "Emerald", "Diamond", "Gold", "Redstone", "Lapis", "Iron", "Coal", "Stone" and "Dirt" to {_ranks::*}
  52.     loop {_ranks::*}:
  53.         console command "pex user %{_p}% group remove %loop-value%"
  54.     console command "pex user %{_p}% group add %{_rank}%"
  55.     if {_set} = false:
  56.         send {_p} title "{@Title}" with subtitle "{@Subtitle}" for 3 seconds
  57.         send "{@p} {@RankupMsg}" to {_p}
  58.         send "{@RankupBroadcast}" to all players
  59.         loop all players in radius 50 around {_p}:
  60.             show {@ParticleCount} "{@Particle}" particles at {_p} for loop-player
  61.         play "{@Sound}" to {_p}
  62.  
  63.  
  64. command /ranks:
  65.     trigger:
  66.         send "&a&lRanks list:"
  67.         send "&6Dirt &f= &aFREE « Default Rank"
  68.         send "&7Stone &f= &a$10k"
  69.         send "&8Coal &f= &a$50k"
  70.         send "&fIron &f= &a$150k"
  71.         send "&9Lapis &f= &a$250k"
  72.         send "&cRedstone &f= &a$500k"
  73.         send "&6Gold &f= &a$1 Million"
  74.         send "&bDiamond &f= &a$2.5 Million"
  75.         send "&2Emerald &f= &a$5 Million"
  76.         send "&5Obsidian &f- &a$10 Million"
  77.         stop
  78.  
  79. command /rankup [<text>] [<offlineplayer>] [<text>]:
  80.     #permission: rankup.use
  81.     aliases: ru
  82.     trigger:
  83.         if arg-1 is "help":
  84.             if player has permission "rankup.help":
  85.                 send "{@p} &a/ru help &8- &7Shows this message."
  86.                 send "{@p} &a/ru set <player> <rank> &8- &7Change player's rank."
  87.                 send "{@p} &a/ru &8- &7To rankup."
  88.                 stop
  89.             else:
  90.                 send "{@NoPerm}"
  91.                 stop
  92.  
  93.         if arg-1 is "set":
  94.             if player has permission "rankup.set":
  95.                 if arg-2 is set:
  96.                     if arg-3 is "Dirt" or "Stone" or "Coal" or "Iron" or "Lapis" or "Redstone" or "Gold" or "Diamond" or "Emerald" or "Obsidian":
  97.                         rankUp(arg-2, "%arg-3%", 0, currentRank(arg-2), true)
  98.                         send "{@p} &aSuccessfully set &f%arg-2%&a's rank to &f%arg-3%" to player
  99.                         send "{@p} &aYour rank has been manually set to &f%arg-3%&a." to arg-2
  100.                         stop
  101.                     else:
  102.                         send "{@error} &cUnknown rank name."
  103.                         stop
  104.                 else:
  105.                     send "{@error} &cMissing player name."
  106.                     stop
  107.             else:
  108.                 send "{@NoPerm}"
  109.                 stop
  110.  
  111.         if arg-1 is not set:
  112.  
  113.             if sender is not a player:
  114.                 send "{@p} &cThis is a players command!"
  115.                 stop
  116.  
  117.             if sender has permission "greatkits.kits.Obsidian":
  118.                 send "{@p} &cYou're at max rank already."
  119.                 stop
  120.  
  121.             add "Obsidian|10000000" to {_ranks::*}
  122.             add "Emerald|5000000" to {_ranks::*}
  123.             add "Diamond|2500000" to {_ranks::*}
  124.             add "Gold|1000000" to {_ranks::*}
  125.             add "Redstone|500000" to {_ranks::*}
  126.             add "Lapis|250000" to {_ranks::*}
  127.             add "Iron|150000" to {_ranks::*}
  128.             add "Coal|50000" to {_ranks::*}
  129.             add "Stone|10000" to {_ranks::*}
  130.             add "Dirt|0" to {_ranks::*}
  131.  
  132.             loop {_ranks::*}:
  133.                 set {_li} to loop-index parsed as integer + 1
  134.                 set {_or::*} to split {_ranks::%{_li}%} at "|"
  135.                 set {_lv::*} to split loop-value at "|"
  136.                 sender has permission "greatkits.kits.%{_or::1}%"
  137.                 rankUp(player, {_lv::1}, {_lv::2} parsed as number, {_or::1})
  138.                 #delete {_lv::*} and {_or::*}
  139.                 stop
  140.  
  141.             #! it will stop the code if the code above worked otherwise this msg will be sent.
  142.             send "{@p} &cInvalid rank."
  143.             stop
  144.  
  145. on join:
  146.     {Prestige::playerdata::%uuid of player%} is not set
  147.     set {Prestige::playerdata::%uuid of player%} to 0
  148.  
  149. function prestigeUp(p: player, set: integer = -1):
  150.     set {_pU} to uuid of {_p}
  151.     #remove {@PrestigeCost} from {_p}'s balance
  152.     if {_set} = -1:
  153.         if {_p} doesn't have permission "greatkits.kits.Obsidian":
  154.             send "{@pr} &cYou need to be at rank &5Obsidian &cto Prestige." to {_p}
  155.             set {_cant} to true
  156.         {_cant} is not set
  157.         if {_p}'s balance >= {@PrestigeCost}:
  158.             set {_p}'s balance to 0
  159.             add 1 to {Prestige::playerdata::%{_pU}%}
  160.             console command "pex user %{_p}% group remove Obsidian"
  161.             console command "pex user %{_p}% group add Dirt"
  162.             teleport {_p} to spawn of {_p}'s world
  163.             set {_pres} to {Prestige::playerdata::%{_pU}%}
  164.             send {_p} title "{@PresTitle}" with subtitle "{@PresSubtitle}" for 3 seconds
  165.             send "{@pr} {@PresMsg}" to {_p}
  166.             send "{@PresBroadcast}" to all players
  167.             loop all players in radius 50 around {_p}:
  168.                 show {@ParticleCount} "{@Particle}" particles at {_p} for loop-player
  169.             play "{@Sound}" to {_p}
  170.         else:
  171.             send "{@pr} &cYou don't have enough money. &7&o(Cost: &f${@PrestigeCost}&7&o)" to {_p}
  172.     else:
  173.         set {Prestige::playerdata::%{_pU}%} to {_set}
  174.  
  175.  
  176.  
  177. command /prestige [<text>] [<offlineplayer>] [<integer>]:
  178.     aliases: pres
  179.     trigger:
  180.         if arg-1 is "help":
  181.             if player has permission "prestige.help":
  182.                 send "{@pr} &a/pres help &8- &7Shows this message."
  183.                 send "{@pr} &a/pres set <player> <number> &8- &7Change player's prestige."
  184.                 send "{@pr} &a/pres &8- &7To prestige."
  185.                 stop
  186.             else:
  187.                 send "{@NoPerm}"
  188.                 stop
  189.  
  190.         if arg-1 is "set":
  191.             if player has permission "prestige.set":
  192.                 if arg-2 is set:
  193.                     if arg-3 is set:
  194.                         prestigeUp(arg-2, arg-3)
  195.                         send "{@pr} &aSuccessfully set &f%arg-2%&a's prestige to &f%arg-3%" to player
  196.                         send "{@pr} &aYour prestige has been manually set to &f%arg-3%&a." to arg-2
  197.                         stop
  198.                     else:
  199.                         send "{@error} &cMissing Prestige number."
  200.                         stop
  201.                 else:
  202.                     send "{@error} &cMissing player name."
  203.                     stop
  204.             else:
  205.                 send "{@NoPerm}"
  206.                 stop
  207.         else:
  208.             prestigeUp(player)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top