Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. function shop(p: player):
  2. set {_u} to uuid of {_p}
  3. open virtual chest inventory with size 3 named "&8Main Shop" to {_p}
  4. set {_n} to 0
  5. loop 27 times:
  6. format gui slot {_n} of {_p} with black stained glass pane to do nothing
  7. add 1 to {_n}
  8. set {_n} to 21
  9. loop 3 times:
  10. format gui slot {_n} of {_p} with lime stained glass pane named " " with lore " ", "&7Created by:", "&4BreakfastDeliqht", and " " to do nothing
  11. add 1 to {_n}
  12. format gui slot 10 of {_p} with spruce log named "&8Blocks Shop" with lore " ", "&cClick here to open the blocks category!", and " " to run:
  13. blocks(player)
  14.  
  15. function Buy(p: player, I: Item, x: number):
  16. set {_u} to uuid of {_p}
  17. if {_p}'s balance >= {_x}:
  18. give {_p} {_I}
  19. remove {_x} from {_p}'s balance
  20. send "&5&lSHOP &8» &7Thank you for your purchase!" to {_p}
  21. else if {_p}'s balance < {_x}:
  22. send "&5&lSHOP &8» &7Insufficient Balance!" to {_p}
  23.  
  24. function blocks(p: player):
  25. set {_u} to uuid of {_p}
  26. open virtual chest inventory with size 6 named "&8Blocks Shop" to {_p}
  27. set {_n} to 0
  28. loop 6 times:
  29. format gui slot {_n} of {_p} with red stained glass pane named "&4&lBACK" with lore " ", and "&cClick to go back to main shop!" to run:
  30. shop(player)
  31. add 9 to {_n}
  32. format gui slot 1 of {_p} with oak log named "&6Oak Log" with lore " ", "&6Amount: &e4", "&6Price: &e$15", and " " to run:
  33. Buy(player,4 oak log,15)
  34. format gui slot 2 of {_p} with spruce log named "&6Spruce Log" with lore " ", "&6Amount: &e4", "&6Price: &e$15", and " " to run:
  35. Buy(player,4 spruce log,15)
  36. format gui slot 3 of {_p} with dark oak log named "&6Dark Oak Log" with lore " ", "&6Amount: &e4", "&6Price: &e$15", and " " to run:
  37. Buy(player,4 dark oak log,15)
  38. format gui slot 4 of {_p} with birch log named "&6Birch Log" with lore " ", "&6Amount: &e4", "&6Price: &e$15", and " " to run:
  39. Buy(player,4 birch log,15)
  40.  
  41. command /shop:
  42. trigger:
  43. shop(player)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement