Advertisement
Guest User

Skript de maquinas by mrguizin

a guest
Nov 29th, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.42 KB | None | 0 0
  1. options:
  2. # Preço das fichas
  3. Preco_Maquina: 1000000000
  4. Preco_Ficha: 50000000
  5.  
  6. # Limite das máquinas
  7. LimiteDeMaquinas: 100
  8.  
  9. Mindrop: 5
  10. maxdrop: 10
  11.  
  12. on place ender portal frame:
  13. if name of player's tool is "&eMáquina":
  14. show 500 of portal particle at location of block at speed 1
  15. add location of location of block to {Maquina.Loc::*}
  16. set {ligada.%location of block%} to false
  17. set {maquina.%location of block%} to true
  18. set {maquina.qnt.%location of block%} to 1
  19. set action bar of player to coloured "&6&lMÁQUINAS: &6Você colocou uma máquina"
  20. create holo object "&eMaquina &6%{maquina.qnt.%location of block%}%x;&7Desligada" with id "%location of block%.desligada" at location 1.0 meters above location of block
  21. stop
  22.  
  23. on break of ender portal frame:
  24.  
  25. if {maquina.%location of block%} is true:
  26.  
  27. cancel event
  28.  
  29. function MenuMaquina(p: player, i: number):
  30.  
  31. if {_i} = 1:
  32.  
  33. wait 5 tick
  34. open chest with 6 row named "&7Máquina - &9%{_p}%" to {_p}
  35. play raw sound "random.chestopen" at {_p} with pitch 1 volume 5
  36. wait 5 tick
  37. format slot 0 of {_p} with a 101 named "&0" to be unstealable
  38. format slot 1 of {_p} with a 101 named "&0" to be unstealable
  39. format slot 2 of {_p} with a 101 named "&0" to be unstealable
  40. format slot 9 of {_p} with a 101 named "&0" to be unstealable
  41. format slot 10 of {_p} with a 101 named "&0" to be unstealable
  42. format slot 18 of {_p} with a 101 named "&0" to be unstealable
  43. format slot 27 of {_p} with a 101 named "&0" to be unstealable
  44. format slot 36 of {_p} with a 101 named "&0" to be unstealable
  45. format slot 37 of {_p} with a 101 named "&0" to be unstealable
  46. format slot 45 of {_p} with a 101 named "&0" to be unstealable
  47. format slot 46 of {_p} with a 101 named "&0" to be unstealable
  48. format slot 47 of {_p} with a 101 named "&0" to be unstealable
  49. format slot 35 of {_p} with a 101 named "&0" to be unstealable
  50. format slot 44 of {_p} with a 101 named "&0" to be unstealable
  51. format slot 43 of {_p} with a 101 named "&0" to be unstealable
  52. format slot 51 of {_p} with a 101 named "&0" to be unstealable
  53. format slot 52 of {_p} with a 101 named "&0" to be unstealable
  54. format slot 53 of {_p} with a 101 named "&0" to be unstealable
  55. format slot 6 of {_p} with a 101 named "&0" to be unstealable
  56. format slot 7 of {_p} with a 101 named "&0" to be unstealable
  57. format slot 8 of {_p} with a 101 named "&0" to be unstealable
  58. format slot 16 of {_p} with a 101 named "&0" to be unstealable
  59. format slot 17 of {_p} with a 101 named "&0" to be unstealable
  60. format slot 26 of {_p} with a 101 named "&0" to be unstealable
  61.  
  62.  
  63. format slot 3 of {_p} with a vine named "&0" to be unstealable
  64. format slot 5 of {_p} with a vine named "&0" to be unstealable
  65. format slot 11 of {_p} with a vine named "&0" to be unstealable
  66. format slot 15 of {_p} with a vine named "&0" to be unstealable
  67. format slot 38 of {_p} with a vine named "&0" to be unstealable
  68. format slot 42 of {_p} with a vine named "&0" to be unstealable
  69. format slot 48 of {_p} with a vine named "&0" to be unstealable
  70. format slot 50 of {_p} with a vine named "&0" to be unstealable
  71.  
  72. format slot 21 of {_p} with a iron pickaxe named "&eQuebrar está máquina" with lore "||&7* Clique aqui para quebrar a máquina" to close then run [make {_p} execute command "maquina confirmar quebrar"]
  73. format slot 23 of {_p} with a eye of ender named "&eComprar ficha de máquina" with lore "||&7* Clique aqui para comprar a ficha de máquina" to close then run [make {_p} execute command "maquina confirmar ficha"]
  74. format slot 31 of {_p} with a ender portal frame named "&eComprar uma máquina" with lore "||&7* Clique aqui para comprar uma máquina" to close then run [make {_p} execute command "maquina confirmar maquina"]
  75.  
  76. if {_i} = 2:
  77.  
  78.  
  79. wait 5 tick
  80. open chest with 6 row named "&7Máquina - &9%{_p}%" to {_p}
  81. play raw sound "random.chestopen" at {_p} with pitch 1 volume 5
  82. wait 5 tick
  83. format slot 0 of {_p} with a 101 named "&0" to be unstealable
  84. format slot 1 of {_p} with a 101 named "&0" to be unstealable
  85. format slot 2 of {_p} with a 101 named "&0" to be unstealable
  86. format slot 9 of {_p} with a 101 named "&0" to be unstealable
  87. format slot 10 of {_p} with a 101 named "&0" to be unstealable
  88. format slot 18 of {_p} with a 101 named "&0" to be unstealable
  89. format slot 27 of {_p} with a 101 named "&0" to be unstealable
  90. format slot 36 of {_p} with a 101 named "&0" to be unstealable
  91. format slot 37 of {_p} with a 101 named "&0" to be unstealable
  92. format slot 45 of {_p} with a 101 named "&0" to be unstealable
  93. format slot 46 of {_p} with a 101 named "&0" to be unstealable
  94. format slot 47 of {_p} with a 101 named "&0" to be unstealable
  95. format slot 35 of {_p} with a 101 named "&0" to be unstealable
  96. format slot 44 of {_p} with a 101 named "&0" to be unstealable
  97. format slot 43 of {_p} with a 101 named "&0" to be unstealable
  98. format slot 51 of {_p} with a 101 named "&0" to be unstealable
  99. format slot 52 of {_p} with a 101 named "&0" to be unstealable
  100. format slot 53 of {_p} with a 101 named "&0" to be unstealable
  101. format slot 6 of {_p} with a 101 named "&0" to be unstealable
  102. format slot 7 of {_p} with a 101 named "&0" to be unstealable
  103. format slot 8 of {_p} with a 101 named "&0" to be unstealable
  104. format slot 16 of {_p} with a 101 named "&0" to be unstealable
  105. format slot 17 of {_p} with a 101 named "&0" to be unstealable
  106. format slot 26 of {_p} with a 101 named "&0" to be unstealable
  107.  
  108.  
  109. format slot 3 of {_p} with a vine named "&0" to be unstealable
  110. format slot 5 of {_p} with a vine named "&0" to be unstealable
  111. format slot 11 of {_p} with a vine named "&0" to be unstealable
  112. format slot 15 of {_p} with a vine named "&0" to be unstealable
  113. format slot 38 of {_p} with a vine named "&0" to be unstealable
  114. format slot 42 of {_p} with a vine named "&0" to be unstealable
  115. format slot 48 of {_p} with a vine named "&0" to be unstealable
  116. format slot 50 of {_p} with a vine named "&0" to be unstealable
  117.  
  118.  
  119. format slot 23 of {_p} with a eye of ender named "&eComprar ficha de máquina" with lore "||&7* Clique aqui para comprar a ficha de máquina" to close then run [make {_p} execute command "maquina confirmar ficha"]
  120. format slot 21 of {_p} with a ender portal frame named "&eComprar uma máquina" with lore "||&7* Clique aqui para comprar uma máquina" to close then run [make {_p} execute command "maquina confirmar maquina"]
  121.  
  122. command /maquina [<text>] [<text>] [<number>]:
  123. aliases: maquinas
  124. trigger:
  125.  
  126. if arg 1 is set:
  127.  
  128. if arg 2 is set:
  129.  
  130. if arg 1 is "llwmtlaktwm":
  131.  
  132. MenuMaquina(player, 1)
  133.  
  134. if arg 1 is "confirmar":
  135.  
  136. if arg 2 is "maquina":
  137.  
  138. set {_5} to {@Preco_Maquina} * 5
  139. set {_51} to {@Preco_Maquina} * 10
  140. send "&7&m>----------------------------------<"
  141. send " &3Escolha a quantidade de máquinas a comprar:"
  142. send json of " - 1" tooltip "&3Preço: {@Preco_Maquina}" run "/maquina comprar maquina 1" to player
  143. send json of " - 5" tooltip "&3Preço: %{_5}%" run "/maquina comprar maquina 5" to player
  144. send json of " - 10" tooltip "&3Preço: %{_51}%" run "/maquina comprar maquina 10" to player
  145. send "&7&m>----------------------------------<"
  146.  
  147. if arg 2 is "ficha":
  148. set {_5} to {@Preco_Ficha} * 5
  149. set {_51} to {@Preco_Ficha} * 10
  150. send "&7&m>----------------------------------<"
  151. send " &3Escolha a quantidade de fichas a comprar:"
  152. send json of " - 1" tooltip "&3Preço: {@Preco_Ficha}" run "/maquina comprar ficha 1" to player
  153. send json of " - 5" tooltip "&3Preço: %{_5}%" run "/maquina comprar ficha 5" to player
  154. send json of " - 10" tooltip "&3Preço: %{_51}%" run "/maquina comprar ficha 10" to player
  155. send "&7&m>----------------------------------<"
  156.  
  157. if arg 2 is "quebrar":
  158.  
  159. set {_p} to player
  160. wait 5 tick
  161. open chest with 3 row named "&7Máquina (Confirmação) - &9%{_p}%" to {_p}
  162. play raw sound "random.chestopen" at {_p} with pitch 1 volume 5
  163. wait 5 tick
  164. format slot 0 of {_p} with a 324 named "&aVoltar" with lore "||&7* Clique aqui para voltar" to close then run [execute {_p} command "llwmtlaktwm"]
  165. format slot 8 of {_p} with a barrier named "&aFechar menu" with lore "||&7* Clique aqui para fechar o menu" to close
  166. format slot 10 of {_p} with a light green wool block named "&aConfirmar" with lore "||&7* Clique aqui para confirmar" to close then run [execute {_p} command "maquina pode quebrar"]
  167. format slot 13 of {_p} with iron pickaxe named "&aQuebrar está maquina" with lore "||&e* Você tem certeza ?" to be unstealable
  168. format slot 16 of {_p} with a red wool block named "&cCancelar" with lore "||&7* Clique aqui para cancelar" to close
  169.  
  170. if arg 1 is "comprar":
  171.  
  172. if arg 2 is "maquina":
  173. if arg 3 is 1:
  174.  
  175. if player's balance >= {@Preco_Maquina}:
  176.  
  177. if player has enough space for 1 stone:
  178.  
  179. give shiny ender portal frame named "&eMáquina" to player
  180. remove {@Preco_Maquina} from player's balance
  181. send "&3[RedWins] &eVocê comprou uma máquina." to player
  182. stop
  183.  
  184. else:
  185.  
  186. send "&3[RedWins] &eVocê não tem espaço para a máquina."
  187. stop
  188.  
  189. else:
  190.  
  191. send "&3[RedWins] &eVocê não tem dinheiro suficiente."
  192. stop
  193.  
  194.  
  195. if arg 3 is 5:
  196.  
  197. set {_i} to {@Preco_Maquina} * 5
  198. if player's balance >= {_i}:
  199.  
  200. if player has enough space for 5 stone:
  201.  
  202. give 5 of shiny ender portal frame named "&eMáquina" to player
  203. remove {_i} from player's balance
  204. send "&3[RedWins] &eVocê comprou uma máquina." to player
  205. stop
  206.  
  207. else:
  208.  
  209. send "&3[RedWins] &eVocê não tem espaço para a máquina."
  210. stop
  211.  
  212. else:
  213.  
  214. send "&3[RedWins] &eVocê não tem dinheiro suficiente."
  215. stop
  216.  
  217. if arg 3 is 10:
  218.  
  219. set {_i} to {@Preco_Maquina} * 10
  220. if player's balance >= {_i}:
  221.  
  222. if player has enough space for 10 stone:
  223.  
  224. give 10 of shiny ender portal frame named "&eMáquina" to player
  225. remove {_i} from player's balance
  226. send "&3[RedWins] &eVocê comprou uma máquina." to player
  227. stop
  228.  
  229. else:
  230.  
  231. send "&3[RedWins] &eVocê não tem espaço para a máquina."
  232. stop
  233.  
  234. else:
  235.  
  236. send "&3[RedWins] &eVocê não tem dinheiro suficiente."
  237. stop
  238.  
  239. if arg 2 is "ficha":
  240.  
  241. if arg 3 is 1:
  242.  
  243. if player's balance >= {@Preco_Ficha}:
  244.  
  245. if player has enough space for 1 stone:
  246.  
  247. give player shiny eye of ender named "&eFicha de máquina" with lore "&7Tipo: Esmeralda"
  248. remove {@Preco_Ficha} from player's balance
  249. send "&3[RedWins] &eVocê comprou uma ficha." to player
  250. stop
  251.  
  252. else:
  253.  
  254. send "&3[RedWins] &eVocê não tem espaço para a máquina."
  255. stop
  256.  
  257. else:
  258.  
  259. send "&3[RedWins] &eVocê não tem dinheiro suficiente."
  260. stop
  261.  
  262. if arg 3 is 5:
  263.  
  264. set {_i} to {@Preco_Ficha} * 5
  265. if player's balance >= {_i}:
  266.  
  267. if player has enough space for 5 stone:
  268.  
  269. give 5 of shiny eye of ender named "&eFicha de máquina" with lore "&7Tipo: Esmeralda" to player
  270. remove {_i} from player's balance
  271. send "&3[RedWins] &eVocê comprou uma ficha." to player
  272. stop
  273.  
  274. else:
  275.  
  276. send "&3[RedWins] &eVocê não tem espaço para a máquina."
  277. stop
  278.  
  279. else:
  280.  
  281. send "&3[RedWins] &eVocê não tem dinheiro suficiente."
  282. stop
  283.  
  284. if arg 3 is 10:
  285.  
  286. set {_i} to {@Preco_Ficha} * 10
  287. if player's balance >= {_i}:
  288.  
  289. if player has enough space for 10 stone:
  290.  
  291. give 10 of shiny eye of ender named "&eFicha de máquina" with lore "&7Tipo: Esmeralda" to player
  292. remove {_i} from player's balance
  293. send "&3[RedWins] &eVocê comprou uma ficha." to player
  294. stop
  295.  
  296. else:
  297.  
  298. send "&3[RedWins] &eVocê não tem espaço para a máquina."
  299. stop
  300.  
  301. else:
  302.  
  303. send "&3[RedWins] &eVocê não tem dinheiro suficiente."
  304. stop
  305.  
  306. if arg 1 is "pode":
  307.  
  308. if arg 2 is "quebrar":
  309.  
  310. set {_b} to location of target block of player
  311. if {maquina.%{_b}%} is true:
  312. if {ligada.%{_b}%} is false:
  313. set action bar of player to coloured "&6&lMÁQUINA: &6Falhou..."
  314. if player's tool is enchanted with silk touch:
  315.  
  316. if {maquina.qnt.%{_b}%} >= 2:
  317. show 200 of portal particle at location of {_b} at speed 0
  318. set action bar of player to coloured "&6&lMÁQUINA: &6Máquina retirada sem perdas"
  319. delete holo object "%{_b}%.desligada"
  320. remove 1 from {maquina.qnt.%{_b}%}
  321. drop shiny ender portal frame named "&eMáquina"
  322. create holo object "&eMaquina &6%{maquina.qnt.%{_b}%}%x;&7Desligada" with id "%{_b}%.desligada" at location 1.0 meters above location of {_b}
  323. stop
  324.  
  325. else:
  326.  
  327. show 200 of portal particle at location of {_b} at speed 0
  328. set action bar of player to coloured "&6&lMÁQUINA: &6Máquina retirada sem perdas"
  329. delete holo object "%{_b}%.desligada"
  330. drop shiny ender portal frame named "&eMáquina"
  331. set block at {_b} to air
  332. remove location of location of {_b} from {Maquina.Loc::*}
  333. set {ligada.%{_b}%} to false
  334. set {maquina.%{_b}%} to false
  335. set {maquina.qnt.%{_b}%} to 0
  336. stop
  337.  
  338.  
  339. else:
  340.  
  341. chance of 80%:
  342.  
  343. if {maquina.qnt.%{_b}%} >= 2:
  344.  
  345. show 200 of flame particle at location of {_b} at speed 0
  346. set action bar of player to coloured "&6&lMÁQUINA: &6Máquina retirada com perdas"
  347. delete holo object "%{_b}%.desligada"
  348. remove 1 from {maquina.qnt.%{_b}%}
  349. create holo object "&eMaquina &6%{maquina.qnt.%{_b}%}%x;&7Desligada" with id "%{_b}%.desligada" at location 1.0 meters above location of {_b}
  350. stop
  351.  
  352. else:
  353.  
  354. show 200 of flame particle at location of {_b} at speed 0
  355. set action bar of player to coloured "&6&lMÁQUINA: &6Máquina retirada com perdas"
  356. delete holo object "%{_b}%.desligada"
  357. set block at {_b} to air
  358. remove location of location of {_b} from {Maquina.Loc::*}
  359. set {ligada.%{_b}%} to false
  360. set {maquina.%{_b}%} to false
  361. set {maquina.qnt.%{_b}%} to 0
  362. stop
  363.  
  364. chance of 20%:
  365.  
  366. if {maquina.qnt.%{_b}%} >= 2:
  367.  
  368. show 200 of portal particle at location of {_b} at speed 0
  369. set action bar of player to coloured "&6&lMÁQUINA: &6Máquina retirada sem perdas"
  370. delete holo object "%{_b}%.desligada"
  371. remove 1 from {maquina.qnt.%{_b}%}
  372. drop shiny ender portal frame named "&eMáquina"
  373. create holo object "&eMaquina &6%{maquina.qnt.%{_b}%}%x;&7Desligada" with id "%{_b}%.desligada" at location 1.0 meters above location of {_b}
  374. stop
  375.  
  376. else:
  377.  
  378. show 200 of portal particle at location of {_b} at speed 0
  379. set action bar of player to coloured "&6&lMÁQUINA: &6Máquina retirada sem perdas"
  380. delete holo object "%{_b}%.desligada"
  381. drop shiny ender portal frame named "&eMáquina"
  382. set block at {_b} to air
  383. remove location of location of {_b} from {Maquina.Loc::*}
  384. set {ligada.%{_b}%} to false
  385. set {maquina.%{_b}%} to false
  386. set {maquina.qnt.%{_b}%} to 0
  387. stop
  388. else:
  389.  
  390. MenuMaquina(player, 2)
  391.  
  392. on right click on ender portal frame:
  393. if player is sneaking:
  394. if {maquina.%location of block%} is true:
  395.  
  396. if {ligada.%location of block%} is false:
  397.  
  398. MenuMaquina(player, 1)
  399.  
  400. else:
  401. if {maquina.%location of block%} is true:
  402. if player's tool is a eye of ender:
  403. if {ligada.%location of block%} is false:
  404. if name of player's tool is "&eFicha de máquina":
  405. if lore of player's tool is "&7Tipo: Esmeralda":
  406. cancel event
  407. delete holo object "%location of block%.desligada"
  408. set action bar of player to coloured "&6&lMÁQUINA: &6Você ligou a máquina"
  409. set {ligada.%location of block%} to true
  410. create holo object "&eMaquina &6%{maquina.qnt.%location of block%}%x;&7Ligada" with id "%location of block%.ligada" at location 1.0 meters above location of block
  411. loop {maquina.qnt.%location of block%} times:
  412. if player has shiny eye of ender named "&eFicha de máquina" with lore "&7Tipo: Esmeralda":
  413. remove shiny eye of ender named "&eFicha de máquina" with lore "&7Tipo: Esmeralda" from player's inventory
  414. add 1 to {_i}
  415. else:
  416. stop loop
  417. loop 20 times:
  418. show 200 of flame particle at location of block at speed 0
  419. set {_q} to a random integer between {@Mindrop} and {@maxdrop}
  420. set {_q} to {_q} * {_i}
  421. drop {_q} of emerald named "&eEsmeralda &a>> Máquina"
  422. wait 3 seconds
  423. delete holo object "%location of block%.ligada"
  424. create holo object "&eMaquina &6%{maquina.qnt.%location of block%}%x;&7Desligada" with id "%location of block%.desligada" at location 1.0 meters above location of block
  425. set action bar of player to coloured "&6&lMÁQUINA: &6Acabou a ficha de sua máquina"
  426. set {ligada.%location of block%} to false
  427. stop
  428. else:
  429. set action bar of player to coloured "&6&lMÁQUINA: &6Essa máquina já possui ficha"
  430. stop
  431. if player's tool is a ender portal frame:
  432. if {ligada.%location of block%} is false:
  433. if name of player's tool is "&eMáquina":
  434. if {maquina.qnt.%location of block%} = {@LimiteDeMaquinas}:
  435. set action bar of player to coloured "&6&lMÁQUINA: &6Limite de máquinas agrupadas é {@LimiteDeMaquinas}"
  436. cancel event
  437. stop
  438. else:
  439. show 200 of portal particle at location of block at speed 0.1
  440. delete holo object "%location of block%.desligada"
  441. cancel event
  442. add 1 to {maquina.qnt.%location of block%}
  443. remove shiny ender portal frame named "&eMáquina" from player's inventory
  444. set action bar of player to coloured "&6&lMÁQUINA: &6Você adicionou uma máquina"
  445. create holo object "&eMaquina &6%{maquina.qnt.%location of block%}%x;&7Desligada" with id "%location of block%.desligada" at location 1.0 meters above location of block
  446.  
  447. on skript load:
  448.  
  449. loop {Maquina.Loc::*}:
  450.  
  451. set {ligada.%loop-value%} to false
  452. delete holo object "%loop-value%.ligada"
  453. delete holo object "%loop-value%.desligada"
  454. create holo object "&eMaquina &6%{maquina.qnt.%loop-value%}%x;&7Desligada" with id "%loop-value%.desligada" at location 1.0 meters above location of loop-value
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement