Guest User

Untitled

a guest
May 5th, 2021
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 114.71 KB | None | 0 0
  1. #
  2. # Free to use for everyone but please don't remove my credit
  3. # Made with love by bonnie20402
  4. # Thank you!
  5. #
  6.  
  7. options:
  8. hw: ul_hockeyarena # Change this value to your rink's world
  9. gkreach: 0.65 # dont messs with this
  10. guild: 810835874001453056 # ignore this
  11. token: - # ignore
  12. bot: bhlbot # ignore this too
  13. chat: 813410558648516689 # ignore this too
  14. resource: https://download.mc-packs.net/pack/0b45349eef67c6a997fcf616a17c657765b13dac.zip # texture pack link
  15. resourcehash: 0b45349eef67c6a997fcf616a17c657765b13dac # texture pack sha-1
  16. immune: 0.2 # Immune time
  17. dir: EnderHockeyLeague/TeamData # dir of team creator data
  18. discordlink: https://discord.gg/XwRUpGw5nr # put ur disco link here
  19.  
  20. on command:
  21. command is "pl" or "plugins" or "bukkit:pl" or "bukkit:plugins" or "me" or "minecraft:me"
  22. sender is player
  23. player is not op
  24. Credits(player)
  25. cancel event
  26. command /credits:
  27. trigger:
  28. Credits(player)
  29. function Credits(p:player):
  30. send "" to {_p}
  31. send "&aMade with love by Bonnie20402" to {_p}
  32. send "&aAll the textures were made by &e_frostbyte_" to {_p}
  33. send "&aInspired on BHL and HHCO" to {_p}
  34. send "" to {_p}
  35. on chat:
  36. set message format to "%colored prefix of player% &7%player%:&f %message%"
  37. function NewClip():
  38. set {isreplay} to false
  39. loop all players in world "{@hw}":
  40. loop-player is not {awaygoalie::player} or {homegoalie::player}
  41. add loop-player to {_replay::*}
  42. set {_rep} to "%{_replay::*}%"
  43. replace all "," with "" in {_rep}
  44. make console execute command "replay delete ehl"
  45. make console execute command "replay start ehl %{_rep}%"
  46. clear {puckpos::*}
  47. clear {awaypos::*}
  48. clear {homepos::*}
  49. clear {awaypose::*}
  50. clear {homepose::*}
  51. set {isreplay} to true #
  52. set {lastclip} to now
  53. while {isreplay} is true:
  54. wait a tick
  55. if {goalieai} is true: # #
  56. add location of {puck} to {puckpos::*} #
  57. add location of {awaygoalie} to {awaypos::*}
  58. add location of {homegoalie} to {homepos::*}
  59. add {awaygoalienbt} to {awaypose::*}
  60. add {homegoalienbt} to {homepose::*}
  61. if difference between {lastclip} and now > 25 seconds:
  62. if {goalieai} is true:
  63. set {_repeat} to true
  64. set {isreplay} to false
  65.  
  66. make console execute command "replay stop ehl"
  67. if {_repeat} is true:
  68. NewClip()
  69. on right click on any trapdoor:
  70. player is not op
  71. cancel event
  72. function RunReplay():
  73. loop all players in world "{@hw}":
  74. set {_loc.%loop-player%} to location of loop-player
  75. set {game::status} to "Goal"
  76. loop all players:
  77. loop-player is in world "{@hw}":
  78. set {_loc.%loop-player%} to location of loop-player
  79. send title "&a&lREPLAY" with subtitle "" to loop-player for 3 seconds
  80. add "replay.command.play" to permission of loop-player
  81. make loop-player execute command "replay play ehl"
  82. remove "replay.command.play" from permission of loop-player
  83. SyncAwayPos()
  84. SyncAwayPose()
  85. SyncHomePos()
  86. SyncHomePose()
  87. loop {puckpos::*}:
  88. wait a tick
  89. teleport {puck} to loop-value
  90. wait 9 seconds
  91. set {game::status} to "Out of play"
  92. if {game::period} = 4:
  93. ResetPG({awaygoalie::player})
  94. ResetPG({homegoalie::player})
  95. set {game::status} to "Waiting"
  96. set {game::period} to 1
  97. loop all players in world "{@hw}":
  98. teleport loop-player to {_loc.%loop-player%}
  99. function SyncAwayPos():
  100. loop {awaypos::*}:
  101. wait a tick
  102. teleport {awaygoalie} to loop-value
  103. function SyncAwayPose():
  104. loop {awaypose::*}:
  105. wait a tick
  106. add loop-value to nbt of {awaygoalie}
  107. function SyncHomePose():
  108. loop {homepose::*}:
  109. wait a tick
  110. add loop-value to nbt of {homegoalie}
  111. function SyncHomePos():
  112. loop {homepos::*}:
  113. wait a tick
  114. teleport {homegoalie} to loop-value #
  115. on right click on armor stand:
  116. player is not op
  117. cancel event
  118.  
  119. function LoadData(p:player): # ignore this function it was used for discord auth/link
  120. deop {_p}
  121. set gamemode of {_p} to survival
  122. clear groups of {_p}
  123. set group of {_p} to "default"
  124. make console execute command "sn teleport lobby %{_p}%"
  125. send "&aTeleported to the lobby" to {_p}
  126. send "&aLoading discord data..." to {_p}
  127. wait 15 ticks
  128. set {_id} to {discord::%{_p}%::id}
  129. if {_id} is not set:
  130. send "&cERROR &a- Account not linked. Please use &9/link &aand join our discord using &9/discord&a in order to be ranked, then rejoin to apply changes. You have been set as a fan." to {_p}
  131. stop
  132. retrieve user with id "%{_id}%" and store the user in {_user}
  133. if {_user} is set:
  134. if {_user} in guild with id "{@guild}" has role role with id "810835961956663307":
  135. send "&aYou are a developer, aren't you? If you are not, i don't know how you have this rank. Seriously, how you get here? What are you doing?" to {_p}
  136. set group of {_p} to "Developer"
  137. op {_p}
  138. stop
  139. if {_user} in guild with id "{@guild}" has role role with id "810836570880868362":
  140. send "&aYou are the league owner." to {_p}
  141. set group of {_p} to "Owner"
  142. op {_p}
  143. stop
  144. if {_user} in guild with id "{@guild}" has role role with id "810836719187394570":
  145. send "&aYou are a part of the league staff. Applied staff rank." to {_p}
  146. set group of {_p} to "Staff"
  147. stop
  148. if {_user} in guild with id "{@guild}" has role role with id "810836879011610636":
  149. send "&aYou are a team captain or alt captain. Applied captain rank." to {_p}
  150. set group of {_p} to "Captain"
  151. stop
  152. send "&aYou are not in a team, but you are in the &9Discord&a. Applied Free Agent rank." to {_p}
  153. set group of {_p} to "FreeAgent"
  154. function NextShootoutPlayer(goal:boolean = false):
  155. {game::status} = "Shootouts"
  156. set {game::status} to "Out of play"
  157. set {game::status} to "Shootouts"
  158. set {_quem} to {game::shootouts::nextshot}
  159. teleport {game::shootouts::player} to {bhl::awaybench} if {game::teams::away::*} contains {game::shootouts::player}
  160. teleport {game::shootouts::player} to {bhl::homebench} if {game::teams::home::*} contains {game::shootouts::player}
  161. set {game::shootouts::nextshot} to "away" if {_quem} = "home"
  162. set {game::shootouts::nextshot} to "home" if {_quem} = "away"
  163. if {game::shootouts::wasgoalie} is true:
  164. NewPG({game::shootouts::player},"awaypg") if {game::away::members::*} contains {game::shootouts::player}
  165. NewPG({game::shootouts::player},"homepg") if {game::home::members::*} contains {game::shootouts::player}
  166. delete {game::shootouts::player}
  167. if {_goal} is true:
  168. broadcast ""
  169. broadcast "&aIt's a goal!"
  170. broadcast ""
  171. add 1 to {game::away::goals} if {game::shootouts::nextshot} = "away"
  172. add 1 to {game::home::goals} if {game::shootouts::nextshot} = "home"
  173. play sound {teams::%{game::away::team}%::horn} at volume 0.3 for all players in world "{@hw}" if {game::shootouts::nextshot} = "away"
  174. play sound {teams::%{game::home::team}%::horn} at volume 0.3 for all players in world "{@hw}" if {game::shootouts::nextshot} = "home"
  175. wait 8 seconds
  176. wait 5 seconds
  177. add 1 to {game::shootouts::taken}
  178. set {-pv} to vector(0,0,0)
  179. teleport {puck} to {bhl::center}
  180. set {goalieai} and {inplay} to true
  181. stop sound {teams::%{game::home::team}%::horn} for all players
  182. stop sound {teams::%{game::away::team}%::horn} for all players
  183. if {game::shootouts::taken} < 7:
  184. if size of {game::shootouts::hometeam::*} and {game::shootouts::awayteam::*} are 0:
  185. RebuildShootoutTeams()
  186. if {game::shootouts::nextshot} = "away":
  187. set {_next} to a random element out of {game::shootouts::hometeam::*}
  188. remove {_next} from {game::shootouts::hometeam::*}
  189. if {game::shootouts::nextshot} = "home":
  190. set {_next} to a random element out of {game::shootouts::awayteam::*}
  191. remove {_next} from {game::shootouts::awayteam::*}
  192. set {game::shootouts::player} to {_next}
  193. set {game::shootouts::wasgoalie} to false
  194. set {game::shootouts::wasgoalie} to true if {game::shootouts::player} is {awaygoalie::player} or {homegoalie::player}
  195. if {game::shootouts::wasgoalie} is true:
  196. set {awaygoalie::player} to "AI" if {game::away::members::*} contains {game::shootouts::player}
  197. ResetHitboxes({awaygoalie}) if {game::away::members::*} contains {game::shootouts::player}
  198. EquipPlayer({_next}) if {game::away::members::*} contains {game::shootouts::player}
  199. set {homegoalie::player} to "AI" if {game::home::members::*} contains {game::shootouts::player}
  200. ResetHitboxes({homegoalie}) if {game::home::members::*} contains {game::shootouts::player}
  201. EquipPlayer({_next}) if {game::home::members::*} contains {game::shootouts::player}
  202. broadcast ""
  203. broadcast "&aThe next player to shot is &e%{_next}%"
  204. broadcast ""
  205. teleport {_next} to {bhl::center}
  206. set {game::shootouts::timer} to now
  207. while {game::shootouts::player} is set:
  208. wait a tick
  209. set {game::shootouts::nextshot} to "home" if {game::away::members::*} contains {game::shootouts::player}
  210. set {game::shootouts::nextshot} to "away" if {game::home::members::*} contains {game::shootouts::player}
  211. if difference between {game::shootouts::timer} and now > 15 seconds:
  212. broadcast ""
  213. broadcast "&aThe player failed to commit the play!"
  214. broadcast ""
  215. NextShootoutPlayer()
  216. else:
  217. if {game::away::goals} > {game::home::goals}:
  218. broadcast ""
  219. broadcast "&aAnd thats it! The %coloured {teams::%%{game::away::team}%%::name}% &awon here in shootouts!"
  220. broadcast ""
  221. set {goalieai} and {inplay} to false
  222. play sound {teams::%{game::away::team}%::horn} for all players in world "{@hw}"
  223. set {game::Status} to "Waiting"
  224. else if {game::away::goals} < {game::home::goals}:
  225. broadcast ""
  226. broadcast "&aAnd that's it! The %coloured {teams::%%{game::home::team}%%::name}% &awon here in the overtime!"
  227. broadcast ""
  228. set {goalieai} and {inplay} to false
  229. play sound {teams::%{game::home::team}%::horn} for all players in world "{@hw}"
  230. set {game::Status} to "Waiting"
  231. else:
  232. Shootouts()
  233.  
  234.  
  235. function RebuildShootoutTeams():
  236. set {game::shootouts::awayteam::*} to {game::away::members::*}
  237. set {game::shootouts::hometeam::*} to {game::home::members::*}
  238. loop {game::away::members::*}:
  239. teleport loop-value to {bhl::awaybench} if loop-value is not {awaygoalie::player}
  240. loop {game::home::members::*}:
  241. teleport loop-value to {bhl::homebench} if loop-value is not {homegoalie::player}
  242. function RebuildShootoutAway():
  243. set {game::shootouts::awayteam::*} to {game::away::members::*}
  244. loop {game::away::members::*}:
  245. teleport loop-value to {bhl::awaybench} if loop-value is not {awaygoalie::player}
  246. function RebuildShootoutHome():
  247. set {game::shootouts::hometeam::*} to {game::home::members::*}
  248. loop {game::home::members::*}:
  249. teleport loop-value to {bhl::homebench} if loop-value is not {homegoalie::player}
  250. function Shootouts():
  251. clear {game::shootouts::awayteam::*}
  252. clear {game::shootouts::hometeam::*}
  253. set {game::shootouts::awayteam::*} to {game::away::members::*}
  254. set {game::shootouts::hometeam::*} to {game::home::members::*}
  255. loop {game::away::members::*}:
  256. teleport loop-value to {bhl::awaybench} if loop-value is not {awaygoalie::player}
  257. loop {game::home::members::*}:
  258. teleport loop-value to {bhl::homebench} if loop-value is not {homegoalie::player}
  259. if {game::status} is "Shootouts":
  260. set {-pv} to vector(0,0,0)
  261. teleport {puck} to {bhl::center}
  262. set {goalieai} and {inplay} to true
  263. set {game::shootouts::taken} to 0
  264. set {game::shootouts::timer} to now
  265. set {game::shootouts::nextshot} to "home"
  266. NextShootoutPlayer()
  267.  
  268.  
  269.  
  270.  
  271. command /startgame:
  272. trigger:
  273. world of player is "{@hw}"
  274. if {game::status} = "Waiting":
  275. #(size of {game::away::members::*} + {game::home::members::*} > 1
  276. set {game::status} to "Out of play"
  277. ResetPG({awaygoalie::player})
  278. ResetPG({homegoalie::player})
  279. set {game::status} to "Starting"
  280. set {game::time::min} to 1
  281. set {game::time::sec} to 0
  282. teleport {puck} to {bhl::center}
  283. set {onplay} to false
  284. set {goalieai} to false
  285. set {isreplay} to false
  286. set {_acap} to a random element out of {game::away::members::*}
  287. set {_hcap} to a random element out of {game::home::members::*}
  288. broadcast "&eThe next game will start in &c1&e minute. The captains are&7 %{_acap}%&e and &7%{_hcap}%"
  289. SelectTeam({_acap},"away")
  290. SelectTeam({_hcap},"home")
  291. every second:
  292. if {game::status} is not "Out of play":
  293. if {game::time::min} > 0:
  294. if {game::time::sec} is 0:
  295. subtract 1 from {game::time::min}
  296. set {game::time::sec} to 60
  297.  
  298. every second:
  299. if {game::time::sec} > 0:
  300. if {game::status} is not "Out of play" or "Waiting" or "Goal" or "Shootouts":
  301. subtract 1 from {game::time::sec}
  302. if {game::time::min} = 0:
  303. if {game::time::sec} = 30:
  304. if {game::status} is "Starting" or "In-Game":
  305. broadcast "&eThe timer will end in &c30&e seconds"
  306. if {game::time::sec} = 15:
  307. if {game::status} is "Starting" or "In-Game":
  308. broadcast "&eThe timer will end in &c15&e seconds"
  309. if {game::time::min} and {game::time::sec} = 0:
  310. if {game::status} is "Intermission":
  311. set {game::status} to "Out of play"
  312.  
  313. play sound "minecraft:buzzer" to all players in world "{@hw}"
  314. broadcast "&eThe game is starting now..."
  315. set {game::status} to "In-game" if {game::period} = 5
  316. delete {pen::*} if {game::period} = 5
  317. set {game::status} to "Shootouts" if {game::period} = 5
  318. send title "&a&lSHOOTOUTS" with subtitle "&eWe are moving our game into shootouts!" to all players in world "{@hw}" if {game::period} = 5
  319. Shootouts()
  320. if {game::period} = 1:
  321. set {game::away::goals} to 0
  322. set {game::home::goals} to 0
  323. set {game::time::min} to 5
  324. if {game::period} is 4:
  325. set {game::time::min} to 3
  326. RespawnPuck("center")
  327. if {game::status} is "In-game":
  328. if {game::period} = 3:
  329. if {game::away::goals} > {game::home::goals}:
  330. set {game::period} to 1
  331. set {game::status} to "Waiting"
  332. set {goalieai} to false
  333. set {inplay} to false
  334. play sound "minecraft:buzzer" to all players in world "{@hw}"
  335. Goal("away",true)
  336. send title "&a&lFINISH" with subtitle "&bAway team&e won the game!" to all players in world "{@hw}"
  337. stop
  338. if {game::home::goals} > {game::away::goals}:
  339. set {game::period} to 1
  340. set {game::status} to "Waiting"
  341. set {goalieai} to false
  342. set {inplay} to false
  343. play sound "minecraft:buzzer" to all players in world "{@hw}"
  344. Goal("home",true)
  345. send title "&a&lFINISH" with subtitle "&aHome team&e won the game!" to all players in world "{@hw}"
  346. stop
  347. if {game::period} < 6:
  348. add 1 to {game::period}
  349. set {game::status} to "Out of play"
  350. set {goalieai} to false
  351. set {inplay} to false
  352. set {isreplay} to false
  353. delete {puckowner}
  354. play sound "minecraft:buzzer" to all players in world "{@hw}"
  355. send title "&a&lFINISH" with subtitle "&eThere will be a short intermission before the next period" to all players in world "{@hw}"
  356. broadcast ""
  357. broadcast "&a&lGAME STATS"
  358. broadcast ""
  359. broadcast "%coloured {teams::%{game::away::team}%::name}% &f%{game::away::goals}%"
  360. broadcast "%coloured {teams::%{game::home::team}%::name}% &f%{game::home::goals}%"
  361. broadcast ""
  362. set {game::status} to "Intermission"
  363. Commentator("intermission")
  364. set {game::time::sec} to 45
  365. if {game::status} = "Starting":
  366. set {game::status} to "Out of play"
  367. set {game::time::min} to 5
  368. set {game::period} to 1
  369. set {game::away::goals} to 0
  370. set {game::home::goals} to 0
  371. RespawnPuck("center")
  372. function AssignTeam(p:player):
  373. remove {_p} from {game::away::members::*} and {game::home::members::*}
  374. if size of {game::away::members::*} > size of {game::home::members::*}:
  375. {game::away::members::*} and {game::home::members::*} do not contain {_p}
  376. add {_p} to {game::home::members::*}
  377. send "&eYou are on the %coloured {teams::%{game::home::team}%::name}%&e team!" to {_p}
  378. EquipPlayer({_p})
  379. teleport {_p} to {bhl::homebench}
  380. if size of {game::away::members::*} < size of {game::home::members::*}:
  381. {game::away::members::*} and {game::home::members::*} do not contain {_p}
  382. add {_p} to {game::away::members::*}
  383. send "&eYou are on the %coloured {teams::%{game::away::team}%::name}%&e team!" to {_p}
  384. EquipPlayer({_p})
  385. teleport {_p} to {bhl::awaybench}
  386. if size of {game::away::members::*} = size of {game::home::members::*}:
  387. {game::away::members::*} and {game::home::members::*} do not contain {_p}
  388. add {_p} to {game::away::members::*}
  389. send "&eYou are on the %coloured {teams::%{game::away::team}%::name}%&e team!" to {_p}
  390. EquipPlayer({_p})
  391. teleport {_p} to {bhl::awaybench} #
  392. send "&aPlease download the texture pack at our &9Discord&a server!" to {_p}
  393. on rightclick: #armor gk
  394. target entity of player is {awaygoalie} or {homegoalie}
  395. tool of player is not {bhl::goaliecontrol}
  396. cancel event
  397. on swapping of held item:
  398. cancel event
  399. tool of player is {bhl::stick}
  400. difference between {deke::%player%::last} and now > 0.5 second
  401. set {deke::%player%::last} to now
  402. if {deke::%player%} is "center":
  403. set {deke::%player%} to "left"
  404. send action bar "&aDeking direction: &e&LLEFT" to player
  405. stop
  406. if {deke::%player%} is "left":
  407. set {deke::%player%} to "right"
  408. send action bar "&aDeking direction: &e&lRIGHT" to player
  409. stop
  410. if {deke::%player%} is "right":
  411. set {deke::%player%} to "center"
  412. send action bar "&aDeking direction: &e&lCENTER" to player
  413. on drop:
  414. "%region at player%" contains "puckarea"
  415. gamemode of player is not creative
  416. cancel event
  417. function ResetPG(p:player):
  418. {_p} is not "AI"
  419. if {_p} is {awaygoalie::player}:
  420. while {game::status} is not "Out of play" or "Warmup" or "Intermission":
  421. wait a tick
  422. send action bar "&aWaiting for out of play to perform action..." to {_p}
  423. set {awaygoalie::player} to "AI"
  424. broadcast ""
  425. broadcast "&6[!] &eThe &baway goalie&e has been reset!"
  426. broadcast ""
  427. ResetHitboxes({awaygoalie})
  428. EquipPlayer({_p})
  429. send action bar "&aDone!" to {_p}
  430. wait a tick
  431. set walking speed of {_p} to 0.2
  432. if {_p} is {homegoalie::player}:
  433. while {game::status} is not "Out of play" or "Warmup" or "Shootouts":
  434. wait a tick
  435. send action bar "&aWaiting for out of play to perform action..." to {_p}
  436. set {homegoalie::player} to "AI"
  437. send action bar "&aDone!" to {_p}
  438. broadcast ""
  439. broadcast "&6[!] &eThe &ahome goalie&e has been reset!"
  440. broadcast ""
  441. ResetHitboxes({homegoalie})
  442. EquipPlayer({_p})
  443. wait a tick
  444. set walking speed of {_p} to 0.2
  445. command /quitgoalie:
  446. trigger:
  447. if player is {awaygoalie::player} or {homegoalie::player}:
  448. ResetPG(player)
  449. else:
  450. send "&aYou aren't a goalie!"
  451.  
  452. command /seasongame:
  453. permission: hockey.season
  454. permission message: &cYou must be a Alt captain or higher game rank to setup a season game.
  455. trigger:
  456. if {game::seasoned} is false:
  457. set {game::seasoned} to true
  458. broadcast "&aThis game has been seasoned by %player% - New players won't be automatically assigned to teams anymore. Goalies locked"
  459. stop
  460. else:
  461. set {game::seasoned} to false
  462. broadcast "&aThis game has been unseasoned by %player% - New players will be automatically assigned to teams. Goalies unlocked"
  463. stop
  464. command /goalie:
  465. trigger:
  466. world of player is "{@hw}"
  467. if {game::away::members::*} contains player:
  468. if {awaygoalie::player} is "AI":
  469. while {game::status} is not "Out of play" or "Warmup":
  470. wait a tick
  471. send action bar "&aWaiting for out of play to perform action..." to player
  472. send action bar "&aApplying action..." to player
  473. wait 1 seconds
  474. NewPG(player,"awaypg")
  475. wait 1 second
  476. EquipPlayer(player)
  477. else:
  478. send "&aThere is already someone playing as the away goalie."
  479. if {game::home::members::*} contains player:
  480. if {homegoalie::player} is "AI":
  481. while {game::status} is not "Out of play" or "Warmup":
  482. wait a tick
  483. send action bar "&aWaiting for out of play to perform action..." to player
  484. send action bar "&aApplying action..." to player
  485. wait 1 seconds
  486. NewPG(player,"homepg")
  487. wait 1 second
  488. EquipPlayer(player)
  489. else:
  490. send "&aThere is already someone playing as the home goalie."
  491. command /stopplay:
  492. permission: staff.settime
  493. permission message: &cYou must be a member of the league's staff to manage game status
  494. trigger:
  495. if {game::status} is "Goal":
  496. send "&cPlease wait for the replay to finish first!"
  497. stop
  498. if {game::status} is "In-game":
  499. set {game::status} to "Out of play"
  500. broadcast "&c&lWARNING: %prefix of player% &c%player% &estopped the play."
  501. set {goalieai} and {inplay} to false
  502. delete {puckowner}
  503. send "&aRespawn the puck using &e/arp"
  504. command /settime [<text>] [<integer>]:
  505. permission: staff.settime
  506. permission message: &cYou must be a member of the league's staff to manage game's time
  507. trigger:
  508. if arg 2 is not set:
  509. send ""
  510. send "&a&lChange time"
  511. send ""
  512. send "&7/settime <min/sec> <value>"
  513. send ""
  514. if arg 2 is set:
  515. if arg 1 is "min":
  516. set {game::time::min} to arg-2
  517. broadcast "&c&lWARNING: &c%coloured prefix of player% &c%player% updated the Timer's minutes to &7%arg-2%"
  518. if arg 1 is "sec":
  519. set {game::time::sec} to arg-2
  520. broadcast "&c&lWARNING: &c%coloured prefix of player% &c%player% updated the Timer's seconds to &7%arg-2%"
  521. command /updatestats [<text>] [<text>] [<integer>]:
  522. permission: staff.updatestats
  523. permission message: &CYou must be a member of the league's staff to manage team's stats
  524. trigger:
  525. if arg-3 is not set:
  526. send ""
  527. send "&a&lUpdate Stats"
  528. send ""
  529. send "&7/updatestats <teamshort> wins/loses/losesot <value>"
  530. send ""
  531. send "&7&o(e.g /updatestats FAZ wins 30)"
  532. send "&7&obig news abusing this will result in demotion ^^"
  533. if arg 3 is set:
  534. if arg 2 is "wins":
  535. set yaml value "wins" from "teamdata.%arg-1%" to arg-3
  536. send "&aStat &eWINS&a updated" #
  537. if arg 2 is "loses":
  538. set yaml value "loses" from "teamdata.%arg-1%" to arg-3
  539. send "&aStat &eLosses&a updated"
  540. if arg 2 is "losesot":
  541. set yaml value "losesot" from "teamdata.%arg-1%" to arg-3
  542. send "&aStat &elosesot&a updated"
  543. save yaml "teamdata.%arg-1%"
  544. LoadTeams()
  545. command /team [<text>] [<text>] [<text>]:
  546. permission: staff.createteam
  547. permission message: &cYou must be staff or developer to use this command!
  548. trigger:
  549. if arg 2 is not set:
  550. send ""
  551. send "&a&lTeam Creator System"
  552. send ""
  553. send ""
  554. send "&7create <short> &6- creates a team"
  555. send "&7rename <short> <name> &6- renames a team"
  556. send "&7awayhelmet <short> <r,g,b> &6- sets away head"
  557. send "&7awaychestplate <short> <r,g,b> &6- sets away chest"
  558. send "&7awayleggings <short> <r,g,b> &6- sets away legs"
  559. send "&7awayboots <short> <r,g,b> &6- sets away boots"
  560. send "&7homehelmet <short> <r,g,b> &6- sets home head"
  561. send "&7homechestplate <short> <r,g,b> &6- sets home chest"
  562. send "&7homeleggings <short> <r,g,b> &6- sets home legs"
  563. send "&7homeboots <short> <r,g,b> &6- sets home boots"
  564. send "&7goalhorn <short> <string> &6- sets goal horn (same codename as /playsound cmd)"
  565. send "&7debuginfo <team> &6- gets team debug info"
  566. send "&7info <team> &6- gets team info"
  567. send "&7captain <short> <name> &6- set team captain"
  568. send "&cdelete <short> <team> &6- deletes a team"
  569. send ""
  570. send "&7&oUse /updatestats to update a team's stats"
  571. if arg 2 is set:
  572. if arg-1 is "Info":
  573. if {teams::%arg-2%::name} is set:
  574. send ""
  575. send "&6Team Stats"
  576. send ""
  577. send "&aName: %coloured {teams::%arg-2%::name}% &e[%{teams::%arg-2%::short}%]"
  578. send "&aRecord: &6%{teams::%arg-2%::wins}%&7-&6%{teams::%arg-2%::loses}%&7-&6%{teams::%arg-2%::losesot}%"
  579. send "&aCaptain: &6%{teams::%arg-2%::captain}%"
  580. send "&7&o[!] Managed manually by staff. If this information is not accurate, please contact league staff."
  581.  
  582. else:
  583. send "&cTeam not found"
  584. if arg-1 is "debuginfo":
  585. if {teams::%arg-2%::name} is set:
  586. send ""
  587. send "&6TeamDebugInfo"
  588. send ""
  589. send "&aName: %coloured {teams::%arg-2%::name}% &e[%{teams::%arg-2%::short}%]"
  590. send "&aRecord: &6%{teams::%arg-2%::wins}%&7-&6%{teams::%arg-2%::loses}%&7-&6%{teams::%arg-2%::losesot}%"
  591. send "&aCaptain: &6%{teams::%arg-2%::captain}%"
  592. send ""
  593. send "&aHorn: &7%{teams::%arg-2%::horn}%"
  594. send "AwayH: &7%{teams::%arg-2%::awayhelmet}%"
  595. send "AwayC: &7%{teams::%arg-2%::awaychestplate}%"
  596. send "AwayL: &7%{teams::%arg-2%::awayleggings}%"
  597. send "AwayB: &7%{teams::%arg-2%::awayboots}%"
  598. send ""
  599. send "HomeH: &7%{teams::%arg-2%::homehelmet}%"
  600. send "HomeC: &7%{teams::%arg-2%::homechestplate}%"
  601. send "HomeL: &7%{teams::%arg-2%::homeleggings}%"
  602. send "HomeB: &7%{teams::%arg-2%::homeboots}%"
  603.  
  604. else:
  605. send "&cTeam not found"
  606. if arg-1 is "create":
  607. send "&aFunction called"
  608. TeamCreator(player,"create",arg-2)
  609. if arg-1 is "captain":
  610. send "&aFunction called"
  611. TeamCreator(player,"captain",arg-2,arg-3)
  612. if arg-1 is "rename":
  613. send "&aFunction called"
  614. TeamCreator(player,"name",arg-2,arg-3)
  615. if arg-1 is "awayhelmet":
  616. send "&aFunction called"
  617. TeamCreator(player,"awayhelmet",arg-2,arg-3)
  618. if arg-1 is "awaychestplate":
  619. send "&aFunction called"
  620. TeamCreator(player,"awaychestplate",arg-2,arg-3)
  621. if arg-1 is "awayleggings":
  622. send "&aFunction called"
  623. TeamCreator(player,"awayleggings",arg-2,arg-3)
  624. if arg-1 is "awayboots":
  625. send "&aFunction called"
  626. TeamCreator(player,"awayboots",arg-2,arg-3)
  627. if arg-1 is "homehelmet":
  628. send "&aFunction called"
  629. TeamCreator(player,"homehelmet",arg-2,arg-3)
  630. if arg-1 is "homechestplate":
  631. send "&aFunction called"
  632. TeamCreator(player,"homechestplate",arg-2,arg-3)
  633. if arg-1 is "homeleggings":
  634. send "&aFunction called"
  635. TeamCreator(player,"homeleggings",arg-2,arg-3)
  636. if arg-1 is "homeboots":
  637. send "&aFunction called"
  638. TeamCreator(player,"homeboots",arg-2,arg-3)
  639. if arg-1 is "goalhorn":
  640. send "&aFunction called"
  641. TeamCreator(player,"horn",arg-2,arg-3)
  642. if arg-1 is "delete":
  643. send "&aFunction called"
  644. TeamCreator(player,"delete",arg-2,arg-3)
  645. function TeamCreator(p:player,s:string,t:string,arg:string = ""):
  646. if {_s} is "create":
  647. if yaml "teamdata.%{_t}%" is not loaded:
  648. load yaml "{@dir}/%{_t}%.yml" as "teamdata.%{_t}%"
  649. add {_t} to {teamslist::*}
  650. send "&aCreated new file forteam &e%{_t}%&a. Applied default settings. Configure the name using &e/team rename %{_t}% <name>" to {_p}
  651. set yaml value "name" from "teamdata.%{_t}%" to {_arg}
  652. set yaml value "short" from "teamdata.%{_t}%" to {_t}
  653. set yaml value "wins" from "teamdata.%{_t}%" to 0
  654. set yaml value "loses" from "teamdata.%{_t}%" to 0
  655. set yaml value "losesot" from "teamdata.%{_t}%" to 0
  656. set yaml value "captain" from "teamdata.%{_t}%" to {_p}
  657. set yaml value "horn" from "teamdata.%{_t}%" to "goal.bonnie2"
  658. set yaml list "awayhelmet" from "teamdata.%{_t}%" to ""
  659. set yaml list "awaychestplate" from "teamdata.%{_t}%" to ""
  660. set yaml list "awayleggings" from "teamdata.%{_t}%" to ""
  661. set yaml list "awayboots" from "teamdata.%{_t}%" to ""
  662. set yaml list "homehelmet" from "teamdata.%{_t}%" to ""
  663. set yaml list "homechestplate" from "teamdata.%{_t}%" to ""
  664. set yaml list "homeleggings" from "teamdata.%{_t}%" to ""
  665. set yaml list "homeboots" from "teamdata.%{_t}%" to ""
  666. save yaml "teamdata.%{_t}%"
  667. else:
  668. send "&aThe team &e%{teams::%{_t}%::name}% already exists!" to {_p}
  669. if {_s} is "name":
  670. if {teams::%{_t}%::short} is set:
  671. set yaml value "name" from "teamdata.%{_t}%" to {_arg}
  672. set yaml value "short" from "teamdata.%{_t}%" to {_t}
  673. save yaml "teamdata.%{_t}%"
  674. send "&aData updated: Short: &e%{_t}% &a- &aName: &e%{_arg}%" to {_p}
  675. if {_s} is "captain":
  676. if {teams::%{_t}%::short} is set:
  677. set yaml value "captain" from "teamdata.%{_t}%" to {_arg}
  678. save yaml "teamdata.%{_t}%"
  679. send "&aData updated: TeamOwner: &e%{teams::%{_t}%::captain}%" to {_p}
  680. if {_s} contains "helmet":
  681. set {_rgb::*} to {_arg} parsed as "%integer%,%integer%,%integer%"
  682. if {_rgb::*} is not set:
  683. send "&cNo data updated: Invalid color %{_arg}% - &cplease use rgb" to {_p}
  684. stop
  685. if {_s} contains "away":
  686. if {teams::%{_t}%::short} is set:
  687. clear yaml list "awayhelmet" from "teamdata.%{_t}%"
  688. add {_rgb::1} to yaml list "awayhelmet" from "teamdata.%{_t}%"
  689. add {_rgb::2} to yaml list "awayhelmet" from "teamdata.%{_t}%"
  690. add {_rgb::3} to yaml list "awayhelmet" from "teamdata.%{_t}%"
  691. send "&aData updated!" to {_p}
  692. if {_s} contains "home":
  693. if {teams::%{_t}%::short} is set:
  694. clear yaml list "homehelmet" from "teamdata.%{_t}%"
  695. add {_rgb::1} to yaml list "homehelmet" from "teamdata.%{_t}%"
  696. add {_rgb::2} to yaml list "homehelmet" from "teamdata.%{_t}%"
  697. add {_rgb::3} to yaml list "homehelmet" from "teamdata.%{_t}%"
  698. send "&aData updated!" to {_p}
  699. if {_s} contains "chestplate":
  700. set {_rgb::*} to {_arg} parsed as "%integer%,%integer%,%integer%"
  701. if {_rgb::*} is not set:
  702. send "&cNo data updated: Invalid color %{_arg}% - &cplease use rgb" to {_p}
  703. stop
  704. if {_s} contains "away":
  705. if {teams::%{_t}%::short} is set:
  706. clear yaml list "awaychestplate" from "teamdata.%{_t}%"
  707. add {_rgb::1} to yaml list "awaychestplate" from "teamdata.%{_t}%"
  708. add {_rgb::2} to yaml list "awaychestplate" from "teamdata.%{_t}%"
  709. add {_rgb::3} to yaml list "awaychestplate" from "teamdata.%{_t}%"
  710. send "&aData updated!" to {_p}
  711. if {_s} contains "home":
  712. if {teams::%{_t}%::short} is set:
  713. clear yaml list "homechestplate" from "teamdata.%{_t}%"
  714. add {_rgb::1} to yaml list "homechestplate" from "teamdata.%{_t}%"
  715. add {_rgb::2} to yaml list "homechestplate" from "teamdata.%{_t}%"
  716. add {_rgb::3} to yaml list "homechestplate" from "teamdata.%{_t}%"
  717. send "&aData updated!" to {_p}
  718. if {_s} contains "leggings":
  719. set {_rgb::*} to {_arg} parsed as "%integer%,%integer%,%integer%"
  720. if {_rgb::*} is not set:
  721. send "&cNo data updated: Invalid color %{_arg}% - &cplease use rgb" to {_p}
  722. stop
  723. if {_s} contains "away":
  724. if {teams::%{_t}%::short} is set:
  725. clear yaml list "awayleggings" from "teamdata.%{_t}%"
  726. add {_rgb::1} to yaml list "awayleggings" from "teamdata.%{_t}%"
  727. add {_rgb::2} to yaml list "awayleggings" from "teamdata.%{_t}%"
  728. add {_rgb::3} to yaml list "awayleggings" from "teamdata.%{_t}%"
  729. send "&aData updated!" to {_p}
  730. if {_s} contains "home":
  731. if {teams::%{_t}%::short} is set:
  732. clear yaml list "homeleggings" from "teamdata.%{_t}%"
  733. add {_rgb::1} to yaml list "homeleggings" from "teamdata.%{_t}%"
  734. add {_rgb::2} to yaml list "homeleggings" from "teamdata.%{_t}%"
  735. add {_rgb::3} to yaml list "homeleggings" from "teamdata.%{_t}%"
  736. send "&aData updated!" to {_p}
  737. if {_s} contains "boots":
  738. set {_rgb::*} to {_arg} parsed as "%integer%,%integer%,%integer%"
  739. if {_rgb::*} is not set:
  740. send "&cNo data updated: Invalid color %{_arg}% - &cplease use rgb" to {_p}
  741. stop
  742. if {_s} contains "away":
  743. if {teams::%{_t}%::short} is set:
  744. clear yaml list "awayboots" from "teamdata.%{_t}%"
  745. add {_rgb::1} to yaml list "awayboots" from "teamdata.%{_t}%"
  746. add {_rgb::2} to yaml list "awayboots" from "teamdata.%{_t}%"
  747. add {_rgb::3} to yaml list "awayboots" from "teamdata.%{_t}%"
  748. send "&aData updated!" to {_p}
  749. if {_s} contains "home":
  750. if {teams::%{_t}%::short} is set:
  751. clear yaml list "homeboots" from "teamdata.%{_t}%"
  752. add {_rgb::1} to yaml list "homeboots" from "teamdata.%{_t}%"
  753. add {_rgb::2} to yaml list "homeboots" from "teamdata.%{_t}%"
  754. add {_rgb::3} to yaml list "homeboots" from "teamdata.%{_t}%"
  755. send "&aData updated!" to {_p}
  756. if {_s} is "goalhorn" or "horn":
  757. if {teams::%{_t}%::short} is set:
  758. set yaml value "horn" from "teamdata.%{_t}%" to {_arg}
  759. send "&aData updated: GoalHorn(Must be like /playsound): &e%{teams::%{_t}%::horn}%" to {_p}
  760. if {_s} is "delete":
  761. if {teamslist::*} contains {_t}:
  762. delete {teams::%{_t}%::*}
  763. remove {_t} from {teamslist::*}
  764. delete {teams::%{_t}%}
  765. send "&aDeleted variables" to {_p}
  766. if yaml "teamdata.%{_t}%" is loaded:
  767. delete yaml "teamdata.%{_t}%"
  768. send "&aTeam &e%{_t}%&a deleted." to {_p}
  769. else:
  770. send "&cThat team does not exist." to {_p}
  771. if {_s} is set:
  772. save yaml "teamdata.%{_t}%"
  773. LoadTeams(true)
  774.  
  775. function EquipPlayer(p:player):
  776. set gamemode of {_p} to adventure
  777. remove night vision from potion effects of {_p}
  778. remove jump boost from potion effects of {_p}
  779. remove invisibility from potion effects of {_p}
  780. apply night vision of tier 1 without particles to {_p} for a day
  781. clear {_p}'s inventory
  782. give {_p} {bhl::stick}
  783.  
  784. if {_p} is {awaygoalie::player} or {homegoalie::player}:
  785. clear inventory of {_p}
  786. apply invisibility of tier 1 without particles to {_p} for a day
  787. set slot 0,1,2,3,4,5,6,7,8 and 9 of {_p} to {bhl::goaliecontrol}
  788. send "&aYou currently are playing as a Player Goalie. Please use &7/quitgoalie&a to quit as goalie." to {_p}
  789. stop
  790. if {game::away::members::*} does not contain {_p}:
  791. if {game::home::members::*} does not contain {_p}:
  792. set gamemode of {_p} to spectator
  793. if {game::away::members::*} contains {_p}:
  794. set helmet of {_p} to leather helmet
  795. dye {_p}'s helmet {teams::%{game::away::team}%::awayhelmet}
  796. set chestplate of {_p} to leather chestplate
  797. dye {_p}'s chestplate {teams::%{game::away::team}%::awaychestplate}
  798. set leggings of {_p} to leather leggings
  799. dye {_p}'s leggings {teams::%{game::away::team}%::awayleggings}
  800. set boots of {_p} to leather boots #
  801. dye {_p}'s boots {teams::%{game::away::team}%::awayboots}
  802. if {game::home::members::*} contains {_p}:
  803. set helmet of {_p} to leather helmet
  804. dye {_p}'s helmet {teams::%{game::home::team}%::homehelmet}
  805. set chestplate of {_p} to leather chestplate
  806. dye {_p}'s chestplate {teams::%{game::home::team}%::homechestplate}
  807. set leggings of {_p} to leather leggings
  808. dye {_p}'s leggings {teams::%{game::home::team}%::homeleggings}
  809. set boots of {_p} to leather boots
  810. dye {_p}'s boots {teams::%{game::home::team}%::homeboots}
  811. on quit:
  812. set quit message to "&7%player% left the ice."
  813. if {game::away::members::*} contains player:
  814. remove player from {game::away::members::*}
  815. if {game::home::members::*} contains player:
  816. remove player from {game::home::members::*}
  817. loop all players in {game::away::members::*}:
  818. loop-player is not {game::away::center}
  819. loop-player is not {game::away::leftwing}
  820. loop-player is not {game::away::rightwing}
  821. if {game::away::leftwing} is not set:
  822. set {game::away::leftwing} to loop-player
  823. send "&eYou are on the &6Left Wing&e position." to loop-player
  824. if {game::away::rightwing} is not set:
  825. set {game::away::rightwing} to loop-player
  826. send "&eYou are on the &6Right Wing&e position." to loop-player
  827. loop all players in {game::home::members::*}:
  828. loop-player is not {game::home::center}
  829. loop-player is not {game::home::leftwing}
  830. loop-player is not {game::home::rightwing}
  831. if {game::home::leftwing} is not set:
  832. set {game::home::lefttwing} to loop-player
  833. send "&eYou are on the &6Left Wing&e position." to loop-player
  834. if {game::home::rightwing} is not set:
  835. set {game::home::rightwing} to loop-player
  836. send "&eYou are on the &6Right Wing&e position." to loop-player
  837. on join:
  838. while player is online: #ever
  839. wait a tick
  840. "%region at player%" contains "puckarea"
  841. player is not {awaygoalie::player} or {homegoalie::player}
  842. {game::status} is "Shootouts"
  843. if player is not {game::shootouts::player}:
  844. teleport player to {bhl::awaybench} if {game::away::members::*} contains player
  845. teleport player to {bhl::homebench} if {game::home::members::*} contains player
  846. on join:
  847. set {stamina::%player%} to 100
  848. while player is online:
  849. wait a tick
  850. set {BHL::%player%::power} to 0 if difference between {BHL::%player%::lastpower} and now > 0.4 seconds
  851. player is not {awaygoalie::player} or {homegoalie::player}
  852. {bhl::%player%::washit} is not set
  853. if {stamina::%player%} = 0:
  854. set walking speed of player to 0.4
  855. else:
  856. if player is not sprinting:
  857. set walking speed of player to 0.4
  858. else:
  859. set walking speed of player to 0.6
  860. if player is sprinting:
  861. wait 0.2 seconds
  862. set {_s} to {stamina::%player%}
  863. set {_c} to a random integer between 8 and 12
  864. subtract {_c} from {stamina::%player%}
  865. if {stamina::%player%} < 0:
  866. set {stamina::%player%} to 0
  867. else:
  868. wait 0.4 seconds
  869. set {_regen} to a random integer between 8 and 14
  870. add {_regen} to {stamina::%player%}
  871. if {stamina::%player%} > 100:
  872. set {stamina::%player%} to 100
  873. on join:
  874. set join message to "&7%player%&7 joined the lobby"
  875. while player is online:
  876. wait a tick
  877. player is not {awaygoalie::player} or {homegoalie::player}
  878. set level of player to {stamina::%player%}
  879. on damage:
  880. "%region at attacker%" contains "puckarea"
  881. cancel event
  882. {game::away::members::*} does not contain victim and attacker
  883. {game::home::members::*} does not contain victim and attacker
  884. {bhl::%attacker%::washit} is not set
  885. attacker is player
  886. victim is player
  887. attacker and victim are not {awaygoalie::player} or {homegoalie::player}
  888. set {_v} to vector from yaw attacker's yaw and pitch 0
  889. set {bhl::%attacker%::power} to 0
  890. set vector length of {_v} to 0.3 if {bhl::%attacker%::power} > 0
  891. set vector length of {_v} to 0.6 if {bhl::%attacker%::power} > 30
  892. set vector length of {_v} to 0.9 if {bhl::%attacker%::power} > 50
  893. set vector length of {_v} to 1.2 if {bhl::%attacker%::power} > 80
  894. set vector length of {_v} to 1.4 if {bhl::%attacker%::power} > 99
  895. set {bhl::%victim%::washit} to now
  896. set {bhl::%attacker%::lasthit} to now
  897. delete {puckowner} if victim is {puckowner}
  898. if distance between attacker and {puck} > 3.5:
  899. if {game::penalty::%victim%} is not set:
  900. Penalty(attacker) if vector length of {_v} > 0.6
  901.  
  902. set walking speed of victim to 0
  903. set velocity of victim to {_v}
  904. while difference between {bhl::%victim%::washit} and now < 0.5 seconds:
  905. wait a tick
  906. set walking speed of victim to 0
  907. delete {bhl::%victim%::washit}
  908. delete {bhl::%attacker%::lasthit}
  909. function JoinBHL(p:player):
  910. delete {game::penalty::%{_p}%}
  911. set {bhl::%{_p}%::lastsneak} to now
  912. set {deke::%{_p}%::last} to now
  913. send "&7%{_p}% joined the ice." to all players in world "{@hw}"
  914. send "&aJoining the ice..." to {_p}
  915.  
  916. wait 10 ticks
  917. if {game::seasoned} is false:
  918. teleport {_p} to {bhl::center}
  919. AssignTeam({_p})
  920. else:
  921. teleport {_p} to {bhl::center}
  922. EquipPlayer({_p})
  923. wait 2 ticks
  924. send "&7&oThis is a season game, so you have not been assigned automatically to a team. Please ask your team's captain or coach to assign you." to {_p}
  925. on quit:
  926. if player is {awaygoalie::player}:
  927. set {awaygoalie::player} to "AI"
  928. broadcast "&C&LWARNING: &eThe &bAway goalie&e left in the middle of the game!"
  929. if player is {homegoalie::player}:
  930. set {homegoalie::player} to "AI"
  931. broadcast "&C&LWARNING: &eThe &aHome goalie&e left in the middle of the game!"
  932. function Scoreboard(p:player):
  933. if world of {_p} is "{@hw}":
  934. set line 9 of scoreboard of {_p} to "&aStatuss: &e%{game::status}%"
  935. set {_s} to {game::time::sec}
  936. if {game::time::sec} < 10:
  937. set {_s} to "0%{game::time::sec}%"
  938. set {_m} to {game::time::sec}
  939. if {game::time::min} < 10:
  940. set {_m} to "0%{game::time::min}%"
  941. set line 8 of scoreboard of {_p} to "&aTime: &e[P%{game::period}%&e] - &e%{_m}%&e:%{_s}%"
  942. set line 7 of scoreboard of {_p} to "&aAway goalie: &f%{awaygoalie::player}%"
  943. set line 6 of scoreboard of {_p} to "&aHome goalie: &f%{homegoalie::player}%"
  944. IF {puckowner} is set:
  945. set line 5 of scoreboard of {_p} to "&aPuck: &f%{puckowner}%"
  946. else:
  947. set line 5 of scoreboard of {_p} to "&aPuck: No one"
  948. set line 4 of scoreboard of {_p} to "&aAway Goals: &f%{game::away::goals}% &6[%{game::away::team}%&6]"
  949. set line 3 of scoreboard of {_p} to "&aHome Goals: &f%{game::home::goals}% &6[%{game::home::team}%&6]"
  950. set line 2 of scoreboard of {_p} to "&a&7&a"
  951. set line 1 of scoreboard of {_p} to "&eehl.skynode.gg v1.4.1"
  952. else:
  953. set line 8 of scoreboard of {_p} to "&aMy rank: %coloured prefix of {_p}%"
  954. set line 7 of scoreboard of {_p} to "&aMy record: &90-0-0"
  955. set line 6 of scoreboard of {_p} to "&AMy goals: &f0"
  956. set line 5 of scoreboard of {_p} to "&aMy saves: &f0"
  957. set line 3 of scoreboard of {_p} to "&aMy team: &fComing soon!"
  958. set line 2 of scoreboard of {_p} to "&a&7&a"
  959. set line 1 of scoreboard of {_p} to "&eversion 1.4.1"
  960. on join:
  961. toggle scoreboard of player to on
  962. set title of player's scoreboard to "&f&lBONNIE'S HOCKEY GAME"
  963. while player is online:
  964. wait a tick
  965. Scoreboard(player)
  966. set tablist name of player to "%coloured prefix of player% &f%player%"
  967. on server list ping:
  968. set motd to "&f&lHOCKEY GAME &ev1.4.1 &7alpha%nl%&7&oJoin our &9discord &7(&e/discord&7)!"
  969. command /discord:
  970. trigger:
  971. send "&9Discord: &7{@discordlink}"
  972. function makeLook(e: living entity, loc: location):
  973. set {_xD} to {_loc}'s x location - {_e}'s x location
  974. set {_yD} to {_loc}'s y location - {_e}'s y location
  975. set {_zD} to {_loc}'s z location - {_e}'s z location
  976. set {_yaw} to atan2({_xD}, {_zD}) - 90
  977.  
  978. set {_adj2} to ({_xD}*{_xD}) + ({_zD}*{_zD})
  979. set {_parallel} to sqrt({_adj2})
  980. set {_pitch} to atan2({_yD}, {_parallel}) - 90
  981.  
  982. add "{Rotation:[%{_yaw}%f, %{_pitch}%f]}" to NBT of {_e}
  983. command /offside [<text>]:
  984. permission: staff.offside
  985. permission message: §cYou are not allowed to call offsides.
  986. trigger:
  987. if arg 1 is "away":
  988. broadcast "&7Called by %player%"
  989. Offside("away")
  990. if arg 1 is "home":
  991. broadcast "&7Called by %player%"
  992. Offside("home")
  993. command /setgoals [<text>] [<integer>]:
  994. permission: staff.offside
  995. permission message: §cYou are not allowed to change goals.
  996. trigger:
  997. if arg 2 is not set:
  998. send "&7/setgoals away/home <number>"
  999. if arg 2 is set:
  1000. if arg 1 is "home" or "away":
  1001. set {game::%arg-1%::goals} to arg-2
  1002. broadcast "&CAn staff updated the goals"
  1003. on region enter:
  1004. "%event-region%" contains "homearea" or "awayarea"
  1005. if {game::status} is "In-game":
  1006. if player is {puckowner}:
  1007. if {game::away::members::*} contains player:
  1008. if "%event-region%" contains "homearea":
  1009. loop {game::away::members::*}:
  1010. loop-value is not player
  1011. if "%region at loop-value%" contains "homearea":
  1012. Offside("away")
  1013. stop
  1014. if {game::home::members::*} contains player:
  1015. if "%event-region%" contains "awayarea":
  1016. loop {game::home::members::*}:
  1017. loop-value is not player
  1018. if "%region at loop-value%" contains "awayarea":
  1019. Offside("home")
  1020. stop
  1021. function Offside(t:string):
  1022. if {_t} = "away":
  1023. broadcast "" #
  1024. broadcast "&eOffside has been called on %{teams::%{game::away::team}%::name}%"
  1025. broadcast ""
  1026. delete {puckowner}
  1027. set {goalieai} and {inplay} and {isreplay} to false
  1028. set {game::status} to "Out of play"
  1029. play sound "whistle.1" for all players in world "{@hw}"
  1030. wait 5 seconds
  1031. if distance between {BHL::homeoffsideleft} and {puck} < distance between {BHL::homeoffsideright} and {puck}:
  1032. RespawnPuck("homeoffsideleft")
  1033. else:
  1034. RespawnPuck("homeoffsideright")
  1035. if {_t} = "home":
  1036. broadcast ""
  1037. broadcast "&eOffside has been called on %{teams::%{game::home::team}%::name}%"
  1038. broadcast ""
  1039. delete {puckowner}
  1040. set {goalieai} and {inplay} and {isreplay} to false
  1041. set {game::status} to "Out of play"
  1042. play sound "whistle.1" for all players in world "{@hw}"
  1043. wait 5 seconds
  1044. if distance between {BHL::awayoffsideleft} and {puck} < distance between {BHL::awayoffsideright} and {puck}:
  1045. RespawnPuck("awayoffsideleft")
  1046. else:
  1047. RespawnPuck("awayoffsideright")
  1048. command /ahockey [<text>]:
  1049. permission: ahockey.configure
  1050. permission message: &CThis command is restricted
  1051. trigger:
  1052. if arg 1 is "lobby":
  1053. set {bhl::lobby} to location of player
  1054. broadcast "updateed lobby"
  1055. if arg 1 is "awayoffsideleft":
  1056. set {bhl::awayoffsideleft} to location of player
  1057. broadcast "updateed awayoffsideleft"
  1058. if arg 1 is "awayoffsideright":
  1059. set {bhl::awayoffsideright} to location of player
  1060. broadcast "updateed awayoffsideright"
  1061. if arg 1 is "homeoffsideleft":
  1062. set {bhl::homeoffsideleft} to location of player
  1063. broadcast "updateed homeoffsideleft"
  1064. if arg 1 is "homeoffsideright":
  1065. set {bhl::homeoffsideright} to location of player
  1066. broadcast "updateed homeoffsideright"
  1067. if arg 1 is "awayleft":
  1068. set {bhl::awayleft} to location of player
  1069. broadcast "updated awayleft"
  1070. if arg 1 is "awaybench":
  1071. set {bhl::awaybench} to location of player
  1072. broadcast "updated awaybench"
  1073. if arg 1 is "homebench":
  1074. set {bhl::homebench} to location of player
  1075. broadcast "updated homebench"
  1076. if arg 1 is "awayright":
  1077. set {bhl::awayright} to location of player
  1078. broadcast "updated awayright"
  1079. if arg 1 is "homeleft":
  1080. set {bhl::homeleft} to location of player
  1081. broadcast "updated homeleft"
  1082. if arg 1 is "homeright":
  1083. set {bhl::homeright} to location of player
  1084. broadcast "updated homeright"
  1085. if arg 1 is "awaybox":
  1086. set {bhl::awaybox} to location of player
  1087. broadcast "set awaybox"
  1088. if arg 1 is "homebox":
  1089. set {bhl::homebox} to location of player
  1090. broadcast "set homeboxx"
  1091. if arg 1 is "setcenter":
  1092. set {BHL::center} to location of player
  1093. send "&a&lGAME &e» Updated &aCenter &elocation!"
  1094. if arg 1 is "setawaynet":
  1095. set {BHL::awaynet} to location of player
  1096. send "&a&lGAME &e» Updated &aAway net &elocation!"
  1097. if arg 1 is "sethomenet":
  1098. set {BHL::homenet} to location of player
  1099. send "&a&lGAME &e» Updated &aHome net &elocation!"
  1100. if arg 1 is "stick":
  1101. set name of tool of player to "&aHockey Stick"
  1102. set {BHL::stick} to tool of player
  1103. send "&a&lGAME &e» Updated &aHockey Stick &eitem!"
  1104. if arg 1 is "gk" or "goalie":
  1105. set name of tool of player to "&aPerform a save &7&o(Left/Right Click)"
  1106. set {bhl::goaliecontrol} to tool of player
  1107. send "&a&lGAME &e» Updated &aGoalie Tool&e item!"
  1108. on join:
  1109. set {deke::%player%} to "center"
  1110. set {BHL::%player%::power} to 0
  1111. set {BHL::%player%::lasthit} to now
  1112. while player is online:
  1113. wait a tick
  1114. if tool of player is {BHL::stick}:
  1115. if distance between player and {puck} < 0.70:
  1116. if player is sneaking:
  1117. player is not {awaygoalie::player} or {homegoalie::player}
  1118. set {_v} to vector from yaw player's yaw and pitch 0
  1119. set vector length of {_v} to 0.1
  1120. set {-pv} to {_v}
  1121. on skript load:
  1122. wait 10 seconds
  1123. RebuildGame()
  1124. on load:
  1125. RebuildGame()
  1126. on damage:
  1127. if victim is {puck}:
  1128. cancel event
  1129. if attacker is silverfish or puffer fish:
  1130. cancel event
  1131. on rightclick: #hit with puck
  1132. tool of player is {bhl::stick}
  1133. if {BHL::%player%::power} < 120:
  1134. set {BHL::lastshot} to player
  1135. set {BHL::%player%::lastpower} to now
  1136. set {_val} to a random integer between 6 and 10
  1137. add {_val} to {BHL::%player%::power}
  1138. if {BHL::%player%::power} > 100:
  1139. set {BHL::%player%::power} to 100
  1140. send action bar "&6Left click for action &7| &a&lPOWER: &7%{bhl::%player%::power}%%%" to player
  1141. on leftclick:
  1142. tool of player is {bhl::stick}
  1143. player is {puckowner}
  1144. Shot()
  1145. on mine:
  1146. tool of player is {bhl::stick}
  1147. player is {puckowner}
  1148. Shot()
  1149. on damage:
  1150. tool of attacker is {bhl::stick}
  1151. attacker is {puckowner}
  1152. Shot()
  1153. function Shot():
  1154. delete {BHL::%{puckowner}%::lastpower}
  1155. set {BHL::%{puckowner}%::lasthit} to now
  1156. if {BHL::%{puckowner}%::power} > 75:
  1157. Commentator("shot","%{puckowner}%")
  1158. play sound "minecraft:puck.pass" to all players in world "{@hw}"
  1159. set {_l} to location of {puckowner}
  1160. set {_v} to vector from yaw {puckowner}'s yaw and pitch 0
  1161. set vector length of {_v} to 1.3
  1162. set {-pv} to {_v} ++ {-pv}
  1163. add 0.3 to y of {-pv}
  1164. set {BHL::%{puckowner}%::power} to 0
  1165. delete {puckowner}
  1166. stop
  1167. if {BHL::%{puckowner}%::power} > 50:
  1168. Commentator("shot","%{puckowner}%")
  1169. play sound "minecraft:puck.pass" to all players in world "{@hw}"
  1170. set {_l} to location of {puckowner}
  1171. set {_v} to vector from yaw {puckowner}'s yaw and pitch 0
  1172. set vector length of {_v} to 1.1
  1173. set {-pv} to {_v} ++ {-pv}
  1174. add 0.2 to y of {-pv}
  1175. set {BHL::%{puckowner}%::power} to 0
  1176. delete {puckowner}
  1177. stop
  1178. if {BHL::%{puckowner}%::power} > 30:
  1179. Commentator("shot","%{puckowner}%")
  1180. play sound "minecraft:puck.pass" to all players in world "{@hw}"
  1181. set {_l} to location of {puckowner}
  1182. set {_v} to vector from yaw {puckowner}'s yaw and pitch 0
  1183. set vector length of {_v} to 1
  1184. set {-pv} to {_v} ++ {-pv} #
  1185. add 0.2 to y of {-pv}
  1186. set {BHL::%{puckowner}%::power} to 0
  1187. delete {puckowner}
  1188. wait 0.3 seconds
  1189. stop
  1190. if {BHL::%{puckowner}%::power} > 15:
  1191. Commentator("shot","%{puckowner}%")
  1192. play sound "minecraft:puck.pass" to all players in world "{@hw}"
  1193. set {_l} to location of {puckowner}
  1194. set {_v} to vector from yaw {puckowner}'s yaw and pitch 0
  1195. set vector length of {_v} to 0.8
  1196. set {-pv} to {_v} ++ {-pv} #
  1197. add 0.1 to y of {-pv}
  1198. set {BHL::%{puckowner}%::power} to 0
  1199. delete {puckowner}
  1200. wait 0.3 seconds
  1201. stop
  1202. if {BHL::%{puckowner}%::power} > -1:
  1203. Commentator("shot","%{puckowner}%")
  1204. play sound "minecraft:puck.pass" to all players in world "{@hw}"
  1205. set {_l} to location of {puckowner}
  1206. set {_v} to vector from yaw {puckowner}'s yaw and pitch 0
  1207. set vector length of {_v} to 0.6
  1208. set {-pv} to {_v} ++ {-pv}
  1209. set {BHL::%{puckowner}%::power} to 0
  1210. delete {puckowner}
  1211. function ClearRAM(p:player):
  1212. delete {deke::%{_p}%}
  1213. delete {BHL::%{_p}%::*}
  1214. delete {bhl::%{_p}%::*}
  1215. delete {stamina::%{_p}%}
  1216. delete {game::penalty::*}
  1217. on damage: #hit with puck
  1218. difference between {bhl::%attacker%::lastsneak} and now > 0.4 seconds
  1219. victim is {puck}
  1220. {puckowner} is not set
  1221. {goalieai} and {inplay} are true
  1222. attacker is sneaking
  1223. set {bhl::%attacker%::lastsneak} to now
  1224. set {bhl::%attacker%::lastshot} to attacker
  1225. tool of attacker is {bhl::stick}
  1226. if {game::status} is "Waiting" or "Starting":
  1227. send "&cPlease start the game before doing this. Use /startgame or turn on warmup mode using /warmup" to attacker
  1228. stop
  1229. set {BHL::lastshot} to attacker
  1230. set {BHL::%attacker%::lasthit} to now
  1231. play sound "minecraft:puck.pass" to all players in world "{@hw}"
  1232. set {_loc} to event-location
  1233. set {_l} to location of attacker
  1234. set {_v} to vector from yaw attacker's yaw and pitch 0
  1235. set vector length of {_v} to 1.1
  1236. set {-pv} to {_v} ++ {-pv}
  1237.  
  1238. every second:
  1239. if "%tps%" does not contain "20" or "19." or "18.":
  1240. {isrestart} is not set
  1241. AutomatedRestart()
  1242. function AutomatedRestart():
  1243. set {isrestart} to true
  1244. broadcast "&6[LAG] &EDetected TPS DROP. The server will restart in 30 seconds."
  1245. wait 30 seconds
  1246. make console execute command "restart"
  1247. command /warmup:
  1248. trigger:
  1249. if {game::status} is "Waiting":
  1250. set {game::status} to "Warmup"
  1251. broadcast "&a&lWARM UP: &eGoal detections has been disabled. Warm up mode turned on by %player%"
  1252. stop
  1253. if {game::status} is "Warmup":
  1254. set {game::status} to "Waiting"
  1255. broadcast "&a&lWARM UP: &eWarm up mode turned off by %player%"
  1256. teleport {puck} to {bhl::center}
  1257. stop
  1258. on damage: # hit system
  1259. attacker is player
  1260. attacker is not sneaking
  1261. victim is {puck}
  1262. cancel event
  1263. tool of attacker is {BHL::stick}
  1264. if {game::status} is "Waiting" or "Starting":
  1265. send "&cPlease start the game before doing this. Use /startgame or turn on warmup mode using /warmup" to attacker
  1266. stop
  1267. if {inplay} is true:
  1268. if {puckowner} is not set: # ver
  1269. set {_vel} to vector length of {-pv} * 20 * 2.237
  1270. {_vel} < 11
  1271. difference between {puckinvis} and now > {@immune} seconds
  1272. set {deke::%attacker%} to "center"
  1273. set {puckowner} to attacker # #
  1274. Commentator("hasit")
  1275. set {puckinvis} to now
  1276. set {bhl::%{puckowner}%::power} to -1
  1277. delete {BHL::%attacker%::lastpower}
  1278. wait 2 ticks
  1279. set {bhl::%{puckowner}%::power} to 0
  1280. stop
  1281. else if {puckowner} is set:
  1282. attacker is not {puckowner}
  1283. set {bhl::%{puckowner}%::power} to 0
  1284. Commentator("playerpoke","%attacker%")
  1285. delete {puckowner}
  1286. set {_v} to vector from yaw attacker's yaw and pitch 0
  1287. set vector length of {_v} to 0.4
  1288. set {-pv} to {_v}
  1289. if {puckowner} is attacker:
  1290. set {bhl::%{puckowner}%::power} to 0
  1291. delete {puckowner}
  1292.  
  1293. function applynbt(e:entity):
  1294. apply invisibility of tier 1 without particles to {_e} for a day
  1295. add "{Invulnerable:1}" to nbt of {_e}
  1296. add "{PersistenceRequired:1}" to nbt of {_e}
  1297. add "{NoAI:1}" to nbt of {_e}
  1298. add "{Silent:1}" to nbt of {_e}
  1299. add "{PuffState:1}" to nbt of {_e}
  1300. add "{NoGravity:1}" to nbt of {_e}
  1301. function AwayGKButterfly(gk:entity,bf:boolean = true):
  1302. if {awaygoalie::currentpose} is "skatingup":
  1303. ResetHitboxes({awaygoalie})
  1304. if y-coord of {awaygoalie} = 6:
  1305. set {awaygoalie::isbutterfly} to true
  1306. set {_gkl} to location of {_gk}
  1307. subtract 0.5 from y-coord of {_gkl}
  1308. teleport {_gk} to {_gkl}
  1309. else:
  1310. set {awaygoalie::isbutterfly} to false
  1311. if y-coord of {_gk} < 6:
  1312. set {_gkl} to location of {_gk}
  1313. add 0.5 to y-coord of {_gkl}
  1314. teleport {_gk} to {_gkl}
  1315. # butterfly
  1316. if {_bf} is true:
  1317. spawn puffer fish at {_gk}
  1318. set {awayhitbox::butterfly::left} to last spawned puffer fish
  1319. applynbt({awayhitbox::butterfly::left})
  1320.  
  1321. spawn puffer fish at {_gk}
  1322. set {awayhitbox::butterfly::leftleft} to last spawned puffer fish
  1323. applynbt({awayhitbox::butterfly::leftleft})
  1324. #
  1325. spawn puffer fish at {_gk}
  1326. set {awayhitbox::butterfly::right} to last spawned puffer fish
  1327. applynbt({awayhitbox::butterfly::right})
  1328.  
  1329. spawn puffer fish at {_gk}
  1330. set {awayhitbox::butterfly::rightright} to last spawned puffer fish
  1331. applynbt({awayhitbox::butterfly::rightright})
  1332.  
  1333. spawn puffer fish at {_gk}
  1334. set {awayhitbox::butterfly::chest} to last spawned puffer fish
  1335. applynbt({awayhitbox::butterfly::chest})
  1336.  
  1337. spawn puffer fish at {_gk}
  1338. set {awayhitbox::butterfly::head} to last spawned puffer fish
  1339. applynbt({awayhitbox::butterfly::head})
  1340.  
  1341. set {awaygoalie::currentpose} to "butterfly"
  1342. set {awaygoalienbt} to "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-12.0f,0.0f,-3.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-69.0f,-57.0f,30.0f],Head:[6.0f,12.0f,-6.0f],Body:[0.0f,-30.0f,0.0f]}}"
  1343. add "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-12.0f,0.0f,-3.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-69.0f,-57.0f,30.0f],Head:[6.0f,12.0f,-6.0f],Body:[0.0f,-30.0f,0.0f]}}" to nbt of {_gk}
  1344. while {awayhitbox::butterfly::leftleft} is set:
  1345. wait a tick
  1346.  
  1347. set {_loc} to location of {_gk} # Chest
  1348. set {_alti} to vector(0,1,0)
  1349. set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
  1350. set {_v} to {_v} ++ {_alti}
  1351. teleport {awayhitbox::butterfly::chest} to {_gk} ~ {_v}
  1352. if distance between {puck} and {awayhitbox::butterfly::chest} < {@gkreach}:
  1353. GoalieReflect({_gk},"pad")
  1354.  
  1355. set {_loc} to location of {_gk} # Head
  1356. set {_alti} to vector(0,1.5,0)
  1357. set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
  1358. set {_v} to {_v} ++ {_alti}
  1359. teleport {awayhitbox::butterfly::head} to {_gk} ~ {_v}
  1360. if distance between {puck} and {awayhitbox::butterfly::head} < {@gkreach}:
  1361. GoalieReflect({_gk},"pad")
  1362. set {_loc} to location of {_gk}
  1363. set {_alti} to vector(0,0.60,0)
  1364. set {_v} to spherical vector radius 0.65, yaw {_gk}'s yaw - 100, pitch 6
  1365. set {_v} to {_v} ++ {_alti}
  1366. teleport {awayhitbox::butterfly::leftleft} to {_gk} ~ {_v}
  1367. if distance between {puck} and {awayhitbox::butterfly::leftleft} < {@gkreach}:
  1368. GoalieReflect({_gk},"pad")
  1369. #
  1370. set {_loc} to location of {_gk} # Pad LEFT
  1371. set {_alti} to vector(0,0.60,0)
  1372. set {_v} to spherical vector radius 0.35, yaw {_gk}'s yaw - 100, pitch 6
  1373. set {_v} to {_v} ++ {_alti}
  1374. teleport {awayhitbox::butterfly::left} to {_gk} ~ {_v}
  1375. if distance between {puck} and {awayhitbox::butterfly::left} < {@gkreach}:
  1376. GoalieReflect({_gk},"pad")
  1377.  
  1378. set {_loc} to location of {_gk} # Pad Right
  1379. set {_alti} to vector(0,0.60,0)
  1380. set {_v} to spherical vector radius 0.35, yaw {_gk}'s yaw + 100, pitch 6
  1381. set {_v} to {_v} ++ {_alti}
  1382. teleport {awayhitbox::butterfly::right} to {_gk} ~ {_v}
  1383. if distance between {puck} and {awayhitbox::butterfly::right} < {@gkreach}:
  1384. GoalieReflect({_gk},"pad")
  1385. #
  1386. set {_loc} to location of {_gk} # Pad rightright
  1387. set {_alti} to vector(0,0.60,0)
  1388. set {_v} to spherical vector radius 0.65, yaw {_gk}'s yaw + 100, pitch 6
  1389. set {_v} to {_v} ++ {_alti}
  1390. teleport {awayhitbox::butterfly::rightright} to {_gk} ~ {_v}
  1391. if distance between {puck} and {awayhitbox::butterfly::rightright} < {@gkreach}:
  1392. GoalieReflect({_gk},"pad")
  1393. if distance between {awaygoalie} and {puck} < 1:
  1394. if {awaygoalie::currentpose} is "butterfly":
  1395. set {_v} to vector length of {-pv} * 20 * 2.237
  1396. y-coord of {puck} < 6.25
  1397. {_v} < 12
  1398. AwayNewPose({awaygoalie},"covered")
  1399. teleport {puck} to {awaygoalie}
  1400. wait a tick
  1401. GoalieSave()
  1402. else:
  1403. GoalieReflect({_gk},"pad")
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416. function ResetHitboxes(p:entity):
  1417. kill all silverfishes and puffer fishes in radius 10 around {_p}
  1418. if {_p} is {awaygoalie} or {awaygoalie::player}:
  1419. delete {awayhitbox::*}
  1420. if {_p} is {homegoalie} or {homegoalie::player}:
  1421. delete {homehitbox::*}
  1422. function UpdatePGSpeed():
  1423. if {awaygoalie::currentpose} is "skatingup":
  1424. set walking speed of {awaygoalie::player} to 0.5
  1425. else:
  1426. set walking speed of {awaygoalie::player} to 0.4
  1427. if {homegoalie::currentpose} is "skatingup":
  1428. set walking speed of {homegoalie::player} to 0.5
  1429. else:
  1430. set walking speed of {homegoalie::player} to 0.45
  1431.  
  1432. function AwayNewPose(gk:entity,pose:string):
  1433. if {_pose} is not "skatingup":
  1434. if {awaygoalie::player} is "AI":
  1435. while y-coord of {awaygoalie} > 5.5:#
  1436. wait a tick
  1437. if y-coord of {awaygoalie} is not 6:
  1438. set {awaygoalie::isbutterfly} to true
  1439. set {_gkl} to location of {_gk}
  1440. subtract 0.5 from y-coord of {_gkl}
  1441. teleport {_gk} to {_gkl}
  1442. else:
  1443. set {awaygoalie::isbutterfly} to false
  1444. if y-coord of {_gk} < 6:
  1445. set {_gkl} to location of {_gk}
  1446. add 0.5 to y-coord of {_gkl}
  1447. teleport {_gk} to {_gkl}
  1448. set {awaygoalie::currentpose} to {_pose}
  1449. if {_pose} is "covered":
  1450. add "{Pose:{LeftLeg:[54.0f,-3.0f,270.0f],LeftArm:[-99.0f,63.0f,-108.0f],RightLeg:[45.0f,9.0f,84.0f],RightArm:[311.0f,-27.0f,-3.0f],Head:[45.0f,-24.0f,0.0f],Body:[18.0f,0.0f,3.0f]}}" to nbt of {_gk}
  1451. set {awaygoalienbt} to "{Pose:{LeftLeg:[54.0f,-3.0f,270.0f],LeftArm:[-99.0f,63.0f,-108.0f],RightLeg:[45.0f,9.0f,84.0f],RightArm:[311.0f,-27.0f,-3.0f],Head:[45.0f,-24.0f,0.0f],Body:[18.0f,0.0f,3.0f]}}"
  1452. if {_pose} is "skatingup":
  1453. ResetHitboxes({awaygoalie})
  1454. spawn puffer fish at {_gk}
  1455. set {awayhitbox::skatingup::chest} to last spawned puffer fish
  1456. applynbt({awayhitbox::skatingup::chest})
  1457. spawn puffer fish at {_gk}
  1458. set {awayhitbox::skatingup::head} to last spawned puffer fish
  1459. applynbt({awayhitbox::skatingup::head})
  1460. set {awaygoalienbt} to "{Pose:{LeftLeg:[0.0f,0.0f,327.0f],LeftArm:[-30.0f,-72.0f,10.0f],RightLeg:[0.0f,0.0f,36.0f],RightArm:[317.0f,-69.0f,27.0f],Head:[0.0f,0.0f,0.0f],Body:[0.0f,0.0f,0.0f]}}"
  1461. add "{Pose:{LeftLeg:[0.0f,0.0f,327.0f],LeftArm:[-30.0f,-72.0f,10.0f],RightLeg:[0.0f,0.0f,36.0f],RightArm:[317.0f,-69.0f,27.0f],Head:[0.0f,0.0f,0.0f],Body:[0.0f,0.0f,0.0f]}}" to nbt of {_gk}
  1462. while {awayhitbox::skatingup::chest} is set:
  1463. wait a tick
  1464. set {_loc} to location of {_gk} # Chest
  1465. set {_alti} to vector(0,1,0)
  1466. set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
  1467. set {_v} to {_v} ++ {_alti}
  1468. teleport {awayhitbox::skatingup::chest} to {_gk} ~ {_v}
  1469. if distance between {puck} and {awayhitbox::skatingup::chest} < {@gkreach}:
  1470. GoalieReflect({_gk},"pad")
  1471. set {_loc} to location of {_gk} # Head
  1472. set {_alti} to vector(0,1.5,0)
  1473. set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
  1474. set {_v} to {_v} ++ {_alti}
  1475. teleport {awayhitbox::skatingup::head} to {_gk} ~ {_v}
  1476. if distance between {puck} and {awayhitbox::skatingup::head} < {@gkreach}:
  1477. GoalieReflect({_gk},"pad")
  1478. distance between {puck} and {awaygoalie} < 1
  1479. GoalieReflect({awaygoalie},"pad")
  1480. if {_pose} = "savinglefthigh": # DONE
  1481. spawn puffer fish at {_gk}
  1482. set {awaygoalienbt} to "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-3.0f,0.0f,-111.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-33.0f,-72.0f,-18.0f],Head:[-12.0f,-54.0f,-6.0f],Body:[0.0f,9.0f,0.0f]}}"
  1483. add "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-3.0f,0.0f,-111.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-33.0f,-72.0f,-18.0f],Head:[-12.0f,-54.0f,-6.0f],Body:[0.0f,9.0f,0.0f]}}" to nbt of {_gk} #sa
  1484. set {awayhitbox::savinglefthigh::glove} to last spawned puffer fish
  1485. applynbt({awayhitbox::savinglefthigh::glove})
  1486. while {awayhitbox::savinglefthigh::glove} is set:
  1487. wait a tick
  1488. set {_alti} to vector(0,1.45,0)
  1489. set {_v} to spherical vector radius 0.70, yaw {_gk}'s yaw - 85, pitch 6
  1490. set {_v} to {_v} ++ {_alti}
  1491. teleport {awayhitbox::savinglefthigh::glove} to {_gk} ~ {_v}
  1492. if distance between {puck} and {awayhitbox::savinglefthigh::glove} < {@gkreach}:
  1493. teleport {puck} to {awayhitbox::savinglefthigh::glove}
  1494. GoalieSave()
  1495. if {_pose} = "savingrighthigh": # DONE
  1496. add "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-12.0f,0.0f,-3.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-141.0f,-93.0f,-108.0f],Head:[-12.0f,45.0f,-6.0f],Body:[3.0f,12.0f,0.0f]}}" to nbt of {_gk}
  1497. set {awaygoalienbt} to "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-12.0f,0.0f,-3.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-141.0f,-93.0f,-108.0f],Head:[-12.0f,45.0f,-6.0f],Body:[3.0f,12.0f,0.0f]}}"
  1498. spawn silverfish at {_gk}
  1499. set {awayhitbox::savingrighthigh::stick1} to last spawned silverfish
  1500. applynbt({awayhitbox::savingrighthigh::stick1})
  1501. # RightStick(stick2)
  1502. spawn silverfish at {_gk}
  1503. set {awayhitbox::savingrighthigh::stick2} to last spawned silverfish
  1504. applynbt({awayhitbox::savingrighthigh::stick2})
  1505. # RightGlove(glove)
  1506. spawn puffer fish at {_gk}
  1507. set {awayhitbox::savingrighthigh::glove} to last spawned puffer fish
  1508. applynbt({awayhitbox::savingrighthigh::glove})
  1509. while {awayhitbox::savingrighthigh::stick2} is set:
  1510. wait a tick
  1511. # StickHitbox1
  1512. set {_alti} to vector(0,1.70,0)
  1513. set {_v} to spherical vector radius 1.30, yaw {_gk}'s yaw + 85, pitch 6
  1514. set {_v} to {_v} ++ {_alti}
  1515. teleport {awayhitbox::savingrighthigh::stick1} to {_gk} ~ {_v}
  1516. # StickBladeHitbox
  1517. set {_alti} to vector(0,1.70,0)
  1518. set {_v} to spherical vector radius 1.45, yaw {_gk}'s yaw + 85, pitch 6
  1519. set {_v} to {_v} ++ {_alti}
  1520. teleport {awayhitbox::savingrighthigh::stick2} to {_gk} ~ {_v}
  1521. # Glove (lefthand)
  1522. set {_alti} to vector(0,1.50,0)
  1523. set {_v} to spherical vector radius 0.90, yaw {_gk}'s yaw + 85, pitch 6
  1524. set {_v} to {_v} ++ {_alti}
  1525. teleport {awayhitbox::savingrighthigh::glove} to {_gk} ~ {_v}
  1526. if distance between {puck} and {awayhitbox::savingrighthigh::stick1} < {@gkreach}:
  1527. GoalieReflect({_gk},"stick")
  1528. if distance between {puck} and {awayhitbox::savingrighthigh::stick2} < {@gkreach}:
  1529. GoalieReflect({_gk},"stick")
  1530.  
  1531. #
  1532. #
  1533. if distance between {puck} and {awayhitbox::savingrighthigh::glove} < {@gkreach}:
  1534. GoalieReflect({_gk},"pad")
  1535. if {_pose} = "savingleft": # DONE
  1536. spawn puffer fish at {_gk}
  1537. set {awayhitbox::savingleft::glove} to last spawned puffer fish
  1538. applynbt({awayhitbox::savingleft::glove})
  1539. set {awaygoalienbt} to "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-3.0f,-3.9756934E-16f,-57.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-33.0f,-72.0f,-18.0f],Head:[9.0f,-51.0f,-6.0f],Body:[0.0f,9.0f,0.0f]}}"
  1540. add "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-3.0f,-3.9756934E-16f,-57.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-33.0f,-72.0f,-18.0f],Head:[9.0f,-51.0f,-6.0f],Body:[0.0f,9.0f,0.0f]}}" to nbt of {_gk}
  1541. while {awayhitbox::savingleft::glove} exists: # DONE
  1542. wait a tick
  1543. set {_alti} to vector(0,1.10,0)
  1544. set {_v} to spherical vector radius 0.75, yaw {_gk}'s yaw - 85, pitch 6
  1545. set {_v} to {_v} ++ {_alti}
  1546. teleport {awayhitbox::savingleft::glove} to {_gk} ~ {_v}
  1547. if distance between {puck} and {awayhitbox::savingleft::glove} < {@gkreach}:
  1548. teleport {puck} to {awayhitbox::savingleft::glove}
  1549. GoalieSave()
  1550. if {_pose} = "savingright": # DONE !
  1551. # RightStick(stick1)
  1552. add "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-12.0f,0.0f,-3.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-177.0f,-93.0f,-111.0f],Head:[-12.0f,45.0f,-6.0f],Body:[3.0f,12.0f,0.0f]}}" to NBT of {_gk}
  1553. set {awaygoalienbt} to "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-12.0f,0.0f,-3.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-177.0f,-93.0f,-111.0f],Head:[-12.0f,45.0f,-6.0f],Body:[3.0f,12.0f,0.0f]}}"
  1554. spawn silverfish at {_gk}
  1555. set {awayhitbox::savingright::stick1} to last spawned silverfish
  1556. applynbt({awayhitbox::savingright::stick1})
  1557. # RightStick(stick2)
  1558. spawn silverfish at {_gk}
  1559. set {awayhitbox::savingright::stick2} to last spawned silverfish
  1560. applynbt({awayhitbox::savingright::stick2})
  1561. # RightGlove(glove)
  1562. spawn puffer fish at {_gk}
  1563. set {awayhitbox::savingright::glove} to last spawned puffer fish
  1564. applynbt({awayhitbox::savingright::glove})
  1565. while {awayhitbox::savingright::stick2} is set:
  1566. wait a tick
  1567. # StickHitbox1
  1568. set {_alti} to vector(0,1.10,0)
  1569. set {_v} to spherical vector radius 1.30, yaw {_gk}'s yaw + 85, pitch 6
  1570. set {_v} to {_v} ++ {_alti}
  1571. teleport {awayhitbox::savingright::stick1} to {_gk} ~ {_v}
  1572. # StickBladeHitbox
  1573. set {_alti} to vector(0,0.90,0)
  1574. set {_v} to spherical vector radius 1.45, yaw {_gk}'s yaw + 85, pitch 6
  1575. set {_v} to {_v} ++ {_alti}
  1576. teleport {awayhitbox::savingright::stick2} to {_gk} ~ {_v}
  1577. # Glove (lefthand)
  1578. set {_alti} to vector(0,1.10,0)
  1579. set {_v} to spherical vector radius 0.90, yaw {_gk}'s yaw + 85, pitch 6
  1580. set {_v} to {_v} ++ {_alti}
  1581. teleport {awayhitbox::savingright::glove} to {_gk} ~ {_v}
  1582. if distance between {puck} and {awayhitbox::savingright::glove} < {@gkreach}:
  1583. GoalieReflect({_gk},"pad")
  1584. #RightStick1
  1585. if distance between {puck} and {awayhitbox::savingright::stick1} < {@gkreach}:
  1586. GoalieReflect({_gk},"stick")
  1587. #Rightsitck2
  1588. if distance between {puck} and {awayhitbox::savingright::stick2} < {@gkreach}:
  1589. GoalieReflect({_gk},"stick")
  1590. function HomeGKButterfly(gk:entity,bf:boolean = true):
  1591. {game::status} is not "Goal"
  1592. if {homegoalie::currentpose} is "skatingup":
  1593. ResetHitboxes({homegoalie})
  1594. if y-coord of {homegoalie} = 6:
  1595. set {homegoalie::isbutterfly} to true
  1596. set {_gkl} to location of {_gk}
  1597. subtract 0.5 from y-coord of {_gkl}
  1598. teleport {_gk} to {_gkl}
  1599. else:
  1600. set {homegoalie::isbutterfly} to false
  1601. if y-coord of {_gk} < 6:
  1602. set {_gkl} to location of {_gk}
  1603. add 0.5 to y-coord of {_gkl}
  1604. teleport {_gk} to {_gkl}
  1605. # butterfly
  1606. if {_bf} is true:
  1607. spawn puffer fish at {_gk}
  1608. set {homehitbox::butterfly::left} to last spawned puffer fish
  1609. applynbt({homehitbox::butterfly::left})
  1610.  
  1611. spawn puffer fish at {_gk}
  1612. set {homehitbox::butterfly::leftleft} to last spawned puffer fish
  1613. applynbt({homehitbox::butterfly::leftleft})
  1614. #
  1615. spawn puffer fish at {_gk}
  1616. set {homehitbox::butterfly::right} to last spawned puffer fish
  1617. applynbt({homehitbox::butterfly::right})
  1618. spawn puffer fish at {_gk}
  1619. set {homehitbox::butterfly::rightright} to last spawned puffer fish
  1620. applynbt({homehitbox::butterfly::rightright})
  1621.  
  1622. spawn puffer fish at {_gk}
  1623. set {homehitbox::butterfly::chest} to last spawned puffer fish
  1624. applynbt({homehitbox::butterfly::chest})
  1625.  
  1626. spawn puffer fish at {_gk}
  1627. set {homehitbox::butterfly::head} to last spawned puffer fish
  1628. applynbt({homehitbox::butterfly::head})
  1629. set {homegoalie::currentpose} to "butterfly"
  1630. set {homegoalienbt} to "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-12.0f,0.0f,-3.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-69.0f,-57.0f,30.0f],Head:[6.0f,12.0f,-6.0f],Body:[0.0f,-30.0f,0.0f]}}"
  1631. add "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-12.0f,0.0f,-3.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-69.0f,-57.0f,30.0f],Head:[6.0f,12.0f,-6.0f],Body:[0.0f,-30.0f,0.0f]}}" to nbt of {_gk}
  1632. while {homehitbox::butterfly::leftleft} is set:
  1633. wait a tick
  1634.  
  1635. set {_loc} to location of {_gk} # Chest
  1636. set {_alti} to vector(0,1,0)
  1637. set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
  1638. set {_v} to {_v} ++ {_alti}
  1639. teleport {homehitbox::butterfly::chest} to {_gk} ~ {_v}
  1640. if distance between {puck} and {homehitbox::butterfly::chest} < {@gkreach}:
  1641. GoalieReflect({_gk},"pad")
  1642.  
  1643. set {_loc} to location of {_gk} # Head
  1644. set {_alti} to vector(0,1.5,0)
  1645. set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
  1646. set {_v} to {_v} ++ {_alti}
  1647. teleport {homehitbox::butterfly::head} to {_gk} ~ {_v}
  1648. if distance between {puck} and {homehitbox::butterfly::head} < {@gkreach}:
  1649. GoalieReflect({_gk},"pad")
  1650. set {_alti} to vector(0,0.60,0)
  1651. set {_v} to spherical vector radius 0.65, yaw {_gk}'s yaw - 100, pitch 6
  1652. set {_v} to {_v} ++ {_alti}
  1653. teleport {homehitbox::butterfly::leftleft} to {_gk} ~ {_v}
  1654. if distance between {puck} and {homehitbox::butterfly::leftleft} < {@gkreach}:
  1655. GoalieReflect({_gk},"pad")
  1656. #
  1657. set {_loc} to location of {_gk} # Pad LEFT
  1658. set {_alti} to vector(0,0.60,0)
  1659. set {_v} to spherical vector radius 0.35, yaw {_gk}'s yaw - 100, pitch 6
  1660. set {_v} to {_v} ++ {_alti}
  1661. teleport {homehitbox::butterfly::left} to {_gk} ~ {_v}
  1662. if distance between {puck} and {homehitbox::butterfly::left} < {@gkreach}:
  1663. GoalieReflect({_gk},"pad")
  1664.  
  1665. set {_loc} to location of {_gk} # Pad Right
  1666. set {_alti} to vector(0,0.60,0)
  1667. set {_v} to spherical vector radius 0.35, yaw {_gk}'s yaw + 100, pitch 6
  1668. set {_v} to {_v} ++ {_alti}
  1669. teleport {homehitbox::butterfly::right} to {_gk} ~ {_v}
  1670. if distance between {puck} and {homehitbox::butterfly::right} < {@gkreach}:
  1671. GoalieReflect({_gk},"pad")
  1672. #
  1673. set {_loc} to location of {_gk} # Pad rightright
  1674. set {_alti} to vector(0,0.60,0)
  1675. set {_v} to spherical vector radius 0.65, yaw {_gk}'s yaw + 100, pitch 6
  1676. set {_v} to {_v} ++ {_alti}
  1677. teleport {homehitbox::butterfly::rightright} to {_gk} ~ {_v}
  1678. if distance between {puck} and {homehitbox::butterfly::rightright} < {@gkreach}:
  1679. GoalieReflect({_gk},"pad")
  1680. if distance between {homegoalie} and {puck} < 1:
  1681. if {homegoalie::currentpose} is "butterfly":
  1682. set {_v} to vector length of {-pv} * 20 * 2.237
  1683. y-coord of {puck} < 6.25
  1684. {_v} < 12
  1685. HomeNewPose({homegoalie},"covered")
  1686. teleport {puck} to {homegoalie}
  1687. wait a tick
  1688. GoalieSave()
  1689.  
  1690. function HomeNewPose(gk:entity,pose:string):
  1691. {game::status} is not "Goal"
  1692. if {_pose} is not "skatingup":
  1693. if y-coord of {homegoalie} = 6:
  1694. set {homegoalie::isbutterfly} to true
  1695. set {_gkl} to location of {_gk}
  1696. subtract 0.5 from y-coord of {_gkl}
  1697. teleport {_gk} to {_gkl}
  1698. else:
  1699. set {homegoalie::isbutterfly} to false
  1700. if y-coord of {_gk} < 6:
  1701. set {_gkl} to location of {_gk}
  1702. add 0.5 to y-coord of {_gkl}
  1703. teleport {_gk} to {_gkl}
  1704. set {homegoalie::currentpose} to {_pose}
  1705. if {_pose} is "covered":
  1706. set {homegoalienbt} to "{Pose:{LeftLeg:[54.0f,-3.0f,270.0f],LeftArm:[-99.0f,63.0f,-108.0f],RightLeg:[45.0f,9.0f,84.0f],RightArm:[311.0f,-27.0f,-3.0f],Head:[45.0f,-24.0f,0.0f],Body:[18.0f,0.0f,3.0f]}}"
  1707. add "{Pose:{LeftLeg:[54.0f,-3.0f,270.0f],LeftArm:[-99.0f,63.0f,-108.0f],RightLeg:[45.0f,9.0f,84.0f],RightArm:[311.0f,-27.0f,-3.0f],Head:[45.0f,-24.0f,0.0f],Body:[18.0f,0.0f,3.0f]}}" to nbt of {_gk}
  1708. if {_pose} is "skatingup":
  1709. ResetHitboxes({homegoalie})
  1710. spawn puffer fish at {_gk}
  1711. set {homehitbox::skatingup::chest} to last spawned puffer fish
  1712. applynbt({homehitbox::skatingup::chest})
  1713. spawn puffer fish at {_gk}
  1714. set {homehitbox::skatingup::head} to last spawned puffer fish
  1715. applynbt({homehitbox::skatingup::head})
  1716. set {homegoalienbt} to "{Pose:{LeftLeg:[0.0f,0.0f,327.0f],LeftArm:[-30.0f,-72.0f,10.0f],RightLeg:[0.0f,0.0f,36.0f],RightArm:[317.0f,-69.0f,27.0f],Head:[0.0f,0.0f,0.0f],Body:[0.0f,0.0f,0.0f]}}"
  1717. add "{Pose:{LeftLeg:[0.0f,0.0f,327.0f],LeftArm:[-30.0f,-72.0f,10.0f],RightLeg:[0.0f,0.0f,36.0f],RightArm:[317.0f,-69.0f,27.0f],Head:[0.0f,0.0f,0.0f],Body:[0.0f,0.0f,0.0f]}}" to nbt of {_gk}
  1718. while {homehitbox::skatingup::chest} is set:
  1719. wait a tick
  1720. set {_loc} to location of {_gk} # Chest
  1721. set {_alti} to vector(0,1,0)
  1722. set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
  1723. set {_v} to {_v} ++ {_alti}
  1724. teleport {homehitbox::skatingup::chest} to {_gk} ~ {_v}
  1725. if distance between {puck} and {homehitbox::skatingup::chest} < {@gkreach}:
  1726. GoalieReflect({_gk},"pad")
  1727. set {_loc} to location of {_gk} # Head
  1728. set {_alti} to vector(0,1.5,0)
  1729. set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
  1730. set {_v} to {_v} ++ {_alti}
  1731. teleport {homehitbox::skatingup::head} to {_gk} ~ {_v}
  1732. if distance between {puck} and {homehitbox::skatingup::head} < {@gkreach}:
  1733. GoalieReflect({_gk},"pad")
  1734. wait a tick
  1735. distance between {puck} and {homegoalie} < 1
  1736. GoalieReflect({homegoalie},"pad")
  1737. if {_pose} = "savinglefthigh": # DONE
  1738. spawn puffer fish at {_gk}
  1739. set {homegoalienbt} to "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-3.0f,0.0f,-111.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-33.0f,-72.0f,-18.0f],Head:[-12.0f,-54.0f,-6.0f],Body:[0.0f,9.0f,0.0f]}}"
  1740. add "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-3.0f,0.0f,-111.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-33.0f,-72.0f,-18.0f],Head:[-12.0f,-54.0f,-6.0f],Body:[0.0f,9.0f,0.0f]}}" to nbt of {_gk} #sa
  1741. set {homehitbox::savinglefthigh::glove} to last spawned puffer fish
  1742. applynbt({homehitbox::savinglefthigh::glove})
  1743. while {homehitbox::savinglefthigh::glove} is set:
  1744. wait a tick
  1745. set {_alti} to vector(0,1.45,0)
  1746. set {_v} to spherical vector radius 0.70, yaw {_gk}'s yaw - 85, pitch 6
  1747. set {_v} to {_v} ++ {_alti}
  1748. teleport {homehitbox::savinglefthigh::glove} to {_gk} ~ {_v}
  1749. if distance between {puck} and {homehitbox::savinglefthigh::glove} < {@gkreach}:
  1750. teleport {puck} to {homehitbox::savinglefthigh::glove}
  1751. GoalieSave()
  1752. if {_pose} = "savingrighthigh": # DONE
  1753. add "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-12.0f,0.0f,-3.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-141.0f,-93.0f,-108.0f],Head:[-12.0f,45.0f,-6.0f],Body:[3.0f,12.0f,0.0f]}}" to nbt of {_gk}
  1754. set {homegoalienbt} to "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-12.0f,0.0f,-3.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-141.0f,-93.0f,-108.0f],Head:[-12.0f,45.0f,-6.0f],Body:[3.0f,12.0f,0.0f]}}"
  1755. spawn silverfish at {_gk}
  1756. set {homehitbox::savingrighthigh::stick1} to last spawned silverfish
  1757. applynbt({homehitbox::savingrighthigh::stick1})
  1758. # RightStick(stick2)
  1759. spawn silverfish at {_gk}
  1760. set {homehitbox::savingrighthigh::stick2} to last spawned silverfish
  1761. applynbt({homehitbox::savingrighthigh::stick2})
  1762. # RightGlove(glove)
  1763. spawn puffer fish at {_gk}
  1764. set {homehitbox::savingrighthigh::glove} to last spawned puffer fish
  1765. applynbt({homehitbox::savingrighthigh::glove})
  1766. while {homehitbox::savingrighthigh::stick2} is set:
  1767. wait a tick
  1768. # StickHitbox1
  1769. set {_alti} to vector(0,1.70,0)
  1770. set {_v} to spherical vector radius 1.30, yaw {_gk}'s yaw + 85, pitch 6
  1771. set {_v} to {_v} ++ {_alti}
  1772. teleport {homehitbox::savingrighthigh::stick1} to {_gk} ~ {_v}
  1773. # StickBladeHitbox
  1774. set {_alti} to vector(0,1.70,0)
  1775. set {_v} to spherical vector radius 1.45, yaw {_gk}'s yaw + 85, pitch 6
  1776. set {_v} to {_v} ++ {_alti}
  1777. teleport {homehitbox::savingrighthigh::stick2} to {_gk} ~ {_v}
  1778. # Glove (lefthand)
  1779. set {_alti} to vector(0,1.50,0)
  1780. set {_v} to spherical vector radius 0.90, yaw {_gk}'s yaw + 85, pitch 6
  1781. set {_v} to {_v} ++ {_alti}
  1782. teleport {homehitbox::savingrighthigh::glove} to {_gk} ~ {_v}
  1783. if distance between {puck} and {homehitbox::savingrighthigh::stick1} < {@gkreach}:
  1784. GoalieReflect({_gk},"stick")
  1785. if distance between {puck} and {homehitbox::savingrighthigh::stick2} < {@gkreach}:
  1786. GoalieReflect({_gk},"stick")
  1787.  
  1788. #
  1789. #
  1790. if distance between {puck} and {homehitbox::savingrighthigh::glove} < {@gkreach}:
  1791. GoalieReflect({_gk},"pad")
  1792. if {_pose} = "savingleft": # DONE
  1793. spawn puffer fish at {_gk}
  1794. set {homehitbox::savingleft::glove} to last spawned puffer fish
  1795. applynbt({homehitbox::savingleft::glove})
  1796. set {homegoalienbt} to "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-3.0f,-3.9756934E-16f,-57.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-33.0f,-72.0f,-18.0f],Head:[9.0f,-51.0f,-6.0f],Body:[0.0f,9.0f,0.0f]}}"
  1797. add "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-3.0f,-3.9756934E-16f,-57.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-33.0f,-72.0f,-18.0f],Head:[9.0f,-51.0f,-6.0f],Body:[0.0f,9.0f,0.0f]}}" to nbt of {_gk}
  1798. while {homehitbox::savingleft::glove} exists: # DONE
  1799. wait a tick
  1800. set {_alti} to vector(0,1.10,0)
  1801. set {_v} to spherical vector radius 0.75, yaw {_gk}'s yaw - 85, pitch 6
  1802. set {_v} to {_v} ++ {_alti}
  1803. teleport {homehitbox::savingleft::glove} to {_gk} ~ {_v}
  1804. if distance between {puck} and {homehitbox::savingleft::glove} < {@gkreach}:
  1805. teleport {puck} to {homehitbox::savingleft::glove}
  1806. GoalieSave()
  1807. if {_pose} = "savingright": # DONE !
  1808. # RightStick(stick1)
  1809. set {homegoalienbt} to "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-12.0f,0.0f,-3.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-177.0f,-93.0f,-111.0f],Head:[-12.0f,45.0f,-6.0f],Body:[3.0f,12.0f,0.0f]}}"
  1810. add "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-12.0f,0.0f,-3.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-177.0f,-93.0f,-111.0f],Head:[-12.0f,45.0f,-6.0f],Body:[3.0f,12.0f,0.0f]}}" to NBT of {_gk}
  1811. spawn silverfish at {_gk}
  1812. set {homehitbox::savingright::stick1} to last spawned silverfish
  1813. applynbt({homehitbox::savingright::stick1})
  1814. # RightStick(stick2)
  1815. spawn silverfish at {_gk}
  1816. set {homehitbox::savingright::stick2} to last spawned silverfish
  1817. applynbt({homehitbox::savingright::stick2})
  1818. # RightGlove(glove)
  1819. spawn puffer fish at {_gk}
  1820. set {homehitbox::savingright::glove} to last spawned puffer fish
  1821. applynbt({homehitbox::savingright::glove})
  1822. while {homehitbox::savingright::stick2} is set:
  1823. wait a tick
  1824. # StickHitbox1
  1825. set {_alti} to vector(0,1.10,0)
  1826. set {_v} to spherical vector radius 1.30, yaw {_gk}'s yaw + 85, pitch 6
  1827. set {_v} to {_v} ++ {_alti}
  1828. teleport {homehitbox::savingright::stick1} to {_gk} ~ {_v}
  1829. # StickBladeHitbox
  1830. set {_alti} to vector(0,0.90,0)
  1831. set {_v} to spherical vector radius 1.45, yaw {_gk}'s yaw + 85, pitch 6
  1832. set {_v} to {_v} ++ {_alti}
  1833. teleport {homehitbox::savingright::stick2} to {_gk} ~ {_v}
  1834. # Glove (lefthand)
  1835. set {_alti} to vector(0,1.10,0)
  1836. set {_v} to spherical vector radius 0.90, yaw {_gk}'s yaw + 85, pitch 6
  1837. set {_v} to {_v} ++ {_alti}
  1838. teleport {homehitbox::savingright::glove} to {_gk} ~ {_v}
  1839. if distance between {puck} and {homehitbox::savingright::glove} < {@gkreach}:
  1840. GoalieReflect({_gk},"pad")
  1841. #RightStick1
  1842. if distance between {puck} and {homehitbox::savingright::stick1} < {@gkreach}:
  1843. GoalieReflect({_gk},"stick")
  1844. #Rightsitck2
  1845. if distance between {puck} and {homehitbox::savingright::stick2} < {@gkreach}:
  1846. GoalieReflect({_gk},"stick")
  1847.  
  1848. command /smth:
  1849. trigger:
  1850. loop {teamslist::*}:
  1851. add loop-value to {_toshuffle::*}
  1852. while size of {_toshuffle::*} > 0:
  1853. wait a tick
  1854. set {_a} to a random element of {_toshuffle::*}
  1855. remove {_a} from {_toshuffle::*}
  1856. add {_a} to {_shuffled::*}
  1857. loop {_shuffled::*}:
  1858. send "%loop-index%. %loop-value%"
  1859. #set metadata tag "vanillaGUI" of player to chest inventory with 3 rows named "&7Hello There"
  1860. function SelectTeam(p:player,t:string,staff:boolean = false):
  1861. close inventory of {_p}
  1862. open virtual chest inventory with 4 rows named "&2Hello, captain! Pick a team." to {_p}
  1863. format gui slot (integers from 0 to 8) of {_p} with orange stained glass pane named "&c" to do nothing
  1864. format gui slot (integers from 27 to 35) of {_p} with orange stained glass pane named "&c" to do nothing #teamnew
  1865. loop {teamslist::*}:
  1866. add loop-value to {_toshuffle::*}
  1867. while size of {_toshuffle::*} > 0:
  1868. wait a tick
  1869. set {_a} to a random element of {_toshuffle::*}
  1870. remove {_a} from {_toshuffle::*}
  1871. add {_a} to {_shuffled::*}
  1872. set {_n} to 8
  1873. loop {_shuffled::*}:
  1874. add 1 to {_n}
  1875. if {_n} < 27:
  1876. set {_x} to loop-value
  1877. format gui slot {_n} of {_p} with iron helmet named coloured {teams::%loop-value%::name} with lore "", "&7Stats: &6&6%{teams::%loop-value%::wins}%&7-&6%{teams::%loop-value%::loses}%&7-&6%{teams::%loop-value%::losesot}%", "&7Captain: &6%{teams::%loop-value%::captain}%", "" and "&eClick to select" to run:
  1878. close inventory of {_p}
  1879. if {_t} is "away":
  1880. set {game::away::team} to {_x}
  1881. if {_staff} is false:
  1882. broadcast "&eThe &bAway &ecaptain &7%{_p}% &epicked the team %coloured {teams::%{_x}%::name}%&e."
  1883. else:
  1884. broadcast "&cThe staff %coloured prefix of {_p}% %{_p}% &cchanged the &bAway&c team to %coloured {teams::%{_x}%::name}%"
  1885. loop {game::away::members::*}:
  1886. EquipPlayer(loop-value-2)
  1887. if {_t} is "home":
  1888. set {game::home::team} to {_x}
  1889. if {_staff} is false:
  1890. broadcast "&eThe &aHome &ecaptain &7%{_p}% &epicked the team %coloured {teams::%{_x}%::name}%&e."
  1891. else:
  1892. broadcast "&cThe staff %coloured prefix of {_p}% %{_p}% &cchanged the &aHome&c team to %coloured {teams::%{_x}%::name}%"
  1893. loop {game::home::members::*}:
  1894. EquipPlayer(loop-value-2)
  1895. command /changeteam [<text>]:
  1896. permission: staff.changeteam
  1897. permission message: &cYou must be staff or higher to manage current game's teams
  1898. trigger:
  1899. if arg 1 is not set:
  1900. send ""
  1901. send "&a&lChanging a team"
  1902. send ""
  1903. send "&7/changeteam away/home"
  1904. send ""
  1905. if arg 1 = "away":
  1906. broadcast "&cAn staff is currently changing the &bAway&c team."
  1907. SelectTeam(player,"away",true)
  1908. if arg 1 is "home":
  1909. broadcast "&cAn staff is currently changing the &aHome&c team."
  1910. SelectTeam(player,"home",true)
  1911. on item damage:
  1912. event-item is {BHL::stick}
  1913. repair tool
  1914. function LoadTeams(all:boolean = true,t:string = ""):
  1915. if {_all} is true:
  1916. loop {teamslist::*}:
  1917. load yaml "{@dir}/%loop-value%.yml" as "teamdata.%loop-value%"
  1918. delete {teams::%loop-value%::*}
  1919. set {teams::%loop-value%::short} to yaml value "short" from "teamdata.%loop-value%"
  1920. set {teams::%loop-value%::name} to yaml value "name" from "teamdata.%loop-value%"
  1921. set {teams::%loop-value%::horn} to yaml value "horn" from "teamdata.%loop-value%"
  1922. set {teams::%loop-value%::wins} to yaml value "wins" from "teamdata.%loop-value%"
  1923. set {teams::%loop-value%::loses} to yaml value "loses" from "teamdata.%loop-value%"
  1924. set {teams::%loop-value%::losesot} to yaml value "losesot" from "teamdata.%loop-value%"
  1925. set {teams::%loop-value%::captain} to yaml value "captain" from "teamdata.%loop-value%"
  1926. set {_rgb::*} to yaml list "awayhelmet" from "teamdata.%loop-value%"
  1927. set {_rgb::1} to round({_rgb::1})
  1928. set {_rgb::2} to round({_rgb::2})
  1929. set {_rgb::3} to round({_rgb::3})
  1930. set {teams::%loop-value%::awayhelmet} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
  1931. set {_rgb::*} to yaml list "awaychestplate" from "teamdata.%loop-value%"
  1932. set {_rgb::1} to round({_rgb::1})
  1933. set {_rgb::2} to round({_rgb::2})
  1934. set {_rgb::3} to round({_rgb::3})
  1935. set {teams::%loop-value%::awaychestplate} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
  1936. set {_rgb::*} to yaml list "awayleggings" from "teamdata.%loop-value%"
  1937. set {_rgb::1} to round({_rgb::1})
  1938. set {_rgb::2} to round({_rgb::2})
  1939. set {_rgb::3} to round({_rgb::3})
  1940. set {teams::%loop-value%::awayleggings} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
  1941. set {_rgb::*} to yaml list "awayboots" from "teamdata.%loop-value%"
  1942. set {_rgb::1} to round({_rgb::1})
  1943. set {_rgb::2} to round({_rgb::2})
  1944. set {_rgb::3} to round({_rgb::3})
  1945. set {teams::%loop-value%::awayboots} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
  1946. set {_rgb::*} to yaml list "homehelmet" from "teamdata.%loop-value%"
  1947. set {_rgb::1} to round({_rgb::1})
  1948. set {_rgb::2} to round({_rgb::2})
  1949. set {_rgb::3} to round({_rgb::3})
  1950. set {teams::%loop-value%::homehelmet} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
  1951. set {_rgb::*} to yaml list "homechestplate" from "teamdata.%loop-value%"
  1952. set {_rgb::1} to round({_rgb::1})
  1953. set {_rgb::2} to round({_rgb::2})
  1954. set {_rgb::3} to round({_rgb::3})
  1955. set {teams::%loop-value%::homechestplate} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
  1956. set {_rgb::*} to yaml list "homeleggings" from "teamdata.%loop-value%"
  1957. set {_rgb::1} to round({_rgb::1})
  1958. set {_rgb::2} to round({_rgb::2})
  1959. set {_rgb::3} to round({_rgb::3})
  1960. set {teams::%loop-value%::homeleggings} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
  1961. set {_rgb::*} to yaml list "homeboots" from "teamdata.%loop-value%"
  1962. set {_rgb::1} to round({_rgb::1})
  1963. set {_rgb::2} to round({_rgb::2})
  1964. set {_rgb::3} to round({_rgb::3})
  1965. set {teams::%loop-value%::homeboots} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
  1966.  
  1967. function RebuildGame():
  1968. delete {game::shootouts::*}
  1969. set {pucklasttp} to now
  1970. unload yaml directory "{@dir}"
  1971. set {isreplay} to false
  1972. delete {isrestart}
  1973. delete {awaygoalie::player}
  1974. delete {homegoalie::player}
  1975. wait a tick
  1976. set {lastpoke} to now
  1977. set {game::seasoned} to false
  1978. set {game::status} to "Waiting"
  1979. set {game::time::min} to 0
  1980. set {game::period} to 1
  1981. set {game::time::sec} to 0
  1982. set {game::home::goals} to 0
  1983. set {game::away::goals} to 0
  1984. set {game::away::team} to a random element of {teamslist::*}
  1985. set {game::home::team} to a random element of {teamslist::*}
  1986. set {puckinvis} to now
  1987. set {inplay} to true
  1988. LoadTeams(true)
  1989. set {awaygoalie::lastpose} to "up"
  1990. set {homegoalie::lastpose} to "up"
  1991. set {awaygoalie::player} to "AI"
  1992. set {homegoalie::player} to "AI"
  1993. set {game::status} to "Waiting"
  1994. kill all silverfishes and puffer fishes
  1995. broadcast "&a&LGAME &e» &ERebuilding game..."
  1996. loop all players:
  1997. LoadData(loop-player)
  1998. loop all armor stands in world "{@hw}":
  1999. if tool of loop-entity is set:
  2000. kill loop-entity
  2001. loop all armor stands in world "lobby":
  2002. if tool of loop-entity is set:
  2003.  
  2004. kill loop-entity
  2005. kill all endermites in world "{@hw}"
  2006. apply slowness of tier 5 without particles to {puck} for 1 day
  2007. broadcast "&a&LGAME &e» &EVariables set."
  2008. SummonGoalie("away",location at {BHL::awaynet})
  2009. set {awaygoalie} to last spawned armor stand
  2010. set display name of {awaygoalie} to "&fAI"
  2011. SummonGoalie("home",location at {BHL::homenet})
  2012. set {homegoalie} to last spawned armor stand
  2013. set display name of {homegoalie} to "&fAI"
  2014. SummonGoalie("home",location at {BHL::lobby})
  2015. set {lobby} to last spawned armor stand
  2016. add "{Pose:{LeftLeg:[18.0f,-3.0f,-84.0f],LeftArm:[-12.0f,0.0f,-3.0f],RightLeg:[15.0f,18.0f,87.0f],RightArm:[-69.0f,-57.0f,30.0f],Head:[6.0f,12.0f,-6.0f],Body:[0.0f,-30.0f,0.0f]}}" to nbt of {lobby}
  2017. AwayNewPose({lobby},"skatingup")
  2018. set helmet of {awaygoalie} to {gk}
  2019. set helmet of {homegoalie} to {gk}
  2020. wait 1 second
  2021. #AwayAI()
  2022. RespawnPuck("center")
  2023. set {goalieai} to true
  2024. Puck()
  2025. loop all players in world "{@hw}":
  2026. EquipPlayer(loop-player)
  2027. on damage:
  2028. victim is {lobby}
  2029. JoinBHL(attacker)
  2030. cancel event
  2031. on rightclick:
  2032. target entity of player is {lobby}
  2033. JoinBHL(player)
  2034. cancel event
  2035. function showVector(o: location, v: vector, c1: integers, c2: integers):
  2036. set {_cv} to vector(x of {_v}, y of {_v}, z of {_v})
  2037. loop vector length of {_cv} / .1 - .5 times:
  2038. set vector length of {_cv} to loop-value * .1
  2039. play 1 of dust using dustOption(rgb({_c1::1}, {_c1::2}, {_c1::3}), .5) at {_o} ~ {_cv}
  2040. set {_pv} to vector from yaw (vector yaw of {_cv} + 90) and pitch 0
  2041. loop 5 times:
  2042. loop 8 times:
  2043. set {_v2} to spherical vector radius .25 - (.05 * loop-value-1), yaw loop-value-2 * 45, pitch 0
  2044. rotate {_v2} around {_pv} by (vector pitch of {_cv} + 90) * -1
  2045. set {_at} to {_o} ~ {_cv}
  2046. play 1 of dust using dustOption(rgb({_c2::1}, {_c2::2}, {_c2::3}), .5) at {_at} ~ {_v2}
  2047. add .1 to vector length of {_cv}
  2048. # and the vectors for the 3 points should determine where on the circle he should be at
  2049.  
  2050. function PuckAltitude():
  2051. while {puck} is set:
  2052. wait a tick
  2053. {puckowner} is not set
  2054. {goalieai} is true
  2055. if difference between {pucklasttp} and now > 1 second:
  2056. subtract 0.02 from y of {-pv} if y-coord of {puck} > 6.3
  2057. if y-coord of {puck} < 6:
  2058. set {pucklasttp} to now
  2059. set y of {-pv} to 0
  2060. set {_loc} to location of {puck}
  2061. set y-coord of {_loc} to 6
  2062. teleport {puck} to {_loc}
  2063. set y of {-pv} to 0
  2064. function AwayAI(): #
  2065. AwayAIPoses()
  2066. set {_gk} to {awaygoalie}
  2067. set {_mid} to location of block below {bhl::awaynet}
  2068. add 0.5 to y-coord of {_mid}
  2069. set {_left} to {_mid}
  2070. set {_right} to {_mid}
  2071. add 2 to z-coord of {_right}
  2072. subtract 2 from z-coord of {_left}
  2073. while {awaygoalie::player} is "AI":
  2074. wait a tick
  2075. {goalieai} is true
  2076. {game::status} is "In-game"
  2077. {puck} is set
  2078. distance between {awaygoalie} and {puck} < 30
  2079. set {_leftv} to vector from {_left} to {puck}
  2080. set {_midv} to vector from {_mid} to {puck}
  2081. set {_rightv} to vector from {_right} to {puck}
  2082. set {_gkv} to vector from {_gk} to {puck} #
  2083. set {_eqx} to vector length of {_gkv}
  2084. set {_d} to distance between {puck} and {_mid}
  2085. set {_rad} to min(max(1 + {_d} / 10, .25), 2) * 2
  2086. set {_v} to spherical vector radius {_rad}, yaw (vector yaw of vector from {_mid} to {puck}), pitch 0
  2087. x-coord of {puck} > x-coord of {awaygoalie}
  2088. loop 180 times:
  2089. set {_v2} to spherical vector radius {_rad}, yaw loop-value, pitch 0
  2090. play 1 of dust using dustOption(rgb(255, 0, 255), .5) at {_mid} ~ {_v2}
  2091. if {awaygoalie::currentpose} is not "skatingup":
  2092. set {_y} to y-coord of {awaygoalie}
  2093. if {_y} is not 5.5:
  2094. subtract 0.5 from y-coord of {_mid}
  2095. teleport {awaygoalie} to {_mid} ~ {_v}
  2096. else:
  2097. set {_y} to y-coord of {awaygoalie}
  2098. if {_y} is not 6:
  2099. add 0.5 to y-coord of {_mid}
  2100. {awaygoalie::currentpose} is not "savingleft" or "savingright"
  2101. teleport {awaygoalie} to {_mid} ~ {_v}
  2102. makeLook({awaygoalie},location at {puck})
  2103. loop 180 times:
  2104. set {_v2} to spherical vector radius .5, yaw loop-value, pitch 0
  2105. play 1 of dust using dustOption(rgb(255, 0, 0), .5) at {_mid} ~ {_v2}
  2106. loop 180 times:
  2107. set {_v2} to spherical vector radius 2, yaw loop-value, pitch 0
  2108. play 1 of dust using dustOption(rgb(255, 0, 0), .5) at {_mid} ~ {_v2}
  2109. function AwayAIPoses():
  2110. set {_gk} to {awaygoalie}
  2111. set {_mid} to location of block below {bhl::awaynet}
  2112. add 0.5 to y-coord of {_mid}
  2113. set {_left} to {_mid}
  2114. set {_right} to {_mid}
  2115. add 1 to z-coord of {_right}
  2116. subtract 1 from z-coord of {_left}
  2117. while {awaygoalie::player} is "AI":
  2118. wait a tick
  2119. {goalieai} is true
  2120. {puck} is set
  2121. x-coord of {puck} > (x-coord of {awaygoalie})
  2122. set {_d} to distance between {awaygoalie} and {puck}
  2123. set {_dm} to distance between {puck} and {_mid}
  2124. set {_dl} to distance between {puck} and {_left}
  2125. set {_dr} to distance between {puck} and {_right}
  2126. if {_d} < 2.30:
  2127. if {_dm} < {_dl} and {_dr}:
  2128. if {awaygoalie::isbutterfly} is false:
  2129. AwayGKButterfly({awaygoalie},true)
  2130. if {_dl} < {_dm} and {_dr}:
  2131. if {awaygoalie::isbutterfly} is false:
  2132. AwayGKButterfly({awaygoalie},true)
  2133. if {awaygoalie::currentpose} is not "savingleft" or "savinglefthigh":
  2134. y-coord of {awaygoalie} is 5.5
  2135. if y-coord of {puck} < 6.50:
  2136. AwayNewPose({awaygoalie},"savingleft")
  2137. else:
  2138. AwayNewPose({awaygoalie},"savinglefthigh")
  2139. if {_dr} < {_dl} and {_dm}:
  2140. if {awaygoalie::isbutterfly} is false:
  2141. AwayGKButterfly({awaygoalie},true)
  2142. if {awaygoalie::currentpose} is not "savingright" or "savingrighthigh":
  2143. AwayNewPose({awaygoalie},"savingright")
  2144. y-coord of {awaygoalie} is 5.5
  2145. if y-coord of {puck} < 6.50:
  2146. AwayNewPose({awaygoalie},"savingirght")
  2147. else:
  2148. AwayNewPose({awaygoalie},"savingrighthigh")
  2149. else:
  2150. if {awaygoalie::currentpose} is not "skatingup":
  2151. ResetHitboxes({awaygoalie})
  2152. AwayNewPose({awaygoalie},"skatingup")
  2153.  
  2154. function Puck():
  2155. set {-pv} to vector(0, 0, 0)
  2156. while {puck} is alive:
  2157. PuckAI()
  2158. wait 1 tick
  2159. if "%x of {-pv}%" contains "NaN":
  2160. set {-pv} to vector(0, 0, 0)
  2161. if {goalieai} and {inplay} are true:
  2162. set {-pv} to {-pv} ** vector(.98, .98, .98)
  2163. if block at ({puck} ~ {-pv}) is not air:
  2164. if {puckowner} is set:
  2165. delete {puckowner}
  2166. if block at ({puck} ~ {-pv}) is mossy cobblestone wall: # cobb
  2167. play sound "minecraft:post" at location of {puck}
  2168. Commentator("post")
  2169. delete {puckowner}
  2170. set {_n} to normalized (vector from block at {puck} -- vector from block at ({puck} ~ {-pv}))
  2171. rotate {-pv} around {_n} by 180 if y-coord of block at ({puck} ~ {-pv}) is not 5.5 or 6
  2172. set {-pv} to {-pv} ** vector(-{@gkreach}, 0, -{@gkreach}) if y-coord of block at ({puck} ~ {-pv}) is not 5.5 or 6
  2173. teleport {puck} to {puck} ~ {-pv} if y-coord of block at ({puck} ~ {-pv}) is 6 or 5.5
  2174. else:
  2175. teleport {puck} to {puck} ~ {-pv}
  2176. set {-pv} to {-pv} ** vector(.98, .98, .98)
  2177. function PuckAI():
  2178. while {puck} is alive:
  2179. wait 1 tick
  2180. while {puckowner} exists:
  2181. wait 1 tick
  2182. if {deke::%{puckowner}%} = "center":
  2183. set {_v} to spherical vector radius 1.30, yaw {puckowner}'s yaw, pitch 6
  2184. if {deke::%{puckowner}%} = "left":
  2185. set {_v} to spherical vector radius 1.30, yaw {puckowner}'s yaw - 80, pitch 6
  2186. if {deke::%{puckowner}%} = "right":
  2187. set {_v} to spherical vector radius 1.30, yaw {puckowner}'s yaw + 80, pitch 6
  2188. set {_alti} to vector(0,0.15,0)
  2189. set {_v} to {_v} ++ {_alti}
  2190. if block at ({puckowner} ~ {_v}) is air:
  2191. teleport {puck} to {puckowner} ~ {_v}
  2192. else:
  2193. delete {puckowner}
  2194. function NewPG(p:player,gk:string):
  2195. if {game::status} is "Warmup":
  2196. if {_p} is {game::shootouts::player}:
  2197. broadcast "&cYou are currently on a shootout, you can't do this!"
  2198. stop
  2199. if {_gk} is "awaypg":
  2200. set {awaygoalie::patch} to now
  2201. teleport {_p} to {awaynet}
  2202. clear inventory of {_p}
  2203. give {_p} {BHL::goaliecontrol}
  2204. set {awaygoalie::player} to {_p}
  2205. while {awaygoalie::player} = {_p}:
  2206. wait a tick
  2207. {game::status} is not "Goal" or "Out of play"
  2208. if "%region at {_p}%" does not contain "goaliearea1 in world {@hw}": # should be handled by regions later
  2209. teleport {_p} to {BHL::awaynet}
  2210. teleport {awaygoalie} to {_p}
  2211. apply invisibility of tier 50 without particles to {_p} for 1 day
  2212. send action bar "&cAs a goalie, you have to stay in your zone!" to {awaygoalie::player}
  2213. else if {awaygoalie::isbutterfly} is true:
  2214. set {_l} to location of {_p}
  2215. subtract 0.5 from y-coord of {_l}
  2216. teleport {awaygoalie} to {_l}
  2217. else:
  2218. teleport {awaygoalie} to {_p}
  2219. if {_gk} is "homepg":
  2220. set {homegoalie::patch} to now
  2221. teleport {_p} to {homenet}
  2222. clear inventory of {_p}
  2223. give {_p} {BHL::goaliecontrol}
  2224. set {homegoalie::player} to {_p}
  2225. apply invisibility of tier 50 without particles to {_p} for 1 day
  2226. while {homegoalie::player} = {_p}:
  2227. wait a tick
  2228. {game::status} is not "Goal" or "Out of play"
  2229. if "%region at {_p}%" does not contain "goaliearea2 in world {@hw}": # should be handled by regions later
  2230. teleport {_p} to {BHL::homenet}
  2231. teleport {homegoalie} to {_p}
  2232. apply invisibility of tier 50 without particles to {_p} for 1 day
  2233. send action bar "&cAs a goalie, you have to stay in your zone!" to {homegoalie::player}
  2234. else if {homegoalie::isbutterfly} is true:
  2235. set {_l} to location of {_p}
  2236. subtract 0.5 from y-coord of {_l}
  2237. teleport {homegoalie} to {_l}
  2238. else:
  2239. teleport {homegoalie} to {_p}
  2240. wait a tick
  2241. on sneak toggle:
  2242. if {goalieai} is true:
  2243. {game::status} is not "Goal"
  2244. if player is {awaygoalie::player}:
  2245. if {awaygoalie::player} is not sneaking:
  2246. if {awaygoalie::currentpose} is "skatingup":
  2247. AwayGKButterfly({awaygoalie},true)
  2248. stop
  2249. else:
  2250. if {awaygoalie::player} is sneaking:
  2251. if {awaygoalie::currentpose} is "butterfly" or "savingleft" or "savinglefthigh" or "savingrighthigh" or "savingright":
  2252. ResetHitboxes({awaygoalie})
  2253. AwayNewPose({awaygoalie},"skatingup")
  2254. stop
  2255. if player is {homegoalie::player}:
  2256. if {homegoalie::player} is not sneaking:
  2257. if {homegoalie::currentpose} is "skatingup":
  2258. HomeGKButterfly({homegoalie},true)
  2259. stop
  2260. else:
  2261. if {homegoalie::player} is sneaking:
  2262. if {homegoalie::currentpose} is "butterfly" or "savingleft" or "savinglefthigh" or "savingrighthigh" or "savingright":
  2263. ResetHitboxes({homegoalie})
  2264. HomeNewPose({homegoalie},"skatingup")
  2265. stop
  2266. on damage:
  2267. victim is {awaygoalie} or {homegoalie}
  2268. cancel event
  2269. on drop:
  2270. event-item is {bhl::goaliecontrol}
  2271. PGGlove(player)
  2272. cancel event
  2273. on rightclick:
  2274. tool of player is {bhl::goaliecontrol}
  2275. cancel event
  2276. on rightclick:
  2277. target entity of player is {awaygoalie} or {homegoalie}
  2278. function PGGlove(p:player):
  2279. {game::status} is not "Goal"
  2280. {goalieai} is true
  2281. if {_p} is {awaygoalie::player}:
  2282. if {awaygoalie::currentpose} is "butterfly" or "savingright" or "savingrighthigh":
  2283. if {awaygoalie::currentpose} is "butterfly" or "savingright" or "savingrighthigh":
  2284. set {awaygoalie::patch} to now
  2285. ResetHitboxes({awaygoalie})
  2286. AwayGKButterfly({awaygoalie},true)
  2287. AwayNewPose({awaygoalie},"savingleft")
  2288. if {awaygoalie::currentpose} is "savinglefthigh":
  2289. set {awaygoalie::patch} to now
  2290. ResetHitboxes({awaygoalie})
  2291. AwayGKButterfly({awaygoalie},true)
  2292. AwayNewPose({awaygoalie}, "savingleft")
  2293. stop
  2294. if {awaygoalie::currentpose} is "savingleft":
  2295. set {awaygoalie::patch} to now
  2296. ResetHitboxes({awaygoalie})
  2297. AwayGKButterfly({awaygoalie},true)
  2298. AwayNewPose({awaygoalie}, "savinglefthigh")
  2299. if {_p} is {homegoalie::player}:
  2300. if {homegoalie::currentpose} is "butterfly" or "savingright" or "savingrighthigh":
  2301. if {homegoalie::currentpose} is "butterfly" or "savingright" or "savingrighthigh":
  2302. set {homegoalie::patch} to now
  2303. ResetHitboxes({homegoalie})
  2304. HomeGKButterfly({homegoalie},true)
  2305.  
  2306. HomeNewPose({homegoalie},"savingleft")
  2307. if {homegoalie::currentpose} is "savinglefthigh": #
  2308. set {homegoalie::patch} to now
  2309. ResetHitboxes({homegoalie})
  2310. HomeGKButterfly({homegoalie},true)
  2311. HomeNewPose({homegoalie}, "savingleft")
  2312. stop
  2313. if {homegoalie::currentpose} is "savingleft":
  2314. set {homegoalie::patch} to now
  2315. ResetHitboxes({homegoalie})
  2316. HomeGKButterfly({homegoalie},true)
  2317. HomeNewPose({homegoalie}, "savinglefthigh")
  2318.  
  2319. on swapping of held item:
  2320. gamemode of player is not creative
  2321. cancel event
  2322. if player is {awaygoalie::player} or {homegoalie::player}:
  2323. cancel event
  2324. tool of player is {bhl::goaliecontrol}
  2325. {goalieai} is true
  2326. {game::status} is not "Goal"
  2327. if player is {awaygoalie::player}:
  2328. if {awaygoalie::currentpose} is "butterfly" or "savingleft" or "savinglefthigh":
  2329. if difference between {awaygoalie::patch} and now > 0.2 second:
  2330. if {awaygoalie::currentpose} is "butterfly" or "savingleft" or "savinglefthigh":
  2331. set {awaygoalie::patch} to now
  2332. ResetHitboxes({awaygoalie})
  2333. AwayGKButterfly({awaygoalie},true)
  2334. AwayNewPose({awaygoalie},"savingright")
  2335. if {awaygoalie::currentpose} is "savingrighthigh":
  2336. set {awaygoalie::patch} to now
  2337. ResetHitboxes({awaygoalie})
  2338. AwayGKButterfly({awaygoalie},true)
  2339. AwayNewPose({awaygoalie}, "savingright")
  2340. stop
  2341. if {awaygoalie::currentpose} is "savingright":
  2342. set {awaygoalie::patch} to now
  2343. ResetHitboxes({awaygoalie})
  2344. AwayGKButterfly({awaygoalie},true)
  2345. AwayNewPose({awaygoalie}, "savingrighthigh")
  2346. stop
  2347. if player is {homegoalie::player}:
  2348. if {homegoalie::currentpose} is "butterfly" or "savingleft" or "savinglefthigh":
  2349. if difference between {homegoalie::patch} and now > 0.2 second:
  2350. if {homegoalie::currentpose} is "butterfly" or "savingleft" or "savinglefthigh":
  2351. set {homegoalie::patch} to now
  2352. ResetHitboxes({homegoalie})
  2353. HomeGKButterfly({homegoalie},true)
  2354. HomeNewPose({homegoalie},"savingright")
  2355. if {homegoalie::currentpose} is "savingrighthigh":
  2356. set {homegoalie::patch} to now
  2357. ResetHitboxes({homegoalie})
  2358. HomeGKButterfly({homegoalie},true)
  2359. HomeNewPose({homegoalie}, "savingright")
  2360. stop
  2361. if {homegoalie::currentpose} is "savingright":
  2362. set {homegoalie::patch} to now
  2363. ResetHitboxes({homegoalie})
  2364. HomeGKButterfly({homegoalie},true)
  2365. HomeNewPose({homegoalie}, "savingrighthigh")
  2366. stop
  2367.  
  2368. on quit:
  2369. remove invisibility from potion effects of player
  2370. ClearRAM(player)
  2371. every tick:
  2372. {game::status} is not "Warmup"
  2373. if "%region at {puck}%" contains "goalregion2":
  2374. if {goalieai} and {inplay} are true:
  2375. Goal("home")
  2376. if "%region at {puck}%" contains "goalregion":
  2377. if {goalieai} and {inplay} are true:
  2378. Goal("away")
  2379. every tick:
  2380. if "%region at {puck}%" does not contain "PuckArea":
  2381. if {goalieai} and {inplay} are true:
  2382. if {puck} is set:
  2383. OutOfPlay()
  2384. function OutOfPlay():
  2385. set {goalieai} and {inplay} and {isreplay} to false
  2386. send title "&a&lOUT OF PLAY" to all players in world "{@hw}"
  2387. play sound "minecraft:whistle.1" to all players in world "{@hw}"
  2388. if {game::status} is not "Warmup":
  2389. set {game::status} to "Out of play"
  2390. wait 3 seconds
  2391. RespawnPuck("center")
  2392. function Goal(team:string,finish:boolean = false):
  2393. if {game::status} is not "Waiting" or "Shootouts":
  2394. set {game::status} to "Goal"
  2395. if {game::status} is "Shootouts":
  2396. if {game::shootouts::player} is set:
  2397. set {goalieai} and {inplay} to false
  2398. NextShootoutPlayer(true)
  2399. stop
  2400. if {_finish} is true:
  2401. if {_team} is "away":
  2402. ClearHomePen()
  2403. play sound {teams::%{game::away::team}%::horn} at volume 0.3 for all players in world "{@hw}"
  2404. set {bhl::%{puckowner}%::power} to 0
  2405. delete {puckowner}
  2406. wait 3 seconds
  2407. wait 30 seconds
  2408. set {goalhorn} to "n/a"
  2409. delete {puckowner}
  2410. while {game::status} = "Goal":
  2411. wait a tick
  2412. RespawnPuck("center")
  2413. stop
  2414. if {_team} is "home":
  2415. ClearAwayPen()
  2416. play sound {teams::%{game::home::team}%::horn} at volume 0.3 for all players in world "{@hw}"
  2417. set {bhl::%{puckowner}%::power} to 0
  2418. delete {puckowner}
  2419. wait 3 seconds
  2420. wait 30 seconds
  2421. set {goalhorn} to "n/a"
  2422. while {game::status} = "Goal":
  2423. wait a tick
  2424. RespawnPuck("center")
  2425. stop
  2426. if {goalieai} is true:
  2427. set {goalieai} to false
  2428. if {_team} is "away":
  2429. ClearHomePen()
  2430. add 1 to {game::away::goals}
  2431. play sound {teams::%{game::away::team}%::horn} at volume 0.3 for all players in world "{@hw}"
  2432. set {goalhorn} to "away"
  2433. if {_finish} = false:
  2434. Commentator("goalaway")
  2435. send title "%coloured {teams::%{game::away::team}%::name}% GOAL!" with subtitle "&e%{BHL::lastshot}% scored!" to all players in world "{@hw}"
  2436. wait 5 seconds
  2437. set {isreplay} to false
  2438. wait 3 seconds
  2439. RunReplay()
  2440. if {game::period} = 4:
  2441. broadcast "&a&lGAME FINISHED: &eThe %coloured {teams::%{game::away::team}%::name}%&e won in the overtime!"
  2442. else:
  2443. ClearAwayPen()
  2444. set {goalieai} to false
  2445. add 1 to {game::home::goals}
  2446. play sound {teams::%{game::home::team}%::horn} at volume 0.3 for all players in world "{@hw}"
  2447. set {goalhorn} to "home"
  2448. if {_finish} = false:
  2449. Commentator("goalhome")
  2450. send title "%coloured {teams::%{game::home::team}%::name}% GOAL!" with subtitle "&e%{BHL::lastshot}% scored!" to all players in world "{@hw}"
  2451. wait 5 seconds
  2452. set {isreplay} to false
  2453. wait 3 seconds
  2454. RunReplay()
  2455. if {game::period} = 4:
  2456. broadcast "&a&lGAME FINISHED: &eThe %coloured {teams::%{game::home::team}%::name}%&e won in the overtime!"
  2457. wait 30 seconds
  2458. while {game::status} = "Goal":
  2459. wait a tick
  2460. set {goalhorn} to "n/a"
  2461. RespawnPuck("center")
  2462. function ClearAwayPen():
  2463. loop {game::away::members::*}:
  2464. delete {pen::%loop-value%::time}
  2465. delete {game::penalty::%loop-value%}
  2466. function ClearHomePen():
  2467. loop {game::home::members::*}:
  2468. delete {pen::%loop-value%::time}
  2469. delete {game::penalty::%loop-value%}
  2470. function Penalty(p:player):
  2471. if {game::status} is "In-game":
  2472. {game::penalty::%{_p}%} is not set
  2473. set {game::penalty::%{_p}%} to true
  2474. broadcast "&a&lDELAYED PENALTY: &e%{_p}% "
  2475. Commentator("delayedpen",{_p})
  2476. while {game::penalty::%{_p}%} is true:
  2477. wait a tick
  2478. if {game::status} is not "In-game" or "Goal":
  2479. PenaltyBox({_p})
  2480. if {game::away::members::*} contains {_p}:
  2481. loop {game::away::members::*}:
  2482. loop-value is {puckowner}
  2483. if {game::penalty::%{_p}%} is true:
  2484. PenaltyBox({_p},"low",true)
  2485. if {game::home::members::*} contains {_p}:
  2486. loop {game::home::members::*}:
  2487. loop-value is {puckowner}
  2488. if {game::penalty::%{_p}%} is true:
  2489. PenaltyBox({_p},"low",true)
  2490. function PenaltyBox(p:player,time:string = "low",resp:boolean = false):
  2491. set {game::penalty::%{_p}%} to false
  2492. play sound "minecraft:powerplay" to all players in world "{@hw}"
  2493. if {_time} is "low":
  2494. set {pen::%{_p}%::time} to 45 # #
  2495. broadcast "&a&lPENALTY: &e%{_p}%&e is being sent to the penalty box."
  2496. set {inplay} and {goalieai} and {isreplay} to false
  2497. set {game::status} to "Out of play" if {game::status} is not "Intermission"
  2498. delete {puckowner}
  2499. wait 8 seconds
  2500. if {_resp} is true:
  2501. if {game::status} is not "Intermission" or "Waiting":
  2502. RespawnPuck("center")
  2503. if {game::away::members::*} contains {_p}:
  2504. teleport {_p} to {bhl::awaybox}
  2505. if {game::home::members::*} contains {_p}:
  2506. teleport {_p} to {bhl::homebox}
  2507. while {pen::%{_p}%::time} is set:
  2508. wait 1 second
  2509. if {pen::%{_p}%::time} > 0:
  2510. if {game::status} is "In-game":
  2511. subtract 1 from {pen::%{_p}%::time}
  2512. if {game::away::members::*} contains {_p}:
  2513. send action bar "&a&lPENALTY: &e%{_p}% &6%{pen::%{_p}%::time}%&6s left" to {game::away::members::*}
  2514. if {game::home::members::*} contains {_p}:
  2515. send action bar "&a&lPENALTY: &e%{_p}% &6%{pen::%{_p}%::time}%&6s left" to {game::home::members::*}
  2516. ELSE:
  2517. delete {pen::%{_p}%::time}
  2518. delete {game::penalty::%{_p}%}
  2519. broadcast "&a&lPENALTY: &e%{_p}% &eis out of the box."
  2520. teleport {_p} to {bhl::awaybench} if {game::away::members::*} contains {_p}
  2521. teleport {_p} to {bhl::homebench} if {game::home::members::*} contains {_p}
  2522.  
  2523.  
  2524. function RespawnPuck(local:string = "center"):
  2525. {game::status} is not "Shootouts"
  2526. if {_local} is set:
  2527. kill {puck}
  2528. kill all endermites
  2529. if {game::status} is not "Intermission" or "Waiting" or "Starting" or "Warmup":
  2530. set {game::status} to "Out of play"
  2531. wait a tick
  2532. set {bhl::%{puckowner}%::power} to 0
  2533. delete {puckowner}
  2534. delete {puck} #
  2535. set {goalieai} to true
  2536. set {_t} to 6
  2537. broadcast ""
  2538. broadcast "&eThe play will be resumed in the center" if {_local} = "center"
  2539. broadcast "&eThe play will be resumed in the home area" if {_local} contains "homeleft" or "homeright"
  2540. broadcast "&eThe play will be resumed in the away area" if {_local} contains "awayleft" or "awayright"
  2541. broadcast "&eThe play will be resumed in the away offside area" if {_local} contains "awayoffsideleft" or "awayoffsideright"
  2542. broadcast "&eThe play will be resumed in the home offside area" if {_local} contains "homeoffsideleft" or "homeoffsideright"
  2543. broadcast ""
  2544. Commentator("isdropping")
  2545. loop 6 times:
  2546. wait 1 second
  2547. subtract 1 from {_t}
  2548. send title "&6&lFACEOFF" with subtitle "&aPuck dropping in &e%{_t}% &asecond(s)..." to all players in world "{@hw}"
  2549. delete {puck}
  2550. kill all endermites
  2551. send title "" with subtitle "&aPuck dropped" to all players in world "{@hw}"
  2552. AwayNewPose({awaygoalie},"skatingup")
  2553. HomeNewPose({homegoalie},"skatingup")
  2554. if {_local} is "center":
  2555. spawn endermite at {bhl::center}
  2556. if {_local} is "awayleft":
  2557. spawn endermite at {bhl::awayleft}
  2558. if {_local} is "awayright":
  2559. spawn endermite at {bhl::awayright}
  2560. if {_local} is "homeleft":
  2561. spawn endermite at {bhl::homeleft}
  2562. if {_local} is "homeright":
  2563. spawn endermite at {bhl::homeright}
  2564. if {_local} is "homeoffsideleft":
  2565. spawn endermite at {bhl::homeoffsideleft}
  2566. if {_local} is "homeoffsideright":
  2567. spawn endermite at {bhl::homeoffsideright}
  2568. if {_local} is "awayoffsideleft":
  2569. spawn endermite at {bhl::awayoffsideleft}
  2570. if {_local} is "awayoffsideright":
  2571. spawn endermite at {bhl::awayoffsideright}
  2572. set {puck} to last spawned endermite
  2573. if {game::status} is not "Intermission" or "Waiting" or "Starting" or "Warmup":
  2574. set {game::status} to "In-game" #
  2575. add "{NoAI:1}" to nbt of {puck}
  2576. add "{PersistenceRequired:1}" TO NBT OF {puck}
  2577. add "{Silent:1}" to nbt of {puck}
  2578. set {inplay} to true
  2579. set {_s} to 0
  2580. if {game::status} is "In-game":
  2581. NewClip()
  2582. Puck()
  2583. PuckAltitude()
  2584. Commentator("isdropped")
  2585. function Commentator(msg:string,o:string = ""):
  2586. stop
  2587. every 40 seconds:
  2588. feed all players
  2589. on damage:
  2590. attacker is {puck} or {awaygoalie} or {homegoalie}
  2591. cancel event
  2592. on player jump:
  2593. {game::status} is "In-game"
  2594. "%region at player%" contains "puckarea"
  2595. tool of player is not {bhl::stick}
  2596. player is not {awaygoalie::player} or {homegoalie::player}
  2597. if {game::away::members::*} contains player:
  2598. if distance between {bhl::awaybench} and player > 10:
  2599. Penalty(player)
  2600. if {game::home::members::*} contains player:
  2601. if distance between {bhl::homebench} and player > 10:
  2602. Penalty(player)
  2603. on player jump:
  2604. if player is {awaygoalie::player} or {homegoalie::player}:
  2605. event-world is "{@hw}"
  2606. cancel event
  2607. tool of player is {bhl::stick}
  2608. cancel event if {game::status} is "In-game" or "Warmup"
  2609. function SummonGoalie(t:string,p:location):
  2610. set {awaygoalie::lastreflect} to now
  2611. set {homegoalie::lastreflect} to now
  2612. spawn armor stand at {_p}
  2613. set {_x} to last spawned armor stand
  2614. if {_t} is "away":
  2615. set {_var} to leather leggings
  2616. add "{NoGravity:1b}" to nbt of {_x}
  2617. add "{NoBasePlate:1b,ShowArms:1b,ArmorItems:[{id:""chainmail_boots"",Count:1b},{id:""leather_leggings"",Count:1b},{id:""chainmail_chestplate"",Count:1b},{id:""iron_helmet"",Count:1b}],HandItems:[{id:""diamond_hoe"",Count:1b},{}]}" to nbt of {_x} #ver
  2618. dye {_var} white
  2619. set leggings of {_x} to {_var}
  2620. if {_t} is "home":
  2621. add "{NoGravity:1b}" to nbt of {_x}
  2622. add "{NoBasePlate:1b,ShowArms:1b,ArmorItems:[{id:""diamond_boots"",Count:1b},{id:""iron_leggings"",Count:1b},{id:""diamond_chestplate"",Count:1b},{id:""iron_helmet"",Count:1b}],HandItems:[{id:""diamond_hoe"",Count:1b},{}]}" to nbt of {_x}
  2623. while {awaygoalie} and {homegoalie} are set:
  2624. wait a tick
  2625. set display name of {awaygoalie} to "%{awaygoalie::player}%"
  2626. set display name of {homegoalie} to "%{homegoalie::player}%"
  2627. function GoalieSave():
  2628. if {goalieai} is true:
  2629. if "%region at {puck}%" does not contain "goalregion" or "goalregion2":
  2630. if {game::status} is "Shootouts":
  2631. if {game::shootouts::player} is set:
  2632. broadcast ""
  2633. broadcast "&aIt was a save!"
  2634. broadcast ""
  2635. set {goalieai} and {inplay} to false
  2636. NextShootoutPlayer()
  2637. stop
  2638. if {game::status} is not "Waiting" or "Warmup":
  2639. set {game::status} to "Out of play"
  2640. set {_v} to vector from yaw 0 and pitch 0
  2641. set vector length of {_v} to 0
  2642. set velocity of {puck} to {_v}
  2643. play sound "minecraft:whistle.1" at {puck}
  2644. set {inplay} to false
  2645. set {goalieai} to false
  2646. set {isreplay} to false
  2647. set {bhl::%{puckowner}%::power} to 0
  2648. delete {puckowner}
  2649. Commentator("goaliesavesit")
  2650. send title "&a&lCOVERED" to all players in world "{@hw}"
  2651. wait 5 seconds
  2652. if distance between {homegoalie} and {puck} < distance between {awaygoalie} and {puck}:
  2653. if distance between {puck} and {bhl::homeleft} < distance between {puck} and {bhl::homeright}:
  2654. RespawnPuck("homeleft")
  2655. else:
  2656. RespawnPuck("homeright")
  2657. else:
  2658. if distance between {puck} and {bhl::awayleft} < distance between {puck} and {bhl::awayright}:
  2659. RespawnPuck("awayleft")
  2660. else:
  2661. RespawnPuck("awayright")
  2662. function GoaliePoke(p:entity,f:string):
  2663. if difference between {lastpoke} and now > 1 second:
  2664. set {lastpoke} to now
  2665. set {bhl::%{puckowner}%::power} to 0
  2666. delete {puckowner}
  2667. if {_f} is "medium":
  2668. set {_v2} to vector from yaw {_p}'s yaw and pitch 0
  2669. set {_v} to vector(0.05,0.15,0.05)
  2670. set {-pv} to {_v2} ++ {-pv}
  2671. set {-pv} to {_v} ++ {-pv}
  2672. if {_f} is "weak":
  2673. set {_v2} to vector from yaw {_p}'s yaw and pitch 0
  2674. set {_v} to vector(0.05,0.15,0.05)
  2675. set {-pv} to {_v2} ++ {-pv}
  2676. set {-pv} to {_v} ++ {-pv}
  2677. function GoalieReflect(p:entity,f:string):
  2678. if {game::status} is "Shootouts":
  2679. if {game::shootouts::player} is set:
  2680. broadcast ""
  2681. broadcast "&aIt was a save!"
  2682. broadcast ""
  2683. set {goalieai} and {inplay} to false
  2684. NextShootoutPlayer()
  2685. if {_p} is {awaygoalie} or {awaygoalie::player}:
  2686. if difference between {awaygoalie::lastreflect} and now > 0.2 seconds:
  2687. set {awaygoalie::lastreflect} to now
  2688. else:
  2689. stop
  2690. if {_p} is {homegoalie} or {homegoalie::player}:
  2691. if difference between {homegoalie::lastreflect} and now > 0.2 seconds:
  2692. set {homegoalie::lastreflect} to now
  2693. else:
  2694. stop
  2695. set {awaygoalie::lastreflect} to now
  2696. delete {puckowner}
  2697. if {_f} is "pad" or "arm":
  2698. Commentator("goaliepad")
  2699. set {_v} to vector from yaw {_p}'s yaw and pitch 0
  2700. set vector length of {_v} to 0.3
  2701. set {-pv} to {_v}
  2702. if {_f} is "stick":
  2703. Commentator("goaliepoke")
  2704. set {_v} to vector from yaw {_p}'s yaw and pitch 0
  2705. set vector length of {_v} to 0.5
  2706. set {-pv} to {_v}
  2707. add 0.3 to y of {-pv}
  2708.  
  2709. command /help:
  2710. aliases: instructions,tutorial,controls
  2711. trigger:
  2712. Instructions(player)
  2713. function Instructions(p:player):
  2714. send "" to {_p}
  2715. send "&7Awaiting rewrite. Check out discord for more information." to {_p}
  2716. command /penalty [<player>]:
  2717. permission: staff.penalty
  2718. permission message: &cYou must be a referee or higher to call a pen!
  2719. trigger:
  2720. Penalty(arg-1)
  2721. command /arp:
  2722. permission: staff.setteam
  2723. permission message: &cYou must be a referee or higher to respawn puck!
  2724. trigger:
  2725. broadcast "&eThe puck has been re spawned by %coloured prefix of player% %player%"
  2726. OutOfPlay()
  2727. command /setteam [<player>] [<text>]:
  2728. permission: captain.setteam
  2729. permission message: &cYou must be a captain or higher to manage teams!
  2730. trigger:
  2731. if arg 2 is not set:
  2732. send "&cCorrect usage: /setteam <player> <away/home/fan>"
  2733. if arg 1 and arg 2 are set:
  2734. if arg 2 is "fan":
  2735. if {game::away::members::*} contains arg-1:
  2736. remove arg-1 from {game::away::members::*}
  2737. if {game::home::members::*} contains arg-1:
  2738. remove arg-1 from {game::home::members::*}
  2739. broadcast "%coloured prefix of player% &e%player% &7Fanned &e%arg-1%"
  2740. EquipPlayer(arg-1)
  2741. if arg 2 is "home":
  2742. if {game::away::members::*} contains arg-1:
  2743. remove arg-1 from {game::away::members::*}
  2744. if {game::home::members::*} contains arg-1:
  2745. send "&CThat player is already in the home team."
  2746. stop
  2747. else:
  2748. add arg-1 to {game::home::members::*}
  2749. broadcast "%coloured prefix of player% &e%player% &7assigned &e%arg-1%&e's team to &aHome"
  2750. EquipPlayer(arg-1)
  2751. if arg 2 is "away": #
  2752. if {game::home::members::*} contains arg-1:
  2753. remove arg-1 from {game::home::members::*}
  2754. if {game::away::members::*} contains arg-1:
  2755. send "&CThat player is already in the away team."
  2756. stop
  2757. else:
  2758. add arg-1 to {game::away::members::*}
  2759. broadcast "%coloured prefix of player% &e%player% &7assigned &e%arg-1%&e's team to &bAway"
  2760. EquipPlayer(arg-1)
  2761.  
Advertisement
Add Comment
Please, Sign In to add comment