Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.31 KB | None | 0 0
  1. #
  2. # Jobs
  3. # Author: BreakfastDeliqht
  4. # Created On: 09/21/2019
  5. # Version: 0.0.1
  6. #
  7.  
  8. function jobs(p: player):
  9. set {_u} to uuid of {_p}
  10. open virtual chest inventory with size 3 named "&8Available Jobs" to {_p}
  11. format gui slot 26 of {_p} with red stained glass pane named "&cResign" with lore " ", "&cResign from your current job.", and " " to run:
  12. make {_p} execute command "resign"
  13. format gui slot 0 of {_p} with golden apple named "&9Doctor" with lore " ", "&bHeal players for a small fee!", "&bPaycheck: $10 per heal." and " " to run:
  14. doctor(player)
  15. format gui slot 1 of {_p} with iron ingot named "&9Miner" with lore " ", "&bMine for money!", "&bPaycheck: VARIES", and " " to run:
  16. miner(player)
  17. format gui slot 2 of {_p} with oak log named "&9Lumberjack" with lore " ", "&bCut down trees for money!", "&bPaycheck: VARIES", and " " to run:
  18. lumberJack(player)
  19.  
  20. function doctor(p: player):
  21. set {_u} to uuid of {_p}
  22. if {employed::%{_u}%} is true:
  23. send "&9&l• &9Employed &8&l» &7You are already &9employed!" to {_p}
  24. else if {employed::%{_u}%} is not set:
  25. send "&9&l• &9Employed &8&l» &7You are now &9employed &7as a &cDoctor!" to {_p}
  26. set {job::%{_u}%} to "Doctor"
  27. set {employed::%{_u}%} to true
  28.  
  29. function miner(p: player):
  30. set {_u} to uuid of {_p}
  31. if {employed::%{_u}%} is true:
  32. send "&9&l• &9Employed &8&l» &7You are already &9employed!" to {_p}
  33. else if {employed::%{_u}%} is not set:
  34. send "&9&l• &9Employed &8&l» &7You are now &9employed &7as a &6Miner!" to {_p}
  35. set {job::%{_u}%} to "Miner"
  36. set {employed::%{_u}%} to true
  37.  
  38. function lumberJack(p: player):
  39. set {_u} to uuid of {_p}
  40. if {employed::%{_u}%} is true:
  41. send "&9&l• &9Employed &8&l» &7You are already &9employed!" to {_p}
  42. else if {employed::%{_u}%} is not set:
  43. send "&9&l• &9Employed &8&l» &7You are now &9employed &7as a &5Lumberjack!" to {_p}
  44. set {job::%{_u}%} to "Lumberjack"
  45. set {employed::%{_u}%} to true
  46.  
  47. command /jobs:
  48. trigger:
  49. jobs(player)
  50.  
  51. on right click on a player:
  52. if {job::%player's uuid%} is "Doctor":
  53. if clicked player's name is "&7Miner":
  54. cancel event
  55. else:
  56. set {request.%clicked player%} to true
  57. set {request.%player%} to true
  58. send "&9&l• &9Employed &8&l» &7You sent a heal request to &b%clicked player% &7for $10." to player
  59. send "&9&l• &9Employed &8&l» &7%player% &7is trying to &cheal you! &7Do &c/heal accept &7to be healed for $10." to clicked player
  60. wait 30 seconds
  61. if {request.%clicked player%} is not set:
  62. add 10 to player's balance
  63. send "&9&l• &9Employed &8&l» &7%clicked player% &7accepted your request. They were healed." to player
  64. else if {request.%clicked player%} is true:
  65. delete {request.%clicked player%}
  66. delete {request.%player%}
  67. send "&9&l• &9Employed &8&l» &7%clicked player% &7failed to accept." to player
  68. send "&9&l• &9Employed &8&l» &7You failed to accept." to clicked player
  69.  
  70. command /heal [<text>]:
  71. trigger:
  72. if arg-1 is not set:
  73. send "&9&l• &9Employed &8&l» &7/heal accept."
  74. else if arg-1 is "accept":
  75. if {request.%player%} is true:
  76. if player's balance >= 10:
  77. delete {request.%player%}
  78. remove 10 from player's balance
  79. heal player
  80. send "&9&l• &9Employed &8&l» &7You were healed for $10."
  81. else:
  82. send "&9&l• &9Employed &8&l» &7Insufficient Balance."
  83. else:
  84. send "&9&l• &9Employed &8&l» &7You don't have a pending request."
  85. else:
  86. send "&9&l• &9Employed &8&l» &7/heal accept."
  87.  
  88. function minerShop(p: player):
  89. set {_u} to uuid of {_p}
  90. open virtual chest inventory with size 1 named "&8Miner Shop" to {_p}
  91. format gui slot 0 of {_p} with cobblestone named "&9Cobblestone" with lore " ", "&9Worth: &b$0.05", "&bClick to sell all cobblestone.", and " " to run:
  92. set {_amt} to amount of cobblestone in {_p}'s inventory
  93. set {_ttl} to {_amt} * 0.05
  94. add {_ttl} to {_p}'s balance
  95. remove all cobblestone from {_p}'s inventory
  96. set action bar of {_p} to "&9+$%{_ttl}%"
  97. format gui slot 1 of {_p} with coal named "&9Coal" with lore " ", "&9Worth: &b$0.10", "&bClick to sell all coal.", and " " to run:
  98. set {_amt} to amount of coal in {_p}'s inventory
  99. set {_ttl} to {_amt} * 0.10
  100. add {_ttl} to {_p}'s balance
  101. remove all coal from {_p}'s inventory
  102. set action bar of {_p} to "&9+$%{_ttl}%"
  103. format gui slot 2 of {_p} with iron ore named "&9Iron Ore" with lore " ", "&9Worth: &b$0.25", "&bClick to sell all iron ore.", and " " to run:
  104. set {_amt} to amount of iron ore in {_p}'s inventory
  105. set {_ttl} to {_amt} * 0.25
  106. add {_ttl} to {_p}'s balance
  107. remove all iron ore from {_p}'s inventory
  108. set action bar of {_p} to "&9+$%{_ttl}%"
  109. format gui slot 3 of {_p} with iron ingot named "&9Iron Ingot" with lore " ", "&9Worth: &b$0.50", "&bClick to sell all iron ingots.", and " " to run:
  110. set {_amt} to amount of iron ingot in {_p}'s inventory
  111. set {_ttl} to {_amt} * 0.50
  112. add {_ttl} to {_p}'s balance
  113. remove all iron ingot from {_p}'s inventory
  114. set action bar of {_p} to "&9+$%{_ttl}%"
  115. format gui slot 4 of {_p} with gold ore named "&9Gold Ore" with lore " ", "&9Worth: &b$0.75", "&bClick to sell all gold ore." and " " to run:
  116. set {_amt} to amount of gold ore in {_p}'s inventory
  117. set {_ttl} to {_amt} * 0.75
  118. add {_ttl} to {_p}'s balance
  119. remove all gold ore from {_p}'s inventory
  120. set action bar of {_p} to "&9+$%{_ttl}%"
  121. format gui slot 5 of {_p} with gold ingot named "&9Gold Ingot" with lore " ", "&9Worth: &b$1.00", "&bClick to sell all gold ingots." and " " to run:
  122. set {_amt} to amount of gold ingot in {_p}'s inventory
  123. set {_ttl} to {_amt} * 1.00
  124. add {_ttl} to {_p}'s balance
  125. remove all gold ingot from {_p}'s inventory
  126. set action bar of {_p} to "&9+$%{_ttl}%"
  127. format gui slot 6 of {_p} with diamond named "&9Diamond" with lore " ", "&9Worth: &b$2.00", "&bClick to sell all diamonds." and " " to run:
  128. set {_amt} to amount of diamond in {_p}'s inventory
  129. set {_ttl} to {_amt} * 2.00
  130. add {_ttl} to {_p}'s balance
  131. remove all diamond from {_p}'s inventory
  132. set action bar of {_p} to "&9+$%{_ttl}%"
  133. format gui slot 7 of {_p} with emerald named "&9Emerald" with lore " ", "&9Worth: &b$2.50", "&bClick here to sell all emeralds." and " " to run:
  134. set {_amt} to amount of emerald in {_p}'s inventory
  135. set {_ttl} to {_amt} * 2.50
  136. add {_ttl} to {_p}'s balance
  137. remove all emerald from {_p}'s inventory
  138. set action bar of {_p} to "&9+$%{_ttl}%"
  139. format gui slot 8 of {_p} with obsidian named "&9Obsidian" with lore " ", "&9Worth: &b$2.75", "&bClick here to sell all obsidian." and " " to run:
  140. set {_amt} to amount of obsidian in {_p}'s inventory
  141. set {_ttl} to {_amt} * 2.75
  142. add {_ttl} to {_p}'s balance
  143. remove all obsidian from {_p}'s inventory
  144. set action bar of {_p} to "&9+$%{_ttl}%"
  145.  
  146. command /resign:
  147. trigger:
  148. set {_u} to uuid of player
  149. if {employed::%{_u}%} is set:
  150. if {job::%{_u}%} is set:
  151. delete {employed::%{_u}%}
  152. delete {job::%{_u}%}
  153. send "&9&l• &9Employed &8&l» &7You resigned from your job!"
  154. else:
  155. send "&9&l• &9Employed &8&l» &7You are not employed!"
  156. else:
  157. send "&9&l• &9Employed &8&l» &7You are not employed!"
  158.  
  159. on right click on player:
  160. if name of clicked player is "&7Miner":
  161. if {job::%player's uuid%} is "Miner":
  162. minerShop(player)
  163. else if {job::%player's uuid%} is not "Miner":
  164. send "&9&l• &9Employed &8&l» &7You are not a Miner!" to player
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement