Builder4Life

Untitled

Apr 12th, 2023
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.67 KB | None | 0 0
  1. options:
  2. prefix: &3&lᴋʙ
  3. chatc: &f
  4. chatc2: &b
  5.  
  6. on quit:
  7. if {kb::%player%} is set:
  8. wait 1 tick
  9. kbleave(player)
  10. send "{@prefix} &8» {@chatc2}%player% {@chatc}left the game" to {kblist.%{_cnt}%::*} and player
  11.  
  12. on join:
  13. if {kbWins::%uuid of player%} is not set:
  14. set {kbWins::%uuid of player%} to 0
  15. if {coins::%uuid of player%} is not set:
  16. set {coins::%uuid of player%} to 0
  17.  
  18. on command "kb":
  19. if {kb::%player%} is set:
  20. cancel event
  21. send "{@prefix} &8» {@chatc}You cannot acces this command ingame"
  22.  
  23. on command "spawn":
  24. if {kb::%player%} is set:
  25. cancel event
  26. send "{@prefix} &8» {@chatc}You cannot acces this command ingame"
  27.  
  28. command /leave:
  29. trigger:
  30. if {kb::%player%} is set:
  31. wait 1 tick
  32. kbleave(player)
  33. send "{@prefix} &8» {@chatc2}%player% {@chatc}left the game" to {kblist.%{_cnt}%::*} and player
  34. send title "{@chatc2}You left &3ɢᴀᴍᴇ %{_cnt}%" with subtitle "{@chatc}You have been teleported to the lobby" to player
  35. teleport player to {kb.lobby}
  36. else:
  37. send "{@prefix} &8» {@chatc}You currently are not in a game"
  38.  
  39. command /kb [<text>]:
  40. trigger:
  41. if arg-1 is not set:
  42. kbg(player)
  43. else:
  44. send "{@prefix} &8» {@chatc}Just use {@chatc2}/kb"
  45.  
  46. function kbg(pl: player):
  47. set {_kb} to a new chest inventory with 3 rows named "&3&lᴋʙ ɢᴀᴍᴇs"
  48. set slots (integers from 0 to 26) of {_kb} to light blue stained glass pane named "&7"
  49. wait 1 tick
  50. set {_slots} to 9
  51. set {_counter} to 0
  52. loop 7 times:
  53. add 1 to {_counter}
  54. add 1 to {_slots}
  55. if {kbstarted.%{_counter}%} is true:
  56. set slot {_slots} of {_kb} to red stained glass pane named "&3ɢᴀᴍᴇ &b%{_counter}%" with lore "&8&m &r", "&asᴛᴀʀᴛᴇᴅ" and "&7ᴘʟᴀʏᴇʀs: &b%size of {kblist.%{_counter}%::*}%"
  57. else:
  58. set slot {_slots} of {_kb} to lime stained glass pane named "&3ɢᴀᴍᴇ &b%{_counter}%" with lore "&8&m &r", "&cᴡᴀɪᴛɪɴɢ" and "&7ᴘʟᴀʏᴇʀs: &b%size of {kblist.%{_counter}%::*}%"
  59. if {kbWins::%uuid of {_pl}%} is set:
  60. set {_wins} to {kbWins::%uuid of {_pl}%}
  61. if {coins::%uuid of {_pl}%} is set:
  62. set {_coins} to {coins::%uuid of {_pl}%}
  63. set slot 4 of {_kb} to skull of ("%{_pl}%" parsed as offline player) named "&3&lᴘʟᴀʏᴇʀ: &b%{_pl}%" with lore "&8&m &r", "&3&lsᴛᴀᴛs:", " &bᴡɪɴs: &f%{_wins}%", " &bᴄᴏɪɴs: &f%{_coins}%", "", "&3&lɪɴғᴏ:", " &7You can buy custom &fᴀʙɪʟɪᴛɪᴇs", " &7with &fᴄᴏɪɴs &7or you can", " &7Buy them at our &f/shop", "" and "&bClick to open your &fᴀʙɪʟɪᴛɪᴇs &bmenu"
  64. open {_kb} to {_pl}
  65.  
  66. function kbabg(pl: player):
  67. set {_kbabg} to a new chest inventory with 5 rows named "&3&lᴋʙ ᴀʙɪʟɪᴛɪᴇs"
  68. set slots (integers from 0 to 45) of {_kbabg} to light blue stained glass pane named "&7"
  69. set slots (integers from 10 to 34) of {_kbabg} to air
  70. set slot 17, 18, 26 and 27 of {_kbabg} to light blue stained glass pane named "&7"
  71. set slot 13 of {_kbabg} to anvil named "&f&lsʜᴏᴘ" with lore "&8&m &r", "&bᴄᴏɪɴs: &f%{coins::%uuid of {_pl}%}%", "", "&7You can buy &fᴀʙɪʟɪᴛɪᴇs &7here", "&7With coins you earned ingame", "&7These little feautures" and "&7adds alot of fun into the game"
  72. set slot 40 of {_kbabg} to red stained glass pane named "&cʙᴀᴄᴋ"
  73. set {_sl1} to 19
  74. loop 5 times:
  75. add 1 to {_sl1}
  76. add 1 to {_cnt}
  77. set slot {_sl1} of {_kbabg} to white stained glass pane named "&3&lsʟᴏᴛ &b%{_cnt}%" with lore "", "&8This slot is currently empty", "&7You can buy custom &fᴀʙɪʟɪᴛɪᴇs", "&7with &fᴄᴏɪɴs &7or you can" and "&7Buy them at our &f/shop", "" and "&bᴄʟɪᴄᴋ ᴛᴏ sᴇʟᴇᴄᴛ ᴀɴ ɪᴛᴇᴍ"
  78. set {_sl} to 19
  79. set {_slc} to 0
  80. loop 5 times:
  81. add 1 to {_sl}
  82. add 1 to {_slc}
  83. if {kbabl.%{_slc}%.%{_pl}%} is set:
  84. set slot {_sl} of {_pl}'s inventory to {kbabl.%{_slc}%.%{_pl}%}
  85. open {_kbabg} to {_pl}
  86.  
  87. function kbshop(pl: player):
  88. set {_kbshop} to a new chest inventory with 5 rows named "&3&lᴋʙ sʜᴏᴘ"
  89. set slots (integers from 0 to 45) of {_kbshop} to light blue stained glass pane named "&7"
  90. set slots (integers from 10 to 34) of {_kbshop} to air
  91. set slot 17, 18, 26 and 27 of {_kbshop} to light blue stained glass pane named "&7"
  92. set slot 40 of {_kbshop} to red stained glass pane named "&cʙᴀᴄᴋ"
  93. open {_kbshop} to {_pl}
  94.  
  95. function kbabs(pl: player, ct: integer):
  96. set {_kbabs} to a new chest inventory with 5 rows named "&3&lᴋʙ sʟᴏᴛ: &b%{_ct}%"
  97. set slots (integers from 0 to 45) of {_kbabs} to light blue stained glass pane named "&7"
  98. set slots (integers from 10 to 34) of {_kbabs} to air
  99. set slot 17, 18, 26 and 27 of {_kbabs} to light blue stained glass pane named "&7"
  100. set slot 40 of {_kbabs} to red stained glass pane named "&cʙᴀᴄᴋ"
  101. open {_kbabs} to {_pl}
  102.  
  103. function kb(pl: player, ct: integer):
  104. if {kb::%{_pl}%} is not set:
  105. set {kb::%{_pl}%} to {_ct}
  106. set {kblist.%{_ct}%::%{_pl}%} to {_pl}
  107. set {kbcnt.%{_ct}%} to false
  108. apply slowness 2 without particles to {_pl} for 4 seconds
  109. apply blindness 2 without particles to {_pl} for 4 seconds
  110. teleport {_pl} to {kbSpw.%{_ct}%}
  111. clear {_pl}'s inventory
  112. set slots (integers from 3 to 7) of {_pl}'s inventory to white stained glass pane named "&f&lɴᴏɴᴇ" with lore "", "&7You can buy custom &fᴀʙɪʟɪᴛɪᴇs", "&7with &fᴄᴏɪɴs &7or you can" and "&7Buy them at our &f/shop"
  113. set slot 1 of {_pl}'s inventory to stick of knockback 3 with all flags hidden named "&a&lsʟᴀᴘ ᴍᴀᴄʜɪɴᴇ" with lore "", "&7Goodluck clapping people" and "&7More fun coming soon ;)"
  114. set slot 9 of {_pl}'s inventory to arrow with all flags hidden named "&7"
  115. set {_sl} to 2
  116. loop 5 times:
  117. add 1 to {_slc}
  118. add 1 to {_sl}
  119. if {kbabl.%{_slc}%.%{_pl}%} is set:
  120. set slot {_sl} of {_pl}'s inventory to {kbabl.%{_slc}%.%{_pl}%}
  121. send "{@prefix} &8» {@chatc2}%{_pl}% {@chatc}joined the game" to {kblist.%{_ct}%::*}
  122. send title "{@chatc2}You joined &3ɢᴀᴍᴇ %{_ct}%" with subtitle "{@chatc}current players {@chatc2}%size of {kblist.%{_ct}%::*}%" to {_pl}
  123. if {kbplct.%{_ct}%} is false:
  124. set {kbplct.%{_ct}%} to true
  125. while {kbplct.%{_ct}%} is true:
  126. send action bar "&3ᴄᴜʀʀᴇɴᴛ ᴘʟᴀʏᴇʀs: &b%size of {kblist.%{_ct}%::*}%" to {kblist.%{_ct}%::*}
  127. wait 1 second
  128. if size of {kblist.%{_ct}%::*} >= 2:
  129. set {kbplct.%{_ct}%} to false
  130. kbstart({_ct})
  131.  
  132. function kbwin(gm: integer):
  133. set {kbstarted.%{_gm}%} to false
  134. delete {kblist.%{_gm}%::*}
  135. delete {kb::%{kblist.%{_gm}%::*}%}
  136. add 1 to {kbWins::%uuid of {kblist.%{_gm}%::*}%}
  137. teleport {kblist.%{_gm}%::*} to {kb.lobby}
  138. send title "{@chatc2}You won &3ɢᴀᴍᴇ %{_gm}%" with subtitle "{@chatc}Goodjob ;)" to {kblist.%{_gm}%::*}
  139. apply slowness 2 without particles to {kblist.%{_gm}%::*} for 4 seconds
  140. apply blindness 2 without particles to {kblist.%{_gm}%::*} for 4 seconds
  141. broadcast "&3&m "
  142. broadcast ""
  143. broadcast "&b%{kblist.%{_gm}%::*}% &fJust won &bGame %{_gm}% &fin kb"
  144. broadcast ""
  145. broadcast "&3&m "
  146.  
  147. function kbstart(gm: integer):
  148. if {kbcnt.%{_gm}%} is false:
  149. set {kbcnt.%{_gm}%} to true
  150. set {kb.count.%{_gm}%} to 6
  151. while {kbcnt.%{_gm}%} is true:
  152. remove 1 from {kb.count.%{_gm}%}
  153. send title "{@prefix} starting in.." with subtitle "{@chatc2}%{kb.count.%{_gm}%}%" to {kblist.%{_gm}%::*}
  154. if {kb.count.%{_gm}%} = 0:
  155. set {kbcnt.%{_gm}%} to false
  156. send title "{@prefix} started" with subtitle "{@chatc2}Goodluck" to {kblist.%{_gm}%::*}
  157. set {kbstarted.%{_gm}%} to true
  158. wait 1 second
  159.  
  160. function inv(pl: player, sl: integer, ct: integer):
  161. if {kbSpw.%{_ct}%} is set:
  162. if {kb.lobby} is set:
  163. if lore of slot {_sl} of {_pl}'s current inventory contains "&cᴡᴀɪᴛɪɴɢ":
  164. kb({_pl}, {_ct})
  165. else:
  166. send "{@prefix} &8» {@chatc}This game is already started" to {_pl}
  167. else:
  168. send "{@prefix} &8» {@chatc}Contact the staff team to setup the lobby" to {_pl}
  169. else:
  170. send "{@prefix} &8» {@chatc}Contact the staff team to set the spawn for this game" to {_pl}
  171. close {_pl}'s inventory
  172.  
  173. function kbleave(pl: player):
  174. set {_ct} to {kb::%{_pl}%}
  175. delete {kb::%{_pl}%}
  176. delete {kblist.%{_ct}%::%{_pl}%}
  177. clear {_pl}'s inventory
  178. heal {_pl}
  179. feed {_pl}
  180. if {kbstarted.%{_ct}%} is false:
  181. if {kblist.%{_ct}%::%{_pl}%} is not set:
  182. set {kbplct.%{_ct}%} to false
  183. if size of {kblist.%{_ct}%::*} < 2:
  184. set {kbcnt.%{_nmb}%} to false
  185. if {kbstarted.%{_nmb}%} is true:
  186. if size of {kblist.%{_nmb}%::*} = 1:
  187. kbwin({_ct})
  188.  
  189. command /kbset [<text>] [<integer>]:
  190. permission: kb.set
  191. trigger:
  192. if arg-1 is "spawn":
  193. if arg-2 is set:
  194. set {kbSpw.%arg-2%} to player's position
  195. set yaw of {kbSpw.%arg-2%} to player's yaw
  196. set pitch of {kbSpw.%arg-2%} to player's pitch
  197. send "{@prefix} &8» {@chatc}The spawn for {@chatc2}Game %arg-2% {@chatc}has been set"
  198. else:
  199. send "{@prefix} &8» {@chatc}Make sure to select a game between 1-7"
  200.  
  201. if arg-1 is "lobby":
  202. set {kb.lobby} to player's position
  203. set yaw of {kb.lobby} to player's yaw
  204. set pitch of {kb.lobby} to player's pitch
  205. send "{@prefix} &8» {@chatc}The {@chatc2}Lobby {@chatc}has been set"
  206.  
  207. if arg-1 is not set:
  208. send "{@prefix} &8» {@chatc}Specify what you want to set"
  209.  
  210. on tab complete of "/kbset":
  211. set tab completions for position 1 to "spawn" and "lobby"
  212. if tab arg-1 = "spawn":
  213. set tab completions for position 2 to 1, 2, 3, 4, 5, 6 and 7
  214.  
  215. command /kbunset [<text>] [<integer>]:
  216. permission: kb.set
  217. trigger:
  218. if arg-1 is "spawn":
  219. if arg-2 is set:
  220. delete {kbSpw.%arg-2%}
  221. send "{@prefix} &8» {@chatc}The spawn for {@chatc2}Game %arg-2% {@chatc}has been unset"
  222. else:
  223. send "{@prefix} &8» {@chatc}Make sure to select a game between 1-7"
  224.  
  225. if arg-1 is "lobby":
  226. delete {kb.lobby}
  227. send "{@prefix} &8» {@chatc}The {@chatc2}Lobby {@chatc}has been unset"
  228.  
  229. if arg-1 is not set:
  230. send "{@prefix} &8» {@chatc}Specify what you want to set"
  231.  
  232. on tab complete of "/kbunset":
  233. set tab completions for position 1 to "spawn" and "lobby"
  234. if tab arg-1 = "spawn":
  235. set tab completions for position 2 to 1, 2, 3, 4, 5, 6 and 7
  236.  
  237. on death:
  238. if {kb::%victim%} is set:
  239. cancel event
  240. wait 1 tick
  241. kbleave(victim)
  242. apply slowness 2 without particles to victim for 4 seconds
  243. apply blindness 2 without particles to victim for 4 seconds
  244. teleport victim to {kb.lobby}
  245. send title "{@chatc2}You died" with subtitle "{@chatc}You have been teleported to the lobby" to victim
  246.  
  247. on drop:
  248. if {kb::%player%} is set:
  249. cancel event
  250.  
  251. on inventory click:
  252. if name of event-inventory contains "&3&lᴋʙ ɢᴀᴍᴇs":
  253. cancel event
  254. if index of event-slot = 10:
  255. inv(player, 10, 1)
  256. if index of event-slot = 11:
  257. inv(player, 11, 2)
  258. if index of event-slot = 12:
  259. inv(player, 12, 3)
  260. if index of event-slot = 13:
  261. inv(player, 13, 4)
  262. if index of event-slot = 14:
  263. inv(player, 14, 5)
  264. if index of event-slot = 15:
  265. inv(player, 15, 6)
  266. if index of event-slot = 16:
  267. inv(player, 16, 7)
  268. if index of event-slot = 4:
  269. kbabg(player)
  270.  
  271. if name of event-inventory contains "&3&lᴋʙ ᴀʙɪʟɪᴛɪᴇs":
  272. cancel event
  273. if index of event-slot = 40:
  274. kbg(player)
  275. if index of event-slot = 13:
  276. kbshop(player)
  277.  
  278. if index of event-slot = 20:
  279. kbabs(player, 1)
  280. if index of event-slot = 21:
  281. kbabs(player, 2)
  282. if index of event-slot = 22:
  283. kbabs(player, 3)
  284. if index of event-slot = 23:
  285. kbabs(player, 4)
  286. if index of event-slot = 24:
  287. kbabs(player, 5)
  288.  
  289. if name of event-inventory contains "&3&lᴋʙ sʟᴏᴛ":
  290. cancel event
  291. if index of event-slot = 40:
  292. kbabg(player)
  293.  
  294. if name of event-inventory contains "&3&lᴋʙ sʜᴏᴘ":
  295. cancel event
  296. if index of event-slot = 40:
  297. kbabg(player)
  298.  
  299. on place of white glass pane:
  300. if {kb::%player%} is set:
  301. cancel event
  302.  
  303. on inventory click:
  304. if {kb::%player%} is set:
  305. if event-inventory is player's inventory:
  306. cancel event
  307.  
  308. command /reset:
  309. trigger:
  310. send "reset"
  311. delete {kblist.1::*}
  312. set {kbstarted.1} to false
Add Comment
Please, Sign In to add comment