Guest User

tuske shop gui skript

a guest
Jul 31st, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.15 KB | None | 0 0
  1. options:
  2. waterbucket: 5
  3. coal: 3
  4. wheat: 1
  5. bread: 3
  6. oaksaplings: 1
  7. iron: 10
  8. phantom: 10
  9. emerald: 20
  10. lavabucket: 8
  11. carrot: 2
  12. potato: 2
  13. spawnegg: 75
  14. grassblock: 15
  15. charcoal: 1
  16. diamond: 50
  17. sand: 5
  18. gravel: 10
  19. sugarcane: 2
  20. cactus: 3
  21. redstone: 15
  22.  
  23. command /shop:
  24. trigger:
  25. open gui "shop" to player
  26.  
  27. on load:
  28. create a gui with id "shop" with virtual chest with 2 rows named "&0&lshop":
  29. make gui 0 with barrier named "&cexit the shop":
  30. close player's inventory
  31. make gui 3 with bonemeal named "&anon-buyable items":
  32. delete gui "shop.%player%"
  33. open gui "shopnonbuyitems" to player
  34. make gui 4 with diamond named "&aores":
  35. delete gui "shop.%player%"
  36. open gui "shopores" to player
  37. make gui 5 with skeleton spawn egg named "&aspawn eggs":
  38. delete gui "shop.%player%"
  39. open gui "shopspawneggs" to player
  40.  
  41. make gui 9 with water bucket named "&6water &f(${@waterbucket})" with lore "right click to sell" and "left click to buy":
  42. if clicked type is left mouse button:
  43. if player's balance is more than or equal to {@waterbucket}:
  44. send action bar "&6you got a water bucket for {@waterbucket} money" to player
  45. give player 1 water bucket
  46. remove {@waterbucket} from player's balance
  47. else:
  48. send action bar "&6you dont have enough money to get a water bucket" to player
  49. if clicked type is right mouse button:
  50. if player has water bucket:
  51. remove 1 water bucket from player's inventory
  52. add {@waterbucket} to player's balance
  53. send action bar "&6you got {@waterbucket} money for selling a water bucket" to player
  54. else:
  55. send action bar "&6you have no water buckets" to player
  56.  
  57. make gui 10 with lava bucket named "&6lava &f(${@lavabucket})" with lore "right click to sell" and "left click to buy":
  58. if clicked type is left mouse button:
  59. if player's balance is more than or equal to {@lavabucket}:
  60. send action bar "&6you got a lava bucket for {@lavabucket} money" to player
  61. give player 1 lava bucket
  62. remove {@lavabucket} from player's balance
  63. else:
  64. send action bar "&6you dont have enough money to get a lava bucket" to player
  65. if clicked type is right mouse button:
  66. if player has lava bucket:
  67. remove 1 lava bucket from player's inventory
  68. add {@lavabucket} to player's balance
  69. send action bar "&6you got {@lavabucket} money for selling a lava bucket" to player
  70. else:
  71. send action bar "&6you have no lava buckets" to player
  72.  
  73. make gui 11 with carrot named "&6carrot &f(${@carrot})" with lore "right click to sell" and "left click to buy":
  74. if clicked type is left mouse button:
  75. if player's balance is more than or equal to {@carrot}:
  76. send action bar "&6you got a carrot for {@carrot} money" to player
  77. give player 1 carrot
  78. remove {@carrot} from player's balance
  79. else:
  80. send action bar "&6you dont have enough money to get a carrot" to player
  81. if clicked type is right mouse button:
  82. if player has carrot:
  83. remove 1 carrot from player's inventory
  84. add {@carrot} to player's balance
  85. send action bar "&6you got {@carrot} money for selling a carrot" to player
  86. else:
  87. send action bar "&6you have no carrots" to player
  88.  
  89. make gui 12 with potato named "&6potato &f(${@potato})" with lore "right click to sell" and "left click to buy":
  90. if clicked type is left mouse button:
  91. if player's balance is more than or equal to {@potato}:
  92. send action bar "&6you got a potato for {@potato} money" to player
  93. give player 1 potato
  94. remove {@potato} from player's balance
  95. else:
  96. send action bar "&6you dont have enough money to get a potato" to player
  97. if clicked type is right mouse button:
  98. if player has potato:
  99. remove 1 potato from player's inventory
  100. add {@potato} to player's balance
  101. send action bar "&6you got {@potato} money for selling a potato" to player
  102. else:
  103. send action bar "&6you have no potatos" to player
  104.  
  105. make gui 13 with grass block named "&6grass block &f(${@grassblock})" with lore "right click to sell" and "left click to buy":
  106. if clicked type is left mouse button:
  107. if player's balance is more than or equal to {@grassblock}:
  108. send action bar "&6you got a grass block for {@grassblock} money" to player
  109. give player 1 grass block
  110. remove {@grassblock} from player's balance
  111. else:
  112. send action bar "&6you dont have enough money to get a grass block" to player
  113. if clicked type is right mouse button:
  114. if player has grass block:
  115. remove 1 grass block from player's inventory
  116. add {@grassblock} to player's balance
  117. send action bar "&6you got {@grassblock} money for selling a grass block" to player
  118. else:
  119. send action bar "&6you have no grass blocks" to player
  120.  
  121. make gui 14 with gravel named "&6gravel &f(${@gravel})" with lore "right click to sell" and "left click to buy":
  122. if clicked type is left mouse button:
  123. if player's balance is more than or equal to {@gravel}:
  124. send action bar "&6you got gravel for {@gravel} money" to player
  125. give player 1 gravel
  126. remove {@gravel} from player's balance
  127. else:
  128. send action bar "&6you dont have enough money to get gravel" to player
  129. if clicked type is right mouse button:
  130. if player has gravel:
  131. remove 1 gravel from player's inventory
  132. add {@gravel} to player's balance
  133. send action bar "&6you got {@gravel} money for selling gravel" to player
  134. else:
  135. send action bar "&6you have no gravel" to player
  136.  
  137. make gui 15 with sand named "&6sand &f(${@sand})" with lore "right click to sell" and "left click to buy":
  138. if clicked type is left mouse button:
  139. if player's balance is more than or equal to {@sand}:
  140. send action bar "&6you got sand for {@sand} money" to player
  141. give player 1 sand
  142. remove {@sand} from player's balance
  143. else:
  144. send action bar "&6you dont have enough money to get sand" to player
  145. if clicked type is right mouse button:
  146. if player has sand:
  147. remove 1 sand from player's inventory
  148. add {@sand} to player's balance
  149. send action bar "&6you got {@sand} money for selling sand" to player
  150. else:
  151. send action bar "&6you have no sand" to player
  152.  
  153. make gui 16 with cactus named "&6cactus &f(${@cactus})" with lore "right click to sell" and "left click to buy":
  154. if clicked type is left mouse button:
  155. if player's balance is more than or equal to {@cactus}:
  156. send action bar "&6you got cactus for {@cactus} money" to player
  157. give player 1 cactus
  158. remove {@cactus} from player's balance
  159. else:
  160. send action bar "&6you dont have enough money to get cacti" to player
  161. if clicked type is right mouse button:
  162. if player has cactus:
  163. remove 1 cactus from player's inventory
  164. add {@cactus} to player's balance
  165. send action bar "&6you got {@cactus} money for selling a cacti" to player
  166. else:
  167. send action bar "&6you have no cacti" to player
  168.  
  169. make gui 17 with sugar cane named "&6sugar cane &f(${@sugarcane})" with lore "right click to sell" and "left click to buy":
  170. if clicked type is left mouse button:
  171. if player's balance is more than or equal to {@sugarcane}:
  172. send action bar "&6you got sugar cane for {@sugarcane} money" to player
  173. give player 1 sugar cane
  174. remove {@sugarcane} from player's balance
  175. else:
  176. send action bar "&6you dont have enough money to get sugar cane" to player
  177. if clicked type is right mouse button:
  178. if player has sugar cane:
  179. remove 1 sugar cane from player's inventory
  180. add {@sugarcane} to player's balance
  181. send action bar "&6you got {@sugarcane} money for selling sugar cane" to player
  182. else:
  183. send action bar "&6you have no sugar cane" to player
  184.  
  185. #
  186. #
  187. #NON-BUYABLE ITEMS GUI
  188. #
  189. #
  190. on load:
  191. create a gui with id "shopnonbuyitems" with virtual chest with 1 rows named "&0&lshop: non-buyable items":
  192. make gui 0 with barrier named "&cgo back":
  193. close player's inventory
  194. open gui "shop" to player
  195. delete gui "shopnonbuyitems.%player%"
  196. make gui 2 with wheat named "&6wheat &f(${@wheat})" with lore "left or right click to sell":
  197. if player has wheat:
  198. remove 1 wheat from player's inventory
  199. add {@wheat} to player's balance
  200. send action bar "&6you got {@wheat} money for selling wheat" to player
  201. else:
  202. send action bar "&6you have no wheat" to player
  203.  
  204. make gui 3 with paper named "&6phantom membrane &f(${@phantom})" with lore "left or right click to sell":
  205. if player has phantom membrane:
  206. remove 1 phantom membrane from player's inventory
  207. add {@phantom} to player's balance
  208. send action bar "&6you got {@phantom} money for selling phantom membrane" to player
  209. else:
  210. send action bar "&6you have no phantom membrane" to player
  211.  
  212. make gui 4 with charcoal named "&6charcoal &f(${@charcoal})" with lore "left or right click to sell":
  213. if player has charcoal:
  214. remove 1 charcoal from player's inventory
  215. add {@charcoal} to player's balance
  216. send action bar "&6you got {@charcoal} money for selling charcoal" to player
  217. else:
  218. send action bar "&6you have no charcoal" to player
  219.  
  220.  
  221.  
  222. #
  223. #
  224. #ORES GUI
  225. #
  226. #
  227. on load:
  228. create a gui with id "shopores" with virtual chest with 1 rows named "&0&lshop: ores":
  229. make gui 0 with barrier named "&cgo back":
  230. close player's inventory
  231. open gui "shop" to player
  232. delete gui "shopores.%player%"
  233. make gui 2 with coal named "&6coal &f(${@coal})" with lore "right click to sell" and "left click to buy":
  234. if clicked type is left mouse button:
  235. if player's balance is more than or equal to {@coal}:
  236. send action bar "&6you got coal for {@coal} money" to player
  237. give player 1 coal
  238. remove {@coal} from player's balance
  239. else:
  240. send action bar "&6you dont have enough money to get coal" to player
  241. if clicked type is right mouse button:
  242. if player has coal:
  243. remove 1 coal from player's inventory
  244. add {@coal} to player's balance
  245. send action bar "&6you got {@coal} money for selling coal" to player
  246. else:
  247. send action bar "&6you have no coal" to player
  248. make gui 3 with iron ore named "&6iron &f(${@iron})" with lore "right click to sell" and "left click to buy":
  249. if clicked type is left mouse button:
  250. if player's balance is more than or equal to {@iron}:
  251. send action bar "&6you got iron for {@iron} money" to player
  252. give player 1 iron ore
  253. remove {@iron} from player's balance
  254. else:
  255. send action bar "&6you dont have enough money to get iron" to player
  256. if clicked type is right mouse button:
  257. if player has iron ore:
  258. remove 1 iron ore from player's inventory
  259. add {@iron} to player's balance
  260. send action bar "&6you got {@iron} money for selling iron" to player
  261. else:
  262. send action bar "&6you have no iron" to player
  263.  
  264. make gui 4 with emerald named "&6emerald &f(${@emerald})" with lore "right click to sell" and "left click to buy":
  265. if clicked type is left mouse button:
  266. if player's balance is more than or equal to {@emerald}:
  267. send action bar "&6you got emerald for {@emerald} money" to player
  268. give player 1 iron ore
  269. remove {@emerald} from player's balance
  270. else:
  271. send action bar "&6you dont have enough money to get emerald" to player
  272. if clicked type is right mouse button:
  273. if player has emerald:
  274. remove 1 emerald from player's inventory
  275. add {@emerald} to player's balance
  276. send action bar "&6you got {@emerald} money for selling emerald" to player
  277. else:
  278. send action bar "&6you have no emerald" to player
  279.  
  280. make gui 5 with diamond named "&6diamond &f(${@diamond})" with lore "right click to sell" and "left click to buy":
  281. if clicked type is left mouse button:
  282. if player's balance is more than or equal to {@diamond}:
  283. send action bar "&6you got diamond for {@diamond} money" to player
  284. give player 1 diamond
  285. remove {@diamond} from player's balance
  286. else:
  287. send action bar "&6you dont have enough money to get diamond" to player
  288. if clicked type is right mouse button:
  289. if player has diamond:
  290. remove 1 diamond from player's inventory
  291. add {@diamond} to player's balance
  292. send action bar "&6you got {@diamond} money for selling diamond" to player
  293. else:
  294. send action bar "&6you have no diamonds" to player
  295.  
  296. make gui 6 with redstone named "&6redstone &f(${@redstone})" with lore "right click to sell" and "left click to buy":
  297. if clicked type is left mouse button:
  298. if player's balance is more than or equal to {@redstone}:
  299. send action bar "&6you got redstone for {@redstone} money" to player
  300. give player 1 redstone
  301. remove {@redstone} from player's balance
  302. else:
  303. send action bar "&6you dont have enough money to get redstone" to player
  304. if clicked type is right mouse button:
  305. if player has redstone:
  306. remove 1 redstone from player's inventory
  307. add {@redstone} to player's balance
  308. send action bar "&6you got {@redstone} money for selling redstone" to player
  309. else:
  310. send action bar "&6you have no redstone" to player
  311.  
  312. #
  313. #
  314. #SPAWN eg GUI
  315. #
  316. #
  317. on load:
  318. create a gui with id "shopspawneggs" with virtual chest with 1 rows named "&0&lshop: spawn eggs":
  319. make gui 0 with barrier named "&cgo back":
  320. close player's inventory
  321. open gui "shop" to player
  322. delete gui "shopspawneggs.%player%"
  323. make gui 2 with cow spawn egg named "&6cow &f(${@spawnegg})" with lore "left or right click to buy":
  324. if player's balance is more than or equal to {@spawnegg}:
  325. send action bar "&6you got cow spawn egg for {@spawnegg} money" to player
  326. give player 1 cow spawn egg
  327. remove {@spawnegg} from player's balance
  328. else:
  329. send action bar "&6you dont have enough money to get cow spawn egg" to player
  330. make gui 3 with pig spawn egg named "&6pig &f(${@spawnegg})" with lore "left or right click to buy":
  331. if player's balance is more than or equal to {@spawnegg}:
  332. send action bar "&6you got pig spawn egg for {@spawnegg} money" to player
  333. give player 1 pig spawn egg
  334. remove {@spawnegg} from player's balance
  335. else:
  336. send action bar "&6you dont have enough money to get pig spawn egg" to player
  337. make gui 4 with chicken spawn egg named "&6chicken &f(${@spawnegg})" with lore "left or right click to buy":
  338. if player's balance is more than or equal to {@spawnegg}:
  339. send action bar "&6you got chicken spawn egg for {@spawnegg} money" to player
  340. give player 1 chicken spawn egg
  341. remove {@spawnegg} from player's balance
  342. else:
  343. send action bar "&6you dont have enough money to get chicken spawn egg" to player
  344. make gui 5 with sheep spawn egg named "&6sheep &f(${@spawnegg})" with lore "left or right click to buy":
  345. if player's balance is more than or equal to {@spawnegg}:
  346. send action bar "&6you got sheep spawn egg for {@spawnegg} money" to player
  347. give player 1 sheep spawn egg
  348. remove {@spawnegg} from player's balance
  349. else:
  350. send action bar "&6you dont have enough money to get sheep spawn egg" to player
  351.  
  352. on quit:
  353. delete gui "shopnonbuyitems.%player%"
  354. delete gui "shop.%player%"
  355. delete gui "shopores.%player%"
  356. delete gui "shopspawneggs.%player%"
Advertisement
Add Comment
Please, Sign In to add comment