Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Free to use for everyone but please don't remove my credit
- # Made with love by bonnie20402
- # Thank you!
- #
- options:
- hw: ul_hockeyarena # Change this value to your rink's world
- gkreach: 0.65 # dont messs with this
- guild: 810835874001453056 # ignore this
- token: - # ignore
- bot: bhlbot # ignore this too
- chat: 813410558648516689 # ignore this too
- resource: https://download.mc-packs.net/pack/0b45349eef67c6a997fcf616a17c657765b13dac.zip # texture pack link
- resourcehash: 0b45349eef67c6a997fcf616a17c657765b13dac # texture pack sha-1
- immune: 0.2 # Immune time
- dir: EnderHockeyLeague/TeamData # dir of team creator data
- discordlink: https://discord.gg/XwRUpGw5nr # put ur disco link here
- on command:
- command is "pl" or "plugins" or "bukkit:pl" or "bukkit:plugins" or "me" or "minecraft:me"
- sender is player
- player is not op
- Credits(player)
- cancel event
- command /credits:
- trigger:
- Credits(player)
- function Credits(p:player):
- send "" to {_p}
- send "&aMade with love by Bonnie20402" to {_p}
- send "&aAll the textures were made by &e_frostbyte_" to {_p}
- send "&aInspired on BHL and HHCO" to {_p}
- send "" to {_p}
- on chat:
- set message format to "%colored prefix of player% &7%player%:&f %message%"
- function NewClip():
- set {isreplay} to false
- loop all players in world "{@hw}":
- loop-player is not {awaygoalie::player} or {homegoalie::player}
- add loop-player to {_replay::*}
- set {_rep} to "%{_replay::*}%"
- replace all "," with "" in {_rep}
- make console execute command "replay delete ehl"
- make console execute command "replay start ehl %{_rep}%"
- clear {puckpos::*}
- clear {awaypos::*}
- clear {homepos::*}
- clear {awaypose::*}
- clear {homepose::*}
- set {isreplay} to true #
- set {lastclip} to now
- while {isreplay} is true:
- wait a tick
- if {goalieai} is true: # #
- add location of {puck} to {puckpos::*} #
- add location of {awaygoalie} to {awaypos::*}
- add location of {homegoalie} to {homepos::*}
- add {awaygoalienbt} to {awaypose::*}
- add {homegoalienbt} to {homepose::*}
- if difference between {lastclip} and now > 25 seconds:
- if {goalieai} is true:
- set {_repeat} to true
- set {isreplay} to false
- make console execute command "replay stop ehl"
- if {_repeat} is true:
- NewClip()
- on right click on any trapdoor:
- player is not op
- cancel event
- function RunReplay():
- loop all players in world "{@hw}":
- set {_loc.%loop-player%} to location of loop-player
- set {game::status} to "Goal"
- loop all players:
- loop-player is in world "{@hw}":
- set {_loc.%loop-player%} to location of loop-player
- send title "&a&lREPLAY" with subtitle "" to loop-player for 3 seconds
- add "replay.command.play" to permission of loop-player
- make loop-player execute command "replay play ehl"
- remove "replay.command.play" from permission of loop-player
- SyncAwayPos()
- SyncAwayPose()
- SyncHomePos()
- SyncHomePose()
- loop {puckpos::*}:
- wait a tick
- teleport {puck} to loop-value
- wait 9 seconds
- set {game::status} to "Out of play"
- if {game::period} = 4:
- ResetPG({awaygoalie::player})
- ResetPG({homegoalie::player})
- set {game::status} to "Waiting"
- set {game::period} to 1
- loop all players in world "{@hw}":
- teleport loop-player to {_loc.%loop-player%}
- function SyncAwayPos():
- loop {awaypos::*}:
- wait a tick
- teleport {awaygoalie} to loop-value
- function SyncAwayPose():
- loop {awaypose::*}:
- wait a tick
- add loop-value to nbt of {awaygoalie}
- function SyncHomePose():
- loop {homepose::*}:
- wait a tick
- add loop-value to nbt of {homegoalie}
- function SyncHomePos():
- loop {homepos::*}:
- wait a tick
- teleport {homegoalie} to loop-value #
- on right click on armor stand:
- player is not op
- cancel event
- function LoadData(p:player): # ignore this function it was used for discord auth/link
- deop {_p}
- set gamemode of {_p} to survival
- clear groups of {_p}
- set group of {_p} to "default"
- make console execute command "sn teleport lobby %{_p}%"
- send "&aTeleported to the lobby" to {_p}
- send "&aLoading discord data..." to {_p}
- wait 15 ticks
- set {_id} to {discord::%{_p}%::id}
- if {_id} is not set:
- 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}
- stop
- retrieve user with id "%{_id}%" and store the user in {_user}
- if {_user} is set:
- if {_user} in guild with id "{@guild}" has role role with id "810835961956663307":
- 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}
- set group of {_p} to "Developer"
- op {_p}
- stop
- if {_user} in guild with id "{@guild}" has role role with id "810836570880868362":
- send "&aYou are the league owner." to {_p}
- set group of {_p} to "Owner"
- op {_p}
- stop
- if {_user} in guild with id "{@guild}" has role role with id "810836719187394570":
- send "&aYou are a part of the league staff. Applied staff rank." to {_p}
- set group of {_p} to "Staff"
- stop
- if {_user} in guild with id "{@guild}" has role role with id "810836879011610636":
- send "&aYou are a team captain or alt captain. Applied captain rank." to {_p}
- set group of {_p} to "Captain"
- stop
- send "&aYou are not in a team, but you are in the &9Discord&a. Applied Free Agent rank." to {_p}
- set group of {_p} to "FreeAgent"
- function NextShootoutPlayer(goal:boolean = false):
- {game::status} = "Shootouts"
- set {game::status} to "Out of play"
- set {game::status} to "Shootouts"
- set {_quem} to {game::shootouts::nextshot}
- teleport {game::shootouts::player} to {bhl::awaybench} if {game::teams::away::*} contains {game::shootouts::player}
- teleport {game::shootouts::player} to {bhl::homebench} if {game::teams::home::*} contains {game::shootouts::player}
- set {game::shootouts::nextshot} to "away" if {_quem} = "home"
- set {game::shootouts::nextshot} to "home" if {_quem} = "away"
- if {game::shootouts::wasgoalie} is true:
- NewPG({game::shootouts::player},"awaypg") if {game::away::members::*} contains {game::shootouts::player}
- NewPG({game::shootouts::player},"homepg") if {game::home::members::*} contains {game::shootouts::player}
- delete {game::shootouts::player}
- if {_goal} is true:
- broadcast ""
- broadcast "&aIt's a goal!"
- broadcast ""
- add 1 to {game::away::goals} if {game::shootouts::nextshot} = "away"
- add 1 to {game::home::goals} if {game::shootouts::nextshot} = "home"
- play sound {teams::%{game::away::team}%::horn} at volume 0.3 for all players in world "{@hw}" if {game::shootouts::nextshot} = "away"
- play sound {teams::%{game::home::team}%::horn} at volume 0.3 for all players in world "{@hw}" if {game::shootouts::nextshot} = "home"
- wait 8 seconds
- wait 5 seconds
- add 1 to {game::shootouts::taken}
- set {-pv} to vector(0,0,0)
- teleport {puck} to {bhl::center}
- set {goalieai} and {inplay} to true
- stop sound {teams::%{game::home::team}%::horn} for all players
- stop sound {teams::%{game::away::team}%::horn} for all players
- if {game::shootouts::taken} < 7:
- if size of {game::shootouts::hometeam::*} and {game::shootouts::awayteam::*} are 0:
- RebuildShootoutTeams()
- if {game::shootouts::nextshot} = "away":
- set {_next} to a random element out of {game::shootouts::hometeam::*}
- remove {_next} from {game::shootouts::hometeam::*}
- if {game::shootouts::nextshot} = "home":
- set {_next} to a random element out of {game::shootouts::awayteam::*}
- remove {_next} from {game::shootouts::awayteam::*}
- set {game::shootouts::player} to {_next}
- set {game::shootouts::wasgoalie} to false
- set {game::shootouts::wasgoalie} to true if {game::shootouts::player} is {awaygoalie::player} or {homegoalie::player}
- if {game::shootouts::wasgoalie} is true:
- set {awaygoalie::player} to "AI" if {game::away::members::*} contains {game::shootouts::player}
- ResetHitboxes({awaygoalie}) if {game::away::members::*} contains {game::shootouts::player}
- EquipPlayer({_next}) if {game::away::members::*} contains {game::shootouts::player}
- set {homegoalie::player} to "AI" if {game::home::members::*} contains {game::shootouts::player}
- ResetHitboxes({homegoalie}) if {game::home::members::*} contains {game::shootouts::player}
- EquipPlayer({_next}) if {game::home::members::*} contains {game::shootouts::player}
- broadcast ""
- broadcast "&aThe next player to shot is &e%{_next}%"
- broadcast ""
- teleport {_next} to {bhl::center}
- set {game::shootouts::timer} to now
- while {game::shootouts::player} is set:
- wait a tick
- set {game::shootouts::nextshot} to "home" if {game::away::members::*} contains {game::shootouts::player}
- set {game::shootouts::nextshot} to "away" if {game::home::members::*} contains {game::shootouts::player}
- if difference between {game::shootouts::timer} and now > 15 seconds:
- broadcast ""
- broadcast "&aThe player failed to commit the play!"
- broadcast ""
- NextShootoutPlayer()
- else:
- if {game::away::goals} > {game::home::goals}:
- broadcast ""
- broadcast "&aAnd thats it! The %coloured {teams::%%{game::away::team}%%::name}% &awon here in shootouts!"
- broadcast ""
- set {goalieai} and {inplay} to false
- play sound {teams::%{game::away::team}%::horn} for all players in world "{@hw}"
- set {game::Status} to "Waiting"
- else if {game::away::goals} < {game::home::goals}:
- broadcast ""
- broadcast "&aAnd that's it! The %coloured {teams::%%{game::home::team}%%::name}% &awon here in the overtime!"
- broadcast ""
- set {goalieai} and {inplay} to false
- play sound {teams::%{game::home::team}%::horn} for all players in world "{@hw}"
- set {game::Status} to "Waiting"
- else:
- Shootouts()
- function RebuildShootoutTeams():
- set {game::shootouts::awayteam::*} to {game::away::members::*}
- set {game::shootouts::hometeam::*} to {game::home::members::*}
- loop {game::away::members::*}:
- teleport loop-value to {bhl::awaybench} if loop-value is not {awaygoalie::player}
- loop {game::home::members::*}:
- teleport loop-value to {bhl::homebench} if loop-value is not {homegoalie::player}
- function RebuildShootoutAway():
- set {game::shootouts::awayteam::*} to {game::away::members::*}
- loop {game::away::members::*}:
- teleport loop-value to {bhl::awaybench} if loop-value is not {awaygoalie::player}
- function RebuildShootoutHome():
- set {game::shootouts::hometeam::*} to {game::home::members::*}
- loop {game::home::members::*}:
- teleport loop-value to {bhl::homebench} if loop-value is not {homegoalie::player}
- function Shootouts():
- clear {game::shootouts::awayteam::*}
- clear {game::shootouts::hometeam::*}
- set {game::shootouts::awayteam::*} to {game::away::members::*}
- set {game::shootouts::hometeam::*} to {game::home::members::*}
- loop {game::away::members::*}:
- teleport loop-value to {bhl::awaybench} if loop-value is not {awaygoalie::player}
- loop {game::home::members::*}:
- teleport loop-value to {bhl::homebench} if loop-value is not {homegoalie::player}
- if {game::status} is "Shootouts":
- set {-pv} to vector(0,0,0)
- teleport {puck} to {bhl::center}
- set {goalieai} and {inplay} to true
- set {game::shootouts::taken} to 0
- set {game::shootouts::timer} to now
- set {game::shootouts::nextshot} to "home"
- NextShootoutPlayer()
- command /startgame:
- trigger:
- world of player is "{@hw}"
- if {game::status} = "Waiting":
- #(size of {game::away::members::*} + {game::home::members::*} > 1
- set {game::status} to "Out of play"
- ResetPG({awaygoalie::player})
- ResetPG({homegoalie::player})
- set {game::status} to "Starting"
- set {game::time::min} to 1
- set {game::time::sec} to 0
- teleport {puck} to {bhl::center}
- set {onplay} to false
- set {goalieai} to false
- set {isreplay} to false
- set {_acap} to a random element out of {game::away::members::*}
- set {_hcap} to a random element out of {game::home::members::*}
- broadcast "&eThe next game will start in &c1&e minute. The captains are&7 %{_acap}%&e and &7%{_hcap}%"
- SelectTeam({_acap},"away")
- SelectTeam({_hcap},"home")
- every second:
- if {game::status} is not "Out of play":
- if {game::time::min} > 0:
- if {game::time::sec} is 0:
- subtract 1 from {game::time::min}
- set {game::time::sec} to 60
- every second:
- if {game::time::sec} > 0:
- if {game::status} is not "Out of play" or "Waiting" or "Goal" or "Shootouts":
- subtract 1 from {game::time::sec}
- if {game::time::min} = 0:
- if {game::time::sec} = 30:
- if {game::status} is "Starting" or "In-Game":
- broadcast "&eThe timer will end in &c30&e seconds"
- if {game::time::sec} = 15:
- if {game::status} is "Starting" or "In-Game":
- broadcast "&eThe timer will end in &c15&e seconds"
- if {game::time::min} and {game::time::sec} = 0:
- if {game::status} is "Intermission":
- set {game::status} to "Out of play"
- play sound "minecraft:buzzer" to all players in world "{@hw}"
- broadcast "&eThe game is starting now..."
- set {game::status} to "In-game" if {game::period} = 5
- delete {pen::*} if {game::period} = 5
- set {game::status} to "Shootouts" if {game::period} = 5
- send title "&a&lSHOOTOUTS" with subtitle "&eWe are moving our game into shootouts!" to all players in world "{@hw}" if {game::period} = 5
- Shootouts()
- if {game::period} = 1:
- set {game::away::goals} to 0
- set {game::home::goals} to 0
- set {game::time::min} to 5
- if {game::period} is 4:
- set {game::time::min} to 3
- RespawnPuck("center")
- if {game::status} is "In-game":
- if {game::period} = 3:
- if {game::away::goals} > {game::home::goals}:
- set {game::period} to 1
- set {game::status} to "Waiting"
- set {goalieai} to false
- set {inplay} to false
- play sound "minecraft:buzzer" to all players in world "{@hw}"
- Goal("away",true)
- send title "&a&lFINISH" with subtitle "&bAway team&e won the game!" to all players in world "{@hw}"
- stop
- if {game::home::goals} > {game::away::goals}:
- set {game::period} to 1
- set {game::status} to "Waiting"
- set {goalieai} to false
- set {inplay} to false
- play sound "minecraft:buzzer" to all players in world "{@hw}"
- Goal("home",true)
- send title "&a&lFINISH" with subtitle "&aHome team&e won the game!" to all players in world "{@hw}"
- stop
- if {game::period} < 6:
- add 1 to {game::period}
- set {game::status} to "Out of play"
- set {goalieai} to false
- set {inplay} to false
- set {isreplay} to false
- delete {puckowner}
- play sound "minecraft:buzzer" to all players in world "{@hw}"
- send title "&a&lFINISH" with subtitle "&eThere will be a short intermission before the next period" to all players in world "{@hw}"
- broadcast ""
- broadcast "&a&lGAME STATS"
- broadcast ""
- broadcast "%coloured {teams::%{game::away::team}%::name}% &f%{game::away::goals}%"
- broadcast "%coloured {teams::%{game::home::team}%::name}% &f%{game::home::goals}%"
- broadcast ""
- set {game::status} to "Intermission"
- Commentator("intermission")
- set {game::time::sec} to 45
- if {game::status} = "Starting":
- set {game::status} to "Out of play"
- set {game::time::min} to 5
- set {game::period} to 1
- set {game::away::goals} to 0
- set {game::home::goals} to 0
- RespawnPuck("center")
- function AssignTeam(p:player):
- remove {_p} from {game::away::members::*} and {game::home::members::*}
- if size of {game::away::members::*} > size of {game::home::members::*}:
- {game::away::members::*} and {game::home::members::*} do not contain {_p}
- add {_p} to {game::home::members::*}
- send "&eYou are on the %coloured {teams::%{game::home::team}%::name}%&e team!" to {_p}
- EquipPlayer({_p})
- teleport {_p} to {bhl::homebench}
- if size of {game::away::members::*} < size of {game::home::members::*}:
- {game::away::members::*} and {game::home::members::*} do not contain {_p}
- add {_p} to {game::away::members::*}
- send "&eYou are on the %coloured {teams::%{game::away::team}%::name}%&e team!" to {_p}
- EquipPlayer({_p})
- teleport {_p} to {bhl::awaybench}
- if size of {game::away::members::*} = size of {game::home::members::*}:
- {game::away::members::*} and {game::home::members::*} do not contain {_p}
- add {_p} to {game::away::members::*}
- send "&eYou are on the %coloured {teams::%{game::away::team}%::name}%&e team!" to {_p}
- EquipPlayer({_p})
- teleport {_p} to {bhl::awaybench} #
- send "&aPlease download the texture pack at our &9Discord&a server!" to {_p}
- on rightclick: #armor gk
- target entity of player is {awaygoalie} or {homegoalie}
- tool of player is not {bhl::goaliecontrol}
- cancel event
- on swapping of held item:
- cancel event
- tool of player is {bhl::stick}
- difference between {deke::%player%::last} and now > 0.5 second
- set {deke::%player%::last} to now
- if {deke::%player%} is "center":
- set {deke::%player%} to "left"
- send action bar "&aDeking direction: &e&LLEFT" to player
- stop
- if {deke::%player%} is "left":
- set {deke::%player%} to "right"
- send action bar "&aDeking direction: &e&lRIGHT" to player
- stop
- if {deke::%player%} is "right":
- set {deke::%player%} to "center"
- send action bar "&aDeking direction: &e&lCENTER" to player
- on drop:
- "%region at player%" contains "puckarea"
- gamemode of player is not creative
- cancel event
- function ResetPG(p:player):
- {_p} is not "AI"
- if {_p} is {awaygoalie::player}:
- while {game::status} is not "Out of play" or "Warmup" or "Intermission":
- wait a tick
- send action bar "&aWaiting for out of play to perform action..." to {_p}
- set {awaygoalie::player} to "AI"
- broadcast ""
- broadcast "&6[!] &eThe &baway goalie&e has been reset!"
- broadcast ""
- ResetHitboxes({awaygoalie})
- EquipPlayer({_p})
- send action bar "&aDone!" to {_p}
- wait a tick
- set walking speed of {_p} to 0.2
- if {_p} is {homegoalie::player}:
- while {game::status} is not "Out of play" or "Warmup" or "Shootouts":
- wait a tick
- send action bar "&aWaiting for out of play to perform action..." to {_p}
- set {homegoalie::player} to "AI"
- send action bar "&aDone!" to {_p}
- broadcast ""
- broadcast "&6[!] &eThe &ahome goalie&e has been reset!"
- broadcast ""
- ResetHitboxes({homegoalie})
- EquipPlayer({_p})
- wait a tick
- set walking speed of {_p} to 0.2
- command /quitgoalie:
- trigger:
- if player is {awaygoalie::player} or {homegoalie::player}:
- ResetPG(player)
- else:
- send "&aYou aren't a goalie!"
- command /seasongame:
- permission: hockey.season
- permission message: &cYou must be a Alt captain or higher game rank to setup a season game.
- trigger:
- if {game::seasoned} is false:
- set {game::seasoned} to true
- broadcast "&aThis game has been seasoned by %player% - New players won't be automatically assigned to teams anymore. Goalies locked"
- stop
- else:
- set {game::seasoned} to false
- broadcast "&aThis game has been unseasoned by %player% - New players will be automatically assigned to teams. Goalies unlocked"
- stop
- command /goalie:
- trigger:
- world of player is "{@hw}"
- if {game::away::members::*} contains player:
- if {awaygoalie::player} is "AI":
- while {game::status} is not "Out of play" or "Warmup":
- wait a tick
- send action bar "&aWaiting for out of play to perform action..." to player
- send action bar "&aApplying action..." to player
- wait 1 seconds
- NewPG(player,"awaypg")
- wait 1 second
- EquipPlayer(player)
- else:
- send "&aThere is already someone playing as the away goalie."
- if {game::home::members::*} contains player:
- if {homegoalie::player} is "AI":
- while {game::status} is not "Out of play" or "Warmup":
- wait a tick
- send action bar "&aWaiting for out of play to perform action..." to player
- send action bar "&aApplying action..." to player
- wait 1 seconds
- NewPG(player,"homepg")
- wait 1 second
- EquipPlayer(player)
- else:
- send "&aThere is already someone playing as the home goalie."
- command /stopplay:
- permission: staff.settime
- permission message: &cYou must be a member of the league's staff to manage game status
- trigger:
- if {game::status} is "Goal":
- send "&cPlease wait for the replay to finish first!"
- stop
- if {game::status} is "In-game":
- set {game::status} to "Out of play"
- broadcast "&c&lWARNING: %prefix of player% &c%player% &estopped the play."
- set {goalieai} and {inplay} to false
- delete {puckowner}
- send "&aRespawn the puck using &e/arp"
- command /settime [<text>] [<integer>]:
- permission: staff.settime
- permission message: &cYou must be a member of the league's staff to manage game's time
- trigger:
- if arg 2 is not set:
- send ""
- send "&a&lChange time"
- send ""
- send "&7/settime <min/sec> <value>"
- send ""
- if arg 2 is set:
- if arg 1 is "min":
- set {game::time::min} to arg-2
- broadcast "&c&lWARNING: &c%coloured prefix of player% &c%player% updated the Timer's minutes to &7%arg-2%"
- if arg 1 is "sec":
- set {game::time::sec} to arg-2
- broadcast "&c&lWARNING: &c%coloured prefix of player% &c%player% updated the Timer's seconds to &7%arg-2%"
- command /updatestats [<text>] [<text>] [<integer>]:
- permission: staff.updatestats
- permission message: &CYou must be a member of the league's staff to manage team's stats
- trigger:
- if arg-3 is not set:
- send ""
- send "&a&lUpdate Stats"
- send ""
- send "&7/updatestats <teamshort> wins/loses/losesot <value>"
- send ""
- send "&7&o(e.g /updatestats FAZ wins 30)"
- send "&7&obig news abusing this will result in demotion ^^"
- if arg 3 is set:
- if arg 2 is "wins":
- set yaml value "wins" from "teamdata.%arg-1%" to arg-3
- send "&aStat &eWINS&a updated" #
- if arg 2 is "loses":
- set yaml value "loses" from "teamdata.%arg-1%" to arg-3
- send "&aStat &eLosses&a updated"
- if arg 2 is "losesot":
- set yaml value "losesot" from "teamdata.%arg-1%" to arg-3
- send "&aStat &elosesot&a updated"
- save yaml "teamdata.%arg-1%"
- LoadTeams()
- command /team [<text>] [<text>] [<text>]:
- permission: staff.createteam
- permission message: &cYou must be staff or developer to use this command!
- trigger:
- if arg 2 is not set:
- send ""
- send "&a&lTeam Creator System"
- send ""
- send ""
- send "&7create <short> &6- creates a team"
- send "&7rename <short> <name> &6- renames a team"
- send "&7awayhelmet <short> <r,g,b> &6- sets away head"
- send "&7awaychestplate <short> <r,g,b> &6- sets away chest"
- send "&7awayleggings <short> <r,g,b> &6- sets away legs"
- send "&7awayboots <short> <r,g,b> &6- sets away boots"
- send "&7homehelmet <short> <r,g,b> &6- sets home head"
- send "&7homechestplate <short> <r,g,b> &6- sets home chest"
- send "&7homeleggings <short> <r,g,b> &6- sets home legs"
- send "&7homeboots <short> <r,g,b> &6- sets home boots"
- send "&7goalhorn <short> <string> &6- sets goal horn (same codename as /playsound cmd)"
- send "&7debuginfo <team> &6- gets team debug info"
- send "&7info <team> &6- gets team info"
- send "&7captain <short> <name> &6- set team captain"
- send "&cdelete <short> <team> &6- deletes a team"
- send ""
- send "&7&oUse /updatestats to update a team's stats"
- if arg 2 is set:
- if arg-1 is "Info":
- if {teams::%arg-2%::name} is set:
- send ""
- send "&6Team Stats"
- send ""
- send "&aName: %coloured {teams::%arg-2%::name}% &e[%{teams::%arg-2%::short}%]"
- send "&aRecord: &6%{teams::%arg-2%::wins}%&7-&6%{teams::%arg-2%::loses}%&7-&6%{teams::%arg-2%::losesot}%"
- send "&aCaptain: &6%{teams::%arg-2%::captain}%"
- send "&7&o[!] Managed manually by staff. If this information is not accurate, please contact league staff."
- else:
- send "&cTeam not found"
- if arg-1 is "debuginfo":
- if {teams::%arg-2%::name} is set:
- send ""
- send "&6TeamDebugInfo"
- send ""
- send "&aName: %coloured {teams::%arg-2%::name}% &e[%{teams::%arg-2%::short}%]"
- send "&aRecord: &6%{teams::%arg-2%::wins}%&7-&6%{teams::%arg-2%::loses}%&7-&6%{teams::%arg-2%::losesot}%"
- send "&aCaptain: &6%{teams::%arg-2%::captain}%"
- send ""
- send "&aHorn: &7%{teams::%arg-2%::horn}%"
- send "AwayH: &7%{teams::%arg-2%::awayhelmet}%"
- send "AwayC: &7%{teams::%arg-2%::awaychestplate}%"
- send "AwayL: &7%{teams::%arg-2%::awayleggings}%"
- send "AwayB: &7%{teams::%arg-2%::awayboots}%"
- send ""
- send "HomeH: &7%{teams::%arg-2%::homehelmet}%"
- send "HomeC: &7%{teams::%arg-2%::homechestplate}%"
- send "HomeL: &7%{teams::%arg-2%::homeleggings}%"
- send "HomeB: &7%{teams::%arg-2%::homeboots}%"
- else:
- send "&cTeam not found"
- if arg-1 is "create":
- send "&aFunction called"
- TeamCreator(player,"create",arg-2)
- if arg-1 is "captain":
- send "&aFunction called"
- TeamCreator(player,"captain",arg-2,arg-3)
- if arg-1 is "rename":
- send "&aFunction called"
- TeamCreator(player,"name",arg-2,arg-3)
- if arg-1 is "awayhelmet":
- send "&aFunction called"
- TeamCreator(player,"awayhelmet",arg-2,arg-3)
- if arg-1 is "awaychestplate":
- send "&aFunction called"
- TeamCreator(player,"awaychestplate",arg-2,arg-3)
- if arg-1 is "awayleggings":
- send "&aFunction called"
- TeamCreator(player,"awayleggings",arg-2,arg-3)
- if arg-1 is "awayboots":
- send "&aFunction called"
- TeamCreator(player,"awayboots",arg-2,arg-3)
- if arg-1 is "homehelmet":
- send "&aFunction called"
- TeamCreator(player,"homehelmet",arg-2,arg-3)
- if arg-1 is "homechestplate":
- send "&aFunction called"
- TeamCreator(player,"homechestplate",arg-2,arg-3)
- if arg-1 is "homeleggings":
- send "&aFunction called"
- TeamCreator(player,"homeleggings",arg-2,arg-3)
- if arg-1 is "homeboots":
- send "&aFunction called"
- TeamCreator(player,"homeboots",arg-2,arg-3)
- if arg-1 is "goalhorn":
- send "&aFunction called"
- TeamCreator(player,"horn",arg-2,arg-3)
- if arg-1 is "delete":
- send "&aFunction called"
- TeamCreator(player,"delete",arg-2,arg-3)
- function TeamCreator(p:player,s:string,t:string,arg:string = ""):
- if {_s} is "create":
- if yaml "teamdata.%{_t}%" is not loaded:
- load yaml "{@dir}/%{_t}%.yml" as "teamdata.%{_t}%"
- add {_t} to {teamslist::*}
- send "&aCreated new file forteam &e%{_t}%&a. Applied default settings. Configure the name using &e/team rename %{_t}% <name>" to {_p}
- set yaml value "name" from "teamdata.%{_t}%" to {_arg}
- set yaml value "short" from "teamdata.%{_t}%" to {_t}
- set yaml value "wins" from "teamdata.%{_t}%" to 0
- set yaml value "loses" from "teamdata.%{_t}%" to 0
- set yaml value "losesot" from "teamdata.%{_t}%" to 0
- set yaml value "captain" from "teamdata.%{_t}%" to {_p}
- set yaml value "horn" from "teamdata.%{_t}%" to "goal.bonnie2"
- set yaml list "awayhelmet" from "teamdata.%{_t}%" to ""
- set yaml list "awaychestplate" from "teamdata.%{_t}%" to ""
- set yaml list "awayleggings" from "teamdata.%{_t}%" to ""
- set yaml list "awayboots" from "teamdata.%{_t}%" to ""
- set yaml list "homehelmet" from "teamdata.%{_t}%" to ""
- set yaml list "homechestplate" from "teamdata.%{_t}%" to ""
- set yaml list "homeleggings" from "teamdata.%{_t}%" to ""
- set yaml list "homeboots" from "teamdata.%{_t}%" to ""
- save yaml "teamdata.%{_t}%"
- else:
- send "&aThe team &e%{teams::%{_t}%::name}% already exists!" to {_p}
- if {_s} is "name":
- if {teams::%{_t}%::short} is set:
- set yaml value "name" from "teamdata.%{_t}%" to {_arg}
- set yaml value "short" from "teamdata.%{_t}%" to {_t}
- save yaml "teamdata.%{_t}%"
- send "&aData updated: Short: &e%{_t}% &a- &aName: &e%{_arg}%" to {_p}
- if {_s} is "captain":
- if {teams::%{_t}%::short} is set:
- set yaml value "captain" from "teamdata.%{_t}%" to {_arg}
- save yaml "teamdata.%{_t}%"
- send "&aData updated: TeamOwner: &e%{teams::%{_t}%::captain}%" to {_p}
- if {_s} contains "helmet":
- set {_rgb::*} to {_arg} parsed as "%integer%,%integer%,%integer%"
- if {_rgb::*} is not set:
- send "&cNo data updated: Invalid color %{_arg}% - &cplease use rgb" to {_p}
- stop
- if {_s} contains "away":
- if {teams::%{_t}%::short} is set:
- clear yaml list "awayhelmet" from "teamdata.%{_t}%"
- add {_rgb::1} to yaml list "awayhelmet" from "teamdata.%{_t}%"
- add {_rgb::2} to yaml list "awayhelmet" from "teamdata.%{_t}%"
- add {_rgb::3} to yaml list "awayhelmet" from "teamdata.%{_t}%"
- send "&aData updated!" to {_p}
- if {_s} contains "home":
- if {teams::%{_t}%::short} is set:
- clear yaml list "homehelmet" from "teamdata.%{_t}%"
- add {_rgb::1} to yaml list "homehelmet" from "teamdata.%{_t}%"
- add {_rgb::2} to yaml list "homehelmet" from "teamdata.%{_t}%"
- add {_rgb::3} to yaml list "homehelmet" from "teamdata.%{_t}%"
- send "&aData updated!" to {_p}
- if {_s} contains "chestplate":
- set {_rgb::*} to {_arg} parsed as "%integer%,%integer%,%integer%"
- if {_rgb::*} is not set:
- send "&cNo data updated: Invalid color %{_arg}% - &cplease use rgb" to {_p}
- stop
- if {_s} contains "away":
- if {teams::%{_t}%::short} is set:
- clear yaml list "awaychestplate" from "teamdata.%{_t}%"
- add {_rgb::1} to yaml list "awaychestplate" from "teamdata.%{_t}%"
- add {_rgb::2} to yaml list "awaychestplate" from "teamdata.%{_t}%"
- add {_rgb::3} to yaml list "awaychestplate" from "teamdata.%{_t}%"
- send "&aData updated!" to {_p}
- if {_s} contains "home":
- if {teams::%{_t}%::short} is set:
- clear yaml list "homechestplate" from "teamdata.%{_t}%"
- add {_rgb::1} to yaml list "homechestplate" from "teamdata.%{_t}%"
- add {_rgb::2} to yaml list "homechestplate" from "teamdata.%{_t}%"
- add {_rgb::3} to yaml list "homechestplate" from "teamdata.%{_t}%"
- send "&aData updated!" to {_p}
- if {_s} contains "leggings":
- set {_rgb::*} to {_arg} parsed as "%integer%,%integer%,%integer%"
- if {_rgb::*} is not set:
- send "&cNo data updated: Invalid color %{_arg}% - &cplease use rgb" to {_p}
- stop
- if {_s} contains "away":
- if {teams::%{_t}%::short} is set:
- clear yaml list "awayleggings" from "teamdata.%{_t}%"
- add {_rgb::1} to yaml list "awayleggings" from "teamdata.%{_t}%"
- add {_rgb::2} to yaml list "awayleggings" from "teamdata.%{_t}%"
- add {_rgb::3} to yaml list "awayleggings" from "teamdata.%{_t}%"
- send "&aData updated!" to {_p}
- if {_s} contains "home":
- if {teams::%{_t}%::short} is set:
- clear yaml list "homeleggings" from "teamdata.%{_t}%"
- add {_rgb::1} to yaml list "homeleggings" from "teamdata.%{_t}%"
- add {_rgb::2} to yaml list "homeleggings" from "teamdata.%{_t}%"
- add {_rgb::3} to yaml list "homeleggings" from "teamdata.%{_t}%"
- send "&aData updated!" to {_p}
- if {_s} contains "boots":
- set {_rgb::*} to {_arg} parsed as "%integer%,%integer%,%integer%"
- if {_rgb::*} is not set:
- send "&cNo data updated: Invalid color %{_arg}% - &cplease use rgb" to {_p}
- stop
- if {_s} contains "away":
- if {teams::%{_t}%::short} is set:
- clear yaml list "awayboots" from "teamdata.%{_t}%"
- add {_rgb::1} to yaml list "awayboots" from "teamdata.%{_t}%"
- add {_rgb::2} to yaml list "awayboots" from "teamdata.%{_t}%"
- add {_rgb::3} to yaml list "awayboots" from "teamdata.%{_t}%"
- send "&aData updated!" to {_p}
- if {_s} contains "home":
- if {teams::%{_t}%::short} is set:
- clear yaml list "homeboots" from "teamdata.%{_t}%"
- add {_rgb::1} to yaml list "homeboots" from "teamdata.%{_t}%"
- add {_rgb::2} to yaml list "homeboots" from "teamdata.%{_t}%"
- add {_rgb::3} to yaml list "homeboots" from "teamdata.%{_t}%"
- send "&aData updated!" to {_p}
- if {_s} is "goalhorn" or "horn":
- if {teams::%{_t}%::short} is set:
- set yaml value "horn" from "teamdata.%{_t}%" to {_arg}
- send "&aData updated: GoalHorn(Must be like /playsound): &e%{teams::%{_t}%::horn}%" to {_p}
- if {_s} is "delete":
- if {teamslist::*} contains {_t}:
- delete {teams::%{_t}%::*}
- remove {_t} from {teamslist::*}
- delete {teams::%{_t}%}
- send "&aDeleted variables" to {_p}
- if yaml "teamdata.%{_t}%" is loaded:
- delete yaml "teamdata.%{_t}%"
- send "&aTeam &e%{_t}%&a deleted." to {_p}
- else:
- send "&cThat team does not exist." to {_p}
- if {_s} is set:
- save yaml "teamdata.%{_t}%"
- LoadTeams(true)
- function EquipPlayer(p:player):
- set gamemode of {_p} to adventure
- remove night vision from potion effects of {_p}
- remove jump boost from potion effects of {_p}
- remove invisibility from potion effects of {_p}
- apply night vision of tier 1 without particles to {_p} for a day
- clear {_p}'s inventory
- give {_p} {bhl::stick}
- if {_p} is {awaygoalie::player} or {homegoalie::player}:
- clear inventory of {_p}
- apply invisibility of tier 1 without particles to {_p} for a day
- set slot 0,1,2,3,4,5,6,7,8 and 9 of {_p} to {bhl::goaliecontrol}
- send "&aYou currently are playing as a Player Goalie. Please use &7/quitgoalie&a to quit as goalie." to {_p}
- stop
- if {game::away::members::*} does not contain {_p}:
- if {game::home::members::*} does not contain {_p}:
- set gamemode of {_p} to spectator
- if {game::away::members::*} contains {_p}:
- set helmet of {_p} to leather helmet
- dye {_p}'s helmet {teams::%{game::away::team}%::awayhelmet}
- set chestplate of {_p} to leather chestplate
- dye {_p}'s chestplate {teams::%{game::away::team}%::awaychestplate}
- set leggings of {_p} to leather leggings
- dye {_p}'s leggings {teams::%{game::away::team}%::awayleggings}
- set boots of {_p} to leather boots #
- dye {_p}'s boots {teams::%{game::away::team}%::awayboots}
- if {game::home::members::*} contains {_p}:
- set helmet of {_p} to leather helmet
- dye {_p}'s helmet {teams::%{game::home::team}%::homehelmet}
- set chestplate of {_p} to leather chestplate
- dye {_p}'s chestplate {teams::%{game::home::team}%::homechestplate}
- set leggings of {_p} to leather leggings
- dye {_p}'s leggings {teams::%{game::home::team}%::homeleggings}
- set boots of {_p} to leather boots
- dye {_p}'s boots {teams::%{game::home::team}%::homeboots}
- on quit:
- set quit message to "&7%player% left the ice."
- if {game::away::members::*} contains player:
- remove player from {game::away::members::*}
- if {game::home::members::*} contains player:
- remove player from {game::home::members::*}
- loop all players in {game::away::members::*}:
- loop-player is not {game::away::center}
- loop-player is not {game::away::leftwing}
- loop-player is not {game::away::rightwing}
- if {game::away::leftwing} is not set:
- set {game::away::leftwing} to loop-player
- send "&eYou are on the &6Left Wing&e position." to loop-player
- if {game::away::rightwing} is not set:
- set {game::away::rightwing} to loop-player
- send "&eYou are on the &6Right Wing&e position." to loop-player
- loop all players in {game::home::members::*}:
- loop-player is not {game::home::center}
- loop-player is not {game::home::leftwing}
- loop-player is not {game::home::rightwing}
- if {game::home::leftwing} is not set:
- set {game::home::lefttwing} to loop-player
- send "&eYou are on the &6Left Wing&e position." to loop-player
- if {game::home::rightwing} is not set:
- set {game::home::rightwing} to loop-player
- send "&eYou are on the &6Right Wing&e position." to loop-player
- on join:
- while player is online: #ever
- wait a tick
- "%region at player%" contains "puckarea"
- player is not {awaygoalie::player} or {homegoalie::player}
- {game::status} is "Shootouts"
- if player is not {game::shootouts::player}:
- teleport player to {bhl::awaybench} if {game::away::members::*} contains player
- teleport player to {bhl::homebench} if {game::home::members::*} contains player
- on join:
- set {stamina::%player%} to 100
- while player is online:
- wait a tick
- set {BHL::%player%::power} to 0 if difference between {BHL::%player%::lastpower} and now > 0.4 seconds
- player is not {awaygoalie::player} or {homegoalie::player}
- {bhl::%player%::washit} is not set
- if {stamina::%player%} = 0:
- set walking speed of player to 0.4
- else:
- if player is not sprinting:
- set walking speed of player to 0.4
- else:
- set walking speed of player to 0.6
- if player is sprinting:
- wait 0.2 seconds
- set {_s} to {stamina::%player%}
- set {_c} to a random integer between 8 and 12
- subtract {_c} from {stamina::%player%}
- if {stamina::%player%} < 0:
- set {stamina::%player%} to 0
- else:
- wait 0.4 seconds
- set {_regen} to a random integer between 8 and 14
- add {_regen} to {stamina::%player%}
- if {stamina::%player%} > 100:
- set {stamina::%player%} to 100
- on join:
- set join message to "&7%player%&7 joined the lobby"
- while player is online:
- wait a tick
- player is not {awaygoalie::player} or {homegoalie::player}
- set level of player to {stamina::%player%}
- on damage:
- "%region at attacker%" contains "puckarea"
- cancel event
- {game::away::members::*} does not contain victim and attacker
- {game::home::members::*} does not contain victim and attacker
- {bhl::%attacker%::washit} is not set
- attacker is player
- victim is player
- attacker and victim are not {awaygoalie::player} or {homegoalie::player}
- set {_v} to vector from yaw attacker's yaw and pitch 0
- set {bhl::%attacker%::power} to 0
- set vector length of {_v} to 0.3 if {bhl::%attacker%::power} > 0
- set vector length of {_v} to 0.6 if {bhl::%attacker%::power} > 30
- set vector length of {_v} to 0.9 if {bhl::%attacker%::power} > 50
- set vector length of {_v} to 1.2 if {bhl::%attacker%::power} > 80
- set vector length of {_v} to 1.4 if {bhl::%attacker%::power} > 99
- set {bhl::%victim%::washit} to now
- set {bhl::%attacker%::lasthit} to now
- delete {puckowner} if victim is {puckowner}
- if distance between attacker and {puck} > 3.5:
- if {game::penalty::%victim%} is not set:
- Penalty(attacker) if vector length of {_v} > 0.6
- set walking speed of victim to 0
- set velocity of victim to {_v}
- while difference between {bhl::%victim%::washit} and now < 0.5 seconds:
- wait a tick
- set walking speed of victim to 0
- delete {bhl::%victim%::washit}
- delete {bhl::%attacker%::lasthit}
- function JoinBHL(p:player):
- delete {game::penalty::%{_p}%}
- set {bhl::%{_p}%::lastsneak} to now
- set {deke::%{_p}%::last} to now
- send "&7%{_p}% joined the ice." to all players in world "{@hw}"
- send "&aJoining the ice..." to {_p}
- wait 10 ticks
- if {game::seasoned} is false:
- teleport {_p} to {bhl::center}
- AssignTeam({_p})
- else:
- teleport {_p} to {bhl::center}
- EquipPlayer({_p})
- wait 2 ticks
- 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}
- on quit:
- if player is {awaygoalie::player}:
- set {awaygoalie::player} to "AI"
- broadcast "&C&LWARNING: &eThe &bAway goalie&e left in the middle of the game!"
- if player is {homegoalie::player}:
- set {homegoalie::player} to "AI"
- broadcast "&C&LWARNING: &eThe &aHome goalie&e left in the middle of the game!"
- function Scoreboard(p:player):
- if world of {_p} is "{@hw}":
- set line 9 of scoreboard of {_p} to "&aStatuss: &e%{game::status}%"
- set {_s} to {game::time::sec}
- if {game::time::sec} < 10:
- set {_s} to "0%{game::time::sec}%"
- set {_m} to {game::time::sec}
- if {game::time::min} < 10:
- set {_m} to "0%{game::time::min}%"
- set line 8 of scoreboard of {_p} to "&aTime: &e[P%{game::period}%&e] - &e%{_m}%&e:%{_s}%"
- set line 7 of scoreboard of {_p} to "&aAway goalie: &f%{awaygoalie::player}%"
- set line 6 of scoreboard of {_p} to "&aHome goalie: &f%{homegoalie::player}%"
- IF {puckowner} is set:
- set line 5 of scoreboard of {_p} to "&aPuck: &f%{puckowner}%"
- else:
- set line 5 of scoreboard of {_p} to "&aPuck: No one"
- set line 4 of scoreboard of {_p} to "&aAway Goals: &f%{game::away::goals}% &6[%{game::away::team}%&6]"
- set line 3 of scoreboard of {_p} to "&aHome Goals: &f%{game::home::goals}% &6[%{game::home::team}%&6]"
- set line 2 of scoreboard of {_p} to "&a&7&a"
- set line 1 of scoreboard of {_p} to "&eehl.skynode.gg v1.4.1"
- else:
- set line 8 of scoreboard of {_p} to "&aMy rank: %coloured prefix of {_p}%"
- set line 7 of scoreboard of {_p} to "&aMy record: &90-0-0"
- set line 6 of scoreboard of {_p} to "&AMy goals: &f0"
- set line 5 of scoreboard of {_p} to "&aMy saves: &f0"
- set line 3 of scoreboard of {_p} to "&aMy team: &fComing soon!"
- set line 2 of scoreboard of {_p} to "&a&7&a"
- set line 1 of scoreboard of {_p} to "&eversion 1.4.1"
- on join:
- toggle scoreboard of player to on
- set title of player's scoreboard to "&f&lBONNIE'S HOCKEY GAME"
- while player is online:
- wait a tick
- Scoreboard(player)
- set tablist name of player to "%coloured prefix of player% &f%player%"
- on server list ping:
- set motd to "&f&lHOCKEY GAME &ev1.4.1 &7alpha%nl%&7&oJoin our &9discord &7(&e/discord&7)!"
- command /discord:
- trigger:
- send "&9Discord: &7{@discordlink}"
- function makeLook(e: living entity, loc: location):
- set {_xD} to {_loc}'s x location - {_e}'s x location
- set {_yD} to {_loc}'s y location - {_e}'s y location
- set {_zD} to {_loc}'s z location - {_e}'s z location
- set {_yaw} to atan2({_xD}, {_zD}) - 90
- set {_adj2} to ({_xD}*{_xD}) + ({_zD}*{_zD})
- set {_parallel} to sqrt({_adj2})
- set {_pitch} to atan2({_yD}, {_parallel}) - 90
- add "{Rotation:[%{_yaw}%f, %{_pitch}%f]}" to NBT of {_e}
- command /offside [<text>]:
- permission: staff.offside
- permission message: §cYou are not allowed to call offsides.
- trigger:
- if arg 1 is "away":
- broadcast "&7Called by %player%"
- Offside("away")
- if arg 1 is "home":
- broadcast "&7Called by %player%"
- Offside("home")
- command /setgoals [<text>] [<integer>]:
- permission: staff.offside
- permission message: §cYou are not allowed to change goals.
- trigger:
- if arg 2 is not set:
- send "&7/setgoals away/home <number>"
- if arg 2 is set:
- if arg 1 is "home" or "away":
- set {game::%arg-1%::goals} to arg-2
- broadcast "&CAn staff updated the goals"
- on region enter:
- "%event-region%" contains "homearea" or "awayarea"
- if {game::status} is "In-game":
- if player is {puckowner}:
- if {game::away::members::*} contains player:
- if "%event-region%" contains "homearea":
- loop {game::away::members::*}:
- loop-value is not player
- if "%region at loop-value%" contains "homearea":
- Offside("away")
- stop
- if {game::home::members::*} contains player:
- if "%event-region%" contains "awayarea":
- loop {game::home::members::*}:
- loop-value is not player
- if "%region at loop-value%" contains "awayarea":
- Offside("home")
- stop
- function Offside(t:string):
- if {_t} = "away":
- broadcast "" #
- broadcast "&eOffside has been called on %{teams::%{game::away::team}%::name}%"
- broadcast ""
- delete {puckowner}
- set {goalieai} and {inplay} and {isreplay} to false
- set {game::status} to "Out of play"
- play sound "whistle.1" for all players in world "{@hw}"
- wait 5 seconds
- if distance between {BHL::homeoffsideleft} and {puck} < distance between {BHL::homeoffsideright} and {puck}:
- RespawnPuck("homeoffsideleft")
- else:
- RespawnPuck("homeoffsideright")
- if {_t} = "home":
- broadcast ""
- broadcast "&eOffside has been called on %{teams::%{game::home::team}%::name}%"
- broadcast ""
- delete {puckowner}
- set {goalieai} and {inplay} and {isreplay} to false
- set {game::status} to "Out of play"
- play sound "whistle.1" for all players in world "{@hw}"
- wait 5 seconds
- if distance between {BHL::awayoffsideleft} and {puck} < distance between {BHL::awayoffsideright} and {puck}:
- RespawnPuck("awayoffsideleft")
- else:
- RespawnPuck("awayoffsideright")
- command /ahockey [<text>]:
- permission: ahockey.configure
- permission message: &CThis command is restricted
- trigger:
- if arg 1 is "lobby":
- set {bhl::lobby} to location of player
- broadcast "updateed lobby"
- if arg 1 is "awayoffsideleft":
- set {bhl::awayoffsideleft} to location of player
- broadcast "updateed awayoffsideleft"
- if arg 1 is "awayoffsideright":
- set {bhl::awayoffsideright} to location of player
- broadcast "updateed awayoffsideright"
- if arg 1 is "homeoffsideleft":
- set {bhl::homeoffsideleft} to location of player
- broadcast "updateed homeoffsideleft"
- if arg 1 is "homeoffsideright":
- set {bhl::homeoffsideright} to location of player
- broadcast "updateed homeoffsideright"
- if arg 1 is "awayleft":
- set {bhl::awayleft} to location of player
- broadcast "updated awayleft"
- if arg 1 is "awaybench":
- set {bhl::awaybench} to location of player
- broadcast "updated awaybench"
- if arg 1 is "homebench":
- set {bhl::homebench} to location of player
- broadcast "updated homebench"
- if arg 1 is "awayright":
- set {bhl::awayright} to location of player
- broadcast "updated awayright"
- if arg 1 is "homeleft":
- set {bhl::homeleft} to location of player
- broadcast "updated homeleft"
- if arg 1 is "homeright":
- set {bhl::homeright} to location of player
- broadcast "updated homeright"
- if arg 1 is "awaybox":
- set {bhl::awaybox} to location of player
- broadcast "set awaybox"
- if arg 1 is "homebox":
- set {bhl::homebox} to location of player
- broadcast "set homeboxx"
- if arg 1 is "setcenter":
- set {BHL::center} to location of player
- send "&a&lGAME &e» Updated &aCenter &elocation!"
- if arg 1 is "setawaynet":
- set {BHL::awaynet} to location of player
- send "&a&lGAME &e» Updated &aAway net &elocation!"
- if arg 1 is "sethomenet":
- set {BHL::homenet} to location of player
- send "&a&lGAME &e» Updated &aHome net &elocation!"
- if arg 1 is "stick":
- set name of tool of player to "&aHockey Stick"
- set {BHL::stick} to tool of player
- send "&a&lGAME &e» Updated &aHockey Stick &eitem!"
- if arg 1 is "gk" or "goalie":
- set name of tool of player to "&aPerform a save &7&o(Left/Right Click)"
- set {bhl::goaliecontrol} to tool of player
- send "&a&lGAME &e» Updated &aGoalie Tool&e item!"
- on join:
- set {deke::%player%} to "center"
- set {BHL::%player%::power} to 0
- set {BHL::%player%::lasthit} to now
- while player is online:
- wait a tick
- if tool of player is {BHL::stick}:
- if distance between player and {puck} < 0.70:
- if player is sneaking:
- player is not {awaygoalie::player} or {homegoalie::player}
- set {_v} to vector from yaw player's yaw and pitch 0
- set vector length of {_v} to 0.1
- set {-pv} to {_v}
- on skript load:
- wait 10 seconds
- RebuildGame()
- on load:
- RebuildGame()
- on damage:
- if victim is {puck}:
- cancel event
- if attacker is silverfish or puffer fish:
- cancel event
- on rightclick: #hit with puck
- tool of player is {bhl::stick}
- if {BHL::%player%::power} < 120:
- set {BHL::lastshot} to player
- set {BHL::%player%::lastpower} to now
- set {_val} to a random integer between 6 and 10
- add {_val} to {BHL::%player%::power}
- if {BHL::%player%::power} > 100:
- set {BHL::%player%::power} to 100
- send action bar "&6Left click for action &7| &a&lPOWER: &7%{bhl::%player%::power}%%%" to player
- on leftclick:
- tool of player is {bhl::stick}
- player is {puckowner}
- Shot()
- on mine:
- tool of player is {bhl::stick}
- player is {puckowner}
- Shot()
- on damage:
- tool of attacker is {bhl::stick}
- attacker is {puckowner}
- Shot()
- function Shot():
- delete {BHL::%{puckowner}%::lastpower}
- set {BHL::%{puckowner}%::lasthit} to now
- if {BHL::%{puckowner}%::power} > 75:
- Commentator("shot","%{puckowner}%")
- play sound "minecraft:puck.pass" to all players in world "{@hw}"
- set {_l} to location of {puckowner}
- set {_v} to vector from yaw {puckowner}'s yaw and pitch 0
- set vector length of {_v} to 1.3
- set {-pv} to {_v} ++ {-pv}
- add 0.3 to y of {-pv}
- set {BHL::%{puckowner}%::power} to 0
- delete {puckowner}
- stop
- if {BHL::%{puckowner}%::power} > 50:
- Commentator("shot","%{puckowner}%")
- play sound "minecraft:puck.pass" to all players in world "{@hw}"
- set {_l} to location of {puckowner}
- set {_v} to vector from yaw {puckowner}'s yaw and pitch 0
- set vector length of {_v} to 1.1
- set {-pv} to {_v} ++ {-pv}
- add 0.2 to y of {-pv}
- set {BHL::%{puckowner}%::power} to 0
- delete {puckowner}
- stop
- if {BHL::%{puckowner}%::power} > 30:
- Commentator("shot","%{puckowner}%")
- play sound "minecraft:puck.pass" to all players in world "{@hw}"
- set {_l} to location of {puckowner}
- set {_v} to vector from yaw {puckowner}'s yaw and pitch 0
- set vector length of {_v} to 1
- set {-pv} to {_v} ++ {-pv} #
- add 0.2 to y of {-pv}
- set {BHL::%{puckowner}%::power} to 0
- delete {puckowner}
- wait 0.3 seconds
- stop
- if {BHL::%{puckowner}%::power} > 15:
- Commentator("shot","%{puckowner}%")
- play sound "minecraft:puck.pass" to all players in world "{@hw}"
- set {_l} to location of {puckowner}
- set {_v} to vector from yaw {puckowner}'s yaw and pitch 0
- set vector length of {_v} to 0.8
- set {-pv} to {_v} ++ {-pv} #
- add 0.1 to y of {-pv}
- set {BHL::%{puckowner}%::power} to 0
- delete {puckowner}
- wait 0.3 seconds
- stop
- if {BHL::%{puckowner}%::power} > -1:
- Commentator("shot","%{puckowner}%")
- play sound "minecraft:puck.pass" to all players in world "{@hw}"
- set {_l} to location of {puckowner}
- set {_v} to vector from yaw {puckowner}'s yaw and pitch 0
- set vector length of {_v} to 0.6
- set {-pv} to {_v} ++ {-pv}
- set {BHL::%{puckowner}%::power} to 0
- delete {puckowner}
- function ClearRAM(p:player):
- delete {deke::%{_p}%}
- delete {BHL::%{_p}%::*}
- delete {bhl::%{_p}%::*}
- delete {stamina::%{_p}%}
- delete {game::penalty::*}
- on damage: #hit with puck
- difference between {bhl::%attacker%::lastsneak} and now > 0.4 seconds
- victim is {puck}
- {puckowner} is not set
- {goalieai} and {inplay} are true
- attacker is sneaking
- set {bhl::%attacker%::lastsneak} to now
- set {bhl::%attacker%::lastshot} to attacker
- tool of attacker is {bhl::stick}
- if {game::status} is "Waiting" or "Starting":
- send "&cPlease start the game before doing this. Use /startgame or turn on warmup mode using /warmup" to attacker
- stop
- set {BHL::lastshot} to attacker
- set {BHL::%attacker%::lasthit} to now
- play sound "minecraft:puck.pass" to all players in world "{@hw}"
- set {_loc} to event-location
- set {_l} to location of attacker
- set {_v} to vector from yaw attacker's yaw and pitch 0
- set vector length of {_v} to 1.1
- set {-pv} to {_v} ++ {-pv}
- every second:
- if "%tps%" does not contain "20" or "19." or "18.":
- {isrestart} is not set
- AutomatedRestart()
- function AutomatedRestart():
- set {isrestart} to true
- broadcast "&6[LAG] &EDetected TPS DROP. The server will restart in 30 seconds."
- wait 30 seconds
- make console execute command "restart"
- command /warmup:
- trigger:
- if {game::status} is "Waiting":
- set {game::status} to "Warmup"
- broadcast "&a&lWARM UP: &eGoal detections has been disabled. Warm up mode turned on by %player%"
- stop
- if {game::status} is "Warmup":
- set {game::status} to "Waiting"
- broadcast "&a&lWARM UP: &eWarm up mode turned off by %player%"
- teleport {puck} to {bhl::center}
- stop
- on damage: # hit system
- attacker is player
- attacker is not sneaking
- victim is {puck}
- cancel event
- tool of attacker is {BHL::stick}
- if {game::status} is "Waiting" or "Starting":
- send "&cPlease start the game before doing this. Use /startgame or turn on warmup mode using /warmup" to attacker
- stop
- if {inplay} is true:
- if {puckowner} is not set: # ver
- set {_vel} to vector length of {-pv} * 20 * 2.237
- {_vel} < 11
- difference between {puckinvis} and now > {@immune} seconds
- set {deke::%attacker%} to "center"
- set {puckowner} to attacker # #
- Commentator("hasit")
- set {puckinvis} to now
- set {bhl::%{puckowner}%::power} to -1
- delete {BHL::%attacker%::lastpower}
- wait 2 ticks
- set {bhl::%{puckowner}%::power} to 0
- stop
- else if {puckowner} is set:
- attacker is not {puckowner}
- set {bhl::%{puckowner}%::power} to 0
- Commentator("playerpoke","%attacker%")
- delete {puckowner}
- set {_v} to vector from yaw attacker's yaw and pitch 0
- set vector length of {_v} to 0.4
- set {-pv} to {_v}
- if {puckowner} is attacker:
- set {bhl::%{puckowner}%::power} to 0
- delete {puckowner}
- function applynbt(e:entity):
- apply invisibility of tier 1 without particles to {_e} for a day
- add "{Invulnerable:1}" to nbt of {_e}
- add "{PersistenceRequired:1}" to nbt of {_e}
- add "{NoAI:1}" to nbt of {_e}
- add "{Silent:1}" to nbt of {_e}
- add "{PuffState:1}" to nbt of {_e}
- add "{NoGravity:1}" to nbt of {_e}
- function AwayGKButterfly(gk:entity,bf:boolean = true):
- if {awaygoalie::currentpose} is "skatingup":
- ResetHitboxes({awaygoalie})
- if y-coord of {awaygoalie} = 6:
- set {awaygoalie::isbutterfly} to true
- set {_gkl} to location of {_gk}
- subtract 0.5 from y-coord of {_gkl}
- teleport {_gk} to {_gkl}
- else:
- set {awaygoalie::isbutterfly} to false
- if y-coord of {_gk} < 6:
- set {_gkl} to location of {_gk}
- add 0.5 to y-coord of {_gkl}
- teleport {_gk} to {_gkl}
- # butterfly
- if {_bf} is true:
- spawn puffer fish at {_gk}
- set {awayhitbox::butterfly::left} to last spawned puffer fish
- applynbt({awayhitbox::butterfly::left})
- spawn puffer fish at {_gk}
- set {awayhitbox::butterfly::leftleft} to last spawned puffer fish
- applynbt({awayhitbox::butterfly::leftleft})
- #
- spawn puffer fish at {_gk}
- set {awayhitbox::butterfly::right} to last spawned puffer fish
- applynbt({awayhitbox::butterfly::right})
- spawn puffer fish at {_gk}
- set {awayhitbox::butterfly::rightright} to last spawned puffer fish
- applynbt({awayhitbox::butterfly::rightright})
- spawn puffer fish at {_gk}
- set {awayhitbox::butterfly::chest} to last spawned puffer fish
- applynbt({awayhitbox::butterfly::chest})
- spawn puffer fish at {_gk}
- set {awayhitbox::butterfly::head} to last spawned puffer fish
- applynbt({awayhitbox::butterfly::head})
- set {awaygoalie::currentpose} to "butterfly"
- 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]}}"
- 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}
- while {awayhitbox::butterfly::leftleft} is set:
- wait a tick
- set {_loc} to location of {_gk} # Chest
- set {_alti} to vector(0,1,0)
- set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::butterfly::chest} to {_gk} ~ {_v}
- if distance between {puck} and {awayhitbox::butterfly::chest} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- set {_loc} to location of {_gk} # Head
- set {_alti} to vector(0,1.5,0)
- set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::butterfly::head} to {_gk} ~ {_v}
- if distance between {puck} and {awayhitbox::butterfly::head} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- set {_loc} to location of {_gk}
- set {_alti} to vector(0,0.60,0)
- set {_v} to spherical vector radius 0.65, yaw {_gk}'s yaw - 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::butterfly::leftleft} to {_gk} ~ {_v}
- if distance between {puck} and {awayhitbox::butterfly::leftleft} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- #
- set {_loc} to location of {_gk} # Pad LEFT
- set {_alti} to vector(0,0.60,0)
- set {_v} to spherical vector radius 0.35, yaw {_gk}'s yaw - 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::butterfly::left} to {_gk} ~ {_v}
- if distance between {puck} and {awayhitbox::butterfly::left} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- set {_loc} to location of {_gk} # Pad Right
- set {_alti} to vector(0,0.60,0)
- set {_v} to spherical vector radius 0.35, yaw {_gk}'s yaw + 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::butterfly::right} to {_gk} ~ {_v}
- if distance between {puck} and {awayhitbox::butterfly::right} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- #
- set {_loc} to location of {_gk} # Pad rightright
- set {_alti} to vector(0,0.60,0)
- set {_v} to spherical vector radius 0.65, yaw {_gk}'s yaw + 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::butterfly::rightright} to {_gk} ~ {_v}
- if distance between {puck} and {awayhitbox::butterfly::rightright} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- if distance between {awaygoalie} and {puck} < 1:
- if {awaygoalie::currentpose} is "butterfly":
- set {_v} to vector length of {-pv} * 20 * 2.237
- y-coord of {puck} < 6.25
- {_v} < 12
- AwayNewPose({awaygoalie},"covered")
- teleport {puck} to {awaygoalie}
- wait a tick
- GoalieSave()
- else:
- GoalieReflect({_gk},"pad")
- function ResetHitboxes(p:entity):
- kill all silverfishes and puffer fishes in radius 10 around {_p}
- if {_p} is {awaygoalie} or {awaygoalie::player}:
- delete {awayhitbox::*}
- if {_p} is {homegoalie} or {homegoalie::player}:
- delete {homehitbox::*}
- function UpdatePGSpeed():
- if {awaygoalie::currentpose} is "skatingup":
- set walking speed of {awaygoalie::player} to 0.5
- else:
- set walking speed of {awaygoalie::player} to 0.4
- if {homegoalie::currentpose} is "skatingup":
- set walking speed of {homegoalie::player} to 0.5
- else:
- set walking speed of {homegoalie::player} to 0.45
- function AwayNewPose(gk:entity,pose:string):
- if {_pose} is not "skatingup":
- if {awaygoalie::player} is "AI":
- while y-coord of {awaygoalie} > 5.5:#
- wait a tick
- if y-coord of {awaygoalie} is not 6:
- set {awaygoalie::isbutterfly} to true
- set {_gkl} to location of {_gk}
- subtract 0.5 from y-coord of {_gkl}
- teleport {_gk} to {_gkl}
- else:
- set {awaygoalie::isbutterfly} to false
- if y-coord of {_gk} < 6:
- set {_gkl} to location of {_gk}
- add 0.5 to y-coord of {_gkl}
- teleport {_gk} to {_gkl}
- set {awaygoalie::currentpose} to {_pose}
- if {_pose} is "covered":
- 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}
- 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]}}"
- if {_pose} is "skatingup":
- ResetHitboxes({awaygoalie})
- spawn puffer fish at {_gk}
- set {awayhitbox::skatingup::chest} to last spawned puffer fish
- applynbt({awayhitbox::skatingup::chest})
- spawn puffer fish at {_gk}
- set {awayhitbox::skatingup::head} to last spawned puffer fish
- applynbt({awayhitbox::skatingup::head})
- 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]}}"
- 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}
- while {awayhitbox::skatingup::chest} is set:
- wait a tick
- set {_loc} to location of {_gk} # Chest
- set {_alti} to vector(0,1,0)
- set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::skatingup::chest} to {_gk} ~ {_v}
- if distance between {puck} and {awayhitbox::skatingup::chest} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- set {_loc} to location of {_gk} # Head
- set {_alti} to vector(0,1.5,0)
- set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::skatingup::head} to {_gk} ~ {_v}
- if distance between {puck} and {awayhitbox::skatingup::head} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- distance between {puck} and {awaygoalie} < 1
- GoalieReflect({awaygoalie},"pad")
- if {_pose} = "savinglefthigh": # DONE
- spawn puffer fish at {_gk}
- 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]}}"
- 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
- set {awayhitbox::savinglefthigh::glove} to last spawned puffer fish
- applynbt({awayhitbox::savinglefthigh::glove})
- while {awayhitbox::savinglefthigh::glove} is set:
- wait a tick
- set {_alti} to vector(0,1.45,0)
- set {_v} to spherical vector radius 0.70, yaw {_gk}'s yaw - 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::savinglefthigh::glove} to {_gk} ~ {_v}
- if distance between {puck} and {awayhitbox::savinglefthigh::glove} < {@gkreach}:
- teleport {puck} to {awayhitbox::savinglefthigh::glove}
- GoalieSave()
- if {_pose} = "savingrighthigh": # DONE
- 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}
- 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]}}"
- spawn silverfish at {_gk}
- set {awayhitbox::savingrighthigh::stick1} to last spawned silverfish
- applynbt({awayhitbox::savingrighthigh::stick1})
- # RightStick(stick2)
- spawn silverfish at {_gk}
- set {awayhitbox::savingrighthigh::stick2} to last spawned silverfish
- applynbt({awayhitbox::savingrighthigh::stick2})
- # RightGlove(glove)
- spawn puffer fish at {_gk}
- set {awayhitbox::savingrighthigh::glove} to last spawned puffer fish
- applynbt({awayhitbox::savingrighthigh::glove})
- while {awayhitbox::savingrighthigh::stick2} is set:
- wait a tick
- # StickHitbox1
- set {_alti} to vector(0,1.70,0)
- set {_v} to spherical vector radius 1.30, yaw {_gk}'s yaw + 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::savingrighthigh::stick1} to {_gk} ~ {_v}
- # StickBladeHitbox
- set {_alti} to vector(0,1.70,0)
- set {_v} to spherical vector radius 1.45, yaw {_gk}'s yaw + 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::savingrighthigh::stick2} to {_gk} ~ {_v}
- # Glove (lefthand)
- set {_alti} to vector(0,1.50,0)
- set {_v} to spherical vector radius 0.90, yaw {_gk}'s yaw + 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::savingrighthigh::glove} to {_gk} ~ {_v}
- if distance between {puck} and {awayhitbox::savingrighthigh::stick1} < {@gkreach}:
- GoalieReflect({_gk},"stick")
- if distance between {puck} and {awayhitbox::savingrighthigh::stick2} < {@gkreach}:
- GoalieReflect({_gk},"stick")
- #
- #
- if distance between {puck} and {awayhitbox::savingrighthigh::glove} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- if {_pose} = "savingleft": # DONE
- spawn puffer fish at {_gk}
- set {awayhitbox::savingleft::glove} to last spawned puffer fish
- applynbt({awayhitbox::savingleft::glove})
- 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]}}"
- 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}
- while {awayhitbox::savingleft::glove} exists: # DONE
- wait a tick
- set {_alti} to vector(0,1.10,0)
- set {_v} to spherical vector radius 0.75, yaw {_gk}'s yaw - 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::savingleft::glove} to {_gk} ~ {_v}
- if distance between {puck} and {awayhitbox::savingleft::glove} < {@gkreach}:
- teleport {puck} to {awayhitbox::savingleft::glove}
- GoalieSave()
- if {_pose} = "savingright": # DONE !
- # RightStick(stick1)
- 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}
- 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]}}"
- spawn silverfish at {_gk}
- set {awayhitbox::savingright::stick1} to last spawned silverfish
- applynbt({awayhitbox::savingright::stick1})
- # RightStick(stick2)
- spawn silverfish at {_gk}
- set {awayhitbox::savingright::stick2} to last spawned silverfish
- applynbt({awayhitbox::savingright::stick2})
- # RightGlove(glove)
- spawn puffer fish at {_gk}
- set {awayhitbox::savingright::glove} to last spawned puffer fish
- applynbt({awayhitbox::savingright::glove})
- while {awayhitbox::savingright::stick2} is set:
- wait a tick
- # StickHitbox1
- set {_alti} to vector(0,1.10,0)
- set {_v} to spherical vector radius 1.30, yaw {_gk}'s yaw + 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::savingright::stick1} to {_gk} ~ {_v}
- # StickBladeHitbox
- set {_alti} to vector(0,0.90,0)
- set {_v} to spherical vector radius 1.45, yaw {_gk}'s yaw + 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::savingright::stick2} to {_gk} ~ {_v}
- # Glove (lefthand)
- set {_alti} to vector(0,1.10,0)
- set {_v} to spherical vector radius 0.90, yaw {_gk}'s yaw + 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {awayhitbox::savingright::glove} to {_gk} ~ {_v}
- if distance between {puck} and {awayhitbox::savingright::glove} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- #RightStick1
- if distance between {puck} and {awayhitbox::savingright::stick1} < {@gkreach}:
- GoalieReflect({_gk},"stick")
- #Rightsitck2
- if distance between {puck} and {awayhitbox::savingright::stick2} < {@gkreach}:
- GoalieReflect({_gk},"stick")
- function HomeGKButterfly(gk:entity,bf:boolean = true):
- {game::status} is not "Goal"
- if {homegoalie::currentpose} is "skatingup":
- ResetHitboxes({homegoalie})
- if y-coord of {homegoalie} = 6:
- set {homegoalie::isbutterfly} to true
- set {_gkl} to location of {_gk}
- subtract 0.5 from y-coord of {_gkl}
- teleport {_gk} to {_gkl}
- else:
- set {homegoalie::isbutterfly} to false
- if y-coord of {_gk} < 6:
- set {_gkl} to location of {_gk}
- add 0.5 to y-coord of {_gkl}
- teleport {_gk} to {_gkl}
- # butterfly
- if {_bf} is true:
- spawn puffer fish at {_gk}
- set {homehitbox::butterfly::left} to last spawned puffer fish
- applynbt({homehitbox::butterfly::left})
- spawn puffer fish at {_gk}
- set {homehitbox::butterfly::leftleft} to last spawned puffer fish
- applynbt({homehitbox::butterfly::leftleft})
- #
- spawn puffer fish at {_gk}
- set {homehitbox::butterfly::right} to last spawned puffer fish
- applynbt({homehitbox::butterfly::right})
- spawn puffer fish at {_gk}
- set {homehitbox::butterfly::rightright} to last spawned puffer fish
- applynbt({homehitbox::butterfly::rightright})
- spawn puffer fish at {_gk}
- set {homehitbox::butterfly::chest} to last spawned puffer fish
- applynbt({homehitbox::butterfly::chest})
- spawn puffer fish at {_gk}
- set {homehitbox::butterfly::head} to last spawned puffer fish
- applynbt({homehitbox::butterfly::head})
- set {homegoalie::currentpose} to "butterfly"
- 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]}}"
- 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}
- while {homehitbox::butterfly::leftleft} is set:
- wait a tick
- set {_loc} to location of {_gk} # Chest
- set {_alti} to vector(0,1,0)
- set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::butterfly::chest} to {_gk} ~ {_v}
- if distance between {puck} and {homehitbox::butterfly::chest} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- set {_loc} to location of {_gk} # Head
- set {_alti} to vector(0,1.5,0)
- set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::butterfly::head} to {_gk} ~ {_v}
- if distance between {puck} and {homehitbox::butterfly::head} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- set {_alti} to vector(0,0.60,0)
- set {_v} to spherical vector radius 0.65, yaw {_gk}'s yaw - 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::butterfly::leftleft} to {_gk} ~ {_v}
- if distance between {puck} and {homehitbox::butterfly::leftleft} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- #
- set {_loc} to location of {_gk} # Pad LEFT
- set {_alti} to vector(0,0.60,0)
- set {_v} to spherical vector radius 0.35, yaw {_gk}'s yaw - 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::butterfly::left} to {_gk} ~ {_v}
- if distance between {puck} and {homehitbox::butterfly::left} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- set {_loc} to location of {_gk} # Pad Right
- set {_alti} to vector(0,0.60,0)
- set {_v} to spherical vector radius 0.35, yaw {_gk}'s yaw + 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::butterfly::right} to {_gk} ~ {_v}
- if distance between {puck} and {homehitbox::butterfly::right} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- #
- set {_loc} to location of {_gk} # Pad rightright
- set {_alti} to vector(0,0.60,0)
- set {_v} to spherical vector radius 0.65, yaw {_gk}'s yaw + 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::butterfly::rightright} to {_gk} ~ {_v}
- if distance between {puck} and {homehitbox::butterfly::rightright} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- if distance between {homegoalie} and {puck} < 1:
- if {homegoalie::currentpose} is "butterfly":
- set {_v} to vector length of {-pv} * 20 * 2.237
- y-coord of {puck} < 6.25
- {_v} < 12
- HomeNewPose({homegoalie},"covered")
- teleport {puck} to {homegoalie}
- wait a tick
- GoalieSave()
- function HomeNewPose(gk:entity,pose:string):
- {game::status} is not "Goal"
- if {_pose} is not "skatingup":
- if y-coord of {homegoalie} = 6:
- set {homegoalie::isbutterfly} to true
- set {_gkl} to location of {_gk}
- subtract 0.5 from y-coord of {_gkl}
- teleport {_gk} to {_gkl}
- else:
- set {homegoalie::isbutterfly} to false
- if y-coord of {_gk} < 6:
- set {_gkl} to location of {_gk}
- add 0.5 to y-coord of {_gkl}
- teleport {_gk} to {_gkl}
- set {homegoalie::currentpose} to {_pose}
- if {_pose} is "covered":
- 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]}}"
- 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}
- if {_pose} is "skatingup":
- ResetHitboxes({homegoalie})
- spawn puffer fish at {_gk}
- set {homehitbox::skatingup::chest} to last spawned puffer fish
- applynbt({homehitbox::skatingup::chest})
- spawn puffer fish at {_gk}
- set {homehitbox::skatingup::head} to last spawned puffer fish
- applynbt({homehitbox::skatingup::head})
- 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]}}"
- 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}
- while {homehitbox::skatingup::chest} is set:
- wait a tick
- set {_loc} to location of {_gk} # Chest
- set {_alti} to vector(0,1,0)
- set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::skatingup::chest} to {_gk} ~ {_v}
- if distance between {puck} and {homehitbox::skatingup::chest} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- set {_loc} to location of {_gk} # Head
- set {_alti} to vector(0,1.5,0)
- set {_v} to spherical vector radius 0, yaw {_gk}'s yaw - 100, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::skatingup::head} to {_gk} ~ {_v}
- if distance between {puck} and {homehitbox::skatingup::head} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- wait a tick
- distance between {puck} and {homegoalie} < 1
- GoalieReflect({homegoalie},"pad")
- if {_pose} = "savinglefthigh": # DONE
- spawn puffer fish at {_gk}
- 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]}}"
- 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
- set {homehitbox::savinglefthigh::glove} to last spawned puffer fish
- applynbt({homehitbox::savinglefthigh::glove})
- while {homehitbox::savinglefthigh::glove} is set:
- wait a tick
- set {_alti} to vector(0,1.45,0)
- set {_v} to spherical vector radius 0.70, yaw {_gk}'s yaw - 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::savinglefthigh::glove} to {_gk} ~ {_v}
- if distance between {puck} and {homehitbox::savinglefthigh::glove} < {@gkreach}:
- teleport {puck} to {homehitbox::savinglefthigh::glove}
- GoalieSave()
- if {_pose} = "savingrighthigh": # DONE
- 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}
- 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]}}"
- spawn silverfish at {_gk}
- set {homehitbox::savingrighthigh::stick1} to last spawned silverfish
- applynbt({homehitbox::savingrighthigh::stick1})
- # RightStick(stick2)
- spawn silverfish at {_gk}
- set {homehitbox::savingrighthigh::stick2} to last spawned silverfish
- applynbt({homehitbox::savingrighthigh::stick2})
- # RightGlove(glove)
- spawn puffer fish at {_gk}
- set {homehitbox::savingrighthigh::glove} to last spawned puffer fish
- applynbt({homehitbox::savingrighthigh::glove})
- while {homehitbox::savingrighthigh::stick2} is set:
- wait a tick
- # StickHitbox1
- set {_alti} to vector(0,1.70,0)
- set {_v} to spherical vector radius 1.30, yaw {_gk}'s yaw + 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::savingrighthigh::stick1} to {_gk} ~ {_v}
- # StickBladeHitbox
- set {_alti} to vector(0,1.70,0)
- set {_v} to spherical vector radius 1.45, yaw {_gk}'s yaw + 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::savingrighthigh::stick2} to {_gk} ~ {_v}
- # Glove (lefthand)
- set {_alti} to vector(0,1.50,0)
- set {_v} to spherical vector radius 0.90, yaw {_gk}'s yaw + 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::savingrighthigh::glove} to {_gk} ~ {_v}
- if distance between {puck} and {homehitbox::savingrighthigh::stick1} < {@gkreach}:
- GoalieReflect({_gk},"stick")
- if distance between {puck} and {homehitbox::savingrighthigh::stick2} < {@gkreach}:
- GoalieReflect({_gk},"stick")
- #
- #
- if distance between {puck} and {homehitbox::savingrighthigh::glove} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- if {_pose} = "savingleft": # DONE
- spawn puffer fish at {_gk}
- set {homehitbox::savingleft::glove} to last spawned puffer fish
- applynbt({homehitbox::savingleft::glove})
- 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]}}"
- 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}
- while {homehitbox::savingleft::glove} exists: # DONE
- wait a tick
- set {_alti} to vector(0,1.10,0)
- set {_v} to spherical vector radius 0.75, yaw {_gk}'s yaw - 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::savingleft::glove} to {_gk} ~ {_v}
- if distance between {puck} and {homehitbox::savingleft::glove} < {@gkreach}:
- teleport {puck} to {homehitbox::savingleft::glove}
- GoalieSave()
- if {_pose} = "savingright": # DONE !
- # RightStick(stick1)
- 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]}}"
- 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}
- spawn silverfish at {_gk}
- set {homehitbox::savingright::stick1} to last spawned silverfish
- applynbt({homehitbox::savingright::stick1})
- # RightStick(stick2)
- spawn silverfish at {_gk}
- set {homehitbox::savingright::stick2} to last spawned silverfish
- applynbt({homehitbox::savingright::stick2})
- # RightGlove(glove)
- spawn puffer fish at {_gk}
- set {homehitbox::savingright::glove} to last spawned puffer fish
- applynbt({homehitbox::savingright::glove})
- while {homehitbox::savingright::stick2} is set:
- wait a tick
- # StickHitbox1
- set {_alti} to vector(0,1.10,0)
- set {_v} to spherical vector radius 1.30, yaw {_gk}'s yaw + 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::savingright::stick1} to {_gk} ~ {_v}
- # StickBladeHitbox
- set {_alti} to vector(0,0.90,0)
- set {_v} to spherical vector radius 1.45, yaw {_gk}'s yaw + 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::savingright::stick2} to {_gk} ~ {_v}
- # Glove (lefthand)
- set {_alti} to vector(0,1.10,0)
- set {_v} to spherical vector radius 0.90, yaw {_gk}'s yaw + 85, pitch 6
- set {_v} to {_v} ++ {_alti}
- teleport {homehitbox::savingright::glove} to {_gk} ~ {_v}
- if distance between {puck} and {homehitbox::savingright::glove} < {@gkreach}:
- GoalieReflect({_gk},"pad")
- #RightStick1
- if distance between {puck} and {homehitbox::savingright::stick1} < {@gkreach}:
- GoalieReflect({_gk},"stick")
- #Rightsitck2
- if distance between {puck} and {homehitbox::savingright::stick2} < {@gkreach}:
- GoalieReflect({_gk},"stick")
- command /smth:
- trigger:
- loop {teamslist::*}:
- add loop-value to {_toshuffle::*}
- while size of {_toshuffle::*} > 0:
- wait a tick
- set {_a} to a random element of {_toshuffle::*}
- remove {_a} from {_toshuffle::*}
- add {_a} to {_shuffled::*}
- loop {_shuffled::*}:
- send "%loop-index%. %loop-value%"
- #set metadata tag "vanillaGUI" of player to chest inventory with 3 rows named "&7Hello There"
- function SelectTeam(p:player,t:string,staff:boolean = false):
- close inventory of {_p}
- open virtual chest inventory with 4 rows named "&2Hello, captain! Pick a team." to {_p}
- format gui slot (integers from 0 to 8) of {_p} with orange stained glass pane named "&c" to do nothing
- format gui slot (integers from 27 to 35) of {_p} with orange stained glass pane named "&c" to do nothing #teamnew
- loop {teamslist::*}:
- add loop-value to {_toshuffle::*}
- while size of {_toshuffle::*} > 0:
- wait a tick
- set {_a} to a random element of {_toshuffle::*}
- remove {_a} from {_toshuffle::*}
- add {_a} to {_shuffled::*}
- set {_n} to 8
- loop {_shuffled::*}:
- add 1 to {_n}
- if {_n} < 27:
- set {_x} to loop-value
- 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:
- close inventory of {_p}
- if {_t} is "away":
- set {game::away::team} to {_x}
- if {_staff} is false:
- broadcast "&eThe &bAway &ecaptain &7%{_p}% &epicked the team %coloured {teams::%{_x}%::name}%&e."
- else:
- broadcast "&cThe staff %coloured prefix of {_p}% %{_p}% &cchanged the &bAway&c team to %coloured {teams::%{_x}%::name}%"
- loop {game::away::members::*}:
- EquipPlayer(loop-value-2)
- if {_t} is "home":
- set {game::home::team} to {_x}
- if {_staff} is false:
- broadcast "&eThe &aHome &ecaptain &7%{_p}% &epicked the team %coloured {teams::%{_x}%::name}%&e."
- else:
- broadcast "&cThe staff %coloured prefix of {_p}% %{_p}% &cchanged the &aHome&c team to %coloured {teams::%{_x}%::name}%"
- loop {game::home::members::*}:
- EquipPlayer(loop-value-2)
- command /changeteam [<text>]:
- permission: staff.changeteam
- permission message: &cYou must be staff or higher to manage current game's teams
- trigger:
- if arg 1 is not set:
- send ""
- send "&a&lChanging a team"
- send ""
- send "&7/changeteam away/home"
- send ""
- if arg 1 = "away":
- broadcast "&cAn staff is currently changing the &bAway&c team."
- SelectTeam(player,"away",true)
- if arg 1 is "home":
- broadcast "&cAn staff is currently changing the &aHome&c team."
- SelectTeam(player,"home",true)
- on item damage:
- event-item is {BHL::stick}
- repair tool
- function LoadTeams(all:boolean = true,t:string = ""):
- if {_all} is true:
- loop {teamslist::*}:
- load yaml "{@dir}/%loop-value%.yml" as "teamdata.%loop-value%"
- delete {teams::%loop-value%::*}
- set {teams::%loop-value%::short} to yaml value "short" from "teamdata.%loop-value%"
- set {teams::%loop-value%::name} to yaml value "name" from "teamdata.%loop-value%"
- set {teams::%loop-value%::horn} to yaml value "horn" from "teamdata.%loop-value%"
- set {teams::%loop-value%::wins} to yaml value "wins" from "teamdata.%loop-value%"
- set {teams::%loop-value%::loses} to yaml value "loses" from "teamdata.%loop-value%"
- set {teams::%loop-value%::losesot} to yaml value "losesot" from "teamdata.%loop-value%"
- set {teams::%loop-value%::captain} to yaml value "captain" from "teamdata.%loop-value%"
- set {_rgb::*} to yaml list "awayhelmet" from "teamdata.%loop-value%"
- set {_rgb::1} to round({_rgb::1})
- set {_rgb::2} to round({_rgb::2})
- set {_rgb::3} to round({_rgb::3})
- set {teams::%loop-value%::awayhelmet} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
- set {_rgb::*} to yaml list "awaychestplate" from "teamdata.%loop-value%"
- set {_rgb::1} to round({_rgb::1})
- set {_rgb::2} to round({_rgb::2})
- set {_rgb::3} to round({_rgb::3})
- set {teams::%loop-value%::awaychestplate} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
- set {_rgb::*} to yaml list "awayleggings" from "teamdata.%loop-value%"
- set {_rgb::1} to round({_rgb::1})
- set {_rgb::2} to round({_rgb::2})
- set {_rgb::3} to round({_rgb::3})
- set {teams::%loop-value%::awayleggings} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
- set {_rgb::*} to yaml list "awayboots" from "teamdata.%loop-value%"
- set {_rgb::1} to round({_rgb::1})
- set {_rgb::2} to round({_rgb::2})
- set {_rgb::3} to round({_rgb::3})
- set {teams::%loop-value%::awayboots} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
- set {_rgb::*} to yaml list "homehelmet" from "teamdata.%loop-value%"
- set {_rgb::1} to round({_rgb::1})
- set {_rgb::2} to round({_rgb::2})
- set {_rgb::3} to round({_rgb::3})
- set {teams::%loop-value%::homehelmet} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
- set {_rgb::*} to yaml list "homechestplate" from "teamdata.%loop-value%"
- set {_rgb::1} to round({_rgb::1})
- set {_rgb::2} to round({_rgb::2})
- set {_rgb::3} to round({_rgb::3})
- set {teams::%loop-value%::homechestplate} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
- set {_rgb::*} to yaml list "homeleggings" from "teamdata.%loop-value%"
- set {_rgb::1} to round({_rgb::1})
- set {_rgb::2} to round({_rgb::2})
- set {_rgb::3} to round({_rgb::3})
- set {teams::%loop-value%::homeleggings} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
- set {_rgb::*} to yaml list "homeboots" from "teamdata.%loop-value%"
- set {_rgb::1} to round({_rgb::1})
- set {_rgb::2} to round({_rgb::2})
- set {_rgb::3} to round({_rgb::3})
- set {teams::%loop-value%::homeboots} to rgb({_rgb::1}, {_rgb::2}, {_rgb::3})
- function RebuildGame():
- delete {game::shootouts::*}
- set {pucklasttp} to now
- unload yaml directory "{@dir}"
- set {isreplay} to false
- delete {isrestart}
- delete {awaygoalie::player}
- delete {homegoalie::player}
- wait a tick
- set {lastpoke} to now
- set {game::seasoned} to false
- set {game::status} to "Waiting"
- set {game::time::min} to 0
- set {game::period} to 1
- set {game::time::sec} to 0
- set {game::home::goals} to 0
- set {game::away::goals} to 0
- set {game::away::team} to a random element of {teamslist::*}
- set {game::home::team} to a random element of {teamslist::*}
- set {puckinvis} to now
- set {inplay} to true
- LoadTeams(true)
- set {awaygoalie::lastpose} to "up"
- set {homegoalie::lastpose} to "up"
- set {awaygoalie::player} to "AI"
- set {homegoalie::player} to "AI"
- set {game::status} to "Waiting"
- kill all silverfishes and puffer fishes
- broadcast "&a&LGAME &e» &ERebuilding game..."
- loop all players:
- LoadData(loop-player)
- loop all armor stands in world "{@hw}":
- if tool of loop-entity is set:
- kill loop-entity
- loop all armor stands in world "lobby":
- if tool of loop-entity is set:
- kill loop-entity
- kill all endermites in world "{@hw}"
- apply slowness of tier 5 without particles to {puck} for 1 day
- broadcast "&a&LGAME &e» &EVariables set."
- SummonGoalie("away",location at {BHL::awaynet})
- set {awaygoalie} to last spawned armor stand
- set display name of {awaygoalie} to "&fAI"
- SummonGoalie("home",location at {BHL::homenet})
- set {homegoalie} to last spawned armor stand
- set display name of {homegoalie} to "&fAI"
- SummonGoalie("home",location at {BHL::lobby})
- set {lobby} to last spawned armor stand
- 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}
- AwayNewPose({lobby},"skatingup")
- set helmet of {awaygoalie} to {gk}
- set helmet of {homegoalie} to {gk}
- wait 1 second
- #AwayAI()
- RespawnPuck("center")
- set {goalieai} to true
- Puck()
- loop all players in world "{@hw}":
- EquipPlayer(loop-player)
- on damage:
- victim is {lobby}
- JoinBHL(attacker)
- cancel event
- on rightclick:
- target entity of player is {lobby}
- JoinBHL(player)
- cancel event
- function showVector(o: location, v: vector, c1: integers, c2: integers):
- set {_cv} to vector(x of {_v}, y of {_v}, z of {_v})
- loop vector length of {_cv} / .1 - .5 times:
- set vector length of {_cv} to loop-value * .1
- play 1 of dust using dustOption(rgb({_c1::1}, {_c1::2}, {_c1::3}), .5) at {_o} ~ {_cv}
- set {_pv} to vector from yaw (vector yaw of {_cv} + 90) and pitch 0
- loop 5 times:
- loop 8 times:
- set {_v2} to spherical vector radius .25 - (.05 * loop-value-1), yaw loop-value-2 * 45, pitch 0
- rotate {_v2} around {_pv} by (vector pitch of {_cv} + 90) * -1
- set {_at} to {_o} ~ {_cv}
- play 1 of dust using dustOption(rgb({_c2::1}, {_c2::2}, {_c2::3}), .5) at {_at} ~ {_v2}
- add .1 to vector length of {_cv}
- # and the vectors for the 3 points should determine where on the circle he should be at
- function PuckAltitude():
- while {puck} is set:
- wait a tick
- {puckowner} is not set
- {goalieai} is true
- if difference between {pucklasttp} and now > 1 second:
- subtract 0.02 from y of {-pv} if y-coord of {puck} > 6.3
- if y-coord of {puck} < 6:
- set {pucklasttp} to now
- set y of {-pv} to 0
- set {_loc} to location of {puck}
- set y-coord of {_loc} to 6
- teleport {puck} to {_loc}
- set y of {-pv} to 0
- function AwayAI(): #
- AwayAIPoses()
- set {_gk} to {awaygoalie}
- set {_mid} to location of block below {bhl::awaynet}
- add 0.5 to y-coord of {_mid}
- set {_left} to {_mid}
- set {_right} to {_mid}
- add 2 to z-coord of {_right}
- subtract 2 from z-coord of {_left}
- while {awaygoalie::player} is "AI":
- wait a tick
- {goalieai} is true
- {game::status} is "In-game"
- {puck} is set
- distance between {awaygoalie} and {puck} < 30
- set {_leftv} to vector from {_left} to {puck}
- set {_midv} to vector from {_mid} to {puck}
- set {_rightv} to vector from {_right} to {puck}
- set {_gkv} to vector from {_gk} to {puck} #
- set {_eqx} to vector length of {_gkv}
- set {_d} to distance between {puck} and {_mid}
- set {_rad} to min(max(1 + {_d} / 10, .25), 2) * 2
- set {_v} to spherical vector radius {_rad}, yaw (vector yaw of vector from {_mid} to {puck}), pitch 0
- x-coord of {puck} > x-coord of {awaygoalie}
- loop 180 times:
- set {_v2} to spherical vector radius {_rad}, yaw loop-value, pitch 0
- play 1 of dust using dustOption(rgb(255, 0, 255), .5) at {_mid} ~ {_v2}
- if {awaygoalie::currentpose} is not "skatingup":
- set {_y} to y-coord of {awaygoalie}
- if {_y} is not 5.5:
- subtract 0.5 from y-coord of {_mid}
- teleport {awaygoalie} to {_mid} ~ {_v}
- else:
- set {_y} to y-coord of {awaygoalie}
- if {_y} is not 6:
- add 0.5 to y-coord of {_mid}
- {awaygoalie::currentpose} is not "savingleft" or "savingright"
- teleport {awaygoalie} to {_mid} ~ {_v}
- makeLook({awaygoalie},location at {puck})
- loop 180 times:
- set {_v2} to spherical vector radius .5, yaw loop-value, pitch 0
- play 1 of dust using dustOption(rgb(255, 0, 0), .5) at {_mid} ~ {_v2}
- loop 180 times:
- set {_v2} to spherical vector radius 2, yaw loop-value, pitch 0
- play 1 of dust using dustOption(rgb(255, 0, 0), .5) at {_mid} ~ {_v2}
- function AwayAIPoses():
- set {_gk} to {awaygoalie}
- set {_mid} to location of block below {bhl::awaynet}
- add 0.5 to y-coord of {_mid}
- set {_left} to {_mid}
- set {_right} to {_mid}
- add 1 to z-coord of {_right}
- subtract 1 from z-coord of {_left}
- while {awaygoalie::player} is "AI":
- wait a tick
- {goalieai} is true
- {puck} is set
- x-coord of {puck} > (x-coord of {awaygoalie})
- set {_d} to distance between {awaygoalie} and {puck}
- set {_dm} to distance between {puck} and {_mid}
- set {_dl} to distance between {puck} and {_left}
- set {_dr} to distance between {puck} and {_right}
- if {_d} < 2.30:
- if {_dm} < {_dl} and {_dr}:
- if {awaygoalie::isbutterfly} is false:
- AwayGKButterfly({awaygoalie},true)
- if {_dl} < {_dm} and {_dr}:
- if {awaygoalie::isbutterfly} is false:
- AwayGKButterfly({awaygoalie},true)
- if {awaygoalie::currentpose} is not "savingleft" or "savinglefthigh":
- y-coord of {awaygoalie} is 5.5
- if y-coord of {puck} < 6.50:
- AwayNewPose({awaygoalie},"savingleft")
- else:
- AwayNewPose({awaygoalie},"savinglefthigh")
- if {_dr} < {_dl} and {_dm}:
- if {awaygoalie::isbutterfly} is false:
- AwayGKButterfly({awaygoalie},true)
- if {awaygoalie::currentpose} is not "savingright" or "savingrighthigh":
- AwayNewPose({awaygoalie},"savingright")
- y-coord of {awaygoalie} is 5.5
- if y-coord of {puck} < 6.50:
- AwayNewPose({awaygoalie},"savingirght")
- else:
- AwayNewPose({awaygoalie},"savingrighthigh")
- else:
- if {awaygoalie::currentpose} is not "skatingup":
- ResetHitboxes({awaygoalie})
- AwayNewPose({awaygoalie},"skatingup")
- function Puck():
- set {-pv} to vector(0, 0, 0)
- while {puck} is alive:
- PuckAI()
- wait 1 tick
- if "%x of {-pv}%" contains "NaN":
- set {-pv} to vector(0, 0, 0)
- if {goalieai} and {inplay} are true:
- set {-pv} to {-pv} ** vector(.98, .98, .98)
- if block at ({puck} ~ {-pv}) is not air:
- if {puckowner} is set:
- delete {puckowner}
- if block at ({puck} ~ {-pv}) is mossy cobblestone wall: # cobb
- play sound "minecraft:post" at location of {puck}
- Commentator("post")
- delete {puckowner}
- set {_n} to normalized (vector from block at {puck} -- vector from block at ({puck} ~ {-pv}))
- rotate {-pv} around {_n} by 180 if y-coord of block at ({puck} ~ {-pv}) is not 5.5 or 6
- set {-pv} to {-pv} ** vector(-{@gkreach}, 0, -{@gkreach}) if y-coord of block at ({puck} ~ {-pv}) is not 5.5 or 6
- teleport {puck} to {puck} ~ {-pv} if y-coord of block at ({puck} ~ {-pv}) is 6 or 5.5
- else:
- teleport {puck} to {puck} ~ {-pv}
- set {-pv} to {-pv} ** vector(.98, .98, .98)
- function PuckAI():
- while {puck} is alive:
- wait 1 tick
- while {puckowner} exists:
- wait 1 tick
- if {deke::%{puckowner}%} = "center":
- set {_v} to spherical vector radius 1.30, yaw {puckowner}'s yaw, pitch 6
- if {deke::%{puckowner}%} = "left":
- set {_v} to spherical vector radius 1.30, yaw {puckowner}'s yaw - 80, pitch 6
- if {deke::%{puckowner}%} = "right":
- set {_v} to spherical vector radius 1.30, yaw {puckowner}'s yaw + 80, pitch 6
- set {_alti} to vector(0,0.15,0)
- set {_v} to {_v} ++ {_alti}
- if block at ({puckowner} ~ {_v}) is air:
- teleport {puck} to {puckowner} ~ {_v}
- else:
- delete {puckowner}
- function NewPG(p:player,gk:string):
- if {game::status} is "Warmup":
- if {_p} is {game::shootouts::player}:
- broadcast "&cYou are currently on a shootout, you can't do this!"
- stop
- if {_gk} is "awaypg":
- set {awaygoalie::patch} to now
- teleport {_p} to {awaynet}
- clear inventory of {_p}
- give {_p} {BHL::goaliecontrol}
- set {awaygoalie::player} to {_p}
- while {awaygoalie::player} = {_p}:
- wait a tick
- {game::status} is not "Goal" or "Out of play"
- if "%region at {_p}%" does not contain "goaliearea1 in world {@hw}": # should be handled by regions later
- teleport {_p} to {BHL::awaynet}
- teleport {awaygoalie} to {_p}
- apply invisibility of tier 50 without particles to {_p} for 1 day
- send action bar "&cAs a goalie, you have to stay in your zone!" to {awaygoalie::player}
- else if {awaygoalie::isbutterfly} is true:
- set {_l} to location of {_p}
- subtract 0.5 from y-coord of {_l}
- teleport {awaygoalie} to {_l}
- else:
- teleport {awaygoalie} to {_p}
- if {_gk} is "homepg":
- set {homegoalie::patch} to now
- teleport {_p} to {homenet}
- clear inventory of {_p}
- give {_p} {BHL::goaliecontrol}
- set {homegoalie::player} to {_p}
- apply invisibility of tier 50 without particles to {_p} for 1 day
- while {homegoalie::player} = {_p}:
- wait a tick
- {game::status} is not "Goal" or "Out of play"
- if "%region at {_p}%" does not contain "goaliearea2 in world {@hw}": # should be handled by regions later
- teleport {_p} to {BHL::homenet}
- teleport {homegoalie} to {_p}
- apply invisibility of tier 50 without particles to {_p} for 1 day
- send action bar "&cAs a goalie, you have to stay in your zone!" to {homegoalie::player}
- else if {homegoalie::isbutterfly} is true:
- set {_l} to location of {_p}
- subtract 0.5 from y-coord of {_l}
- teleport {homegoalie} to {_l}
- else:
- teleport {homegoalie} to {_p}
- wait a tick
- on sneak toggle:
- if {goalieai} is true:
- {game::status} is not "Goal"
- if player is {awaygoalie::player}:
- if {awaygoalie::player} is not sneaking:
- if {awaygoalie::currentpose} is "skatingup":
- AwayGKButterfly({awaygoalie},true)
- stop
- else:
- if {awaygoalie::player} is sneaking:
- if {awaygoalie::currentpose} is "butterfly" or "savingleft" or "savinglefthigh" or "savingrighthigh" or "savingright":
- ResetHitboxes({awaygoalie})
- AwayNewPose({awaygoalie},"skatingup")
- stop
- if player is {homegoalie::player}:
- if {homegoalie::player} is not sneaking:
- if {homegoalie::currentpose} is "skatingup":
- HomeGKButterfly({homegoalie},true)
- stop
- else:
- if {homegoalie::player} is sneaking:
- if {homegoalie::currentpose} is "butterfly" or "savingleft" or "savinglefthigh" or "savingrighthigh" or "savingright":
- ResetHitboxes({homegoalie})
- HomeNewPose({homegoalie},"skatingup")
- stop
- on damage:
- victim is {awaygoalie} or {homegoalie}
- cancel event
- on drop:
- event-item is {bhl::goaliecontrol}
- PGGlove(player)
- cancel event
- on rightclick:
- tool of player is {bhl::goaliecontrol}
- cancel event
- on rightclick:
- target entity of player is {awaygoalie} or {homegoalie}
- function PGGlove(p:player):
- {game::status} is not "Goal"
- {goalieai} is true
- if {_p} is {awaygoalie::player}:
- if {awaygoalie::currentpose} is "butterfly" or "savingright" or "savingrighthigh":
- if {awaygoalie::currentpose} is "butterfly" or "savingright" or "savingrighthigh":
- set {awaygoalie::patch} to now
- ResetHitboxes({awaygoalie})
- AwayGKButterfly({awaygoalie},true)
- AwayNewPose({awaygoalie},"savingleft")
- if {awaygoalie::currentpose} is "savinglefthigh":
- set {awaygoalie::patch} to now
- ResetHitboxes({awaygoalie})
- AwayGKButterfly({awaygoalie},true)
- AwayNewPose({awaygoalie}, "savingleft")
- stop
- if {awaygoalie::currentpose} is "savingleft":
- set {awaygoalie::patch} to now
- ResetHitboxes({awaygoalie})
- AwayGKButterfly({awaygoalie},true)
- AwayNewPose({awaygoalie}, "savinglefthigh")
- if {_p} is {homegoalie::player}:
- if {homegoalie::currentpose} is "butterfly" or "savingright" or "savingrighthigh":
- if {homegoalie::currentpose} is "butterfly" or "savingright" or "savingrighthigh":
- set {homegoalie::patch} to now
- ResetHitboxes({homegoalie})
- HomeGKButterfly({homegoalie},true)
- HomeNewPose({homegoalie},"savingleft")
- if {homegoalie::currentpose} is "savinglefthigh": #
- set {homegoalie::patch} to now
- ResetHitboxes({homegoalie})
- HomeGKButterfly({homegoalie},true)
- HomeNewPose({homegoalie}, "savingleft")
- stop
- if {homegoalie::currentpose} is "savingleft":
- set {homegoalie::patch} to now
- ResetHitboxes({homegoalie})
- HomeGKButterfly({homegoalie},true)
- HomeNewPose({homegoalie}, "savinglefthigh")
- on swapping of held item:
- gamemode of player is not creative
- cancel event
- if player is {awaygoalie::player} or {homegoalie::player}:
- cancel event
- tool of player is {bhl::goaliecontrol}
- {goalieai} is true
- {game::status} is not "Goal"
- if player is {awaygoalie::player}:
- if {awaygoalie::currentpose} is "butterfly" or "savingleft" or "savinglefthigh":
- if difference between {awaygoalie::patch} and now > 0.2 second:
- if {awaygoalie::currentpose} is "butterfly" or "savingleft" or "savinglefthigh":
- set {awaygoalie::patch} to now
- ResetHitboxes({awaygoalie})
- AwayGKButterfly({awaygoalie},true)
- AwayNewPose({awaygoalie},"savingright")
- if {awaygoalie::currentpose} is "savingrighthigh":
- set {awaygoalie::patch} to now
- ResetHitboxes({awaygoalie})
- AwayGKButterfly({awaygoalie},true)
- AwayNewPose({awaygoalie}, "savingright")
- stop
- if {awaygoalie::currentpose} is "savingright":
- set {awaygoalie::patch} to now
- ResetHitboxes({awaygoalie})
- AwayGKButterfly({awaygoalie},true)
- AwayNewPose({awaygoalie}, "savingrighthigh")
- stop
- if player is {homegoalie::player}:
- if {homegoalie::currentpose} is "butterfly" or "savingleft" or "savinglefthigh":
- if difference between {homegoalie::patch} and now > 0.2 second:
- if {homegoalie::currentpose} is "butterfly" or "savingleft" or "savinglefthigh":
- set {homegoalie::patch} to now
- ResetHitboxes({homegoalie})
- HomeGKButterfly({homegoalie},true)
- HomeNewPose({homegoalie},"savingright")
- if {homegoalie::currentpose} is "savingrighthigh":
- set {homegoalie::patch} to now
- ResetHitboxes({homegoalie})
- HomeGKButterfly({homegoalie},true)
- HomeNewPose({homegoalie}, "savingright")
- stop
- if {homegoalie::currentpose} is "savingright":
- set {homegoalie::patch} to now
- ResetHitboxes({homegoalie})
- HomeGKButterfly({homegoalie},true)
- HomeNewPose({homegoalie}, "savingrighthigh")
- stop
- on quit:
- remove invisibility from potion effects of player
- ClearRAM(player)
- every tick:
- {game::status} is not "Warmup"
- if "%region at {puck}%" contains "goalregion2":
- if {goalieai} and {inplay} are true:
- Goal("home")
- if "%region at {puck}%" contains "goalregion":
- if {goalieai} and {inplay} are true:
- Goal("away")
- every tick:
- if "%region at {puck}%" does not contain "PuckArea":
- if {goalieai} and {inplay} are true:
- if {puck} is set:
- OutOfPlay()
- function OutOfPlay():
- set {goalieai} and {inplay} and {isreplay} to false
- send title "&a&lOUT OF PLAY" to all players in world "{@hw}"
- play sound "minecraft:whistle.1" to all players in world "{@hw}"
- if {game::status} is not "Warmup":
- set {game::status} to "Out of play"
- wait 3 seconds
- RespawnPuck("center")
- function Goal(team:string,finish:boolean = false):
- if {game::status} is not "Waiting" or "Shootouts":
- set {game::status} to "Goal"
- if {game::status} is "Shootouts":
- if {game::shootouts::player} is set:
- set {goalieai} and {inplay} to false
- NextShootoutPlayer(true)
- stop
- if {_finish} is true:
- if {_team} is "away":
- ClearHomePen()
- play sound {teams::%{game::away::team}%::horn} at volume 0.3 for all players in world "{@hw}"
- set {bhl::%{puckowner}%::power} to 0
- delete {puckowner}
- wait 3 seconds
- wait 30 seconds
- set {goalhorn} to "n/a"
- delete {puckowner}
- while {game::status} = "Goal":
- wait a tick
- RespawnPuck("center")
- stop
- if {_team} is "home":
- ClearAwayPen()
- play sound {teams::%{game::home::team}%::horn} at volume 0.3 for all players in world "{@hw}"
- set {bhl::%{puckowner}%::power} to 0
- delete {puckowner}
- wait 3 seconds
- wait 30 seconds
- set {goalhorn} to "n/a"
- while {game::status} = "Goal":
- wait a tick
- RespawnPuck("center")
- stop
- if {goalieai} is true:
- set {goalieai} to false
- if {_team} is "away":
- ClearHomePen()
- add 1 to {game::away::goals}
- play sound {teams::%{game::away::team}%::horn} at volume 0.3 for all players in world "{@hw}"
- set {goalhorn} to "away"
- if {_finish} = false:
- Commentator("goalaway")
- send title "%coloured {teams::%{game::away::team}%::name}% GOAL!" with subtitle "&e%{BHL::lastshot}% scored!" to all players in world "{@hw}"
- wait 5 seconds
- set {isreplay} to false
- wait 3 seconds
- RunReplay()
- if {game::period} = 4:
- broadcast "&a&lGAME FINISHED: &eThe %coloured {teams::%{game::away::team}%::name}%&e won in the overtime!"
- else:
- ClearAwayPen()
- set {goalieai} to false
- add 1 to {game::home::goals}
- play sound {teams::%{game::home::team}%::horn} at volume 0.3 for all players in world "{@hw}"
- set {goalhorn} to "home"
- if {_finish} = false:
- Commentator("goalhome")
- send title "%coloured {teams::%{game::home::team}%::name}% GOAL!" with subtitle "&e%{BHL::lastshot}% scored!" to all players in world "{@hw}"
- wait 5 seconds
- set {isreplay} to false
- wait 3 seconds
- RunReplay()
- if {game::period} = 4:
- broadcast "&a&lGAME FINISHED: &eThe %coloured {teams::%{game::home::team}%::name}%&e won in the overtime!"
- wait 30 seconds
- while {game::status} = "Goal":
- wait a tick
- set {goalhorn} to "n/a"
- RespawnPuck("center")
- function ClearAwayPen():
- loop {game::away::members::*}:
- delete {pen::%loop-value%::time}
- delete {game::penalty::%loop-value%}
- function ClearHomePen():
- loop {game::home::members::*}:
- delete {pen::%loop-value%::time}
- delete {game::penalty::%loop-value%}
- function Penalty(p:player):
- if {game::status} is "In-game":
- {game::penalty::%{_p}%} is not set
- set {game::penalty::%{_p}%} to true
- broadcast "&a&lDELAYED PENALTY: &e%{_p}% "
- Commentator("delayedpen",{_p})
- while {game::penalty::%{_p}%} is true:
- wait a tick
- if {game::status} is not "In-game" or "Goal":
- PenaltyBox({_p})
- if {game::away::members::*} contains {_p}:
- loop {game::away::members::*}:
- loop-value is {puckowner}
- if {game::penalty::%{_p}%} is true:
- PenaltyBox({_p},"low",true)
- if {game::home::members::*} contains {_p}:
- loop {game::home::members::*}:
- loop-value is {puckowner}
- if {game::penalty::%{_p}%} is true:
- PenaltyBox({_p},"low",true)
- function PenaltyBox(p:player,time:string = "low",resp:boolean = false):
- set {game::penalty::%{_p}%} to false
- play sound "minecraft:powerplay" to all players in world "{@hw}"
- if {_time} is "low":
- set {pen::%{_p}%::time} to 45 # #
- broadcast "&a&lPENALTY: &e%{_p}%&e is being sent to the penalty box."
- set {inplay} and {goalieai} and {isreplay} to false
- set {game::status} to "Out of play" if {game::status} is not "Intermission"
- delete {puckowner}
- wait 8 seconds
- if {_resp} is true:
- if {game::status} is not "Intermission" or "Waiting":
- RespawnPuck("center")
- if {game::away::members::*} contains {_p}:
- teleport {_p} to {bhl::awaybox}
- if {game::home::members::*} contains {_p}:
- teleport {_p} to {bhl::homebox}
- while {pen::%{_p}%::time} is set:
- wait 1 second
- if {pen::%{_p}%::time} > 0:
- if {game::status} is "In-game":
- subtract 1 from {pen::%{_p}%::time}
- if {game::away::members::*} contains {_p}:
- send action bar "&a&lPENALTY: &e%{_p}% &6%{pen::%{_p}%::time}%&6s left" to {game::away::members::*}
- if {game::home::members::*} contains {_p}:
- send action bar "&a&lPENALTY: &e%{_p}% &6%{pen::%{_p}%::time}%&6s left" to {game::home::members::*}
- ELSE:
- delete {pen::%{_p}%::time}
- delete {game::penalty::%{_p}%}
- broadcast "&a&lPENALTY: &e%{_p}% &eis out of the box."
- teleport {_p} to {bhl::awaybench} if {game::away::members::*} contains {_p}
- teleport {_p} to {bhl::homebench} if {game::home::members::*} contains {_p}
- function RespawnPuck(local:string = "center"):
- {game::status} is not "Shootouts"
- if {_local} is set:
- kill {puck}
- kill all endermites
- if {game::status} is not "Intermission" or "Waiting" or "Starting" or "Warmup":
- set {game::status} to "Out of play"
- wait a tick
- set {bhl::%{puckowner}%::power} to 0
- delete {puckowner}
- delete {puck} #
- set {goalieai} to true
- set {_t} to 6
- broadcast ""
- broadcast "&eThe play will be resumed in the center" if {_local} = "center"
- broadcast "&eThe play will be resumed in the home area" if {_local} contains "homeleft" or "homeright"
- broadcast "&eThe play will be resumed in the away area" if {_local} contains "awayleft" or "awayright"
- broadcast "&eThe play will be resumed in the away offside area" if {_local} contains "awayoffsideleft" or "awayoffsideright"
- broadcast "&eThe play will be resumed in the home offside area" if {_local} contains "homeoffsideleft" or "homeoffsideright"
- broadcast ""
- Commentator("isdropping")
- loop 6 times:
- wait 1 second
- subtract 1 from {_t}
- send title "&6&lFACEOFF" with subtitle "&aPuck dropping in &e%{_t}% &asecond(s)..." to all players in world "{@hw}"
- delete {puck}
- kill all endermites
- send title "" with subtitle "&aPuck dropped" to all players in world "{@hw}"
- AwayNewPose({awaygoalie},"skatingup")
- HomeNewPose({homegoalie},"skatingup")
- if {_local} is "center":
- spawn endermite at {bhl::center}
- if {_local} is "awayleft":
- spawn endermite at {bhl::awayleft}
- if {_local} is "awayright":
- spawn endermite at {bhl::awayright}
- if {_local} is "homeleft":
- spawn endermite at {bhl::homeleft}
- if {_local} is "homeright":
- spawn endermite at {bhl::homeright}
- if {_local} is "homeoffsideleft":
- spawn endermite at {bhl::homeoffsideleft}
- if {_local} is "homeoffsideright":
- spawn endermite at {bhl::homeoffsideright}
- if {_local} is "awayoffsideleft":
- spawn endermite at {bhl::awayoffsideleft}
- if {_local} is "awayoffsideright":
- spawn endermite at {bhl::awayoffsideright}
- set {puck} to last spawned endermite
- if {game::status} is not "Intermission" or "Waiting" or "Starting" or "Warmup":
- set {game::status} to "In-game" #
- add "{NoAI:1}" to nbt of {puck}
- add "{PersistenceRequired:1}" TO NBT OF {puck}
- add "{Silent:1}" to nbt of {puck}
- set {inplay} to true
- set {_s} to 0
- if {game::status} is "In-game":
- NewClip()
- Puck()
- PuckAltitude()
- Commentator("isdropped")
- function Commentator(msg:string,o:string = ""):
- stop
- every 40 seconds:
- feed all players
- on damage:
- attacker is {puck} or {awaygoalie} or {homegoalie}
- cancel event
- on player jump:
- {game::status} is "In-game"
- "%region at player%" contains "puckarea"
- tool of player is not {bhl::stick}
- player is not {awaygoalie::player} or {homegoalie::player}
- if {game::away::members::*} contains player:
- if distance between {bhl::awaybench} and player > 10:
- Penalty(player)
- if {game::home::members::*} contains player:
- if distance between {bhl::homebench} and player > 10:
- Penalty(player)
- on player jump:
- if player is {awaygoalie::player} or {homegoalie::player}:
- event-world is "{@hw}"
- cancel event
- tool of player is {bhl::stick}
- cancel event if {game::status} is "In-game" or "Warmup"
- function SummonGoalie(t:string,p:location):
- set {awaygoalie::lastreflect} to now
- set {homegoalie::lastreflect} to now
- spawn armor stand at {_p}
- set {_x} to last spawned armor stand
- if {_t} is "away":
- set {_var} to leather leggings
- add "{NoGravity:1b}" to nbt of {_x}
- 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
- dye {_var} white
- set leggings of {_x} to {_var}
- if {_t} is "home":
- add "{NoGravity:1b}" to nbt of {_x}
- 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}
- while {awaygoalie} and {homegoalie} are set:
- wait a tick
- set display name of {awaygoalie} to "%{awaygoalie::player}%"
- set display name of {homegoalie} to "%{homegoalie::player}%"
- function GoalieSave():
- if {goalieai} is true:
- if "%region at {puck}%" does not contain "goalregion" or "goalregion2":
- if {game::status} is "Shootouts":
- if {game::shootouts::player} is set:
- broadcast ""
- broadcast "&aIt was a save!"
- broadcast ""
- set {goalieai} and {inplay} to false
- NextShootoutPlayer()
- stop
- if {game::status} is not "Waiting" or "Warmup":
- set {game::status} to "Out of play"
- set {_v} to vector from yaw 0 and pitch 0
- set vector length of {_v} to 0
- set velocity of {puck} to {_v}
- play sound "minecraft:whistle.1" at {puck}
- set {inplay} to false
- set {goalieai} to false
- set {isreplay} to false
- set {bhl::%{puckowner}%::power} to 0
- delete {puckowner}
- Commentator("goaliesavesit")
- send title "&a&lCOVERED" to all players in world "{@hw}"
- wait 5 seconds
- if distance between {homegoalie} and {puck} < distance between {awaygoalie} and {puck}:
- if distance between {puck} and {bhl::homeleft} < distance between {puck} and {bhl::homeright}:
- RespawnPuck("homeleft")
- else:
- RespawnPuck("homeright")
- else:
- if distance between {puck} and {bhl::awayleft} < distance between {puck} and {bhl::awayright}:
- RespawnPuck("awayleft")
- else:
- RespawnPuck("awayright")
- function GoaliePoke(p:entity,f:string):
- if difference between {lastpoke} and now > 1 second:
- set {lastpoke} to now
- set {bhl::%{puckowner}%::power} to 0
- delete {puckowner}
- if {_f} is "medium":
- set {_v2} to vector from yaw {_p}'s yaw and pitch 0
- set {_v} to vector(0.05,0.15,0.05)
- set {-pv} to {_v2} ++ {-pv}
- set {-pv} to {_v} ++ {-pv}
- if {_f} is "weak":
- set {_v2} to vector from yaw {_p}'s yaw and pitch 0
- set {_v} to vector(0.05,0.15,0.05)
- set {-pv} to {_v2} ++ {-pv}
- set {-pv} to {_v} ++ {-pv}
- function GoalieReflect(p:entity,f:string):
- if {game::status} is "Shootouts":
- if {game::shootouts::player} is set:
- broadcast ""
- broadcast "&aIt was a save!"
- broadcast ""
- set {goalieai} and {inplay} to false
- NextShootoutPlayer()
- if {_p} is {awaygoalie} or {awaygoalie::player}:
- if difference between {awaygoalie::lastreflect} and now > 0.2 seconds:
- set {awaygoalie::lastreflect} to now
- else:
- stop
- if {_p} is {homegoalie} or {homegoalie::player}:
- if difference between {homegoalie::lastreflect} and now > 0.2 seconds:
- set {homegoalie::lastreflect} to now
- else:
- stop
- set {awaygoalie::lastreflect} to now
- delete {puckowner}
- if {_f} is "pad" or "arm":
- Commentator("goaliepad")
- set {_v} to vector from yaw {_p}'s yaw and pitch 0
- set vector length of {_v} to 0.3
- set {-pv} to {_v}
- if {_f} is "stick":
- Commentator("goaliepoke")
- set {_v} to vector from yaw {_p}'s yaw and pitch 0
- set vector length of {_v} to 0.5
- set {-pv} to {_v}
- add 0.3 to y of {-pv}
- command /help:
- aliases: instructions,tutorial,controls
- trigger:
- Instructions(player)
- function Instructions(p:player):
- send "" to {_p}
- send "&7Awaiting rewrite. Check out discord for more information." to {_p}
- command /penalty [<player>]:
- permission: staff.penalty
- permission message: &cYou must be a referee or higher to call a pen!
- trigger:
- Penalty(arg-1)
- command /arp:
- permission: staff.setteam
- permission message: &cYou must be a referee or higher to respawn puck!
- trigger:
- broadcast "&eThe puck has been re spawned by %coloured prefix of player% %player%"
- OutOfPlay()
- command /setteam [<player>] [<text>]:
- permission: captain.setteam
- permission message: &cYou must be a captain or higher to manage teams!
- trigger:
- if arg 2 is not set:
- send "&cCorrect usage: /setteam <player> <away/home/fan>"
- if arg 1 and arg 2 are set:
- if arg 2 is "fan":
- if {game::away::members::*} contains arg-1:
- remove arg-1 from {game::away::members::*}
- if {game::home::members::*} contains arg-1:
- remove arg-1 from {game::home::members::*}
- broadcast "%coloured prefix of player% &e%player% &7Fanned &e%arg-1%"
- EquipPlayer(arg-1)
- if arg 2 is "home":
- if {game::away::members::*} contains arg-1:
- remove arg-1 from {game::away::members::*}
- if {game::home::members::*} contains arg-1:
- send "&CThat player is already in the home team."
- stop
- else:
- add arg-1 to {game::home::members::*}
- broadcast "%coloured prefix of player% &e%player% &7assigned &e%arg-1%&e's team to &aHome"
- EquipPlayer(arg-1)
- if arg 2 is "away": #
- if {game::home::members::*} contains arg-1:
- remove arg-1 from {game::home::members::*}
- if {game::away::members::*} contains arg-1:
- send "&CThat player is already in the away team."
- stop
- else:
- add arg-1 to {game::away::members::*}
- broadcast "%coloured prefix of player% &e%player% &7assigned &e%arg-1%&e's team to &bAway"
- EquipPlayer(arg-1)
Advertisement
Add Comment
Please, Sign In to add comment