Back to home

PMAJellies Aim Trainer V5

KAVE5
click to copy
This game is archived.
If you with to unarchive it, click the "restore" button in the options menu.

Category:
Training / Drills / Tools

Author:
PMAJellies

Rating:
23

Version:
1.0.0

Posted:
3 months ago

Tags:
aim trainer training hitscan

Share this workshop!

Options

variables
{
	global:
		0: RadiusSize
		1: Gametype
		2: HeroPool
		3: RedSpheres
		4: DoubleCheck
		5: HeroPoolArray
		6: InGame
		7: FireRate
		8: Effects
		9: ThreatsHeroes
		10: Lives
		12: JuggleHero1
		13: JuggleHero2
		14: Distance
		15: Points
		16: FlyingHeroPool
		17: FlyingHeroArray
		18: Shots
		19: Time
		20: HeroArenaArray
		26: Gamemode

	player:
		0: HeroArenaBotPos
		1: InBounds
		2: PlayerSupport
		3: MercyOn
		4: LucioOn
		26: Random
}

subroutines
{
	0: TileFrenzyMenu
	1: FlickMenu
	2: ThreatsMenu
	3: JuggleMenu1
	4: JuggleMenu2
	5: FlyingHeroesMenu
	6: FlyingHeroesHeroes
	7: HeroArenaMenu
	8: HeroArenaSpawn
}

rule("Restart [Interact]")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Interact) == True;
	}

	actions
	{
		Set Global Variable(Time, 0);
		Set Global Variable(Lives, 0);
	}
}

rule("Global Variables")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		Set Global Variable(Gamemode, 0);
		Set Global Variable(RadiusSize, 1);
		Set Global Variable(Gametype, 0);
		Set Global Variable(DoubleCheck, False);
		Set Global Variable At Index(HeroPoolArray, 0, Hero(Lúcio));
		Set Global Variable At Index(HeroPoolArray, 1, Hero(Zarya));
		Set Global Variable At Index(HeroPoolArray, 2, Hero(Roadhog));
		Set Global Variable(InGame, False);
		Set Global Variable(ThreatsHeroes, Empty Array);
		Set Global Variable At Index(FlyingHeroArray, 0, 69);
		Set Global Variable At Index(FlyingHeroArray, 1, Hero(Widowmaker));
		Set Global Variable At Index(FlyingHeroArray, 2, Hero(Winston));
		Set Global Variable At Index(FlyingHeroArray, 3, Hero(Sombra));
		Set Global Variable At Index(FlyingHeroArray, 4, Hero(Pharah));
		Set Global Variable(HeroArenaArray, Empty Array);
		Set Global Variable(V, Empty Array);
		Set Global Variable(W, Empty Array);
		Set Global Variable At Index(W, 0, Vector(19.495, 30, -19.495));
		Set Global Variable At Index(W, 1, Vector(19.495, 30, 19.495));
		Set Global Variable At Index(W, 2, Vector(-19.495, 30, -19.495));
		Set Global Variable At Index(W, 3, Vector(-19.495, 30, 19.495));
		Set Global Variable(V, False);
	}
}

disabled rule("Debug Hud")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Is Dummy Bot(Event Player) == False;
	}

	actions
	{
		Create HUD Text(Event Player, Facing Direction Of(Event Player), Null, Null, Left, 0, White, White, White, Visible To and String,
			Default Visibility);
		Create HUD Text(Event Player, Position Of(Event Player), Null, Null, Left, 0, White, White, White, Visible To and String,
			Default Visibility);
		Create HUD Text(Event Player, Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), 1000)), Null, Event Player, True), Null, Null, Right, 0, Yellow, White, White,
			Visible To and String, Default Visibility);
		disabled Create HUD Text(All Players(All Teams), Custom String("Slot 0: {0}", Players In Slot(0, Team 2), Null, Null), Null, Null, Top, 0,
			White, White, White, Visible To and String, Default Visibility);
		disabled Create HUD Text(All Players(All Teams), Custom String("Slot 1: {0}", Players In Slot(1, Team 2), Null, Null), Null, Null, Top, 0,
			White, White, White, Visible To and String, Default Visibility);
		disabled Create HUD Text(All Players(All Teams), Custom String("Slot 2: {0}", Players In Slot(2, Team 2), Null, Null), Null, Null, Top, 0,
			White, White, White, Visible To and String, Default Visibility);
		disabled Create HUD Text(All Players(All Teams), Custom String("Slot 3: {0}", Players In Slot(3, Team 2), Null, Null), Null, Null, Top, 0,
			White, White, White, Visible To and String, Default Visibility);
	}
}

rule("Teleport")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Has Spawned(Event Player) == True;
		Is Alive(Event Player) == True;
		Global Variable(Gamemode) != 6;
		Is Dummy Bot(Event Player) == False;
	}

	actions
	{
		Teleport(Event Player, Vector(0, 0, 0));
		Set Facing(Event Player, Vector(0.940, 0.350, 0), To World);
	}
}

rule("Time Loop")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Match Time <= 600;
	}

	actions
	{
		Set Match Time(3599);
	}
}

rule("Create Menu Effects Single Player")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Global Variable(Gamemode) == 0;
		Number of Players(All Teams) == 1;
	}

	actions
	{
		Destroy All Icons;
		Destroy All Effects;
		Destroy All In-World Text;
		Wait(0.050, Ignore Condition);
		Teleport(All Players(All Teams), Vector(0, 0, 0));
		Set Facing(All Players(All Teams), Vector(0.940, 0.350, 0), To World);
		Create In-World Text(All Players(All Teams), Custom String("PMAJellies Aim Trainer V5", Null, Null, Null), Vector(19.500, 12.500,
			0), 3, Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create Effect(All Players(All Teams), Sphere, White, Vector(19.500, 10, -8.000), 0.700, Visible To Position and Radius);
		Create Effect(All Players(All Teams), Sphere, White, Vector(19.500, 7, -8.000), 0.700, Visible To Position and Radius);
		Create Effect(All Players(All Teams), Sphere, White, Vector(19.500, 4, -8.000), 0.700, Visible To Position and Radius);
		Create Effect(All Players(All Teams), Sphere, White, Vector(19.500, 10, 0), 0.700, Visible To Position and Radius);
		Create Effect(All Players(All Teams), Sphere, White, Vector(19.500, 7, 0), 0.700, Visible To Position and Radius);
		Create Effect(All Players(All Teams), Sphere, White, Vector(19.500, 4, 0), 0.700, Visible To Position and Radius);
		Create In-World Text(All Players(All Teams), Custom String("Sphere Frenzy", Null, Null, Null), Vector(19.500, 8.500, -4.000), 2,
			Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Flick", Null, Null, Null), Vector(19.500, 5.500, -5.500), 2,
			Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Threats", Null, Null, Null), Vector(19.500, 2.500, -5.000), 2,
			Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Hero Arena", Null, Null, Null), Vector(19.500, 8.500, 3.800), 2,
			Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Hero Juggle", Null, Null, Null), Vector(19.500, 5.500, 3.900), 2,
			Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Flying Heroes", Null, Null, Null), Vector(19.500, 2.500, 4), 2,
			Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create Effect(All Players(All Teams), Sphere, Purple, Vector(19.500, 7, 10), 0.700, Visible To Position and Radius);
		Create In-World Text(All Players(All Teams), Custom String("Change Hero", Null, Null, Null), Vector(19.500, 5.500, 13.700), 2,
			Do Not Clip, Visible To Position and String, White, Default Visibility);
	}
}

rule("Create Menu Effects More than 1 Player")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Global Variable(Gamemode) == 0;
		Number of Players(All Teams) > 1;
	}

	actions
	{
		Destroy All Icons;
		Destroy All Effects;
		Destroy All In-World Text;
		Wait(0.050, Ignore Condition);
		Teleport(All Players(All Teams), Vector(0, 0, 0));
		Set Facing(All Players(All Teams), Vector(0.940, 0.350, 0), To World);
		Create In-World Text(All Players(All Teams), Custom String("PMAJellies Aim Trainer V5", Null, Null, Null), Vector(19.495, 12.500,
			0), 3, Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create Effect(All Players(All Teams), Sphere, Red, Vector(19.500, 10, -8.000), 0.700, Visible To Position and Radius);
		Create Effect(All Players(All Teams), Sphere, Red, Vector(19.500, 7, -8.000), 0.700, Visible To Position and Radius);
		Create Effect(All Players(All Teams), Sphere, White, Vector(19.500, 4, -8.000), 0.700, Visible To Position and Radius);
		Create Effect(All Players(All Teams), Sphere, White, Vector(19.500, 10, 0), 0.700, Visible To Position and Radius);
		Create Effect(All Players(All Teams), Sphere, White, Vector(19.500, 7, 0), 0.700, Visible To Position and Radius);
		Create Effect(All Players(All Teams), Sphere, White, Vector(19.500, 4, 0), 0.700, Visible To Position and Radius);
		Create In-World Text(All Players(All Teams), Custom String("Sphere Frenzy", Null, Null, Null), Vector(19.500, 8.500, -4.000), 2,
			Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Flick", Null, Null, Null), Vector(19.500, 5.500, -5.500), 2,
			Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Threats", Null, Null, Null), Vector(19.500, 2.500, -5.000), 2,
			Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Hero Arena", Null, Null, Null), Vector(19.500, 8.500, 3.800), 2,
			Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Hero Juggle", Null, Null, Null), Vector(19.500, 5.500, 3.900), 2,
			Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Flying Heroes", Null, Null, Null), Vector(19.500, 2.500, 4), 2,
			Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Red Buttons Optimized for Single Player", Null, Null, Null), Vector(
			19.495, 15, 0), 2, Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create Effect(All Players(All Teams), Sphere, Purple, Vector(19.500, 7, 10), 0.700, Visible To Position and Radius);
		Create In-World Text(All Players(All Teams), Custom String("Change Hero", Null, Null, Null), Vector(19.500, 5.500, 13.700), 2,
			Do Not Clip, Visible To Position and String, White, Default Visibility);
	}
}

rule("Tile Frenzy Menu")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(19.500, 10, -8.000), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(19.500, 10, -8.000)))), Null,
			Event Player, True)) <= 0.800;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 0;
	}

	actions
	{
		Set Global Variable(Gamemode, 1);
		Destroy All Effects;
		Destroy All In-World Text;
		Set Status(Event Player, Null, Rooted, 9999);
		Teleport(Event Player, Vector(0, 0, 0));
		Wait(0.100, Ignore Condition);
		Set Gravity(Event Player, 0);
		Wait(0.100, Ignore Condition);
		Teleport(Event Player, Vector(0, 15, 0));
		Set Facing(Event Player, Vector(1, 0, 0), To World);
		Call Subroutine(TileFrenzyMenu);
	}
}

rule("TileFrenzyMenu Subroutine")
{
	event
	{
		Subroutine;
		TileFrenzyMenu;
	}

	actions
	{
		Create In-World Text(All Players(All Teams), Custom String("Sphere Frenzy", Null, Null, Null), Vector(19.500, 24, 0), 3,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Skip If(Compare(Global Variable(Gametype), ==, 0), 8);
		Create In-World Text(All Players(All Teams), Custom String("Hero", Null, Null, Null), Vector(19.500, 20, 0), 2,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		If(Compare(Global Variable(HeroPool), ==, 0));
			Create In-World Text(All Players(All Teams), Custom String("Lucio", Null, Null, Null), Vector(19.500, 19, 0), 2,
				Clip Against Surfaces, Visible To Position and String, Red, Default Visibility);
		Else If(Compare(Global Variable(HeroPool), ==, 1));
			Create In-World Text(All Players(All Teams), Custom String("Zarya", Null, Null, Null), Vector(19.500, 19, 0), 2,
				Clip Against Surfaces, Visible To Position and String, Yellow, Default Visibility);
		Else;
			Create In-World Text(All Players(All Teams), Custom String("Roadhog", Null, Null, Null), Vector(19.500, 19, 0), 2,
				Clip Against Surfaces, Visible To Position and String, Green, Default Visibility);
		End;
		Skip If(Compare(Global Variable(Gametype), ==, 1), 8);
		Create In-World Text(All Players(All Teams), Custom String("Radius Size", Null, Null, Null), Vector(19.500, 20, 0), 2,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		If(Compare(Global Variable(RadiusSize), <, 0.400));
			Create In-World Text(All Players(All Teams), Custom String("{0} m", Global Variable(RadiusSize), Null, Null), Vector(19.500, 19,
				0), 2, Clip Against Surfaces, Visible To Position and String, Red, Default Visibility);
		Else If(Compare(Global Variable(RadiusSize), <=, 0.700));
			Create In-World Text(All Players(All Teams), Custom String("{0} m", Global Variable(RadiusSize), Null, Null), Vector(19.500, 19,
				0), 2, Clip Against Surfaces, Visible To Position and String, Yellow, Default Visibility);
		Else;
			Create In-World Text(All Players(All Teams), Custom String("{0} m", Global Variable(RadiusSize), Null, Null), Vector(19.500, 19,
				0), 2, Clip Against Surfaces, Visible To Position and String, Green, Default Visibility);
		End;
		Create Icon(All Players(All Teams), Vector(19.500, 19.500, -4.000), Arrow: Left, Visible To and Position, White, False);
		Create Icon(All Players(All Teams), Vector(19.500, 19.500, 4), Arrow: Right, Visible To and Position, White, False);
		Create In-World Text(All Players(All Teams), Custom String("Game type", Null, Null, Null), Vector(19.500, 17, 0), 2,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		If(Compare(Global Variable(Gametype), ==, 0));
			Create In-World Text(All Players(All Teams), Custom String("Spheres", Global Variable(RadiusSize), Null, Null), Vector(19.500, 16,
				0), 2, Clip Against Surfaces, Visible To Position and String, Purple, Default Visibility);
		Else;
			Create In-World Text(All Players(All Teams), Custom String("Heroes", Global Variable(RadiusSize), Null, Null), Vector(19.500, 16,
				0), 2, Clip Against Surfaces, Visible To Position and String, Orange, Default Visibility);
		End;
		Create In-World Text(All Players(All Teams), Custom String("Start", Null, Null, Null), Vector(19.500, 14.500, -3.000), 2,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Endless", Null, Null, Null), Vector(19.500, 14.500, 3), 2,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Back", Global Variable(RadiusSize), Null, Null), Vector(19.500, 13, 0),
			2, Clip Against Surfaces, Visible To Position and String, Red, Default Visibility);
	}
}

rule("Frenzy / Flick | Left arrow")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 21.350, -4.000), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 21.350, -4.000)))), Null,
			Event Player, True)) <= 0.800;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(RadiusSize) > 0.050;
		Global Variable(InGame) == False;
		Or(Compare(Global Variable(Gamemode), ==, 1), Compare(Global Variable(Gamemode), ==, 2)) == True;
	}

	actions
	{
		If(Compare(Global Variable(Gamemode), ==, 2));
			Modify Global Variable(RadiusSize, Subtract, 0.050);
			Destroy All Effects;
			Destroy All In-World Text;
			Destroy All Icons;
			Wait(0.020, Ignore Condition);
			Call Subroutine(FlickMenu);
			Abort;
		End;
		If(Compare(Global Variable(Gametype), ==, 0));
			Modify Global Variable(RadiusSize, Subtract, 0.050);
		Else If(And(Compare(Global Variable(HeroPool), ==, 0), Compare(Global Variable(Gametype), ==, 1)));
			Set Global Variable(HeroPool, 2);
		Else;
			Modify Global Variable(HeroPool, Subtract, 1);
		End;
		Destroy All Effects;
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.020, Ignore Condition);
		Call Subroutine(TileFrenzyMenu);
	}
}

rule("Frenzy / Flick | Right arrow")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 21.350, 4), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 21.350, 4)))), Null, Event Player,
			True)) <= 0.800;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(InGame) == False;
		Or(Compare(Global Variable(Gamemode), ==, 1), Compare(Global Variable(Gamemode), ==, 2)) == True;
	}

	actions
	{
		If(Compare(Global Variable(Gamemode), ==, 2));
			Modify Global Variable(RadiusSize, Add, 0.050);
			Destroy All Effects;
			Destroy All In-World Text;
			Destroy All Icons;
			Wait(0.020, Ignore Condition);
			Call Subroutine(FlickMenu);
			Abort;
		End;
		If(Compare(Global Variable(Gametype), ==, 0));
			Modify Global Variable(RadiusSize, Add, 0.050);
		Else If(And(Compare(Global Variable(HeroPool), ==, 2), Compare(Global Variable(Gametype), ==, 1)));
			Set Global Variable(HeroPool, 0);
		Else;
			Modify Global Variable(HeroPool, Add, 1);
		End;
		Destroy All Effects;
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.020, Ignore Condition);
		Call Subroutine(TileFrenzyMenu);
	}
}

rule("Frenzy / Flick | Game type")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 17.400, 0), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 17.400, 0)))), Null, Event Player,
			True)) <= 0.800;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(InGame) == False;
		Or(Compare(Global Variable(Gamemode), ==, 1), Compare(Global Variable(Gamemode), ==, 2)) == True;
	}

	actions
	{
		If(Compare(Global Variable(Gametype), ==, 0));
			Set Global Variable(Gametype, 1);
		Else;
			Set Global Variable(Gametype, 0);
		End;
		Destroy All Effects;
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.020, Ignore Condition);
		If(Compare(Global Variable(Gamemode), ==, 1));
			Call Subroutine(TileFrenzyMenu);
		Else;
			Call Subroutine(FlickMenu);
		End;
	}
}

rule("Frenzy / Flick | Back")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 14.400, 0), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 14.400, 0)))), Null, Event Player,
			True)) <= 0.800;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(InGame) == False;
		Or(Compare(Global Variable(Gamemode), ==, 1), Compare(Global Variable(Gamemode), ==, 2)) == True;
	}

	actions
	{
		Destroy All Effects;
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.020, Ignore Condition);
		Set Global Variable(Gamemode, 0);
		Clear Status(Event Player, Rooted);
		Set Gravity(Event Player, 100);
	}
}

rule("Frenzy | Start")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 15.900, -3.000), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 15.900, -3.000)))), Null,
			Event Player, True)) <= 0.800;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 1;
		Global Variable(InGame) == False;
	}

	actions
	{
		Set Global Variable(Time, 30);
		Destroy All Effects;
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.020, Ignore Condition);
		If(Compare(Global Variable(Gametype), ==, 0));
			Set Global Variable At Index(RedSpheres, 0, Vector(20, Random Real(10, 24), Random Real(-10.000, 10)));
			Set Global Variable At Index(RedSpheres, 1, Vector(20, Random Real(10, 24), Random Real(-10.000, 10)));
			Set Global Variable At Index(RedSpheres, 2, Vector(20, Random Real(10, 24), Random Real(-10.000, 10)));
			Create Effect(All Players(All Teams), Sphere, Red, Value In Array(Global Variable(RedSpheres), 0), Global Variable(RadiusSize),
				Visible To Position and Radius);
			Create Effect(All Players(All Teams), Sphere, Red, Value In Array(Global Variable(RedSpheres), 1), Global Variable(RadiusSize),
				Visible To Position and Radius);
			Create Effect(All Players(All Teams), Sphere, Red, Value In Array(Global Variable(RedSpheres), 2), Global Variable(RadiusSize),
				Visible To Position and Radius);
			Set Primary Fire Enabled(Event Player, False);
		Else;
			Create Dummy Bot(Value In Array(Global Variable(HeroPoolArray), Global Variable(HeroPool)), Team 2, -1.000, Vector(0, 0, 0),
				Vector(-1.000, 0, 0));
			Create Dummy Bot(Value In Array(Global Variable(HeroPoolArray), Global Variable(HeroPool)), Team 2, -1.000, Vector(2, 0, 0),
				Vector(-1.000, 0, 0));
			Create Dummy Bot(Value In Array(Global Variable(HeroPoolArray), Global Variable(HeroPool)), Team 2, -1.000, Vector(4, 0, 0),
				Vector(-1.000, 0, 0));
			Set Gravity(All Players(Team 2), 0);
			Wait(0.050, Ignore Condition);
			Teleport(Players In Slot(0, Team 2), Vector(19, Random Real(10, 24), Random Real(-10.000, 10)));
			Teleport(Players In Slot(1, Team 2), Vector(19, Random Real(10, 24), Random Real(-10.000, 10)));
			Teleport(Players In Slot(2, Team 2), Vector(19, Random Real(10, 24), Random Real(-10.000, 10)));
			Start Facing(All Players(Team 2), Vector(-1.000, 0, 0), 1000, To World, Direction and Turn Rate);
		End;
		Create HUD Text(All Players(All Teams), Custom String("Time: {0}", Global Variable(Time), Null, Null), Global Variable(Points),
			Global Variable(Shots), Top, 0, White, White, White, Visible To and String, Default Visibility);
		Chase Global Variable At Rate(Time, 0, 1, Destination and Rate);
		Set Global Variable(InGame, True);
		Set Global Variable(Shots, -1.000);
		Set Global Variable(Points, 0);
	}
}

rule("Frenzy | Start Endless")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 15.900, 3), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 15.900, 3)))), Null, Event Player,
			True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 1;
		Global Variable(InGame) == False;
	}

	actions
	{
		Set Global Variable(Time, 9999);
		Destroy All Effects;
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.020, Ignore Condition);
		If(Compare(Global Variable(Gametype), ==, 0));
			Set Global Variable At Index(RedSpheres, 0, Vector(20, Random Real(10, 24), Random Real(-10.000, 10)));
			Set Global Variable At Index(RedSpheres, 1, Vector(20, Random Real(10, 24), Random Real(-10.000, 10)));
			Set Global Variable At Index(RedSpheres, 2, Vector(20, Random Real(10, 24), Random Real(-10.000, 10)));
			Create Effect(All Players(All Teams), Sphere, Red, Value In Array(Global Variable(RedSpheres), 0), Global Variable(RadiusSize),
				Visible To Position and Radius);
			Create Effect(All Players(All Teams), Sphere, Red, Value In Array(Global Variable(RedSpheres), 1), Global Variable(RadiusSize),
				Visible To Position and Radius);
			Create Effect(All Players(All Teams), Sphere, Red, Value In Array(Global Variable(RedSpheres), 2), Global Variable(RadiusSize),
				Visible To Position and Radius);
			Set Primary Fire Enabled(Event Player, False);
		Else;
			Create Dummy Bot(Value In Array(Global Variable(HeroPoolArray), Global Variable(HeroPool)), Team 2, -1.000, Vector(0, 0, 0),
				Vector(-1.000, 0, 0));
			Create Dummy Bot(Value In Array(Global Variable(HeroPoolArray), Global Variable(HeroPool)), Team 2, -1.000, Vector(2, 0, 0),
				Vector(-1.000, 0, 0));
			Create Dummy Bot(Value In Array(Global Variable(HeroPoolArray), Global Variable(HeroPool)), Team 2, -1.000, Vector(4, 0, 0),
				Vector(-1.000, 0, 0));
			Set Gravity(All Players(Team 2), 0);
			Wait(0.050, Ignore Condition);
			Teleport(Players In Slot(0, Team 2), Vector(19, Random Real(10, 24), Random Real(-10.000, 10)));
			Teleport(Players In Slot(1, Team 2), Vector(19, Random Real(10, 24), Random Real(-10.000, 10)));
			Teleport(Players In Slot(2, Team 2), Vector(19, Random Real(10, 24), Random Real(-10.000, 10)));
			Start Facing(All Players(Team 2), Vector(-1.000, 0, 0), 1000, To World, Direction and Turn Rate);
		End;
		Create HUD Text(All Players(All Teams), Custom String("Time: {0}", Global Variable(Time), Null, Null), Global Variable(Points),
			Global Variable(Shots), Top, 0, White, White, White, Visible To and String, Default Visibility);
		Chase Global Variable At Rate(Time, 0, 1, Destination and Rate);
		Set Global Variable(InGame, True);
		Set Global Variable(Shots, -1.000);
		Set Global Variable(Points, 0);
	}
}

rule("Frenzy Sphere 0")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Value In Array(Global Variable(RedSpheres), 0), Ray Cast Hit Position(Eye Position(Event Player), Add(
			Eye Position(Event Player), Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player),
			Value In Array(Global Variable(RedSpheres), 0)))), Null, Event Player, True)) <= Global Variable(RadiusSize);
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(DoubleCheck) == False;
		Global Variable(FireRate) == False;
		Global Variable(Gamemode) == 1;
	}

	actions
	{
		Set Global Variable(DoubleCheck, True);
		Play Effect(All Players(All Teams), Ring Explosion Sound, White, Event Player, 100);
		Modify Global Variable(Points, Add, 1);
		Set Global Variable At Index(RedSpheres, 0, Vector(20, Random Real(10, 24), Random Real(-10.000, 10)));
		Wait(0.016, Ignore Condition);
		Set Global Variable(DoubleCheck, False);
	}
}

rule("Frenzy Sphere 1")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Value In Array(Global Variable(RedSpheres), 1), Ray Cast Hit Position(Eye Position(Event Player), Add(
			Eye Position(Event Player), Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player),
			Value In Array(Global Variable(RedSpheres), 1)))), Null, Event Player, True)) <= Global Variable(RadiusSize);
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(DoubleCheck) == False;
		Global Variable(FireRate) == False;
		Global Variable(Gamemode) == 1;
	}

	actions
	{
		Set Global Variable(DoubleCheck, True);
		Play Effect(All Players(All Teams), Ring Explosion Sound, White, Event Player, 100);
		Modify Global Variable(Points, Add, 1);
		Set Global Variable At Index(RedSpheres, 1, Vector(20, Random Real(10, 24), Random Real(-10.000, 10)));
		Wait(0.016, Ignore Condition);
		Set Global Variable(DoubleCheck, False);
	}
}

rule("Frenzy Sphere 2")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Value In Array(Global Variable(RedSpheres), 2), Ray Cast Hit Position(Eye Position(Event Player), Add(
			Eye Position(Event Player), Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player),
			Value In Array(Global Variable(RedSpheres), 2)))), Null, Event Player, True)) <= Global Variable(RadiusSize);
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(DoubleCheck) == False;
		Global Variable(FireRate) == False;
		Global Variable(Gamemode) == 1;
	}

	actions
	{
		Set Global Variable(DoubleCheck, True);
		Play Effect(All Players(All Teams), Ring Explosion Sound, White, Event Player, 100);
		Modify Global Variable(Points, Add, 1);
		Set Global Variable At Index(RedSpheres, 2, Vector(20, Random Real(10, 24), Random Real(-10.000, 10)));
		Wait(0.016, Ignore Condition);
		Set Global Variable(DoubleCheck, False);
	}
}

rule("Time Up")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Global Variable(Time) == 0;
		Global Variable(InGame) == True;
		Or(Compare(Global Variable(Gamemode), ==, 1), Compare(Global Variable(Gamemode), ==, 2)) == True;
	}

	actions
	{
		Set Status(All Players(Team 1), Null, Frozen, 3);
		Big Message(All Players(All Teams), Custom String("Points: {0}", Global Variable(Points), Null, Null));
		Destroy All Effects;
		Destroy All Dummy Bots;
		Destroy All HUD Text;
		Wait(2, Ignore Condition);
		If(Compare(Global Variable(Gamemode), ==, 1));
			Call Subroutine(TileFrenzyMenu);
		Else;
			Call Subroutine(FlickMenu);
		End;
		Set Global Variable(InGame, False);
		Set Primary Fire Enabled(All Players(All Teams), True);
	}
}

rule("Firerate | Click Primary Fire")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(InGame) == True;
		Or(Compare(Global Variable(Gamemode), ==, 1), Compare(Global Variable(Gamemode), ==, 2)) == True;
	}

	actions
	{
		Set Global Variable(FireRate, True);
		Skip If(Compare(Global Variable(Gamemode), ==, 2), 1);
		Modify Global Variable(Shots, Add, 1);
	}
}

rule("Firerate | Release Primary Fire")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Primary Fire) == False;
		Global Variable(InGame) == True;
		Or(Compare(Global Variable(Gamemode), ==, 1), Compare(Global Variable(Gamemode), ==, 2)) == True;
	}

	actions
	{
		Set Global Variable(FireRate, False);
	}
}

rule("Hero Frenzy")
{
	event
	{
		Player Took Damage;
		Team 2;
		All;
	}

	conditions
	{
		Global Variable(Gamemode) == 1;
		Global Variable(Gametype) == 1;
		Global Variable(InGame) == True;
	}

	actions
	{
		Teleport(Event Player, Vector(19, Random Real(10, 24), Random Real(-10.000, 10)));
		Heal(Event Player, Null, 500);
		If(Compare(Event Was Critical Hit, ==, True));
			Modify Global Variable(Points, Add, 2);
		Else;
			Modify Global Variable(Points, Add, 1);
		End;
	}
}

rule("Hero Frenzy Bot Dies")
{
	event
	{
		Player Died;
		Team 2;
		All;
	}

	conditions
	{
		Global Variable(Gamemode) == 1;
		Global Variable(Gametype) == 1;
		Global Variable(InGame) == True;
	}

	actions
	{
		Respawn(Event Player);
		Wait(0.050, Ignore Condition);
		Teleport(Event Player, Vector(19, Random Real(10, 24), Random Real(-10.000, 10)));
	}
}

rule("Change Hero")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Distance Between(Vector(19.500, 7, 10), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(19.500, 7, 10)))), Null, Event Player,
			True)) <= 0.800;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 0;
	}

	actions
	{
		Kill(Event Player, Null);
	}
}

rule("Flick Menu")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(19.500, 7, -8.000), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(19.500, 7, -8.000)))), Null,
			Event Player, True)) <= 0.800;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 0;
	}

	actions
	{
		Set Global Variable(RadiusSize, 0.750);
		Set Global Variable(Gamemode, 2);
		Destroy All Effects;
		Destroy All In-World Text;
		Set Status(Event Player, Null, Rooted, 9999);
		Teleport(Event Player, Vector(0, 0, 0));
		Wait(0.100, Ignore Condition);
		Set Gravity(Event Player, 0);
		Wait(0.100, Ignore Condition);
		Teleport(Event Player, Vector(0, 15, 0));
		Set Facing(Event Player, Vector(1, 0, 0), To World);
		Call Subroutine(FlickMenu);
	}
}

rule("Flick Subroutine")
{
	event
	{
		Subroutine;
		FlickMenu;
	}

	actions
	{
		Create In-World Text(All Players(All Teams), Custom String("Flick", Null, Null, Null), Vector(19.500, 24, 0), 3,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Reaction Time", Null, Null, Null), Vector(19.500, 20, 0), 2,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		If(Compare(Global Variable(RadiusSize), <, 0.550));
			Create In-World Text(All Players(All Teams), Custom String("{0} s", Global Variable(RadiusSize), Null, Null), Vector(19.500, 19,
				0), 2, Clip Against Surfaces, Visible To Position and String, Red, Default Visibility);
		Else If(Compare(Global Variable(RadiusSize), <=, 0.700));
			Create In-World Text(All Players(All Teams), Custom String("{0} s", Global Variable(RadiusSize), Null, Null), Vector(19.500, 19,
				0), 2, Clip Against Surfaces, Visible To Position and String, Yellow, Default Visibility);
		Else;
			Create In-World Text(All Players(All Teams), Custom String("{0} s", Global Variable(RadiusSize), Null, Null), Vector(19.500, 19,
				0), 2, Clip Against Surfaces, Visible To Position and String, Green, Default Visibility);
		End;
		Create Icon(All Players(All Teams), Vector(19.500, 19.500, -4.000), Arrow: Left, Visible To and Position, White, False);
		Create Icon(All Players(All Teams), Vector(19.500, 19.500, 4), Arrow: Right, Visible To and Position, White, False);
		Create In-World Text(All Players(All Teams), Custom String("Game type", Null, Null, Null), Vector(19.500, 17, 0), 2,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		If(Compare(Global Variable(Gametype), ==, 0));
			Create In-World Text(All Players(All Teams), Custom String("Spheres", Global Variable(RadiusSize), Null, Null), Vector(19.500, 16,
				0), 2, Clip Against Surfaces, Visible To Position and String, Purple, Default Visibility);
		Else;
			Create In-World Text(All Players(All Teams), Custom String("Heroes", Global Variable(RadiusSize), Null, Null), Vector(19.500, 16,
				0), 2, Clip Against Surfaces, Visible To Position and String, Orange, Default Visibility);
		End;
		Create In-World Text(All Players(All Teams), Custom String("Start", Null, Null, Null), Vector(19.500, 14.500, -3.000), 2,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Endless", Null, Null, Null), Vector(19.500, 14.500, 3), 2,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Back", Global Variable(RadiusSize), Null, Null), Vector(19.500, 13, 0),
			2, Clip Against Surfaces, Visible To Position and String, Red, Default Visibility);
	}
}

rule("Flick | Start")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 15.900, -3.000), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 15.900, -3.000)))), Null,
			Event Player, True)) <= 0.800;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 2;
		Global Variable(InGame) == False;
	}

	actions
	{
		Set Global Variable(Time, 61);
		Destroy All Effects;
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(1.020, Ignore Condition);
		If(Compare(Global Variable(Gametype), ==, 0));
			Set Global Variable At Index(RedSpheres, 0, Vector(20, Random Real(14, 22), Random Real(-5.000, 5)));
			Create Effect(All Players(All Teams), Sphere, Red, Value In Array(Global Variable(RedSpheres), 0), 0.350,
				Visible To Position and Radius);
			Create Effect(All Players(All Teams), Sphere, Red, Value In Array(Global Variable(RedSpheres), 0), 0.350,
				Visible To Position and Radius);
			disabled Set Primary Fire Enabled(Event Player, False);
		Else;
			Create Dummy Bot(Hero(Widowmaker), Team 2, -1.000, Vector(0, 0, 0), Vector(-1.000, 0, 0));
			Set Gravity(All Players(Team 2), 0);
			Wait(0.050, Ignore Condition);
			Teleport(Players In Slot(0, Team 2), Vector(19, Random Real(14, 22), Random Real(-5.000, 5)));
			Start Facing(All Players(Team 2), Vector(-1.000, 0, 0), 1000, To World, Direction and Turn Rate);
		End;
		Create HUD Text(All Players(All Teams), Custom String("Time: {0}", Global Variable(Time), Null, Null), Global Variable(Points),
			Global Variable(Shots), Top, 0, White, White, White, Visible To and String, Default Visibility);
		Chase Global Variable At Rate(Time, 0, 1, Destination and Rate);
		Set Global Variable(InGame, True);
		Set Global Variable(Shots, -1.000);
		Set Global Variable(Points, 0);
	}
}

rule("Flick | Start Endless")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 15.900, 3), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 15.900, 3)))), Null, Event Player,
			True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 2;
		Global Variable(InGame) == False;
	}

	actions
	{
		Set Global Variable(Time, 9999);
		Destroy All Effects;
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(1.020, Ignore Condition);
		If(Compare(Global Variable(Gametype), ==, 0));
			Set Global Variable At Index(RedSpheres, 0, Vector(20, Random Real(14, 22), Random Real(-5.000, 5)));
			Create Effect(All Players(All Teams), Sphere, Red, Value In Array(Global Variable(RedSpheres), 0), 0.300,
				Visible To Position and Radius);
			Create Effect(All Players(All Teams), Orb, Red, Value In Array(Global Variable(RedSpheres), 0), 0.200,
				Visible To Position and Radius);
		Else;
			Create Dummy Bot(Hero(Widowmaker), Team 2, -1.000, Vector(0, 0, 0), Vector(-1.000, 0, 0));
			Set Gravity(All Players(Team 2), 0);
			Wait(0.050, Ignore Condition);
			Teleport(Players In Slot(0, Team 2), Vector(19, Random Real(14, 22), Random Real(-5.000, 5)));
			Start Facing(All Players(Team 2), Vector(-1.000, 0, 0), 1000, To World, Direction and Turn Rate);
		End;
		Create HUD Text(All Players(All Teams), Custom String("Time: {0}", Global Variable(Time), Null, Null), Global Variable(Points),
			Global Variable(Shots), Top, 0, White, White, White, Visible To and String, Default Visibility);
		Chase Global Variable At Rate(Time, 0, 1, Destination and Rate);
		Set Global Variable(InGame, True);
		Set Global Variable(Shots, -1.000);
		Set Global Variable(Points, 0);
	}
}

rule("Flick In Game Loop")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Global Variable(InGame) == True;
		Global Variable(Gamemode) == 2;
	}

	actions
	{
		Wait(Global Variable(RadiusSize), Abort When False);
		Set Global Variable At Index(RedSpheres, 0, Vector(0, -10.000, 0));
		Teleport(All Players(Team 2), Vector(0, 100, 0));
		Wait(1, Ignore Condition);
		Set Global Variable At Index(RedSpheres, 0, Vector(20, Random Real(14, 22), Random Real(-5.000, 5)));
		Teleport(Players In Slot(0, Team 2), Vector(19, Random Real(14, 22), Random Real(-5.000, 5)));
		Modify Global Variable(Shots, Add, 1);
		Loop If Condition Is True;
	}
}

rule("Sphere Flick")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Value In Array(Global Variable(RedSpheres), 0), Ray Cast Hit Position(Eye Position(Event Player), Add(
			Eye Position(Event Player), Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player),
			Value In Array(Global Variable(RedSpheres), 0)))), Null, Event Player, True)) <= 0.350;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 2;
		Global Variable(FireRate) == False;
		Global Variable(Gametype) == 0;
	}

	actions
	{
		Set Global Variable(Effects, Value In Array(Global Variable(RedSpheres), 0));
		Play Effect(All Players(All Teams), Ring Explosion Sound, White, Event Player, 100);
		Play Effect(All Players(All Teams), Ring Explosion, Yellow, Global Variable(Effects), 1);
		Play Effect(All Players(All Teams), Good Explosion, Orange, Global Variable(Effects), 1);
		Modify Global Variable(Points, Add, 1);
		Set Global Variable At Index(RedSpheres, 0, Vector(0, -10.000, 0));
	}
}

rule("Hero Flick")
{
	event
	{
		Player Took Damage;
		Team 2;
		All;
	}

	conditions
	{
		Global Variable(Gamemode) == 2;
		Global Variable(Gametype) == 1;
		Global Variable(InGame) == True;
		Global Variable(Gametype) == 1;
	}

	actions
	{
		Set Global Variable(Effects, Add(Position Of(Event Player), Vector(0, 1, 0)));
		Wait(0.020, Ignore Condition);
		Respawn(Event Player);
		Play Effect(All Players(All Teams), Good Explosion, Red, Global Variable(Effects), 1);
		Teleport(Event Player, Vector(0, 100, 0));
		Heal(Event Player, Null, 500);
		If(Compare(Event Was Critical Hit, ==, True));
			Modify Global Variable(Points, Add, 2);
		Else;
			Modify Global Variable(Points, Add, 1);
		End;
	}
}

rule("Threats Menu")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(19.500, 4, -8.000), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(19.500, 4, -8.000)))), Null,
			Event Player, True)) <= 0.800;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 0;
	}

	actions
	{
		Set Global Variable(Gamemode, 3);
		Destroy All Effects;
		Destroy All In-World Text;
		Wait(0.050, Ignore Condition);
		Teleport(All Players(Team 1), Vector(-18.801, 0, -0.002));
		Set Facing(All Players(Team 1), Vector(0.970, 0.240, 0), To World);
		Call Subroutine(ThreatsMenu);
	}
}

rule("ThreatsMenu Subroutine")
{
	event
	{
		Subroutine;
		ThreatsMenu;
	}

	actions
	{
		Create In-World Text(All Players(All Teams), Custom String("Threats", Null, Null, Null), Vector(19.500, 24, 0), 3,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Hero Pool", Null, Null, Null), Vector(19.500, 20, 0), 2,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Threat Heroes", Null, Null, Null), Vector(19.500, 15, 0), 2,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Start", Null, Null, Null), Vector(19.500, 10, -4.000), 2,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Endless", Null, Null, Null), Vector(19.500, 10, 4), 2,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Back", Global Variable(RadiusSize), Null, Null), Vector(19.500, 7.500,
			0), 2, Clip Against Surfaces, Visible To Position and String, Red, Default Visibility);
		Create In-World Text(All Players(All Teams), Hero Icon String(Hero(Zarya)), Vector(20, 18, -2.000), 2, Clip Against Surfaces,
			Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Hero Icon String(Hero(Genji)), Vector(20, 18, -6.000), 2, Clip Against Surfaces,
			Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Hero Icon String(Hero(Lúcio)), Vector(20, 18, -10.000), 2, Clip Against Surfaces,
			Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Hero Icon String(Hero(Tracer)), Vector(20, 18, -14.000), 2, Clip Against Surfaces,
			Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Hero Icon String(Hero(Pharah)), Vector(20, 18, 2), 2, Clip Against Surfaces,
			Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Hero Icon String(Hero(Mercy)), Vector(20, 18, 6), 2, Clip Against Surfaces,
			Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Hero Icon String(Hero(Soldier: 76)), Vector(20, 18, 10), 2, Clip Against Surfaces,
			Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Hero Icon String(Hero(Reaper)), Vector(20, 18, 14), 2, Clip Against Surfaces,
			Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Hero Icon String(Value In Array(Global Variable(ThreatsHeroes), 0)), Vector(20, 12,
			-10.000), 2, Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Hero Icon String(Value In Array(Global Variable(ThreatsHeroes), 1)), Vector(20, 12,
			-6.000), 2, Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Hero Icon String(Value In Array(Global Variable(ThreatsHeroes), 2)), Vector(20, 12,
			-2.000), 2, Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Hero Icon String(Value In Array(Global Variable(ThreatsHeroes), 3)), Vector(20, 12,
			2), 2, Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Hero Icon String(Value In Array(Global Variable(ThreatsHeroes), 4)), Vector(20, 12,
			6), 2, Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Hero Icon String(Value In Array(Global Variable(ThreatsHeroes), 5)), Vector(20, 12,
			10), 2, Do Not Clip, Visible To Position and String, White, Default Visibility);
		Create Icon(All Players(All Teams), Vector(20, 12, 14), Trashcan, Visible To and Position, Red, False);
	}
}

rule("Threats Add Tracer")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 21, -14.000), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 21, -14.000)))), Null,
			Event Player, True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == False;
	}

	actions
	{
		Modify Global Variable(ThreatsHeroes, Append To Array, Hero(Tracer));
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.016, Ignore Condition);
		Call Subroutine(ThreatsMenu);
	}
}

rule("Threats Add Lucio")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 21, -10.000), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 21, -10.000)))), Null,
			Event Player, True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == False;
	}

	actions
	{
		Modify Global Variable(ThreatsHeroes, Append To Array, Hero(Lúcio));
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.016, Ignore Condition);
		Call Subroutine(ThreatsMenu);
	}
}

rule("Threats Add Genji")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 21, -6.000), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 21, -6.000)))), Null,
			Event Player, True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == False;
	}

	actions
	{
		Modify Global Variable(ThreatsHeroes, Append To Array, Hero(Genji));
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.016, Ignore Condition);
		Call Subroutine(ThreatsMenu);
	}
}

rule("Threats Add Zarya")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 21, -2.000), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 21, -2.000)))), Null,
			Event Player, True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == False;
	}

	actions
	{
		Modify Global Variable(ThreatsHeroes, Append To Array, Hero(Zarya));
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.016, Ignore Condition);
		Call Subroutine(ThreatsMenu);
	}
}

rule("Threats Add Pharah")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 21, 2), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 21, 2)))), Null, Event Player,
			True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == False;
	}

	actions
	{
		Modify Global Variable(ThreatsHeroes, Append To Array, Hero(Pharah));
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.016, Ignore Condition);
		Call Subroutine(ThreatsMenu);
	}
}

rule("Threats Add Mercy")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 21, 6), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 21, 6)))), Null, Event Player,
			True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == False;
	}

	actions
	{
		Modify Global Variable(ThreatsHeroes, Append To Array, Hero(Mercy));
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.016, Ignore Condition);
		Call Subroutine(ThreatsMenu);
	}
}

rule("Threats Add Soldier")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 21, 10), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 21, 10)))), Null, Event Player,
			True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == False;
	}

	actions
	{
		Modify Global Variable(ThreatsHeroes, Append To Array, Hero(Soldier: 76));
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.016, Ignore Condition);
		Call Subroutine(ThreatsMenu);
	}
}

rule("Threats Add Reaper")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 21, 14), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 21, 14)))), Null, Event Player,
			True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == False;
	}

	actions
	{
		Modify Global Variable(ThreatsHeroes, Append To Array, Hero(Reaper));
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.016, Ignore Condition);
		Call Subroutine(ThreatsMenu);
	}
}

rule("Trash Hero Threats")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 15.500, 14), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 15.500, 14)))), Null,
			Event Player, True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == False;
	}

	actions
	{
		Set Global Variable(ThreatsHeroes, Empty Array);
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.016, Ignore Condition);
		Call Subroutine(ThreatsMenu);
	}
}

rule("Threats | Start")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 13, -4.000), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 13, -4.000)))), Null,
			Event Player, True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == False;
	}

	actions
	{
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.016, Ignore Condition);
		Create Dummy Bot(Value In Array(Global Variable(ThreatsHeroes), 0), Team 2, -1.000, Vector(16, 0, Random Real(-16.000, 16)),
			Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(Global Variable(ThreatsHeroes), 1), Team 2, -1.000, Vector(16, 0, Random Real(-16.000, 16)),
			Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(Global Variable(ThreatsHeroes), 2), Team 2, -1.000, Vector(16, 0, Random Real(-16.000, 16)),
			Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(Global Variable(ThreatsHeroes), 3), Team 2, -1.000, Vector(16, 0, Random Real(-16.000, 16)),
			Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(Global Variable(ThreatsHeroes), 4), Team 2, -1.000, Vector(16, 0, Random Real(-16.000, 16)),
			Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(Global Variable(ThreatsHeroes), 5), Team 2, -1.000, Vector(16, 0, Random Real(-16.000, 16)),
			Vector(-1.000, 0, 0));
		Set Global Variable(InGame, True);
		Create In-World Text(All Players(All Teams), Custom String("LIVES: {0}", Global Variable(Lives), Null, Null), Vector(19.500, 27,
			0), 5, Do Not Clip, Visible To Position and String, White, Default Visibility);
		Set Global Variable(Lives, 5);
		Set Global Variable(Points, 0);
	}
}

rule("Threats | Start Endless")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 13, 4), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 13, 4)))), Null, Event Player,
			True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == False;
	}

	actions
	{
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.016, Ignore Condition);
		Create Dummy Bot(Value In Array(Global Variable(ThreatsHeroes), 0), Team 2, -1.000, Vector(16, 0, Random Real(-16.000, 16)),
			Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(Global Variable(ThreatsHeroes), 1), Team 2, -1.000, Vector(16, 0, Random Real(-16.000, 16)),
			Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(Global Variable(ThreatsHeroes), 2), Team 2, -1.000, Vector(16, 0, Random Real(-16.000, 16)),
			Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(Global Variable(ThreatsHeroes), 3), Team 2, -1.000, Vector(16, 0, Random Real(-16.000, 16)),
			Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(Global Variable(ThreatsHeroes), 4), Team 2, -1.000, Vector(16, 0, Random Real(-16.000, 16)),
			Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(Global Variable(ThreatsHeroes), 5), Team 2, -1.000, Vector(16, 0, Random Real(-16.000, 16)),
			Vector(-1.000, 0, 0));
		Set Global Variable(InGame, True);
		Create In-World Text(All Players(All Teams), Custom String("LIVES: {0}", Global Variable(Lives), Null, Null), Vector(19.500, 27,
			0), 5, Do Not Clip, Visible To Position and String, White, Default Visibility);
		Set Global Variable(Lives, 9999);
		Set Global Variable(Points, 0);
	}
}

rule("Threats | Back")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(20, 10.200, 0), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(20, 10.200, 0)))), Null, Event Player,
			True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == False;
	}

	actions
	{
		Destroy All Effects;
		Destroy All In-World Text;
		Destroy All Icons;
		Set Global Variable(ThreatsHeroes, Empty Array);
		Wait(0.200, Ignore Condition);
		Set Global Variable(Gamemode, 0);
	}
}

rule("Threats Bot Movement")
{
	event
	{
		Ongoing - Each Player;
		Team 2;
		All;
	}

	conditions
	{
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == True;
		X Component Of(Position Of(Event Player)) < 15;
	}

	actions
	{
		Start Facing(Event Player, Vector(-1.000, 0, 0), 1000, To World, Direction and Turn Rate);
		Heal(Event Player, Null, 1000);
		Start Throttle In Direction(Event Player, Vector(-1.000, 0, 0), 1, To World, Replace existing throttle, Direction and Magnitude);
		If(Compare(Hero Of(Event Player), ==, Hero(Tracer)));
			Set Player Variable(Event Player, Random, Random Integer(-1.000, 1));
			Wait(Random Real(1, 3), Ignore Condition);
			Start Facing(Event Player, Vector(0, 0, Player Variable(Event Player, Random)), 10000, To World, Direction and Turn Rate);
			Start Throttle In Direction(Event Player, Vector(-1.000, 0, Player Variable(Event Player, Random)), 1, To World,
				Replace existing throttle, Direction and Magnitude);
			Wait(0.050, Ignore Condition);
			Press Button(Event Player, Secondary Fire);
			Wait(0.050, Ignore Condition);
			Start Facing(Event Player, Vector(-1.000, 0, 0), 10000, To World, Direction and Turn Rate);
			Start Throttle In Direction(Event Player, Vector(-1.000, 0, 0), 1, To World, Replace existing throttle, Direction and Magnitude);
		Else If(Compare(Hero Of(Event Player), ==, Hero(Genji)));
			Wait(Random Real(1, 2), Ignore Condition);
			Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Add(Eye Position(Event Player), Add(Vector(0, 0.700, 0),
				Facing Direction Of(Event Player)))), 10000, To World, Direction and Turn Rate);
			Wait(0.050, Ignore Condition);
			Press Button(Event Player, Ability 1);
			Wait(0.050, Ignore Condition);
			Start Facing(Event Player, Vector(-1.000, 0, 0), 10000, To World, Direction and Turn Rate);
		Else If(Compare(Hero Of(Event Player), ==, Hero(Zarya)));
			Wait(Random Real(1, 4), Ignore Condition);
			Press Button(Event Player, Ability 1);
		Else If(Compare(Hero Of(Event Player), ==, Hero(Pharah)));
			Wait(Random Real(0.200, 0.500), Ignore Condition);
			Press Button(Event Player, Ability 1);
			Wait(Random Real(1.500, 2), Ignore Condition);
			Start Holding Button(Event Player, Jump);
			Wait(Random Real(0.200, 0.500), Ignore Condition);
			Stop Holding Button(Event Player, Jump);
			Wait(Random Real(0.200, 0.500), Ignore Condition);
			Start Holding Button(Event Player, Jump);
			Wait(Random Real(0.200, 0.500), Ignore Condition);
			Stop Holding Button(Event Player, Jump);
			Wait(Random Real(0.200, 0.500), Ignore Condition);
			Start Holding Button(Event Player, Jump);
			Wait(Random Real(0.200, 0.500), Ignore Condition);
			Stop Holding Button(Event Player, Jump);
		Else If(Compare(Hero Of(Event Player), ==, Hero(Mercy)));
			Wait(Random Real(0.200, 0.500), Ignore Condition);
			Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Eye Position(First Of(Remove From Array(All Players(
				Team 2), Players On Hero(Hero(Mercy), Team 2))))), 500, To World, Direction and Turn Rate);
			Wait(Random Real(0.200, 0.800), Ignore Condition);
			Skip If(Compare(X Component Of(Eye Position(Event Player)), <, -12.000), 2);
			Start Holding Button(Event Player, Ability 1);
			Start Holding Button(Event Player, Primary Fire);
		Else If(Compare(Hero Of(Event Player), ==, Hero(Soldier: 76)));
			Start Holding Button(Event Player, Ability 1);
			Start Throttle In Direction(Event Player, Facing Direction Of(Event Player), 1, To World, Replace existing throttle,
				Direction and Magnitude);
			While(Compare(Is Alive(Event Player), ==, True));
				Skip If(Compare(Z Component Of(Eye Position(Event Player)), >, 18), 2);
				Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Add(Add(Eye Position(Event Player), Facing Direction Of(
					Event Player)), Vector(0, 0, 0.600))), 400, To World, Direction and Turn Rate);
				Wait(Random Real(0.200, 0.600), Ignore Condition);
				Skip If(Compare(Z Component Of(Eye Position(Event Player)), <, -18.000), 2);
				Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Add(Add(Eye Position(Event Player), Facing Direction Of(
					Event Player)), Vector(0, 0, -0.600))), 400, To World, Direction and Turn Rate);
				Wait(Random Real(0.200, 0.600), Ignore Condition);
			End;
		Else If(Compare(Hero Of(Event Player), ==, Hero(Reaper)));
			Wait(Random Real(0.200, 1.500), Ignore Condition);
			Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Add(Eye Position(Event Player), Vector(-1.000, -0.100,
				0))), 1000, To World, Direction and Turn Rate);
			Wait(0.200, Ignore Condition);
			Start Holding Button(Event Player, Ability 2);
			Wait(0.200, Ignore Condition);
			Press Button(Event Player, Primary Fire);
	}
}

rule("Threats Bot Dies")
{
	event
	{
		Player Died;
		Team 2;
		All;
	}

	conditions
	{
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == True;
	}

	actions
	{
		Respawn(Event Player);
		Wait(0.001, Ignore Condition);
		Teleport(Event Player, Vector(16, 0, Random Real(-16.000, 16)));
		Modify Global Variable(Points, Add, 1);
	}
}

rule("Threats Bot Lose life")
{
	event
	{
		Ongoing - Each Player;
		Team 2;
		All;
	}

	conditions
	{
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == True;
		X Component Of(Position Of(Event Player)) <= -19.400;
	}

	actions
	{
		Small Message(All Players(All Teams), Custom String("Life loss", Null, Null, Null));
		Modify Global Variable(Lives, Subtract, 1);
		Heal(Event Player, Null, 1000);
		Teleport(Event Player, Vector(16, 0, Random Real(-16.000, 16)));
	}
}

rule("Threats Lose")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Global Variable(Gamemode) == 3;
		Global Variable(InGame) == True;
		Global Variable(Lives) == 0;
	}

	actions
	{
		Set Status(All Players(All Teams), Null, Frozen, 3);
		Big Message(All Players(All Teams), Custom String("Points: {0}", Global Variable(Points), Null, Null));
		Destroy All Effects;
		Destroy All In-World Text;
		Wait(3, Ignore Condition);
		Destroy All Dummy Bots;
		Call Subroutine(ThreatsMenu);
		Set Global Variable(InGame, False);
	}
}

rule("Hero Juggle Menu")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(19.500, 7, 0), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(19.500, 7, 0)))), Null, Event Player,
			True)) <= 0.800;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 0;
	}

	actions
	{
		Set Global Variable(JuggleHero1, 0);
		Set Global Variable(JuggleHero2, 30);
		Set Global Variable(Gamemode, 5);
		Destroy All Effects;
		Destroy All In-World Text;
		Wait(0.050, Ignore Condition);
		Create Effect(All Players(All Teams), Sphere, Red, Vector(0, 2, 19.500), 0.500, Visible To Position and Radius);
		Create In-World Text(All Players(All Teams), Custom String("Back", Null, Null, Null), Vector(0, 2, 19.500), 1, Do Not Clip,
			Visible To Position and String, White, Default Visibility);
		Call Subroutine(JuggleMenu1);
		Call Subroutine(JuggleMenu2);
	}
}

rule("JuggleMenu1 Sub")
{
	event
	{
		Subroutine;
		JuggleMenu1;
	}

	actions
	{
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero1)), Team 2, -1.000, Vector(18, 0, 0), Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero1)), Team 2, -1.000, Vector(18, 0, 2), Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero1)), Team 2, -1.000, Vector(18, 0, -2.000), Vector(-1.000, 0,
			0));
		Set Damage Received(All Players(Team 2), 0.001);
		Set Gravity(All Players(Team 2), 50);
		Set Max Health(All Players(Team 2), 500);
		Wait(0.250, Ignore Condition);
		Heal(All Players(Team 2), Null, 10000);
		Create In-World Text(All Players(All Teams), Custom String("HERO", Null, Null, Null), Vector(12, 2, 19.500), 2, Do Not Clip,
			Visible To Position and String, White, Default Visibility);
		Create Icon(All Players(All Teams), Vector(15, 1.800, 19.500), Arrow: Left, Visible To and Position, White, False);
		Create Icon(All Players(All Teams), Vector(9, 1.800, 19.500), Arrow: Right, Visible To and Position, White, False);
	}
}

rule("JuggleMenu2 Sub")
{
	event
	{
		Subroutine;
		JuggleMenu2;
	}

	actions
	{
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero2)), Team 2, -1.000, Vector(-18.000, 0, 0), Vector(1, 0, 0));
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero2)), Team 2, -1.000, Vector(-18.000, 0, 2), Vector(1, 0, 0));
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero2)), Team 2, -1.000, Vector(-18.000, 0, -2.000), Vector(1, 0,
			0));
		Set Damage Received(All Players(Team 2), 0.001);
		Set Gravity(All Players(Team 2), 50);
		Set Max Health(All Players(Team 2), 500);
		Wait(0.250, Ignore Condition);
		Heal(All Players(Team 2), Null, 10000);
		Create In-World Text(All Players(All Teams), Custom String("HERO", Null, Null, Null), Vector(-12.000, 2, 19.500), 2, Do Not Clip,
			Visible To Position and String, White, Default Visibility);
		Create Icon(All Players(All Teams), Vector(-15.000, 1.800, 19.500), Arrow: Right, Visible To and Position, White, False);
		Create Icon(All Players(All Teams), Vector(-9.000, 1.800, 19.500), Arrow: Left, Visible To and Position, White, False);
	}
}

rule("Juggle Impulse")
{
	event
	{
		Player Took Damage;
		Team 2;
		All;
	}

	conditions
	{
		Global Variable(Gamemode) == 5;
	}

	actions
	{
		Heal(Event Player, Null, 100);
		If(Compare(Event Was Critical Hit, ==, True));
			Apply Impulse(Event Player, Vector(0, 1, 0), 12, To World, Cancel Contrary Motion);
		Else;
			Apply Impulse(Event Player, Vector(0, 1, Z Component Of(Direction Towards(Multiply(Facing Direction Of(Attacker), Distance Between(
				Eye Position(Event Player), Eye Position(Attacker))), Eye Position(Event Player)))), 10, To World, Cancel Contrary Motion);
		End;
	}
}

rule("Juggle Barriers")
{
	event
	{
		Ongoing - Each Player;
		Team 2;
		All;
	}

	conditions
	{
		Or(Compare(Z Component Of(Eye Position(Event Player)), >=, 8), Compare(Z Component Of(Eye Position(Event Player)), <=, -8.000))
			== True;
		Global Variable(Gamemode) == 5;
	}

	actions
	{
		If(Compare(Z Component Of(Eye Position(Event Player)), >=, 8));
			Apply Impulse(Event Player, Vector(0, 0, -1.000), 7.500, To World, Incorporate Contrary Motion);
		End;
		If(Compare(Z Component Of(Eye Position(Event Player)), <=, -8.000));
			Apply Impulse(Event Player, Vector(0, 0, 1), 7.500, To World, Incorporate Contrary Motion);
		End;
		Wait(0.500, Ignore Condition);
		Loop If Condition Is True;
	}
}

rule("Hero Juggle 1 | Left arrow")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(15, 3.800, 19.500), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(15, 3.800, 19.500)))), Null,
			Event Player, True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 5;
		Global Variable(JuggleHero1) != 0;
	}

	actions
	{
		Modify Global Variable(JuggleHero1, Subtract, 1);
		Destroy Dummy Bot(Team 2, Slot Of(Players Within Radius(Vector(17.005, 1.425, -0.013), 10, Team 2, Off)));
		Wait(0.050, Ignore Condition);
		Destroy Dummy Bot(Team 2, Slot Of(Players Within Radius(Vector(17.005, 1.425, -0.013), 10, Team 2, Off)));
		Wait(0.050, Ignore Condition);
		Destroy Dummy Bot(Team 2, Slot Of(Players Within Radius(Vector(17.005, 1.425, -0.013), 10, Team 2, Off)));
		Wait(0.050, Ignore Condition);
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero1)), Team 2, -1.000, Vector(18, 0, 0), Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero1)), Team 2, -1.000, Vector(18, 0, 2), Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero1)), Team 2, -1.000, Vector(18, 0, -2.000), Vector(-1.000, 0,
			0));
		Set Damage Received(All Players(Team 2), 0.001);
		Set Gravity(All Players(Team 2), 50);
		Set Max Health(All Players(Team 2), 500);
		Wait(0.250, Ignore Condition);
		Heal(All Players(Team 2), Null, 10000);
	}
}

rule("Hero Juggle 1 | Right arrow")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(9, 3.800, 19.500), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(9, 3.800, 19.500)))), Null,
			Event Player, True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 5;
		Global Variable(JuggleHero1) != 30;
	}

	actions
	{
		Modify Global Variable(JuggleHero1, Add, 1);
		Destroy Dummy Bot(Team 2, Slot Of(Players Within Radius(Vector(17.005, 1.425, -0.013), 10, Team 2, Off)));
		Wait(0.050, Ignore Condition);
		Destroy Dummy Bot(Team 2, Slot Of(Players Within Radius(Vector(17.005, 1.425, -0.013), 10, Team 2, Off)));
		Wait(0.050, Ignore Condition);
		Destroy Dummy Bot(Team 2, Slot Of(Players Within Radius(Vector(17.005, 1.425, -0.013), 10, Team 2, Off)));
		Wait(0.050, Ignore Condition);
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero1)), Team 2, -1.000, Vector(18, 0, 0), Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero1)), Team 2, -1.000, Vector(18, 0, 2), Vector(-1.000, 0, 0));
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero1)), Team 2, -1.000, Vector(18, 0, -2.000), Vector(-1.000, 0,
			0));
		Set Damage Received(All Players(Team 2), 0.001);
		Set Gravity(All Players(Team 2), 50);
		Set Max Health(All Players(Team 2), 500);
		Wait(0.250, Ignore Condition);
		Heal(All Players(Team 2), Null, 10000);
	}
}

rule("Hero Juggle 2 | Left arrow")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(-15.000, 3.800, 19.500), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(-15.000, 3.800, 19.500)))),
			Null, Event Player, True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 5;
		Global Variable(JuggleHero2) != 0;
	}

	actions
	{
		Modify Global Variable(JuggleHero2, Subtract, 1);
		Destroy Dummy Bot(Team 2, Slot Of(Players Within Radius(Vector(-17.005, 1.425, -0.013), 10, Team 2, Off)));
		Wait(0.050, Ignore Condition);
		Destroy Dummy Bot(Team 2, Slot Of(Players Within Radius(Vector(-17.005, 1.425, -0.013), 10, Team 2, Off)));
		Wait(0.050, Ignore Condition);
		Destroy Dummy Bot(Team 2, Slot Of(Players Within Radius(Vector(-17.005, 1.425, -0.013), 10, Team 2, Off)));
		Wait(0.050, Ignore Condition);
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero2)), Team 2, -1.000, Vector(-18.000, 0, 0), Vector(1, 0, 0));
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero2)), Team 2, -1.000, Vector(-18.000, 0, 2), Vector(1, 0, 0));
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero2)), Team 2, -1.000, Vector(-18.000, 0, -2.000), Vector(1, 0,
			0));
		Set Damage Received(All Players(Team 2), 0.001);
		Set Gravity(All Players(Team 2), 50);
		Set Max Health(All Players(Team 2), 500);
		Wait(0.250, Ignore Condition);
		Heal(All Players(Team 2), Null, 10000);
	}
}

rule("Hero Juggle 2 | Right arrow")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(-9.000, 3.800, 19.500), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(-9.000, 3.800, 19.500)))),
			Null, Event Player, True)) <= 1;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 5;
		Global Variable(JuggleHero2) != 30;
	}

	actions
	{
		Modify Global Variable(JuggleHero2, Add, 1);
		Destroy Dummy Bot(Team 2, Slot Of(Players Within Radius(Vector(-17.005, 1.425, -0.013), 10, Team 2, Off)));
		Wait(0.050, Ignore Condition);
		Destroy Dummy Bot(Team 2, Slot Of(Players Within Radius(Vector(-17.005, 1.425, -0.013), 10, Team 2, Off)));
		Wait(0.050, Ignore Condition);
		Destroy Dummy Bot(Team 2, Slot Of(Players Within Radius(Vector(-17.005, 1.425, -0.013), 10, Team 2, Off)));
		Wait(0.050, Ignore Condition);
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero2)), Team 2, -1.000, Vector(-18.000, 0, 0), Vector(1, 0, 0));
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero2)), Team 2, -1.000, Vector(-18.000, 0, 2), Vector(1, 0, 0));
		Create Dummy Bot(Value In Array(All Heroes, Global Variable(JuggleHero2)), Team 2, -1.000, Vector(-18.000, 0, -2.000), Vector(1, 0,
			0));
		Set Damage Received(All Players(Team 2), 0.001);
		Set Gravity(All Players(Team 2), 50);
		Set Max Health(All Players(Team 2), 500);
		Wait(0.250, Ignore Condition);
		Heal(All Players(Team 2), Null, 10000);
	}
}

rule("Hero Juggle | Back")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(0, 2, 19.500), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(0, 2, 19.500)))), Null, Event Player,
			True)) <= 0.500;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 5;
		Global Variable(InGame) == False;
	}

	actions
	{
		Destroy All Dummy Bots;
		Destroy All Effects;
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.020, Ignore Condition);
		Set Global Variable(Gamemode, 0);
		Set Global Variable(ThreatsHeroes, Empty Array);
	}
}

rule("Flying Heroes Menu")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(19.500, 4, 0), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(19.500, 4, 0)))), Null, Event Player,
			True)) <= 0.800;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 0;
	}

	actions
	{
		Set Global Variable(Gamemode, 6);
		Destroy All Effects;
		Destroy All In-World Text;
		Wait(0.050, Ignore Condition);
		Set Global Variable(Distance, 15);
		Set Global Variable(FlyingHeroPool, 0);
		Teleport(All Players(Team 1), Vector(0, 46, -12.000));
		Set Facing(All Players(Team 1), Vector(0, 0, -1.000), To World);
		Call Subroutine(FlyingHeroesMenu);
		Create Dummy Bot(Random Value In Array(All Heroes), Team 2, -1.000, Vector(-5.000, 50, -35.000), Vector(0, 0, 1));
		Create Dummy Bot(Random Value In Array(All Heroes), Team 2, -1.000, Vector(-3.000, 50, -35.000), Vector(0, 0, 1));
		Create Dummy Bot(Random Value In Array(All Heroes), Team 2, -1.000, Vector(-1.000, 50, -35.000), Vector(0, 0, 1));
		Create Dummy Bot(Random Value In Array(All Heroes), Team 2, -1.000, Vector(1, 50, -35.000), Vector(0, 0, 1));
		Create Dummy Bot(Random Value In Array(All Heroes), Team 2, -1.000, Vector(3, 50, -35.000), Vector(0, 0, 1));
		Create Dummy Bot(Random Value In Array(All Heroes), Team 2, -1.000, Vector(5, 50, -35.000), Vector(0, 0, 1));
	}
}

rule("Flying Heroes Menu Subroutine")
{
	event
	{
		Subroutine;
		FlyingHeroesMenu;
	}

	actions
	{
		Create In-World Text(All Players(All Teams), Custom String("Flying Heroes", Null, Null, Null), Vector(0, 62, 0), 3,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("Heroes", Null, Null, Null), Vector(0, 60, 0), 2, Clip Against Surfaces,
			Visible To Position and String, White, Default Visibility);
		If(Compare(Global Variable(FlyingHeroPool), ==, 0));
			Create In-World Text(All Players(All Teams), Custom String("Mixed", Null, Null, Null), Vector(0, 59, 0), 2, Clip Against Surfaces,
				Visible To Position and String, Lime Green, Default Visibility);
		Else If(Compare(Global Variable(FlyingHeroPool), ==, 1));
			Create In-World Text(All Players(All Teams), Custom String("Widow", Null, Null, Null), Vector(0, 59, 0), 2, Clip Against Surfaces,
				Visible To Position and String, Purple, Default Visibility);
		Else If(Compare(Global Variable(FlyingHeroPool), ==, 2));
			Create In-World Text(All Players(All Teams), Custom String("Winston", Null, Null, Null), Vector(0, 59, 0), 2,
				Clip Against Surfaces, Visible To Position and String, Orange, Default Visibility);
		Else If(Compare(Global Variable(FlyingHeroPool), ==, 3));
			Create In-World Text(All Players(All Teams), Custom String("Sombra", Null, Null, Null), Vector(0, 59, 0), 2, Clip Against Surfaces,
				Visible To Position and String, Purple, Default Visibility);
		Else If(Compare(Global Variable(FlyingHeroPool), ==, 4));
			Create In-World Text(All Players(All Teams), Custom String("Pharmercy", Null, Null, Null), Vector(0, 59, 0), 2,
				Clip Against Surfaces, Visible To Position and String, Sky Blue, Default Visibility);
		Else;
		End;
		Create Icon(All Players(All Teams), Vector(2, 59.500, 0), Arrow: Left, Visible To and Position, White, False);
		Create Icon(All Players(All Teams), Vector(-2.000, 59.500, 0), Arrow: Right, Visible To and Position, White, False);
		Create In-World Text(All Players(All Teams), Custom String("Distance", Null, Null, Null), Vector(0, 56, 0), 2,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(All Teams), Custom String("{0} m", Global Variable(Distance), Null, Null), Vector(0, 55, 0), 2,
			Clip Against Surfaces, Visible To Position and String, Yellow, Default Visibility);
		Create Icon(All Players(All Teams), Vector(2, 55.500, 0), Arrow: Left, Visible To and Position, White, False);
		Create Icon(All Players(All Teams), Vector(-2.000, 55.500, 0), Arrow: Right, Visible To and Position, White, False);
		Create In-World Text(All Players(All Teams), Custom String("Back", Global Variable(RadiusSize), Null, Null), Vector(0, 52, 0), 2,
			Clip Against Surfaces, Visible To Position and String, Red, Default Visibility);
	}
}

rule("Impulse Flying Heroes")
{
	event
	{
		Ongoing - Each Player;
		Team 2;
		All;
	}

	conditions
	{
		Y Component Of(Eye Position(Event Player)) < 42;
		Global Variable(Gamemode) == 6;
	}

	actions
	{
		Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Vector(0, 48, -12.000)), 300, To World,
			Direction and Turn Rate);
		If(Compare(X Component Of(Eye Position(Event Player)), <, 0));
			Apply Impulse(Event Player, Vector(Random Real(0.400, 0.800), 1, 0), Random Real(15, 30), To World, Cancel Contrary Motion);
		End;
		If(Compare(X Component Of(Eye Position(Event Player)), >=, 0));
			Apply Impulse(Event Player, Vector(Random Real(-0.400, -0.800), 1, 0), Random Real(15, 30), To World, Cancel Contrary Motion);
		End;
	}
}

rule("Flying Heroes | Increase Distance")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(-2.000, 56.500, 0), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(-2.000, 56.500, 0)))), Null,
			Event Player, True)) <= 1.200;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 6;
	}

	actions
	{
		Teleport(All Players(Team 2), Add(Position Of(All Players(Team 2)), Vector(0, 0, -5.000)));
		Modify Global Variable(Distance, Add, 5);
		Destroy All Effects;
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.050, Ignore Condition);
		Call Subroutine(FlyingHeroesMenu);
	}
}

rule("Flying Heroes | Decrease Distance")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(2, 56.500, 0), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(2, 56.500, 0)))), Null, Event Player,
			True)) <= 1.200;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 6;
		Global Variable(Distance) > 5;
	}

	actions
	{
		Teleport(All Players(Team 2), Add(Position Of(All Players(Team 2)), Vector(0, 0, 5)));
		Modify Global Variable(Distance, Add, -5.000);
		Destroy All Effects;
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.050, Ignore Condition);
		Call Subroutine(FlyingHeroesMenu);
	}
}

rule("Flying Heroes | Next Heroes")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(-2.000, 60.500, 0), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player),
			Multiply(Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(-2.000, 60.500, 0)))), Null,
			Event Player, True)) <= 1.200;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 6;
		Global Variable(FlyingHeroPool) != 4;
	}

	actions
	{
		Modify Global Variable(FlyingHeroPool, Add, 1);
		Destroy All Effects;
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.050, Ignore Condition);
		Call Subroutine(FlyingHeroesHeroes);
		Wait(0.050, Ignore Condition);
		Call Subroutine(FlyingHeroesMenu);
	}
}

rule("Flying Heroes | Prev Heroes")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(2, 60.500, 0), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(2, 60.500, 0)))), Null, Event Player,
			True)) <= 1.200;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 6;
		Global Variable(FlyingHeroPool) != 0;
	}

	actions
	{
		Modify Global Variable(FlyingHeroPool, Add, -1.000);
		Destroy All Effects;
		Destroy All In-World Text;
		Destroy All Icons;
		Wait(0.050, Ignore Condition);
		Call Subroutine(FlyingHeroesHeroes);
		Wait(0.050, Ignore Condition);
		Call Subroutine(FlyingHeroesMenu);
	}
}

rule("Flying Heroes | Back")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(0, 53, 0), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(0, 53, 0)))), Null, Event Player, True))
			<= 1.200;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 6;
	}

	actions
	{
		Destroy All Effects;
		Destroy All In-World Text;
		Destroy All Icons;
		Destroy All Dummy Bots;
		Wait(0.050, Ignore Condition);
		Teleport(All Players(Team 1), Vector(0, 0, 0));
		Set Facing(All Players(All Teams), Vector(0.940, 0.350, 0), To World);
		Set Global Variable(Gamemode, 0);
	}
}

rule("FlyingHeroesHeroes Sub")
{
	event
	{
		Subroutine;
		FlyingHeroesHeroes;
	}

	actions
	{
		If(Compare(Global Variable(FlyingHeroPool), ==, 0));
			Start Forcing Player To Be Hero(Players In Slot(0, Team 2), Random Value In Array(All Heroes));
			Start Forcing Player To Be Hero(Players In Slot(1, Team 2), Random Value In Array(All Heroes));
			Start Forcing Player To Be Hero(Players In Slot(2, Team 2), Random Value In Array(All Heroes));
			Start Forcing Player To Be Hero(Players In Slot(3, Team 2), Random Value In Array(All Heroes));
			Start Forcing Player To Be Hero(Players In Slot(4, Team 2), Random Value In Array(All Heroes));
			Start Forcing Player To Be Hero(Players In Slot(5, Team 2), Random Value In Array(All Heroes));
		Else If(Compare(Global Variable(FlyingHeroPool), ==, 1));
			Start Forcing Player To Be Hero(All Players(Team 2), Hero(Widowmaker));
		Else If(Compare(Global Variable(FlyingHeroPool), ==, 2));
			Start Forcing Player To Be Hero(All Players(Team 2), Hero(Winston));
		Else If(Compare(Global Variable(FlyingHeroPool), ==, 3));
			Start Forcing Player To Be Hero(All Players(Team 2), Hero(Sombra));
		Else If(Compare(Global Variable(FlyingHeroPool), ==, 4));
			Start Forcing Player To Be Hero(Players In Slot(0, Team 2), Hero(Pharah));
			Start Forcing Player To Be Hero(Players In Slot(1, Team 2), Hero(Mercy));
			Start Forcing Player To Be Hero(Players In Slot(2, Team 2), Hero(Pharah));
			Start Forcing Player To Be Hero(Players In Slot(3, Team 2), Hero(Mercy));
			Start Forcing Player To Be Hero(Players In Slot(4, Team 2), Hero(Pharah));
			Start Forcing Player To Be Hero(Players In Slot(5, Team 2), Hero(Mercy));
		Else;
		End;
	}
}

rule("Flying Heroes | Bot Dies")
{
	event
	{
		Player Died;
		Team 2;
		All;
	}

	conditions
	{
		Global Variable(Gamemode) == 6;
	}

	actions
	{
		Respawn(Event Player);
		Wait(0.050, Ignore Condition);
		If(Compare(Global Variable(FlyingHeroPool), ==, 0));
			Start Forcing Player To Be Hero(Event Player, Random Value In Array(All Heroes));
		Else;
			Call Subroutine(FlyingHeroesHeroes);
		End;
		Teleport(Event Player, Position Of(Closest Player To(Vector(0, 50, -40.000), Team 2)));
	}
}

rule("Flying Heroes | Winston")
{
	event
	{
		Ongoing - Each Player;
		Team 2;
		Winston;
	}

	conditions
	{
		Global Variable(Gamemode) == 6;
		Y Component Of(Eye Position(Event Player)) >= 52;
		Global Variable(FlyingHeroPool) != 0;
	}

	actions
	{
		Abort If(Compare(Random Integer(0, 10), !=, 5));
		Wait(Random Real(0, 1), Ignore Condition);
		Press Button(Event Player, Ability 1);
		Wait(2, Ignore Condition);
		Teleport(Event Player, Position Of(Closest Player To(Vector(0, 50, -40.000), Team 2)));
	}
}

rule("Flying Heroes | Sombra Invisible")
{
	event
	{
		Ongoing - Each Player;
		Team 2;
		Sombra;
	}

	conditions
	{
		Global Variable(Gamemode) == 6;
		Global Variable(FlyingHeroPool) != 0;
		Y Component Of(Eye Position(Event Player)) >= 47;
	}

	actions
	{
		Abort If(Compare(Random Integer(0, 10), !=, 5));
		Wait(Random Real(0, 0.500), Ignore Condition);
		Press Button(Event Player, Ability 1);
		Wait(Random Real(1.400, 2.500), Ignore Condition);
		Press Button(Event Player, Ability 1);
	}
}

rule("Flying Heroes | Pharmercy")
{
	event
	{
		Ongoing - Each Player;
		Team 2;
		All;
	}

	conditions
	{
		Global Variable(Gamemode) == 6;
		Global Variable(FlyingHeroPool) == 4;
		Y Component Of(Eye Position(Event Player)) >= 51;
	}

	actions
	{
		Abort If(Compare(Random Integer(3, 5), !=, 4));
		Start Holding Button(Event Player, Jump);
		Wait(Random Real(1, 1.500), Ignore Condition);
		Stop Holding Button(Event Player, Jump);
		Wait(Random Real(0.500, 1), Ignore Condition);
		Start Holding Button(Event Player, Jump);
		Wait(Random Real(1, 1.500), Ignore Condition);
		Stop Holding Button(Event Player, Jump);
	}
}

rule("Flying Heroes | Player Dies")
{
	event
	{
		Player Died;
		Team 1;
		All;
	}

	conditions
	{
		Global Variable(Gamemode) == 6;
	}

	actions
	{
		Respawn(Event Player);
		Wait(0.050, Ignore Condition);
		Teleport(Event Player, Vector(0, 46, -12.000));
		Set Facing(Event Player, Vector(0, 0, -1.000), To World);
	}
}

rule("Hero Arena Menu")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Distance Between(Vector(19.500, 10, 0), Ray Cast Hit Position(Eye Position(Event Player), Add(Eye Position(Event Player), Multiply(
			Facing Direction Of(Event Player), Distance Between(Eye Position(Event Player), Vector(19.500, 10, 0)))), Null, Event Player,
			True)) <= 0.800;
		Is Button Held(Event Player, Primary Fire) == True;
		Global Variable(Gamemode) == 0;
	}

	actions
	{
		Set Global Variable(Gamemode, 4);
		Destroy All Effects;
		Destroy All In-World Text;
		Wait(0.050, Ignore Condition);
		Call Subroutine(HeroArenaMenu);
		Set Player Variable(All Players(Team 1), MercyOn, False);
		Set Player Variable(All Players(Team 1), LucioOn, False);
	}
}