Back to home

Copy-and-Paste Role Lock Module

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

Category:
Other

Author:
Ambrosia

Rating:
0

Version:
1.2.0

Posted:
about 1 month ago

Last updated:
about 1 month ago

Tags:
role lock module copy and paste

Share this workshop!

Options

A copy-and-paste module that enables you to add quick and easy role lock to any mode. Pick a hero from any category to be restricted to that role. Also checks to see which heroes are currently allowed or disallowed.

The current code mentions my battletag, but feel free to remove this battletag when using the script in your own mode.

rule("Initialize DPS restrictions")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Array Contains(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(
			Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(
			Append To Array(Append To Array(Empty Array, Hero(Ashe)), Hero(Bastion)), Hero(Doomfist)), Hero(Genji)), Hero(Hanzo)), Hero(
			Junkrat)), Hero(McCree)), Hero(Mei)), Hero(Pharah)), Hero(Reaper)), Hero(Soldier: 76)), Hero(Sombra)), Hero(Symmetra)), Hero(
			Torbjörn)), Hero(Tracer)), Hero(Widowmaker)), Hero Of(Event Player)) == True;
	}

	actions
	{
		Set Player Allowed Heroes(Event Player, Filtered Array(Append To Array(Append To Array(Append To Array(Append To Array(
			Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(
			Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Empty Array, Hero(Ashe)), Hero(Bastion)), Hero(
			Doomfist)), Hero(Genji)), Hero(Hanzo)), Hero(Junkrat)), Hero(McCree)), Hero(Mei)), Hero(Pharah)), Hero(Reaper)), Hero(
			Soldier: 76)), Hero(Sombra)), Hero(Symmetra)), Hero(Torbjörn)), Hero(Tracer)), Hero(Widowmaker)), Array Contains(
			Allowed Heroes(Event Player), Current Array Element)));
	}
}

rule("Initialize Tank restrictions")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Array Contains(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(
			Append To Array(Empty Array, Hero(D.Va)), Hero(Orisa)), Hero(Reinhardt)), Hero(Roadhog)), Hero(Sigma)), Hero(Winston)), Hero(
			Wrecking Ball)), Hero(Zarya)), Hero Of(Event Player)) == True;
	}

	actions
	{
		Set Player Allowed Heroes(Event Player, Filtered Array(Append To Array(Append To Array(Append To Array(Append To Array(
			Append To Array(Append To Array(Append To Array(Append To Array(Empty Array, Hero(D.Va)), Hero(Orisa)), Hero(Reinhardt)), Hero(
			Roadhog)), Hero(Sigma)), Hero(Winston)), Hero(Wrecking Ball)), Hero(Zarya)), Array Contains(Allowed Heroes(Event Player),
			Current Array Element)));
	}
}

rule("Initialize Healer restrictions")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Array Contains(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(
			Empty Array, Hero(Ana)), Hero(Baptiste)), Hero(Brigitte)), Hero(Lúcio)), Hero(Mercy)), Hero(Moira)), Hero(Zenyatta)), Hero Of(
			Event Player)) == True;
	}

	actions
	{
		Set Player Allowed Heroes(Event Player, Filtered Array(Append To Array(Append To Array(Append To Array(Append To Array(
			Append To Array(Append To Array(Append To Array(Empty Array, Hero(Ana)), Hero(Baptiste)), Hero(Brigitte)), Hero(Lúcio)), Hero(
			Mercy)), Hero(Moira)), Hero(Zenyatta)), Array Contains(Allowed Heroes(Event Player), Current Array Element)));
	}
}

Changelog

about 1 month ago 1.2.0

Added Sigma, added checks to remove heroes who are not allowed, and cut the script down to just 3 events instead of 4.

SPRFW
click to copy
about 1 month ago 1.0.0

This revision contains no notes

SA2YN
click to copy