Builder4Life

Untitled

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