Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.19 KB | None | 0 0
  1.  
  2.  
  3.  
  4. # ----------------------------- Tuske's Main ShopGui -----------------------------------
  5.  
  6. on skript load:
  7. ShopGui()
  8.  
  9.  
  10. function ShopGui():
  11. set {_shape::1} to "1xxxxxxx1"
  12. set {_shape::2} to "2xAxBxCx2"
  13. set {_shape::3} to "1xxExFxx1"
  14. set {_shape::4} to "2xGxHxIx2"
  15. set {_shape::5} to "1xxxxxxx1"
  16. create a gui with id "&8Skyblock Shop" with virtual chest with 5 rows named "&8Skyblock Shop" and shape {_shape::*}:
  17. make gui "1" with white stained glass pane named "&7"
  18. make gui "2" with yellow stained glass pane named "&7"
  19. make gui "A" with grass named "&a&lBuilding Blocks" with lore "&7Click to open up this category":
  20. open gui "&8Building Blocks" to player
  21. make gui "I" with white wool block named "&f&lColored Blocks" with lore "&7Click to open up this category":
  22. open gui "&8Colored Blocks" to player
  23. make gui "G" with sunflower named "&e&lDecoration" with lore "&7Click to open up this category":
  24. open gui "&8Decoration" to player
  25. make gui "B" with wheat item named "&6&lFarming and Food" with lore "&7Click to open up this category":
  26. open gui "&8Farming and Food" to player
  27. make gui "H" with creeper head named "&2&lMiscellaneous" with lore "&7Click to open up this category":
  28. open gui "&8Miscellaneous" to player
  29. make gui "F" with redstone named "&c&lRedstone and Redstone Items" with lore "&7Click to open up this category":
  30. open gui "&8Redstone and Redstone Items" to player
  31. make gui "E" with iron ingot named "&7&lOres and Valuables" with lore "&7Click to open up this category":
  32. open gui "&8Ores and Valuables" to player
  33. make gui "C" with bone named "&d&lMob Drops" with lore "&7Click to open up this category":
  34. open gui "&8Mob Drops" to player
  35.  
  36.  
  37.  
  38.  
  39. create a gui with id "&8Redstone and Redstone Items" with virtual chest with 2 rows named "&8Redstone and Redstone Items":
  40. run when close the gui:
  41. wait 1 tick
  42. open gui "&8Skyblock Shop" to gui-player
  43. slot(last gui, redstone, 1500, 375)
  44. slot(last gui, redstone block, 13500, 3375)
  45. slot(last gui, redstone repeater, 5440, 1360)
  46. slot(last gui, redstone comparator item, 70400, 17600)
  47. slot(last gui, redstone lamp, 70400, 17600)
  48. slot(last gui, hopper, 51500, 12800)
  49. slot(last gui, dropper, 6400, 1600)
  50. slot(last gui, dispenser, 9600, 2400)
  51. slot(last gui, normal piston, 25600, 0)
  52. slot(last gui, sticky piston, 64000, 0)
  53. slot(last gui, nether quartz, 32000, 8000)
  54.  
  55. create a gui with id "&8Ores and Valuables" with virtual chest with 2 rows named "&8Ores and Valuables":
  56. run when close the gui:
  57. wait 1 tick
  58. open gui "&8Skyblock Shop" to gui-player
  59. slot(last gui, coal, 1000, 250)
  60. slot(last gui, coal block, 9000, 2250)
  61. slot(last gui, iron ingot, 9600, 1920)
  62. slot(last gui, iron block, 86400, 21600)
  63. slot(last gui, gold nugget, 1600, 400)
  64. slot(last gui, gold ingot, 14400, 3600)
  65. slot(last gui, gold block, 129600, 32400)
  66. slot(last gui, diamond, 96000, 19200)
  67. slot(last gui, diamond block, 864000, 216000)
  68. slot(last gui, emerald, 128000, 25600)
  69. slot(last gui, emerald block, 1152000, 288000)
  70.  
  71. create a gui with id "&8Farming and Food" with virtual chest with 4 rows named "&8Farming and Food":
  72. run when close the gui:
  73. wait 1 tick
  74. open gui "&8Skyblock Shop" to gui-player
  75. slot(last gui, oak sapling, 19200, 4800)
  76. slot(last gui, spruce sapling, 19200, 4800)
  77. slot(last gui, birch sapling, 19200, 4800)
  78. slot(last gui, jungle sapling, 19200, 4800)
  79. slot(last gui, acacia sapling, 19200, 4800)
  80. slot(last gui, dark oak sapling, 19200, 4800)
  81. slot(last gui, seeds, 1920, 320)
  82. slot(last gui, wheat, 1000, 500)
  83. slot(last gui, hay block, 14400, 3600)
  84. slot(last gui, potato, 1200, 300)
  85. slot(last gui, poisonous potato, 6400, 1600)
  86. slot(last gui, nether wart item, 2200, 700)
  87. slot(last gui, soul sand, 640000, 3200)
  88. slot(last gui, pumpkin seeds, 19200, 2400)
  89. slot(last gui, pumpkin, 76800, 9600)
  90. slot(last gui, melon seeds, 10, 2.5)
  91. slot(last gui, melon slice, 640, 160)
  92. slot(last gui, melon block, 5760, 1440)
  93. slot(last gui, carrot item, 1200, 300)
  94. slot(last gui, sugar canes, 1200, 300)
  95. slot(last gui, cactus, 25000, 5000)
  96. slot(last gui, brown dye, 3200, 800)
  97. slot(last gui, brown mushroom, 1200, 300)
  98. slot(last gui, red mushroom, 1200, 300)
  99. slot(last gui, apple, 3200, 800)
  100. slot(last gui, bread, 3200, 800)
  101. slot(last gui, baked potato, 1200, 300)
  102. slot(last gui, cooked porkchop, 1200, 300)
  103. slot(last gui, steak, 1200, 300)
  104. slot(last gui, cooked cod fillet, 28800, 7200)
  105. slot(last gui, cooked chicken, 1200, 300)
  106. slot(last gui, cooked rabbit, 1500, 375)
  107. slot(last gui, cooked mutton, 1500, 375)
  108.  
  109. create a gui with id "&8Building Blocks" with virtual chest with 6 rows named "&8Building Blocks":
  110. run when close the gui:
  111. wait 1 tick
  112. open gui "&8Skyblock Shop" to gui-player
  113. slot(last gui, stone, 0, 0)
  114. slot(last gui, cobblestone, 0, 0)
  115. slot(last gui, mossy cobble block, 0, 0)
  116. slot(last gui, stone bricks, 0, 0)
  117. slot(last gui, mossy stone brick, 0, 0)
  118. slot(last gui, cracked stone brick, 0, 0)
  119. slot(last gui, red brick block, 0, 0)
  120. slot(last gui, granite, 0, 0)
  121. slot(last gui, diorite, 0, 0)
  122. slot(last gui, andesite, 0, 0)
  123. slot(last gui, gravel, 0, 0)
  124. slot(last gui, sand, 0, 0)
  125. slot(last gui, sandstone, 0, 0)
  126. slot(last gui, chiseled sandstone, 0, 0)
  127. slot(last gui, smooth sandstone, 0, 0)
  128. slot(last gui, lapis lazuli block, 0, 0)
  129. slot(last gui, obsidian, 0, 0)
  130. slot(last gui, red sand, 0, 0)
  131. slot(last gui, snow block, 0, 0)
  132. slot(last gui, packed ice, 0, 0)
  133. slot(last gui, quartz block, 0, 0)
  134. slot(last gui, chiseled quartz, 0, 0)
  135. slot(last gui, quartz pillar, 0, 0)
  136. slot(last gui, red brick block, 0, 0)
  137. slot(last gui, netherrack, 0, 0)
  138. slot(last gui, nether brick block, 0, 0)
  139. slot(last gui, oak wood planks, 0, 0)
  140. slot(last gui, spruce wood planks, 0, 0)
  141. slot(last gui, birch wood planks, 0, 0)
  142. slot(last gui, jungle wood planks, 0, 0)
  143. slot(last gui, acacia wood planks, 0, 0)
  144. slot(last gui, dark oak wood planks, 0, 0)
  145. slot(last gui, oak log, 0, 0)
  146. slot(last gui, spruce log, 0, 0)
  147. slot(last gui, birch log, 0, 0)
  148. slot(last gui, jungle log, 0, 0)
  149. slot(last gui, acacia log, 0, 0)
  150. slot(last gui, dark oak log, 0, 0)
  151. slot(last gui, end stone, 0, 0)
  152. slot(last gui, clay block, 0, 0)
  153. slot(last gui, plain glass block, 0, 0)
  154. slot(last gui, ice block, 0, 0)
  155. slot(last gui, dirt, 0, 0)
  156. slot(last gui, grass, 0, 0)
  157. slot(last gui, podzol, 0, 0)
  158. slot(last gui, mycelium, 0, 0)
  159. slot(last gui, coarse dirt, 0, 0)
  160. slot(last gui, prismarine, 0, 0)
  161. slot(last gui, prismarine bricks, 0, 0)
  162. slot(last gui, dark prismarine, 0, 0)
  163. slot(last gui, sea lantern, 0, 0)
  164. slot(last gui, red sandstone, 0, 0)
  165. slot(last gui, red chiseled sandstone, 0, 0)
  166. slot(last gui, smooth red sandstone, 0, 0)
  167.  
  168.  
  169.  
  170. create a gui with id "&8Colored Blocks" with virtual chest with 6 rows named "&8Colored Blocks":
  171. run when close the gui:
  172. wait 1 tick
  173. open gui "&8Skyblock Shop" to gui-player
  174. slot(last gui, white wool block, 960, 240)
  175. slot(last gui, orange wool block, 960, 240)
  176. slot(last gui, magenta wool block, 960, 240)
  177. slot(last gui, light blue wool block, 960, 240)
  178. slot(last gui, yellow wool block, 960, 240)
  179. slot(last gui, green wool block, 960, 240)
  180. slot(last gui, pink wool block, 960, 240)
  181. slot(last gui, gray wool block, 960, 240)
  182. slot(last gui, light gray wool block, 960, 240)
  183. slot(last gui, cyan wool block, 960, 240)
  184. slot(last gui, purple wool block, 960, 240)
  185. slot(last gui, blue wool block, 960, 240)
  186. slot(last gui, brown wool block, 960, 240)
  187. slot(last gui, green wool block, 960, 240)
  188. slot(last gui, red wool block, 960, 240)
  189. slot(last gui, black wool block, 960, 240)
  190. slot(last gui, white glass block, 960, 240)
  191. slot(last gui, orange glass block, 960, 240)
  192. slot(last gui, magenta glass block, 960, 240)
  193. slot(last gui, light blue glass block, 960, 240)
  194. slot(last gui, yellow glass block, 960, 240)
  195. slot(last gui, green glass block, 960, 240)
  196. slot(last gui, pink glass block, 960, 240)
  197. slot(last gui, gray glass block, 960, 240)
  198. slot(last gui, light gray glass block, 960, 240)
  199. slot(last gui, cyan glass block, 960, 240)
  200. slot(last gui, purple glass block, 960, 240)
  201. slot(last gui, blue glass block, 960, 240)
  202. slot(last gui, brown glass block, 960, 240)
  203. slot(last gui, green glass block, 960, 240)
  204. slot(last gui, red glass block, 960, 240)
  205. slot(last gui, black glass block, 960, 240)
  206. slot(last gui, white terracotta, 960, 240)
  207. slot(last gui, orange terracotta, 960, 240)
  208. slot(last gui, magenta terracotta, 960, 240)
  209. slot(last gui, light blue terracotta, 960, 240)
  210. slot(last gui, yellow terracotta, 960, 240)
  211. slot(last gui, green terracotta, 960, 240)
  212. slot(last gui, pink terracotta, 960, 240)
  213. slot(last gui, gray terracotta, 960, 240)
  214. slot(last gui, light gray terracotta, 960, 240)
  215. slot(last gui, cyan terracotta, 960, 240)
  216. slot(last gui, purple terracotta, 960, 240)
  217. slot(last gui, blue terracotta, 960, 240)
  218. slot(last gui, brown terracotta, 960, 240)
  219. slot(last gui, green terracotta, 960, 240)
  220. slot(last gui, red terracotta, 960, 240)
  221. slot(last gui, black terracotta, 960, 240)
  222.  
  223. create a gui with id "&8Decoration" with virtual chest with 5 rows named "&8Decorations":
  224. run when close the gui:
  225. wait 1 tick
  226. open gui "&8Skyblock Shop" to gui-player
  227. slot(last gui, glowstone, 0, 0)
  228. slot(last gui, slime block, 0, 0)
  229. slot(last gui, bookshelf, 0, 0)
  230. slot(last gui, note block, 0, 0)
  231. slot(last gui, fern, 0, 0)
  232. slot(last gui, dead bush, 0, 0)
  233. slot(last gui, iron bar, 0, 0)
  234. slot(last gui, poppy, 0, 0)
  235. slot(last gui, sunflower, 0, 0)
  236. slot(last gui, lilac, 0, 0)
  237. slot(last gui, rose bush, 0, 0)
  238. slot(last gui, peony, 0, 0)
  239. slot(last gui, white standing banner, 0, 0)
  240. slot(last gui, orange standing banner, 0, 0)
  241. slot(last gui, magenta standing banner, 0, 0)
  242. slot(last gui, light blue standing banner, 0, 0)
  243. slot(last gui, yellow standing banner, 0, 0)
  244. slot(last gui, green standing banner, 0, 0)
  245. slot(last gui, pink standing banner, 0, 0)
  246. slot(last gui, gray standing banner, 0, 0)
  247. slot(last gui, light gray standing banner, 0, 0)
  248. slot(last gui, cyan standing banner, 0, 0)
  249. slot(last gui, purple standing banner, 0, 0)
  250. slot(last gui, blue standing banner, 0, 0)
  251. slot(last gui, brown standing banner, 0, 0)
  252. slot(last gui, green standing banner, 0, 0)
  253. slot(last gui, red standing banner, 0, 0)
  254. slot(last gui, black standing banner, 0, 0)
  255. slot(last gui, blue orchid, 0, 0)
  256. slot(last gui, allium, 0, 0)
  257. slot(last gui, azure bluet, 0, 0)
  258. slot(last gui, red tulip, 0, 0)
  259. slot(last gui, orange tulip, 0, 0)
  260. slot(last gui, white tulip, 0, 0)
  261. slot(last gui, pink tulip, 0, 0)
  262. slot(last gui, oxeye daisy, 0, 0)
  263. slot(last gui, flower pot, 0, 0)
  264.  
  265.  
  266. create a gui with id "&8Mob Drops" with virtual chest with 3 rows named "&8Mob Drops":
  267. run when close the gui:
  268. wait 1 tick
  269. open gui "&8Skyblock Shop" to gui-player
  270. slot(last gui, arrow, 750, 187.5)
  271. slot(last gui, bone, 600, 150)
  272. slot(last gui, blaze rod, 1200, 300)
  273. slot(last gui, slimeball, 600, 150)
  274. slot(last gui, ink sac, 320, 80)
  275. slot(last gui, string, 500, 125)
  276. slot(last gui, spider eye, 2400, 600)
  277. slot(last gui, gunpowder, 5600, 1400)
  278. slot(last gui, ender pearl, 6000, 1500)
  279. slot(last gui, rotten flesh, 200, 50)
  280. slot(last gui, beef, 900, 225)
  281. slot(last gui, leather, 700, 175)
  282. slot(last gui, chicken, 900, 225)
  283. slot(last gui, feather, 400, 100)
  284. slot(last gui, egg, 250, 62.5)
  285. slot(last gui, porkchop, 1000, 250)
  286. slot(last gui, mutton, 1000, 250)
  287. slot(last gui, rabbit, 1000, 250)
  288. slot(last gui, rabbit hide, 1200, 300)
  289. slot(last gui, rabbit foot, 51200, 12800)
  290.  
  291. create a gui with id "&8Miscellaneous" with virtual chest with 1 rows named "&8Miscellaneous":
  292. run when close the gui:
  293. wait 1 tick
  294. open gui "&8Skyblock Shop" to gui-player
  295. slot(last gui, enchantment table, 192000, 48000)
  296. slot(last gui, chest, 9600, 2400)
  297. slot(last gui, trapped chest, 9600, 2400)
  298. slot(last gui, flint, 0, 0)
  299. slot(last gui, water bucket, 7200, 1800)
  300. slot(last gui, lava bucket, 24000, 6000)
  301. slot(last gui, name tag, 16000000, 400000)
  302. slot(last gui, brewing stand, 1280, 320)
  303. slot(last gui, ghast tear, 28800, 1280)
  304.  
  305.  
  306. # ----------------------------- Functions -----------------------------------
  307.  
  308.  
  309. function slot(gui: guiinventory, item: item, buy: number, sell: number):
  310. set {shop::items::%{_item}%} to {_item}
  311. set {shop::buy::%{_item}%} to {_buy}
  312. set {shop::sell::%{_item}%} to {_sell}
  313. set {_stacksize} to max stacksize of {_item}
  314. set {_buylore} to ({_buy}/{_stacksize})
  315. set {_selllore} to ({_sell}/{_stacksize})
  316. edit {_gui}:
  317. make next gui with {_item} named "&e%{_item}.getI18NDisplayName()%" with lore "", " &2&l* &aBuy &f$%spaced {_buylore}%", " &4&l* &cSell &f$%spaced {_selllore}%", "", "&7** Tip: &fLeft-Click&7 to buy &7&none&7! **" and "&7** Tip: &fShift-Click&7 to buy a &7&nstack&7! **":
  318. item(type of clicked item, "%clicked type%", gui-player)
  319.  
  320.  
  321.  
  322.  
  323. function item(item: item, ct: string, p: player):
  324. #buy 1 stack
  325. set {_stacksize} to max stacksize of {_item}
  326. if {_ct} is "left mouse button with shift":
  327. broadcast "%{_stacksize}%"
  328. if {_item} is not air:
  329. if balance of {_p} >= {shop::buy::%{_item}%}:
  330. if {_p} has enough space for {_stacksize} of {_item}:
  331. give {_p} {_stacksize} of type of {_item}
  332. remove {shop::buy::%{_item}%} from balance of {_p}
  333. set {_buy} to spaced {shop::buy::%{_item}%}
  334. send "&e&lSHOP &8⎜ &fYou bought &e%{_stacksize}% x %{_item}.getI18NDisplayName()% &ffor &6$%{_buy}%&f!" to {_p}
  335. else:
  336. send "&e&lSHOP &8⎜ &fYour inventory is full!" to {_p}
  337. else:
  338. send "&e&lSHOP &8⎜ &fYou don't have enough money!" to {_p}
  339.  
  340. #buy 1 item
  341. else:
  342. if {_item} is not air:
  343. if balance of {_p} >= {shop::buy::%{_item}%}/{_stacksize}:
  344. if {_p} has enough space for 1 of {_item}:
  345. give {_p} 1 of type of {_item}
  346. remove {shop::buy::%{_item}%}/{_stacksize} from balance of {_p}
  347. set {_buy} to ({shop::buy::%{_item}%}/64)
  348. set {_buy} to spaced {_buy}
  349. send "&e&lSHOP &8⎜ &fYou bought &e1 x %{_item}.getI18NDisplayName()% &ffor &6$%{_buy}%&f!" to {_p}
  350. else:
  351. send "&e&lSHOP &8⎜ &fYour inventory is full!" to {_p}
  352. else:
  353. send "&e&lSHOP &8⎜ &fYou don't have enough money!" to {_p}
  354. else:
  355. stop
  356.  
  357.  
  358.  
  359. # ----------------------------- Commands -----------------------------------
  360.  
  361. command /shop:
  362. trigger:
  363. open gui "&8Skyblock Shop" to player
  364.  
  365.  
  366. command /sell [<text>]:
  367. trigger:
  368. if arg 1 is "all":
  369. set {_amount} and {_itemAmount} to 0
  370. loop {shop::items::*}:
  371. set {_item} to "%loop-value%" parsed as item
  372. set {_inventory::*} to type of items of inventory of {_chest}
  373. set {_stacksize} to max stacksize of {_item}
  374. set {_price} to {shop::sell::%{_item}%}/{_stacksize}
  375.  
  376. loop all items in inventory of player:
  377. loop-item is {_item}
  378. add {_price} * item amount of loop-item to player's balance
  379. add {_price} * item amount of loop-item to {_amount}
  380. add item amount of loop-item to {_itemAmount}
  381. remove loop-item from inventory of player
  382. if {_itemAmount} is not 0:
  383. send "&e&lSHOP &8⎜ &fSold all &e%{_itemAmount}% &fitems for a total of &6$%spaced {_amount}%&f!"
  384. else:
  385. send "&e&lSHOP &8⎜ &fThere's currently nothing you can sell!"
  386.  
  387.  
  388. else:
  389. set {_item} to type of player's held item
  390. set {_sell} to {shop::sell::%{_item}%}/{_stacksize}
  391. if {_item} is air:
  392. send "&e&lSHOP &8⎜ &fYou can't sell your &e&oactuel &fhand!"
  393. stop
  394. if {_item} is a monster spawner:
  395. send "&e&lSHOP &8⎜ &fThis item isn't sellable!"
  396. stop
  397. else if {_sell} is 0:
  398. send "&e&lSHOP &8⎜ &fThis item isn't sellable!"
  399. stop
  400. else if {_sell} is not set:
  401. send "&e&lSHOP &8⎜ &fThis item isn't sellable!"
  402. else:
  403. set {_amount} to "%player's held item%"
  404. set {_amount::*} to {_amount} split at " "
  405. if "%{_amount::1}%" is "%{_item}%":
  406. add {_sell} to balance of player
  407. set {_price} to spaced {_sell}
  408. send "&e&lSHOP &8⎜ &fYou sold &e1x %{_item}.getI18NDisplayName()% &ffor &6$%{_price}%&f!"
  409. remove 1 of tool from tool
  410. else:
  411. set {_amount::1} to "%{_amount::1}%" parsed as a number
  412. set {_price} to ({_sell} * {_amount::1})
  413. add {_price} to balance of player
  414. set {_price} to spaced {_price}
  415. send "&e&lSHOP &8⎜ &fYou sold &e%{_amount::1}%x %{_item}.getI18NDisplayName()% &ffor &6$%{_price}%&f!"
  416. remove {_amount::1} of tool from tool
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement