SHARE
TWEET

rankshop

MasterKyle08 Feb 22nd, 2020 161 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Rank Shop
  2.  
  3. function buyRank(p: player, price: number, rank: text):
  4.   close {_p}'s inventory
  5.   if {_p}'s balance < {_price}:
  6.     play sound "entity.villager.no" with volume 10 to {_p}
  7.     send "&c&lYou dont have enough money to buy %fancyRANK({_rank})%&f Rank!" to {_p}
  8.     stop
  9.   execute console command "eco take %{_p}% %{_price}%"
  10.   loop "iron", "diamond" and "emerald":
  11.     execute console command "lp user %{_p}% parent remove %loop-value%"
  12.   execute console command "lp user %{_p}% parent add %{_rank}%"
  13.   send "&f&l%{_p}% &7just bought %fancyRANK({_rank})%&f&l &7Rank! &7Type &b/rankshop &7to purchase ranks!" to all players
  14.  
  15. command /rankshop:
  16.   permission: rankshop.command
  17.   aliases: /rs
  18.   trigger:
  19.     play sound "block.stone_button.click_on" with volume 10 to player
  20.     open virtual chest inventory with size 3 named "Buyable Ranks" to player
  21.     format gui slot (integers between 0 and 26) of player with black glass pane named ""
  22.     format gui slot 11 of player with iron block named "&lIRON &fRank" with lore "&7Price: &a$500,000" to run function buyRank(player, 500000, "iron")
  23.     format gui slot 13 of player with diamond block named "&b&lDIAMOND &fRank" with lore "&7Price: &a$1,000,000" to run function buyRank(player, 1000000, "diamond")
  24.     format gui slot 15 of player with emerald block named "&2&lEMERALD &fRank" with lore "&7Price: &a$1,500,000" to run function buyRank(player, 1500000, "emerald")
  25.  
  26. function fancyRANK(rank: text) :: text:
  27.   return "&f&lIRON" if {_rank} = "iron"
  28.   return "&b&lDIAMOND" if {_rank} = "diamond"
  29.   return "&a&lEMERALD" if {_rank} = "emerald"
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