Advertisement
Guest User

SimpleHOMES

a guest
Aug 26th, 2017
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.72 KB | None | 0 0
  1. options:
  2. PrEfixo: &a[TOPCraft]
  3. LimiteHomeMembro: 2
  4. PermMembro: home.membro
  5. LimiteHomeVip: 100
  6. PermVip: home.vip
  7. PermCriar: home.criar
  8. PermDeletar: home.deletar
  9. PermIr: home.ir
  10. PermLista: home.lista
  11.  
  12. variables:
  13. {aHome.Set.WaitArgument::%player%} = false
  14. {aHome.Ir.WaitArgument::%player%} = false
  15. {aHome.Del.WaitArgument::%player%} = false
  16. {aHome.Del.Confirm.WaitArgument::%player%} = false
  17.  
  18. on quit:
  19.  
  20. set {aHome.Set.WaitArgument::%player%} to false
  21. set {aHome.Ir.WaitArgument::%player%} to false
  22. set {aHome.Del.WaitArgument::%player%} to false
  23. set {aHome.Del.Confirm.WaitArgument::%player%} to false
  24.  
  25. on command "delhome":
  26. cancel event
  27. execute player command "home"
  28. stop
  29.  
  30. on command "sethome":
  31. cancel event
  32. execute player command "home"
  33. stop
  34.  
  35.  
  36. command /home [<text>] [<text>]:
  37. aliases: homes
  38. trigger:
  39.  
  40. if arg 1 is not set:
  41.  
  42. MenuMain(player)
  43.  
  44. else:
  45.  
  46. if arg 1 is "ir":
  47.  
  48. if {aHome.Ir.WaitArgument::%player%} is false:
  49.  
  50. set {aHome.Ir.WaitArgument::%player%} to true
  51. send "%nl%{@PrEfixo} &7Digite o nome da home que você deseja ir, ou digite 'cancelar' para cancelar.%nl%" to player
  52. stop
  53.  
  54. else:
  55.  
  56. send "%nl%{@PrEfixo} &7Por favor digite o nome.%nl%" to player
  57. stop
  58.  
  59. if arg 1 is "criar":
  60.  
  61. if {aHome.Set.WaitArgument::%player%} is false:
  62.  
  63. set {aHome.Set.WaitArgument::%player%} to true
  64. send "%nl%{@PrEfixo} &7Digite o nome da home que você desejar, ou digite 'cancelar' para cancelar.%nl%" to player
  65. stop
  66.  
  67. else:
  68.  
  69. send "%nl%{@PrEfixo} &7Por favor digite o nome.%nl%" to player
  70. stop
  71.  
  72. if arg 1 is "deletar":
  73.  
  74. if {aHome.Del.WaitArgument::%player%} is false:
  75.  
  76. set {aHome.Del.WaitArgument::%player%} to true
  77. send "%nl%{@PrEfixo} &7Digite o nome da home que você deseja deletar.%nl%" to player
  78. stop
  79.  
  80. else:
  81.  
  82. send "%nl%{@PrEfixo} &7Por favor digite o nome.%nl%" to player
  83. stop
  84.  
  85. if arg 1 is "lista":
  86.  
  87. MenuLista(player)
  88.  
  89.  
  90. on chat:
  91. set {_args::*} to message split at " "
  92. if {aHome.Set.WaitArgument::%player%} is true:
  93.  
  94. if size of {_args::*} = 1:
  95.  
  96. set {_m} to {_args::1} parsed as text
  97. if {_m} is "cancelar":
  98.  
  99. send "%nl%{@PrEfixo} &7Você cancelou a criação da home.%nl%"
  100. set {aHome.Set.WaitArgument::%player%} to false
  101. cancel event
  102. stop
  103.  
  104. else:
  105.  
  106. if {aHome.Home.%player%::%{_m}%} is not set:
  107.  
  108. CreateHome(player, {_m})
  109. set {aHome.Set.WaitArgument::%player%} to false
  110. cancel event
  111. stop
  112.  
  113. else:
  114.  
  115. send "%nl%{@PrEfixo} &7Já existe uma home com o nome &9%{_m}%&7.%nl%" to player
  116. cancel event
  117. stop
  118.  
  119. else:
  120.  
  121. send "%nl%{@PrEfixo} &7Por favor digite o nome.%nl%"
  122. cancel event
  123. stop
  124.  
  125. if {aHome.Ir.WaitArgument::%player%} is true:
  126.  
  127. if size of {_args::*} = 1:
  128.  
  129. set {_m} to {_args::1} parsed as text
  130. if {_m} is "cancelar":
  131.  
  132. send "%nl%{@PrEfixo} &7Você cancelou o teleporte para home.%nl%"
  133. set {aHome.Ir.WaitArgument::%player%} to false
  134. cancel event
  135. stop
  136.  
  137. else:
  138.  
  139. TeleportHome(player, {_m})
  140. cancel event
  141. stop
  142.  
  143. else:
  144.  
  145. send "%nl%{@PrEfixo} &7Por favor digite o nome.%nl%"
  146. cancel event
  147. stop
  148.  
  149. if {aHome.Del.WaitArgument::%player%} is true:
  150.  
  151. if size of {_args::*} = 1:
  152.  
  153. set {_m} to {_args::1} parsed as text
  154. if {_m} is "cancelar":
  155.  
  156. send "%nl%{@PrEfixo} &7Você cancelou a exclusão de uma home.%nl%"
  157. set {aHome.Ir.WaitArgument::%player%} to false
  158. cancel event
  159. stop
  160.  
  161. else:
  162. set {aHome.ConfirmDel::%player%} to {_m}
  163. DelHome(player, {_m}, "Certz")
  164. cancel event
  165. stop
  166.  
  167. else:
  168.  
  169. send "%nl%{@PrEfixo} &7Por favor digite o nome.%nl%"
  170. cancel event
  171. stop
  172.  
  173. if {aHome.Del.Confirm.WaitArgument::%player%} is true:
  174.  
  175. if size of {_args::*} = 1:
  176.  
  177. set {_h} to "%{aHome.ConfirmDel::%player%}%" parsed as text
  178. set {_m} to {_args::1} parsed as text
  179. send "%{_h}%" to console
  180. cancel event
  181. if {_m} is "sim":
  182.  
  183. DelHome(player, {_h}, "Del")
  184.  
  185. if {_m} is "não":
  186.  
  187. DelHome(player, {_h}, "Nao")
  188.  
  189. else:
  190.  
  191. DelHome(player, {_h}, "Certz")
  192.  
  193.  
  194. function DelHome(p: player, m: text, i: text):
  195.  
  196. if {_p} has permission "{@PermDeletar}":
  197.  
  198. if {_i} is "Certz":
  199.  
  200. if {aHome.Home.%{_p}%::%{_m}%} is set:
  201.  
  202. set {aHome.Del.WaitArgument::%{_p}%} to false
  203. set {aHome.Del.Confirm.WaitArgument::%{_p}%} to true
  204. send "%nl%{@PrEfixo} &7Você realmente quer deletar sua home &9%{_m}%&7 ?%nl% &7Se sim digite 'sim&7' se não digite 'não&7'.%nl%" to {_p}
  205. stop
  206.  
  207. else:
  208.  
  209. send "%nl%{@PrEfixo} &7Você não tem uma home com o nome &9%{_m}%&7.%nl%" to {_p}
  210. stop
  211.  
  212. if {_i} is "Del":
  213.  
  214. set {aHome.Del.Confirm.WaitArgument::%{_p}%} to false
  215. clear {aHome.Home.%{_p}%::%{_m}%}
  216. send "%nl%{@PrEfixo} &7Você deletou a home &9%{_m}%&7!%nl%" to {_p}
  217. stop
  218.  
  219. if {_i} is "Nao":
  220.  
  221. set {aHome.Del.Confirm.WaitArgument::%{_p}%} to false
  222. send "%nl%{@PrEfixo} &7Exclusão de &9%{_m}%&7 cancelada!%nl%" to {_p}
  223. stop
  224.  
  225.  
  226. else:
  227.  
  228. send "%nl%{@PrEfixo} &7Você não tem permissão para deletar homes%nl%" to {_p}
  229.  
  230. function TeleportHome(p: player, m: text):
  231.  
  232. if {_p} has permission "{@PermIr}":
  233.  
  234. if {aHome.Home.%{_p}%::%{_m}%} is set:
  235.  
  236. set {aHome.Ir.WaitArgument::%{_p}%} to false
  237. send "%nl%{@PrEfixo} &7Teleportando a home selecionada, aguarde!%nl%" to {_p}
  238. wait 3 seconds
  239. teleport {_p} to {aHome.Home.%{_p}%::%{_m}%}
  240.  
  241. else:
  242.  
  243. send "%nl%{@PrEfixo} &7Você não tem uma home com o nome &9%{_m}%&7.%nl%" to {_p}
  244.  
  245. else:
  246.  
  247. send "%nl%{@PrEfixo} &7Você não tem permissão para ir as suas homes%nl%" to {_p}
  248.  
  249. function MenuMain(p: player):
  250.  
  251. wait 5 tick
  252. open chest with 3 row named "&9Home - &7%{_p}%" to {_p}
  253. play raw sound "random.chestopen" at {_p} with pitch 1 volume 5
  254. wait 5 tick
  255. set {_slot} to 0
  256. loop 27 times:
  257.  
  258. format slot {_slot} of {_p} with a gray stained glass named "&0" to be unstealable
  259. add 1 to {_slot}
  260.  
  261. format slot 8 of {_p} with a red wool block named "&aFechar menu" with lore "||&7* Clique aqui para fechar o menu" to close
  262. format slot 10 of {_p} with {_p}'s skull named "&7%{_p}'s name%" with lore "||&e* Homes: &6%size of {aHome.Home.%{_p}%::*}%" to be unstealable
  263. format slot 12 of {_p} with ender pearl named "&7Ir para uma home" with lore "||&e* Clique aqui" to close then run [make {_p} execute command "home ir"]
  264. format slot 13 of {_p} with redstone named "&7Criar uma home" with lore "||&e* Clique aqui" to close then run [make {_p} execute command "home criar"]
  265. format slot 14 of {_p} with barrier named "&7Deletar uma home" with lore "||&e* Clique aqui" to close then run [make {_p} execute command "home deletar"]
  266. format slot 15 of {_p} with book named "&7Lista de homes" with lore "||&e* Clique aqui" to close then run [make {_p} execute command "home lista"]
  267.  
  268. function MenuLista(p: player):
  269.  
  270. if {_p} has permission "{@PermLista}":
  271.  
  272. wait 5 tick
  273. open chest with 6 row named "&9Suas homes - &7%{_p}%" to {_p}
  274. play raw sound "random.chestopen" at {_p} with pitch 1 volume 5
  275. wait 5 tick
  276. set {_slot} to 0
  277. loop 54 times:
  278.  
  279. format slot {_slot} of {_p} with a gray stained glass named "&0" to be unstealable
  280. add 1 to {_slot}
  281.  
  282. set {_slot} to 9
  283. loop {aHome.Home.%{_p}%::*}:
  284.  
  285. format slot {_slot} of {_p} with 324 named "&9%loop-index%" with lore "||&e* Localização|| &f%loop-value%" to be unstealable
  286. if {_slot} < 45:
  287. add 1 to {_slot}
  288. else:
  289. stop loop
  290.  
  291. format slot 0 of {_p} with a light green wool block named "&aVoltar o menu" with lore "||&7* Clique aqui para voltar o menu" to close then run [execute {_p} command "home"]
  292. format slot 8 of {_p} with a red wool block named "&aFechar menu" with lore "||&7* Clique aqui para fechar o menu" to close
  293.  
  294.  
  295. else:
  296.  
  297. send "%nl%{@PrEfixo} &7Você não tem permissão para ver as suas homes%nl%" to {_p}
  298.  
  299. function CreateHome(p: player, n: text):
  300.  
  301. if {_p} has permission "{@PermCriar}":
  302.  
  303. if {_p} has permission "{@PermVip}":
  304.  
  305. if size of {aHome.Home.%{_p}%::*} = {@LimiteHomeVip}:
  306.  
  307. send "%nl%{@PrEfixo} &7Você excedeu o limite de homes &9({@LimiteHomeVip})%nl%" to {_p}
  308.  
  309. else:
  310.  
  311. set {aHome.Home.%{_p}%::%{_n}%} to location of {_p}
  312. send "%nl%{@PrEfixo} &7Home &9%{_n}% &7setada com sucesso!%nl%" to {_p}
  313.  
  314. if {_p} has permission "{@PermMembro}":
  315.  
  316. if size of {aHome.Home.%{_p}%::*} = {@LimiteHomeMembro}:
  317.  
  318. send "%nl%{@PrEfixo} &7Você excedeu o limite de homes &9({@LimiteHomeMembro})%nl%" to {_p}
  319.  
  320. else:
  321.  
  322. set {aHome.Home.%{_p}%::%{_n}%} to location of {_p}
  323. send "%nl%{@PrEfixo} &7Home &9%{_n}% &7setada com sucesso!%nl%" to {_p}
  324.  
  325. else:
  326.  
  327. send "%nl%{@PrEfixo} &7Você não tem permissão para criar homes%nl%" to {_p}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement