Back to home

Widow HS 4v4 - Dab edition

WYDNK
click to copy
This code is over 6 months old.
Codes expire after 6 months and will no longer function.
This game is archived.
If you with to unarchive it, click the "restore" button in the options menu.
This code can also be found at workshop.codes/WYDNK

Thumbnail for Widow HS 4v4 - Dab edition

Category:
Custom game mode

Author:
Dab

Rating:
1

Version:
1.0.0

Posted:
7 months ago

Last updated:
7 months ago

Tags:
widowmaker hs only headshot 4v4 mod while you wait

Project Links

Share this workshop!

Options

WIDOWMAKER HS 4v4 - DAB EDITION

Created by Dab#11921

Play widowmaker 4v4 hs with a full range of new features to improve your experience including:

Disabled Spawn shooting: Players will have their scope disabled until they walk out of the spawn doors

Punished Crouch spamming: Players who crouch spam will be briefly stunned to discourage spamming

Stat tracking: Critical Accuracy, Hook-shot accuracy, and Killstreaks are tracked, with the player's stats shown top left and the top players on each category shown in the top right

Highlighted Popping-off players: Players who start carrying their team or rolling the enemy will be marked as "Popping off" and covered in red sparkles so everyone knows who to look out for, when these players are killed they will be marked as "Shut down"

AFK Mode: Players who are inactive, or who know they will be inactive can be moved into the "AFK ZONE" in the players spawn. This will allow them to move into AFK mode in which they become invisible, and invulnerable, as well as having them not considered part of the team, such that when the only remaining player on a team is AFK the team will lose a point as if they were already dead.

1v1 Requests: Melee players on the enemy team to request a private 1v1 with them, if they accept via meleeing you back, a 1v1 will begin, and nobody outside of the 1v1 will be able to damage those players until one of them emerges victorious over the other. By doing this, when a 1v1 is started, those two players can feel confident knowing the only enemy of concern is the person they're 1v1'ing

variables
{
	global:
		26: CurrentTeam1AFK
		27: CurrentTeam2AFK
		31: InProgress1v1
		32: HUD1v1
		33: HookShotOnlyMode
		40: HUD1v1Description

	player:
		0: Hits
		1: Shots
		2: accuracy
		3: HookHits
		4: crouchesUsed
		5: HookShots
		26: isAFK
		27: AFKHUDLabel
		28: AFKHUDText
		29: AFKHUDlist
		31: CanAFK
		32: isIn1v1
		33: killsThisRound
		34: isOnFire
		35: PoppingOffEffect
		36: failureToKeepPopping
		37: isInSpawn
		38: killstreak
		39: requesting1v1withsomeone
		40: requested1v1bysomeone
		41: requestedwith
		42: requestedby
		43: requestHUD
		44: In1v1With
		45: Effect1v1
		46: CritAcc
		47: IsHooking
		48: HighestKillStreak
}

rule("Player joined")
{
	event
	{
		Player Joined Match;
		All;
		All;
	}

	actions
	{
		Wait(3, Ignore Condition);
		Big Message(Event Player, Custom String("WELCOME TO WIDOW 4v4 DAB EDITION", Null, Null, Null));
		Wait(2, Ignore Condition);
		Big Message(Event Player, Custom String("MELEE TO REQUEST A 1v1", Null, Null, Null));
	}
}

rule("Generate startUp player HUDText")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	actions
	{
		Create HUD Text(Event Player, Null, Null, String("{0} {1} {2}", Custom String("crouch meter:", Null, Null, Null), Player Variable(
			Event Player, crouchesUsed), Custom String("out of 5", Null, Null, Null)), Left, -5, White, White, Sky Blue,
			Visible To and String, Default Visibility);
		Create HUD Text(Event Player, Null, Null, String("{0} {1}", Custom String("Critical Acc:", Null, Null, Null), String("{0}%",
			Multiply(100, Player Variable(Event Player, CritAcc)), Null, Null), Null), Left, -4, White, White, Sky Blue,
			Visible To and String, Default Visibility);
		Create HUD Text(Event Player, Null, Null, String("{0} {1}", Custom String("Hook shot Acc:", Null, Null, Null), String("{0}%",
			Multiply(100, Player Variable(Event Player, accuracy)), Null, Null), Null), Left, -3, White, White, Sky Blue,
			Visible To and String, Default Visibility);
		Create HUD Text(Event Player, Null, Null, String("{0} {1}", Custom String("Current killstreak:", Null, Null, Null),
			Player Variable(Event Player, killstreak), Null), Left, -2, White, White, Sky Blue, Visible To and String, Default Visibility);
	}
}

rule("Generate startUp general HUD text")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		Create HUD Text(All Players(All Teams), Null, Custom String("WIDOW 4v4 - DAB EDITION", Null, Null, Null), Null, Right, -6, White,
			White, White, Visible To and String, Default Visibility);
		disabled Create HUD Text(All Players(All Teams), Null, Null, Custom String("MELEE SOMEONE TO REQUEST A PRIVATE 1v1", Null, Null, Null),
			Right, -5, White, White, Yellow, Visible To and String, Default Visibility);
		Create HUD Text(All Players(All Teams), Null, Custom String("current afk players:", Null, Null, Null), Null, Left, -1, White,
			White, White, Visible To and String, Default Visibility);
		Set Player Variable(All Players(All Teams), CanAFK, 0);
		Create HUD Text(All Players(All Teams), Null, Null, Custom String("  ", Null, Null, Null), Top, -5, White, White, White,
			Visible To and String, Default Visibility);
		Create HUD Text(All Players(All Teams), Null, Null, Custom String("  ", Null, Null, Null), Top, -5, White, White, White,
			Visible To and String, Default Visibility);
		Create HUD Text(All Players(All Teams), Null, Null, Custom String("  ", Null, Null, Null), Top, -5, White, White, White,
			Visible To and String, Default Visibility);
		Disable Built-In Game Mode Scoring;
		Create HUD Text(All Players(All Teams), Null, Null, String("{0} {1}", Custom String("Top Critical Acc:", Null, Null, Null), String(
			"{0}, {1}", Last Of(Sorted Array(All Players(All Teams), Player Variable(Current Array Element, CritAcc))), String("{0}%",
			Multiply(100, Player Variable(Last Of(Sorted Array(All Players(All Teams), Player Variable(Current Array Element, CritAcc))),
			CritAcc)), Null, Null), Null), Null), Right, -4, White, White, Purple, Visible To and String, Default Visibility);
		Create HUD Text(All Players(All Teams), Null, Null, String("{0} {1}", Custom String("Top hook shot Acc:", Null, Null, Null),
			String("{0} {1}", Last Of(Sorted Array(All Players(All Teams), Player Variable(Current Array Element, accuracy))), String(
			"{0}%", Multiply(100, Player Variable(Last Of(Sorted Array(All Players(All Teams), Player Variable(Current Array Element,
			accuracy))), accuracy)), Null, Null), Null), Null), Right, -3, White, White, Purple, Visible To and String,
			Default Visibility);
		Create HUD Text(All Players(All Teams), Null, Null, String("{0} {1}", Custom String("Highest killstreak:", Null, Null, Null),
			String("{0} {1} {2}", Last Of(Sorted Array(All Players(All Teams), Player Variable(Current Array Element, HighestKillStreak))),
			Player Variable(Last Of(Sorted Array(All Players(All Teams), Player Variable(Current Array Element, HighestKillStreak))),
			HighestKillStreak), Custom String("KILLS", Null, Null, Null)), Null), Right, -2, White, White, Purple, Visible To and String,
			Default Visibility);
		disabled Disable Built-In Game Mode Completion;
		disabled Create HUD Text(All Players(All Teams), Null, Null, String("{0}: {1}", Custom String("Number of players", Null, Null, Null),
			Number of Players(Team 1), Null), Left, 0, White, White, White, Visible To and String, Default Visibility);
		disabled Create HUD Text(All Players(All Teams), Null, Null, String("{0}: {1}", Custom String("Number of afk players", Null, Null, Null),
			Count Of(Filtered Array(All Players(Team 1), Compare(Player Variable(Current Array Element, isAFK), ==, True))), Null), Left,
			0, White, White, White, Visible To and String, Default Visibility);
		disabled Create HUD Text(All Players(All Teams), Null, Null, String("{0}: {1}", Custom String("Number of is alive players", Null, Null,
			Null), Count Of(Filtered Array(All Players(Team 1), Compare(Is Alive(Current Array Element), ==, True))), Null), Left, 0,
			White, White, White, Visible To and String, Default Visibility);
		disabled Create HUD Text(All Players(All Teams), Null, Null, String("{0}: {1}", Custom String("Number of has spawned players", Null, Null,
			Null), Count Of(Filtered Array(All Players(Team 1), Compare(Has Spawned(Current Array Element), ==, True))), Null), Left, 0,
			White, White, White, Visible To and String, Default Visibility);
		disabled Create HUD Text(All Players(All Teams), Null, Null, String("{0}: {1}", Custom String("Number of players", Null, Null, Null),
			Number of Players(Team 2), Null), Left, 0, White, White, White, Visible To and String, Default Visibility);
		disabled Create HUD Text(All Players(All Teams), Null, Null, String("{0}: {1}", Custom String("Number of afk players", Null, Null, Null),
			Count Of(Filtered Array(All Players(Team 2), Compare(Player Variable(Current Array Element, isAFK), ==, True))), Null), Left,
			0, White, White, White, Visible To and String, Default Visibility);
		disabled Create HUD Text(All Players(All Teams), Null, Null, String("{0}: {1}", Custom String("Number of is alive players", Null, Null,
			Null), Count Of(Filtered Array(All Players(Team 2), Compare(Is Alive(Current Array Element), ==, True))), Null), Left, 0,
			White, White, White, Visible To and String, Default Visibility);
		disabled Create HUD Text(All Players(All Teams), Null, Null, String("{0}: {1}", Custom String("Number of has spawned players", Null, Null,
			Null), Count Of(Filtered Array(All Players(Team 2), Compare(Has Spawned(Current Array Element), ==, True))), Null), Left, 0,
			White, White, White, Visible To and String, Default Visibility);
		disabled Set Damage Dealt(All Players(All Teams), 0.010);
		disabled Set Team Score(Team 1, 8);
		disabled Set Team Score(Team 2, 8);
	}
}

rule("---------------------------------------------------------------------------------------------------------detirmine round victory")
{
	event
	{
		Ongoing - Global;
	}
}

rule("Declare premature round victory if AFK mode")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Is Game In Progress == True;
		Count Of(Filtered Array(All Players(Team 1), And(Compare(Player Variable(Current Array Element, isAFK), ==, False), And(Is Alive(
			Current Array Element), Has Spawned(Current Array Element))))) == 0;
		Number of Players(Team 1) > 0;
		disabled Count Of(Filtered Array(All Living Players(Team 1), Or(Compare(Player Variable(Current Array Element, isAFK), ==, True), Compare(
			Has Spawned(Current Array Element), ==, False)))) == Number of Living Players(Team 1);
		disabled Number of Players(Team 2) > 1;
	}

	actions
	{
		If(Compare(Team Score(Team 2), <, 8));
			Declare Round Victory(Team 2);
			Modify Team Score(Team 2, 1);
		Else;
			Modify Team Score(Team 2, 1);
			Declare Round Victory(Team 2);
			Declare Team Victory(Team 2);
	}
}

rule("Declare premature round victory if AFK mode")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Is Game In Progress == True;
		Count Of(Filtered Array(All Players(Team 2), And(Compare(Player Variable(Current Array Element, isAFK), ==, False), And(Is Alive(
			Current Array Element), Has Spawned(Current Array Element))))) == 0;
		Number of Players(Team 2) > 0;
		disabled Count Of(Filtered Array(All Living Players(Team 2), Or(Compare(Player Variable(Current Array Element, isAFK), ==, True), Compare(
			Has Spawned(Current Array Element), ==, False)))) == Number of Living Players(Team 2);
		disabled Number of Players(Team 1) > 1;
	}

	actions
	{
		If(Compare(Team Score(Team 1), <, 8));
			Declare Round Victory(Team 1);
			Modify Team Score(Team 1, 1);
		Else;
			Modify Team Score(Team 1, 1);
			Declare Round Victory(Team 1);
			Declare Team Victory(Team 1);
	}
}

rule("score on objective cap")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Point Capture Percentage >= 99;
	}

	actions
	{
		If(Compare(Team Score(Team Of(Closest Player To(Vector(3.749, 7.223, 0.190), All Teams))), <, 8));
			Declare Round Victory(Team Of(Closest Player To(Vector(3.749, 7.223, 0.190), All Teams)));
			Modify Team Score(Team Of(Closest Player To(Vector(3.749, 7.223, 0.190), All Teams)), 1);
		Else;
			Declare Team Victory(Team Of(Closest Player To(Vector(3.749, 7.223, 0.190), All Teams)));
	}
}

rule("------------------------------------------------------------------------------------------------------------------------AFK MODE")
{
	event
	{
		Ongoing - Global;
	}
}

rule("Auto-AFK mode team 1")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Is Moving(Event Player) == False;
		Player Variable(Event Player, isInSpawn) == True;
		Z Component Of(Position Of(Event Player)) > 42.125;
		Player Variable(Event Player, CanAFK) == 0;
	}

	actions
	{
		Wait(10, Abort When False);
		Teleport(Event Player, Vector(13.350, 8.030, 43.600));
	}
}

rule("Auto-AFK mode team 2")
{
	event
	{
		Ongoing - Each Player;
		Team 2;
		All;
	}

	conditions
	{
		Is Moving(Event Player) == False;
		Player Variable(Event Player, isInSpawn) == True;
		Z Component Of(Position Of(Event Player)) < -42.125;
		Player Variable(Event Player, CanAFK) == 0;
	}

	actions
	{
		Wait(10, Abort When False);
		Teleport(Event Player, Vector(13.350, 8.030, -43.600));
	}
}

rule("afk mode team 1")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Distance Between(Position Of(Event Player), Vector(13.350, 8.030, 43.600)) < 1;
		Has Spawned(Event Player) == True;
		Player Variable(Event Player, isAFK) == False;
		Is Alive(Event Player) == True;
		Global Variable(CurrentTeam1AFK) < Subtract(Number of Players(Team 1), 1);
		Count Of(Remove From Array(All Living Players(Team 1), Filtered Array(All Players(Team 1), Compare(Has Spawned(
			Current Array Element), ==, False)))) > 1;
		Player Variable(Event Player, CanAFK) == 0;
	}

	actions
	{
		Small Message(Event Player, Custom String("going afk in 3", Null, Null, Null));
		Wait(1, Abort When False);
		Small Message(Event Player, Custom String("2", Null, Null, Null));
		Wait(1, Abort When False);
		Small Message(Event Player, Custom String("1", Null, Null, Null));
		Wait(1, Abort When False);
		Small Message(All Players(All Teams), String("{0} {1}", Event Player, Custom String("entered afk mode", Null, Null, Null), Null));
		Modify Global Variable(CurrentTeam1AFK, Add, 1);
		disabled Set Status(Event Player, Null, Rooted, 9999);
		Set Status(Event Player, Null, Phased Out, 9999);
		disabled Set Secondary Fire Enabled(Event Player, False);
		Set Invisible(Event Player, All);
		Create HUD Text(All Players(All Teams), Null, Null, Event Player, Left, Slot Of(Event Player), White, White, Aqua,
			Visible To and String, Default Visibility);
		Set Player Variable(Event Player, AFKHUDlist, Last Text ID);
		Create HUD Text(Event Player, Custom String("CURRENTLY IN AFK MODE", Null, Null, Null), Null, Null, Top, -2, White, White, White,
			Visible To and String, Default Visibility);
		Set Player Variable(Event Player, AFKHUDLabel, Last Text ID);
		Create HUD Text(Event Player, Null, Null, Custom String("WALK OUT OF THE AFK ZONE TO RETURN TO PLAY", Null, Null, Null), Top, -1,
			White, White, White, Visible To and String, Default Visibility);
		Set Player Variable(Event Player, AFKHUDText, Last Text ID);
		Set Player Variable(Event Player, isAFK, True);
		Wait(3, Ignore Condition);
		Set Player Variable(Event Player, CanAFK, 1);
	}
}

rule("exit afk mode team 1")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Has Spawned(Event Player) == True;
		Is Alive(Event Player) == True;
		disabled Is Button Held(Event Player, Interact) == True;
		Player Variable(Event Player, isAFK) == True;
		Player Variable(Event Player, CanAFK) == 1;
		Distance Between(Position Of(Event Player), Vector(13.350, 8.030, 43.600)) > 1;
		Throttle Of(Event Player) != Vector(0, 0, 0);
	}

	actions
	{
		disabled Small Message(Event Player, Custom String("returning to play in 3", Null, Null, Null));
		disabled Wait(1, Abort When False);
		disabled Small Message(Event Player, Custom String("2", Null, Null, Null));
		disabled Wait(1, Abort When False);
		disabled Small Message(Event Player, Custom String("1", Null, Null, Null));
		disabled Wait(1, Abort When False);
		Small Message(All Players(All Teams), String("{0} {1}", Event Player, Custom String("has exited AFK mode", Null, Null, Null),
			Null));
		disabled Clear Status(Event Player, Rooted);
		Set Invisible(Event Player, None);
		Play Effect(All Players(All Teams), Good Explosion, White, Event Player, 5);
		disabled Wait(2, Ignore Condition);
		Destroy HUD Text(Player Variable(Event Player, AFKHUDLabel));
		Destroy HUD Text(Player Variable(Event Player, AFKHUDText));
		Destroy HUD Text(Player Variable(Event Player, AFKHUDlist));
		Clear Status(Event Player, Phased Out);
		disabled Set Secondary Fire Enabled(Event Player, True);
		Set Player Variable(Event Player, isAFK, False);
		Modify Global Variable(CurrentTeam1AFK, Subtract, 1);
	}
}

rule("AFK mode team 2")
{
	event
	{
		Ongoing - Each Player;
		Team 2;
		All;
	}

	conditions
	{
		Distance Between(Position Of(Event Player), Vector(13.350, 8.030, -43.600)) < 1;
		Has Spawned(Event Player) == True;
		Player Variable(Event Player, isAFK) == False;
		Is Alive(Event Player) == True;
		Global Variable(CurrentTeam2AFK) < Subtract(Number of Players(Team 2), 1);
		Count Of(Remove From Array(All Living Players(Team 2), Filtered Array(All Players(Team 2), Compare(Has Spawned(
			Current Array Element), ==, False)))) > 1;
		Player Variable(Event Player, CanAFK) == 0;
	}

	actions
	{
		Small Message(Event Player, Custom String("going afk in 3", Null, Null, Null));
		Wait(1, Abort When False);
		Small Message(Event Player, Custom String("2", Null, Null, Null));
		Wait(1, Abort When False);
		Small Message(Event Player, Custom String("1", Null, Null, Null));
		Wait(1, Abort When False);
		Small Message(All Players(All Teams), String("{0} {1}", Event Player, Custom String("entered afk mode", Null, Null, Null), Null));
		Modify Global Variable(CurrentTeam2AFK, Add, 1);
		disabled Set Status(Event Player, Null, Rooted, 9999);
		Set Status(Event Player, Null, Phased Out, 9999);
		disabled Set Secondary Fire Enabled(Event Player, False);
		Set Invisible(Event Player, All);
		Create HUD Text(All Players(All Teams), Null, Null, Event Player, Left, Slot Of(Event Player), White, White, Aqua,
			Visible To and String, Default Visibility);
		Set Player Variable(Event Player, AFKHUDlist, Last Text ID);
		Create HUD Text(Event Player, Custom String("CURRENTLY IN AFK MODE", Null, Null, Null), Null, Null, Top, -2, White, White, White,
			Visible To and String, Default Visibility);
		Set Player Variable(Event Player, AFKHUDLabel, Last Text ID);
		Create HUD Text(Event Player, Null, Null, Custom String("WALK OUT OF THE AFK ZONE TO RETURN TO PLAY", Null, Null, Null), Top, -1,
			White, White, White, Visible To and String, Default Visibility);
		Set Player Variable(Event Player, AFKHUDText, Last Text ID);
		Set Player Variable(Event Player, isAFK, True);
		Wait(3, Ignore Condition);
		Set Player Variable(Event Player, CanAFK, 1);
	}
}

rule("exit afk mode team 2")
{
	event
	{
		Ongoing - Each Player;
		Team 2;
		All;
	}

	conditions
	{
		Has Spawned(Event Player) == True;
		Is Alive(Event Player) == True;
		disabled Is Button Held(Event Player, Interact) == True;
		Player Variable(Event Player, isAFK) == True;
		Player Variable(Event Player, CanAFK) == 1;
		Distance Between(Position Of(Event Player), Vector(13.350, 8.030, -43.600)) > 1;
		Throttle Of(Event Player) != Vector(0, 0, 0);
	}

	actions
	{
		disabled Small Message(Event Player, Custom String("returning to play in 3", Null, Null, Null));
		disabled Wait(1, Abort When False);
		disabled Small Message(Event Player, Custom String("2", Null, Null, Null));
		disabled Wait(1, Abort When False);
		disabled Small Message(Event Player, Custom String("1", Null, Null, Null));
		disabled Wait(1, Abort When False);
		Small Message(All Players(All Teams), String("{0} {1}", Event Player, Custom String("has exited AFK mode", Null, Null, Null),
			Null));
		disabled Clear Status(Event Player, Rooted);
		Set Invisible(Event Player, None);
		Play Effect(All Players(All Teams), Good Explosion, White, Event Player, 5);
		disabled Wait(2, Ignore Condition);
		Destroy HUD Text(Player Variable(Event Player, AFKHUDLabel));
		Destroy HUD Text(Player Variable(Event Player, AFKHUDText));
		Destroy HUD Text(Player Variable(Event Player, AFKHUDlist));
		Clear Status(Event Player, Phased Out);
		disabled Set Secondary Fire Enabled(Event Player, True);
		Set Player Variable(Event Player, isAFK, False);
		Modify Global Variable(CurrentTeam2AFK, Subtract, 1);
	}
}

rule("player left")
{
	event
	{
		Player Left Match;
		All;
		All;
	}

	conditions
	{
		Player Variable(Event Player, isAFK) == True;
	}

	actions
	{
		If(Compare(Team Of(Event Player), ==, Team 1));
			Modify Global Variable(CurrentTeam1AFK, Subtract, 1);
		Else If(Compare(Team Of(Event Player), ==, Team 2));
			Modify Global Variable(CurrentTeam2AFK, Subtract, 1);
	}
}

rule("Reset afk between rounds")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Between Rounds == True;
		Player Variable(Event Player, isAFK) == False;
	}

	actions
	{
		Set Player Variable(Event Player, CanAFK, 0);
	}
}

rule("player left team 1")
{
	event
	{
		Player Left Match;
		Team 1;
		All;
	}

	conditions
	{
		Count Of(Filtered Array(All Living Players(Team 1), Or(Compare(Player Variable(Current Array Element, isAFK), ==, True), Compare(
			Has Spawned(Current Array Element), ==, False)))) == Number of Living Players(Team 1);
	}

	actions
	{
		Declare Round Victory(Team 2);
	}
}

rule("player left team 2")
{
	event
	{
		Player Left Match;
		Team 2;
		All;
	}

	conditions
	{
		Count Of(Filtered Array(All Living Players(Team 2), Or(Compare(Player Variable(Current Array Element, isAFK), ==, True), Compare(
			Has Spawned(Current Array Element), ==, False)))) == Number of Living Players(Team 2);
	}

	actions
	{
		Declare Round Victory(Team 1);
	}
}

rule("create afk zone effect")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		Create Effect(All Players(Team 1), Ring, Purple, Vector(13.350, 8.030, 43.600), 1, Visible To Position and Radius);
		Create Effect(All Players(Team 2), Ring, Purple, Vector(13.350, 8.030, -43.600), 1, Visible To Position and Radius);
		Create In-World Text(All Players(Team 1), Custom String("AFK ZONE", Null, Null, Null), Vector(13.350, 8.030, 43.600), 1,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
		Create In-World Text(All Players(Team 2), Custom String("AFK ZONE", Null, Null, Null), Vector(13.350, 8.030, -43.600), 1,
			Clip Against Surfaces, Visible To Position and String, White, Default Visibility);
	}
}

rule("afk zone message team 1")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Distance Between(Position Of(Event Player), Vector(13.350, 8.030, 43.600)) < 1;
		Player Variable(Event Player, isAFK) == False;
	}

	actions
	{
		If(Compare(Player Variable(Event Player, CanAFK), !=, 0));
			Small Message(Event Player, Custom String("Cannot enter afk mode at the moment", Null, Null, Null));
	}
}

rule("afk zone message team 2")
{
	event
	{
		Ongoing - Each Player;
		Team 2;
		All;
	}

	conditions
	{
		Distance Between(Position Of(Event Player), Vector(13.350, 8.030, -43.600)) < 1;
		Player Variable(Event Player, isAFK) == False;
	}

	actions
	{
		If(Compare(Player Variable(Event Player, CanAFK), !=, 0));
			Small Message(Event Player, Custom String("Cannot enter afk mode at the moment", Null, Null, Null));
	}
}

rule("----------------------------------------------------------------------------------------------------------------ANTI CROUCH-SPAM")
{
	event
	{
		Ongoing - Global;
	}
}

rule("anti crouch set vars")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

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

	actions
	{
		Modify Player Variable(Event Player, crouchesUsed, Add, 1);
	}
}

rule("anti crouch loop //disable if you dont want the crouch rule")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Player Variable(Event Player, crouchesUsed) > Absolute Value(0);
	}

	actions
	{
		Modify Player Variable(Event Player, crouchesUsed, Subtract, 1);
		Wait(0.750, Ignore Condition);
		Loop If Condition Is True;
	}
}

rule("anti crouch -1Point")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Player Variable(Event Player, crouchesUsed) > Absolute Value(4);
	}

	actions
	{
		Set Player Variable(Event Player, crouchesUsed, 0);
		Big Message(Event Player, Custom String("CROUCHING TOO OFTEN!", Null, Null, Null));
		Communicate(Event Player, Acknowledge);
		Set Status(Event Player, Null, Stunned, 0.400);
	}
}

rule("-------------------------------------------------------------------------------------------------------------PLAYERS POPPING OFF")
{
	event
	{
		Ongoing - Global;
	}
}

rule("Assign per-round kills")
{
	event
	{
		Player Earned Elimination;
		All;
		All;
	}

	actions
	{
		Modify Player Variable(Event Player, killsThisRound, Add, 1);
		Modify Player Variable(Event Player, killstreak, Add, 1);
		If(Compare(Player Variable(Event Player, killstreak), >, Player Variable(Event Player, HighestKillStreak)));
			Set Player Variable(Event Player, HighestKillStreak, Player Variable(Event Player, killstreak));
	}
}

rule("assign players popping off")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Player Variable(Event Player, killsThisRound) == Count Of(Filtered Array(All Players(Opposite Team Of(Team Of(Event Player))),
			Compare(Player Variable(Current Array Element, isAFK), ==, False)));
		Player Variable(Event Player, killstreak) == 3;
	}

	actions
	{
		Big Message(All Players(All Teams), String("{0} {1}", Event Player, Custom String("IS POPPING OFF!!", Null, Null, Null), Null));
		Set Player Variable(Event Player, isOnFire, True);
		Create Effect(All Players(All Teams), Sparkles, Red, Event Player, 1, Visible To Position and Radius);
		Set Player Variable(Event Player, PoppingOffEffect, Last Created Entity);
	}
}

rule("reset kills per round")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Between Rounds == True;
	}

	actions
	{
		If(And(Compare(Player Variable(Event Player, isOnFire), ==, True), Compare(Player Variable(Event Player, killsThisRound), <, 3)));
			Modify Player Variable(Event Player, failureToKeepPopping, Add, 1);
		End;
		Set Player Variable(Event Player, killsThisRound, 0);
		Set Player Variable(Event Player, isInSpawn, True);
	}
}

rule("end popping off when die")
{
	event
	{
		Player Died;
		All;
		All;
	}

	conditions
	{
		Player Variable(Victim, isOnFire) == True;
	}

	actions
	{
		Set Player Variable(Victim, isOnFire, False);
		Big Message(All Players(All Teams), String("{0} {1} {2}", Attacker, Custom String("shut down", Null, Null, Null), Victim));
		Destroy Effect(Player Variable(Victim, PoppingOffEffect));
	}
}

rule("end popping off if failure to keep performing")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Player Variable(Event Player, failureToKeepPopping) == 2;
	}

	actions
	{
		Set Player Variable(Event Player, failureToKeepPopping, 0);
		Set Player Variable(Event Player, isOnFire, False);
		Destroy Effect(Player Variable(Event Player, PoppingOffEffect));
	}
}

rule("reset killstreak")
{
	event
	{
		Player Died;
		All;
		All;
	}

	actions
	{
		Set Player Variable(Event Player, killstreak, 0);
	}
}

rule("----------------------------------------------------------------------------------------------------------DISABLE SPAWN SHOOTING")
{
	event
	{
		Ongoing - Global;
	}
}

rule("DISABLE SPAWN CAMP")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Global Variable(HookShotOnlyMode) == False;
		Player Variable(Event Player, isInSpawn) == False;
		X Component Of(Position Of(Event Player)) > 2.850;
		Absolute Value(Z Component Of(Position Of(Event Player))) > 42.125;
		Y Component Of(Position Of(Event Player)) < 14;
	}

	actions
	{
		Set Player Variable(Event Player, isInSpawn, True);
		Set Secondary Fire Enabled(Event Player, False);
	}
}

rule("re-enable shooting once left spawn")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Global Variable(HookShotOnlyMode) == False;
		Player Variable(Event Player, isInSpawn) == True;
		Or(Compare(X Component Of(Position Of(Event Player)), <, 2.850), Compare(Absolute Value(Z Component Of(Position Of(Event Player))),
			<, 42.125)) == True;
	}

	actions
	{
		Set Player Variable(Event Player, isInSpawn, False);
		Set Secondary Fire Enabled(Event Player, True);
	}
}

rule("leave spawn message")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Global Variable(HookShotOnlyMode) == False;
		Is Button Held(Event Player, Secondary Fire) == True;
	}

	actions
	{
		If(Compare(Player Variable(Event Player, isAFK), ==, True));
			Small Message(Event Player, Custom String("WALK OUT OF THE AFK ZONE TO RETURN TO PLAY", Null, Null, Null));
		Else If(Compare(Player Variable(Event Player, isInSpawn), ==, True));
			Small Message(Event Player, Custom String("LEAVE SPAWN TO BE ALLOWED TO SHOOT", Null, Null, Null));
	}
}

rule("---------------------------------------------------------------------------------------------------------------------------1v1's")
{
	event
	{
		Ongoing - Global;
	}
}

rule("request 1v1")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Melee) == True;
		Distance Between(Event Player, Closest Player To(Event Player, Opposite Team Of(Team Of(Event Player)))) < 3;
		Is Game In Progress == True;
		Player Variable(Event Player, requesting1v1withsomeone) == False;
		Player Variable(Event Player, requested1v1bysomeone) == False;
		Player Variable(Event Player, isIn1v1) == False;
		Player Variable(Closest Player To(Event Player, Opposite Team Of(Team Of(Event Player))), requested1v1bysomeone) == False;
		Player Variable(Closest Player To(Event Player, Opposite Team Of(Team Of(Event Player))), requesting1v1withsomeone) == False;
		Player Variable(Closest Player To(Event Player, Opposite Team Of(Team Of(Event Player))), isIn1v1) == False;
		Global Variable(InProgress1v1) == False;
		Is Alive(Closest Player To(Event Player, Opposite Team Of(Team Of(Event Player)))) == True;
	}

	actions
	{
		Destroy HUD Text(Player Variable(Event Player, requestHUD));
		Set Player Variable(Event Player, requesting1v1withsomeone, True);
		Set Player Variable(Closest Player To(Event Player, Opposite Team Of(Team Of(Event Player))), requested1v1bysomeone, True);
		Set Player Variable(Event Player, requestedwith, Closest Player To(Event Player, Opposite Team Of(Team Of(Event Player))));
		Set Player Variable(Closest Player To(Event Player, Opposite Team Of(Team Of(Event Player))), requestedby, Event Player);
		Create HUD Text(Event Player, String("{0} {1}", Custom String("you requested a 1v1 with", Null, Null, Null), Player Variable(
			Event Player, requestedwith), Null), Null, Null, Top, 0, Yellow, White, White, Visible To and String, Default Visibility);
		Set Player Variable(Event Player, requestHUD, Last Text ID);
		Create HUD Text(Closest Player To(Event Player, Opposite Team Of(Team Of(Event Player))), String("{0} {1}", Event Player,
			Custom String("requested a 1v1 with you! Melee them back to accept!", Null, Null, Null), Null), Null, Null, Top, 0, Yellow,
			White, White, Visible To and String, Default Visibility);
		Set Player Variable(Closest Player To(Event Player, Opposite Team Of(Team Of(Event Player))), requestHUD, Last Text ID);
		Wait(5, Ignore Condition);
		Destroy HUD Text(Player Variable(Event Player, requestHUD));
		Destroy HUD Text(Player Variable(Player Variable(Event Player, requestedwith), requestHUD));
		disabled Small Message(Event Player, String("{0} {1}", Custom String("YOU REQUESTED A 1V1 WITH", Null, Null, Null), Closest Player To(
			Event Player, Opposite Team Of(Team Of(Event Player))), Null));
		disabled Small Message(Closest Player To(Event Player, Opposite Team Of(Team Of(Event Player))), String("{0} {1}", Event Player,
			Custom String("requested a 1v1! melee to accept!", Null, Null, Null), Null));
		Set Player Variable(Event Player, requesting1v1withsomeone, False);
		Set Player Variable(Player Variable(Event Player, requestedwith), requested1v1bysomeone, False);
	}
}

rule("accept 1v1")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Game In Progress == True;
		Player Variable(Event Player, requested1v1bysomeone) == True;
		Distance Between(Event Player, Player Variable(Event Player, requestedby)) < 3;
		Is Button Held(Event Player, Melee) == True;
		Global Variable(InProgress1v1) == False;
	}

	actions
	{
		Destroy HUD Text(Player Variable(Event Player, requestHUD));
		Destroy HUD Text(Player Variable(Player Variable(Event Player, requestedby), requestHUD));
		Set Global Variable(InProgress1v1, True);
		Create HUD Text(All Players(All Teams), Null, Custom String("these players will be invulnerable until their 1v1 is complete", Null,
			Null, Null), Null, Top, 0, Sky Blue, White, White, Visible To and String, Default Visibility);
		Set Global Variable(HUD1v1Description, Last Text ID);
		Create HUD Text(All Players(All Teams), String("{0} {1}", Custom String("Current 1v1:", Null, Null, Null), String("{0} vs {1}",
			Event Player, Player Variable(Event Player, requestedby), Null), Null), Null, Null, Top, 0, Sky Blue, White, White,
			Visible To and String, Default Visibility);
		Set Global Variable(HUD1v1, Last Text ID);
		Big Message(All Players(All Teams), String("{0} {1} {2}", Player Variable(Event Player, requestedby), Custom String(
			"has entered a 1v1 with", Null, Null, Null), Event Player));
		disabled Create Icon(Event Player, Player Variable(Event Player, requestedby), Skull, Visible To and Position, Orange, True);
		disabled Create Icon(Player Variable(Event Player, requestedby), Event Player, Skull, Visible To and Position, Orange, True);
		Create Effect(Remove From Array(Remove From Array(All Players(All Teams), Event Player), Player Variable(Event Player,
			requestedby)), Sparkles, Yellow, Event Player, 1, Visible To Position and Radius);
		Set Player Variable(Event Player, Effect1v1, Last Created Entity);
		Create Effect(Remove From Array(Remove From Array(All Players(All Teams), Event Player), Player Variable(Event Player,
			requestedby)), Sparkles, Yellow, Player Variable(Event Player, requestedby), 1, Visible To Position and Radius);
		Set Player Variable(Player Variable(Event Player, requestedby), Effect1v1, Last Created Entity);
		Set Player Variable(Event Player, isIn1v1, True);
		Set Player Variable(Player Variable(Event Player, requestedby), isIn1v1, True);
		Set Player Variable(Event Player, In1v1With, Player Variable(Event Player, requestedby));
		Set Player Variable(Player Variable(Event Player, requestedby), In1v1With, Event Player);
		Start Damage Modification(Event Player, Remove From Array(All Players(All Teams), Player Variable(Event Player, requestedby)), 0,
			Receivers Damagers and Damage Percent);
		disabled Set Player Variable(Event Player, Effect1v1, Last Damage Modification ID);
		Start Damage Modification(Player Variable(Event Player, requestedby), Remove From Array(All Players(All Teams), Event Player), 0,
			Receivers Damagers and Damage Percent);
		disabled Set Player Variable(Player Variable(Event Player, requestedby), Effect1v1, Last Damage Modification ID);
		Set Player Variable(Event Player, requested1v1bysomeone, False);
		Set Player Variable(Player Variable(Event Player, requestedby), requesting1v1withsomeone, False);
		Start Damage Modification(Remove From Array(All Players(All Teams), Player Variable(Event Player, requestedby)), Event Player, 0,
			Receivers Damagers and Damage Percent);
		Start Damage Modification(Remove From Array(All Players(All Teams), Event Player), Player Variable(Event Player, requestedby), 0,
			Receivers Damagers and Damage Percent);
		Set Secondary Fire Enabled(Event Player, False);
		Set Secondary Fire Enabled(Player Variable(Event Player, requestedby), False);
		Big Message(Event Player, Custom String("1v1 starts in 3", Null, Null, Null));
		Big Message(Player Variable(Event Player, requestedby), Custom String("1v1 starts in 3", Null, Null, Null));
		Wait(2, Ignore Condition);
		Big Message(Event Player, Custom String("2", Null, Null, Null));
		Big Message(Player Variable(Event Player, requestedby), Custom String("2", Null, Null, Null));
		Wait(2, Ignore Condition);
		Big Message(Event Player, Custom String("1", Null, Null, Null));
		Big Message(Player Variable(Event Player, requestedby), Custom String("1", Null, Null, Null));
		Wait(2, Ignore Condition);
		Big Message(Event Player, Custom String("FIGHT!!!", Null, Null, Null));
		Big Message(Player Variable(Event Player, requestedby), Custom String("FIGHT!!!", Null, Null, Null));
		Wait(2, Ignore Condition);
		Set Secondary Fire Enabled(Event Player, True);
		Set Secondary Fire Enabled(Player Variable(Event Player, requestedby), True);
	}
}

rule("end 1v1 by kill")
{
	event
	{
		Player Died;
		All;
		All;
	}

	conditions
	{
		Player Variable(Event Player, isIn1v1) == True;
	}

	actions
	{
		Destroy All Icons;
		Stop All Damage Modifications;
		Big Message(All Players(All Teams), String("{0} {1} {2}", Player Variable(Event Player, In1v1With), Custom String(
			"ROLLED AND SMOKED", Null, Null, Null), Event Player));
		Set Player Variable(Event Player, isIn1v1, False);
		Set Player Variable(Player Variable(Event Player, In1v1With), isIn1v1, False);
		Destroy Effect(Player Variable(Event Player, Effect1v1));
		Destroy Effect(Player Variable(Player Variable(Event Player, In1v1With), Effect1v1));
		Destroy HUD Text(Global Variable(HUD1v1));
		Destroy HUD Text(Global Variable(HUD1v1Description));
		Set Global Variable(InProgress1v1, False);
	}
}

rule("end 1v1 by round end")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Player Variable(Event Player, isIn1v1) == True;
		Is Between Rounds == True;
	}

	actions
	{
		Destroy All Icons;
		Stop All Damage Modifications;
		Set Player Variable(Event Player, isIn1v1, False);
		Set Player Variable(Player Variable(Event Player, In1v1With), isIn1v1, False);
		Destroy Effect(Player Variable(Event Player, Effect1v1));
		Destroy Effect(Player Variable(Player Variable(Event Player, In1v1With), Effect1v1));
		Destroy HUD Text(Global Variable(HUD1v1));
		Destroy HUD Text(Global Variable(HUD1v1Description));
		Set Global Variable(InProgress1v1, False);
	}
}

rule("end 1v1 by kill")
{
	event
	{
		Player Left Match;
		All;
		All;
	}

	conditions
	{
		Player Variable(Event Player, isIn1v1) == True;
	}

	actions
	{
		Destroy All Icons;
		Stop All Damage Modifications;
		Set Player Variable(Event Player, isIn1v1, False);
		Set Player Variable(Player Variable(Event Player, In1v1With), isIn1v1, False);
		Destroy Effect(Player Variable(Event Player, Effect1v1));
		Destroy Effect(Player Variable(Player Variable(Event Player, In1v1With), Effect1v1));
		Destroy HUD Text(Global Variable(HUD1v1));
		Destroy HUD Text(Global Variable(HUD1v1Description));
		Set Global Variable(InProgress1v1, False);
	}
}

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

rule("count hits")
{
	event
	{
		Player Dealt Damage;
		All;
		All;
	}

	conditions
	{
		Or(Compare(Team Score(Team 1), ==, 9), Compare(Team Score(Team 1), ==, 9)) == False;
	}

	actions
	{
		Modify Player Variable(Event Player, Hits, Add, 1);
		Set Player Variable(Event Player, CritAcc, Divide(Player Variable(Event Player, Hits), Player Variable(Event Player, Shots)));
	}
}

rule("count shots")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Firing Primary(Event Player) == True;
		Or(Compare(Team Score(Team 1), ==, 9), Compare(Team Score(Team 1), ==, 9)) == False;
	}

	actions
	{
		Modify Player Variable(Event Player, Shots, Add, 1);
		Set Player Variable(Event Player, CritAcc, Divide(Player Variable(Event Player, Hits), Player Variable(Event Player, Shots)));
	}
}

rule("Is player hook-shotting?")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

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

	actions
	{
		Set Player Variable(Event Player, IsHooking, True);
	}
}

rule("cancel hook shot when hit ground")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Altitude Of(Event Player) == 0;
	}

	actions
	{
		Wait(0.100, Abort When False);
		Set Player Variable(Event Player, IsHooking, False);
	}
}

rule("count hits (hook)")
{
	event
	{
		Player Dealt Damage;
		All;
		All;
	}

	conditions
	{
		Player Variable(Event Player, IsHooking) == True;
		Or(Compare(Team Score(Team 1), ==, 9), Compare(Team Score(Team 1), ==, 9)) == False;
	}

	actions
	{
		Modify Player Variable(Event Player, HookHits, Add, 1);
		Set Player Variable(Event Player, accuracy, Divide(Player Variable(Event Player, HookHits), Player Variable(Event Player,
			HookShots)));
	}
}

rule("count shots (hook)")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Player Variable(Event Player, IsHooking) == True;
		Is Firing Primary(Event Player) == True;
		Or(Compare(Team Score(Team 1), ==, 9), Compare(Team Score(Team 1), ==, 9)) == False;
	}

	actions
	{
		Modify Player Variable(Event Player, HookShots, Add, 1);
		Set Player Variable(Event Player, accuracy, Divide(Player Variable(Event Player, HookHits), Player Variable(Event Player,
			HookShots)));
	}
}

rule("Health check and heal on kill")
{
	event
	{
		Player Died;
		All;
		All;
	}

	conditions
	{
		Entity Exists(Attacker) == True;
		Attacker != Event Player;
	}

	actions
	{
		Small Message(Event Player, String("{0} {1} {2}", Attacker, Custom String("had", Null, Null, Null), String("{0} {1}", Health(
			Attacker), Custom String("HP remaining", Null, Null, Null), Null)));
	}
}