Advertisement
AdamLam

Untitled

Feb 3rd, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.81 KB | None | 0 0
  1. function GuiFillForge(p: player,s: number,m: material):
  2. set {_times} to {_s}
  3. set {_slot} to 0
  4. loop {_times} times:
  5. create gui slot {_slot} of {_p} with {_m} named " " with lore " " to do nothing
  6. set {_slot} to {_slot}+1
  7. if {_m} is red stained glass pane:
  8. create gui slot {_s}-5 of {_p} with barrier block named "&4&lEXIT" with lore " " to run:
  9. play raw sound "note.hat" at player with pitch 1 volume 1
  10. close player's inventory
  11. on craft:
  12. if event-item is helmet or chestplate or leggings or boots or sword or pickaxe or axe or shovel:
  13. send "&6>> &cYou can craft Tools and Sets only in &7&lForge &cstructure."
  14. cancel event
  15. play raw sound "note.bassattack" at player with pitch 1 volume 1
  16. close player's inventory
  17. on rightclick on anvil:
  18. if block below event-block is glowstone:
  19. if event-block is very damaged anvil:
  20. cancel event
  21. if {%player%.ForgeInProgress} is true:
  22. if now is greater than {%player%.ForgeTime}:
  23. if player has enough space for 1 stone:
  24. play raw sound "note.hat" at player with pitch 1 volume 1
  25. give {%player%.ForgeItem} to player
  26. send "&6>> Here is your freshly forged %{%player%.ForgeItemName}%"
  27. delete {%player%.ForgeItem}
  28. delete {%player%.ForgeTime}
  29. delete {%player%.ForgeItemName}
  30. set {%player%.ForgeInProgress} to false
  31. set block at location of event-block to anvil
  32. else:
  33. send "&6>> &cYou don't have space to receive forged item."
  34. else:
  35. send "&6>> &cThe item will be forged at %{%player%.ForgeTime}% &6&l(GMT+1)"
  36. else:
  37. cancel event
  38. if {%player%.ForgeInProgress} is not set:
  39. set {%player%.ForgeInProgress} to false
  40. else:
  41. set {_loc} to location of event-block
  42. open virtual chest with size 4 named "Forge" to player
  43. wait 2 ticks
  44. GuiFillForge(player,36,red stained glass pane)
  45. wait 2 ticks
  46. GuiFillForge(player,27,black stained glass pane)
  47. wait 2 ticks
  48. create gui slot 13 of player with anvil named "&f&lRepair" with lore "&6>> &7&lRepair item you're currently holding" to run:
  49. if player's balance is greater than or equal to 100:
  50. play raw sound "note.hat" at player with pitch 1 volume 1
  51. remove 100 from player's balance
  52. repair tool of player
  53. send "&6>> &aYou repaired an item."
  54. else:
  55. play raw sound "note.bassattack" at player with pitch 1 volume 1
  56. send "&6>> &cYou have insufficient funds to repair"
  57.  
  58. create gui slot 11 of player with iron ingot named "&7&lForge Iron Items" with lore "&6>> &bClick to forge iron items" to run:
  59. play raw sound "note.hat" at player with pitch 1 volume 1
  60. close player's inventory
  61. wait 2 ticks
  62. open virtual chest with size 5 named "Forge Iron Items" to player
  63. wait 2 ticks
  64. GuiFillForge(player,45,red stained glass pane)
  65. GuiFillForge(player,36,black stained glass pane)
  66. wait 2 ticks
  67. create gui slot 1 of player with iron helmet named "&6&lIron &f&lHelmet" with lore "Price: $100 and 10 iron ingots" to run:
  68. if player's balance is greater than or equal to 100:
  69. if player has 10 iron ingots:
  70. remove 10 iron ingots from player's inventory
  71. remove 100 from player's balance
  72. play raw sound "note.hat" at player with pitch 1 volume 1
  73. close player's inventory
  74. set {%player%.ForgeInProgress} to true
  75. set {_cooldown} to 30 minutes
  76. set {%player%.ForgeTime} to now
  77. add {_cooldown} to {%player%.ForgeTime}
  78. set {%player%.ForgeItem} to iron helmet
  79. set block at {_loc} to very damaged anvil
  80. set {%player%.ForgeItemName} to "&6&lIron &f&lHelmet"
  81. else:
  82. play raw sound "note.bassattack" at player with pitch 1 volume 1
  83. send "&6>> &cYou don't have enough iron ingots to craft this"
  84. else:
  85. play raw sound "note.bassattack" at player with pitch 1 volume 1
  86. send "&6>> &cYou have insufficient funds to craft this"
  87. create gui slot 10 of player with iron chestplate named "&6&lIron &f&lChestplate" with lore "Price: $100 and 10 iron ingots" to run:
  88. if player's balance is greater than or equal to 100:
  89. if player has 10 iron ingots:
  90. remove 10 iron ingots from player's inventory
  91. remove 100 from player's balance
  92. play raw sound "note.hat" at player with pitch 1 volume 1
  93. close player's inventory
  94. set {%player%.ForgeInProgress} to true
  95. set {_cooldown} to 30 minutes
  96. set {%player%.ForgeTime} to now
  97. add {_cooldown} to {%player%.ForgeTime}
  98. set {%player%.ForgeItem} to iron chestplate
  99. set block at {_loc} to very damaged anvil
  100. set {%player%.ForgeItemName} to "&6&lIron &f&lChestplate"
  101. else:
  102. play raw sound "note.bassattack" at player with pitch 1 volume 1
  103. send "&6>> &cYou don't have enough iron ingots to craft this"
  104. else:
  105. play raw sound "note.bassattack" at player with pitch 1 volume 1
  106. send "&6>> &cYou have insufficient funds to craft this"
  107. create gui slot 19 of player with iron Leggings named "&6&lIron &f&lLeggings" with lore "Price: $100 and 10 iron ingots" to run:
  108. if player's balance is greater than or equal to 100:
  109. if player has 10 iron ingots:
  110. remove 10 iron ingots from player's inventory
  111. remove 100 from player's balance
  112. play raw sound "note.hat" at player with pitch 1 volume 1
  113. close player's inventory
  114. set {%player%.ForgeInProgress} to true
  115. set {_cooldown} to 30 minutes
  116. set {%player%.ForgeTime} to now
  117. add {_cooldown} to {%player%.ForgeTime}
  118. set {%player%.ForgeItem} to iron leggings
  119. set block at {_loc} to very damaged anvil
  120. set {%player%.ForgeItemName} to "&6&lIron &f&lLeggings"
  121. else:
  122. play raw sound "note.bassattack" at player with pitch 1 volume 1
  123. send "&6>> &cYou don't have enough iron ingots to craft this"
  124. else:
  125. play raw sound "note.bassattack" at player with pitch 1 volume 1
  126. send "&6>> &cYou have insufficient funds to craft this"
  127. create gui slot 28 of player with iron boots named "&6&lIron &f&lBoots" with lore "Price: $100 and 10 iron ingots" to run:
  128. if player's balance is greater than or equal to 100:
  129. if player has 10 iron ingots:
  130. remove 10 iron ingots from player's inventory
  131. remove 100 from player's balance
  132. play raw sound "note.hat" at player with pitch 1 volume 1
  133. close player's inventory
  134. set {%player%.ForgeInProgress} to true
  135. set {_cooldown} to 30 minutes
  136. set {%player%.ForgeTime} to now
  137. add {_cooldown} to {%player%.ForgeTime}
  138. set {%player%.ForgeItem} to iron boots
  139. set block at {_loc} to very damaged anvil
  140. set {%player%.ForgeItemName} to "&6&lIron &f&lBoots"
  141. else:
  142. play raw sound "note.bassattack" at player with pitch 1 volume 1
  143. send "&6>> &cYou don't have enough iron ingots to craft this"
  144. else:
  145. play raw sound "note.bassattack" at player with pitch 1 volume 1
  146. send "&6>> &cYou have insufficient funds to craft this"
  147. create gui slot 7 of player with iron sword named "&6&lIron &f&lSword" with lore "Price: $100 and 10 iron ingots" to run:
  148. if player's balance is greater than or equal to 100:
  149. if player has 10 iron ingots:
  150. remove 10 iron ingots from player's inventory
  151. remove 100 from player's balance
  152. play raw sound "note.hat" at player with pitch 1 volume 1
  153. close player's inventory
  154. set {%player%.ForgeInProgress} to true
  155. set {_cooldown} to 30 minutes
  156. set {%player%.ForgeTime} to now
  157. add {_cooldown} to {%player%.ForgeTime}
  158. set {%player%.ForgeItem} to iron sword
  159. set block at {_loc} to very damaged anvil
  160. set {%player%.ForgeItemName} to "&6&lIron &f&lSword"
  161. else:
  162. play raw sound "note.bassattack" at player with pitch 1 volume 1
  163. send "&6>> &cYou don't have enough iron ingots to craft this"
  164. else:
  165. play raw sound "note.bassattack" at player with pitch 1 volume 1
  166. send "&6>> &cYou have insufficient funds to craft this"
  167. create gui slot 16 of player with iron pickaxe named "&6&lIron &f&lPickaxe" with lore "Price: $100 and 10 iron ingots" to run:
  168. if player's balance is greater than or equal to 100:
  169. if player has 10 iron ingots:
  170. remove 10 iron ingots from player's inventory
  171. remove 100 from player's balance
  172. play raw sound "note.hat" at player with pitch 1 volume 1
  173. close player's inventory
  174. set {%player%.ForgeInProgress} to true
  175. set {_cooldown} to 30 minutes
  176. set {%player%.ForgeTime} to now
  177. add {_cooldown} to {%player%.ForgeTime}
  178. set {%player%.ForgeItem} to iron pickaxe
  179. set block at {_loc} to very damaged anvil
  180. set {%player%.ForgeItemName} to "&6&lIron &f&lPickaxe"
  181. else:
  182. play raw sound "note.bassattack" at player with pitch 1 volume 1
  183. send "&6>> &cYou don't have enough iron ingots to craft this"
  184. else:
  185. play raw sound "note.bassattack" at player with pitch 1 volume 1
  186. send "&6>> &cYou have insufficient funds to craft this"
  187. create gui slot 25 of player with iron shovel named "&6&lIron &f&lAxe" with lore "Price: $100 and 10 iron ingots" to run:
  188. if player's balance is greater than or equal to 100:
  189. if player has 10 iron ingots:
  190. remove 10 iron ingots from player's inventory
  191. remove 100 from player's balance
  192. play raw sound "note.hat" at player with pitch 1 volume 1
  193. close player's inventory
  194. set {%player%.ForgeInProgress} to true
  195. set {_cooldown} to 30 minutes
  196. set {%player%.ForgeTime} to now
  197. add {_cooldown} to {%player%.ForgeTime}
  198. set {%player%.ForgeItem} to iron axe
  199. set block at {_loc} to very damaged anvil
  200. set {%player%.ForgeItemName} to "&6&lIron &f&lAxe"
  201. else:
  202. play raw sound "note.bassattack" at player with pitch 1 volume 1
  203. send "&6>> &cYou don't have enough iron ingots to craft this"
  204. else:
  205. play raw sound "note.bassattack" at player with pitch 1 volume 1
  206. send "&6>> &cYou have insufficient funds to craft this"
  207. create gui slot 34 of player with iron axe named "&6&lIron &f&lShovel" with lore "Price: $100 and 10 iron ingots" to run:
  208. if player's balance is greater than or equal to 100:
  209. if player has 10 iron ingots:
  210. remove 10 iron ingots from player's inventory
  211. remove 100 from player's balance
  212. play raw sound "note.hat" at player with pitch 1 volume 1
  213. close player's inventory
  214. set {%player%.ForgeInProgress} to true
  215. set {_cooldown} to 30 minutes
  216. set {%player%.ForgeTime} to now
  217. add {_cooldown} to {%player%.ForgeTime}
  218. set {%player%.ForgeItem} to iron shovel
  219. set block at {_loc} to very damaged anvil
  220. set {%player%.ForgeItemName} to "&6&lIron &f&lShovel"
  221. else:
  222. play raw sound "note.bassattack" at player with pitch 1 volume 1
  223. send "&6>> &cYou don't have enough iron ingots to craft this"
  224. else:
  225. play raw sound "note.bassattack" at player with pitch 1 volume 1
  226. send "&6>> &cYou have insufficient funds to craft this"
  227. if block 2 below event-block is emerald block:
  228. create gui slot 15 of event-player with light blue stained glass pane named "&b&lUnlock Forge level II" with lore "&6>> &cClick to unlock, upgrade &7&lForge &cto level &a&lII" to run:
  229. play raw sound "note.bassattack" at player with pitch 1 volume 1
  230. send "&6>> &cTo unlock forging diamond tools and sets, upgrade &7&lForge&c."
  231. close player's inventory
  232. else:
  233. create gui slot 15 of event-player with diamond named "&b&lForge Diamond Items" with lore "&6>> &bClick to forge diamond items" to run:
  234. play raw sound "note.hat" at player with pitch 1 volume 1
  235. close player's inventory
  236. wait 2 ticks
  237. open virtual chest with size 5 named "Forge Diamond Items" to player
  238. wait 2 ticks
  239. GuiFillForge(player,45,red stained glass pane)
  240. GuiFillForge(player,36,black stained glass pane)
  241. wait 2 ticks
  242. create gui slot 1 of player with diamond helmet named "&b&lDiamond &f&lHelmet" with lore "Price: $100 and 10 diamonds" to run:
  243. if player's balance is greater than or equal to 100:
  244. if player has 10 diamonds:
  245. remove 10 diamonds from player's inventory
  246. remove 100 from player's balance
  247. play raw sound "note.hat" at player with pitch 1 volume 1
  248. close player's inventory
  249. set {%player%.ForgeInProgress} to true
  250. set {_cooldown} to 30 minutes
  251. set {%player%.ForgeTime} to now
  252. add {_cooldown} to {%player%.ForgeTime}
  253. set {%player%.ForgeItem} to diamond helmet
  254. set block at {_loc} to very damaged anvil
  255. set {%player%.ForgeItemName} to "&b&lDiamond &f&lHelmet"
  256. else:
  257. play raw sound "note.bassattack" at player with pitch 1 volume 1
  258. send "&6>> &cYou don't have enough diamonds to craft this"
  259. else:
  260. play raw sound "note.bassattack" at player with pitch 1 volume 1
  261. send "&6>> &cYou have insufficient funds to craft this"
  262. create gui slot 10 of player with diamond chestplate named "&b&lDiamond &f&lChestplate" with lore "Price: $100 and 10 diamonds" to run:
  263. if player's balance is greater than or equal to 100:
  264. if player has 10 diamonds:
  265. remove 10 diamonds from player's inventory
  266. remove 100 from player's balance
  267. play raw sound "note.hat" at player with pitch 1 volume 1
  268. close player's inventory
  269. set {%player%.ForgeInProgress} to true
  270. set {_cooldown} to 30 minutes
  271. set {%player%.ForgeTime} to now
  272. add {_cooldown} to {%player%.ForgeTime}
  273. set {%player%.ForgeItem} to diamond chestplate
  274. set block at {_loc} to very damaged anvil
  275. set {%player%.ForgeItemName} to "&b&lDiamond &f&lChestplate"
  276. else:
  277. play raw sound "note.bassattack" at player with pitch 1 volume 1
  278. send "&6>> &cYou don't have enough diamonds to craft this"
  279. else:
  280. play raw sound "note.bassattack" at player with pitch 1 volume 1
  281. send "&6>> &cYou have insufficient funds to craft this"
  282. create gui slot 19 of player with diamond Leggings named "&b&lDiamond &f&lLeggings" with lore "Price: $100 and 10 diamonds" to run:
  283. if player's balance is greater than or equal to 100:
  284. if player has 10 diamonds:
  285. remove 10 diamonds from player's inventory
  286. remove 100 from player's balance
  287. play raw sound "note.hat" at player with pitch 1 volume 1
  288. close player's inventory
  289. set {%player%.ForgeInProgress} to true
  290. set {_cooldown} to 30 minutes
  291. set {%player%.ForgeTime} to now
  292. add {_cooldown} to {%player%.ForgeTime}
  293. set {%player%.ForgeItem} to diamond leggings
  294. set block at {_loc} to very damaged anvil
  295. set {%player%.ForgeItemName} to "&b&lDiamond &f&lLeggings"
  296. else:
  297. play raw sound "note.bassattack" at player with pitch 1 volume 1
  298. send "&6>> &cYou don't have enough diamonds to craft this"
  299. else:
  300. play raw sound "note.bassattack" at player with pitch 1 volume 1
  301. send "&6>> &cYou have insufficient funds to craft this"
  302. create gui slot 28 of player with diamond boots named "&b&lDiamond &f&lBoots" with lore "Price: $100 and 10 diamonds" to run:
  303. if player's balance is greater than or equal to 100:
  304. if player has 10 diamonds:
  305. remove 10 diamonds from player's inventory
  306. remove 100 from player's balance
  307. play raw sound "note.hat" at player with pitch 1 volume 1
  308. close player's inventory
  309. set {%player%.ForgeInProgress} to true
  310. set {_cooldown} to 30 minutes
  311. set {%player%.ForgeTime} to now
  312. add {_cooldown} to {%player%.ForgeTime}
  313. set {%player%.ForgeItem} to diamond boots
  314. set block at {_loc} to very damaged anvil
  315. set {%player%.ForgeItemName} to "&b&lDiamond &f&lBoots"
  316. else:
  317. play raw sound "note.bassattack" at player with pitch 1 volume 1
  318. send "&6>> &cYou don't have enough diamonds to craft this"
  319. else:
  320. play raw sound "note.bassattack" at player with pitch 1 volume 1
  321. send "&6>> &cYou have insufficient funds to craft this"
  322. create gui slot 7 of player with diamond sword named "&b&lDiamond &f&lSword" with lore "Price: $100 and 10 diamonds" to run:
  323. if player's balance is greater than or equal to 100:
  324. if player has 10 diamonds:
  325. remove 10 diamonds from player's inventory
  326. remove 100 from player's balance
  327. play raw sound "note.hat" at player with pitch 1 volume 1
  328. close player's inventory
  329. set {%player%.ForgeInProgress} to true
  330. set {_cooldown} to 30 minutes
  331. set {%player%.ForgeTime} to now
  332. add {_cooldown} to {%player%.ForgeTime}
  333. set {%player%.ForgeItem} to diamond sword
  334. set block at {_loc} to very damaged anvil
  335. set {%player%.ForgeItemName} to "&b&lDiamond &f&lSword"
  336. else:
  337. play raw sound "note.bassattack" at player with pitch 1 volume 1
  338. send "&6>> &cYou don't have enough diamonds to craft this"
  339. else:
  340. play raw sound "note.bassattack" at player with pitch 1 volume 1
  341. send "&6>> &cYou have insufficient funds to craft this"
  342. create gui slot 16 of player with diamond pickaxe named "&b&lDiamond &f&lPickaxe" with lore "Price: $100 and 10 diamonds" to run:
  343. if player's balance is greater than or equal to 100:
  344. if player has 10 diamonds:
  345. remove 10 diamonds from player's inventory
  346. remove 100 from player's balance
  347. play raw sound "note.hat" at player with pitch 1 volume 1
  348. close player's inventory
  349. set {%player%.ForgeInProgress} to true
  350. set {_cooldown} to 30 minutes
  351. set {%player%.ForgeTime} to now
  352. add {_cooldown} to {%player%.ForgeTime}
  353. set {%player%.ForgeItem} to diamond pickaxe
  354. set block at {_loc} to very damaged anvil
  355. set {%player%.ForgeItemName} to "&b&lDiamond &f&lPickaxe"
  356. else:
  357. play raw sound "note.bassattack" at player with pitch 1 volume 1
  358. send "&6>> &cYou don't have enough diamonds to craft this"
  359. else:
  360. play raw sound "note.bassattack" at player with pitch 1 volume 1
  361. send "&6>> &cYou have insufficient funds to craft this"
  362. create gui slot 25 of player with diamond shovel named "&b&lDiamond &f&lShovel" with lore "Price: $100 and 10 diamonds" to run:
  363. if player's balance is greater than or equal to 100:
  364. if player has 10 diamonds:
  365. remove 10 diamonds from player's inventory
  366. remove 100 from player's balance
  367. play raw sound "note.hat" at player with pitch 1 volume 1
  368. close player's inventory
  369. set {%player%.ForgeInProgress} to true
  370. set {_cooldown} to 30 minutes
  371. set {%player%.ForgeTime} to now
  372. add {_cooldown} to {%player%.ForgeTime}
  373. set {%player%.ForgeItem} to diamond shovel
  374. set block at {_loc} to very damaged anvil
  375. set {%player%.ForgeItemName} to "&b&lDiamond &f&lShovel"
  376. else:
  377. play raw sound "note.bassattack" at player with pitch 1 volume 1
  378. send "&6>> &cYou don't have enough diamonds to craft this"
  379. else:
  380. play raw sound "note.bassattack" at player with pitch 1 volume 1
  381. send "&6>> &cYou have insufficient funds to craft this"
  382. create gui slot 34 of player with diamond axe named "&b&lDiamond &f&lAxe" with lore "Price: $100 and 10 diamonds" to run:
  383. if player's balance is greater than or equal to 100:
  384. if player has 10 diamonds:
  385. remove 10 diamonds from player's inventory
  386. remove 100 from player's balance
  387. play raw sound "note.hat" at player with pitch 1 volume 1
  388. close player's inventory
  389. set {%player%.ForgeInProgress} to true
  390. set {_cooldown} to 30 minutes
  391. set {%player%.ForgeTime} to now
  392. add {_cooldown} to {%player%.ForgeTime}
  393. set {%player%.ForgeItem} to diamond axe
  394. set block at {_loc} to very damaged anvil
  395. set {%player%.ForgeItemName} to "&b&lDiamond &f&lAxe"
  396. else:
  397. play raw sound "note.bassattack" at player with pitch 1 volume 1
  398. send "&6>> &cYou don't have enough diamonds to craft this"
  399. else:
  400. play raw sound "note.bassattack" at player with pitch 1 volume 1
  401. send "&6>> &cYou have insufficient funds to craft this"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement