How to disable heroes that have died in TDM

I wanted to know if anyone has figured out how to disable heroes after they have died once in TDM.

First of all, set a variable for each team with all the heroes of the game.
Then when a player died, remove “hero of(event player)” from the array, then set “allowed hereos” to the array. Be careful of rez as it can cancel a death!

How do I remove a hero?

Use the “remove from array” command

rule("Set global A and global B")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		Set Global Variable(A, All Heroes);
		Set Global Variable(B, All Heroes);
	}
}

rule("Remove hereos from team 1")
{
	event
	{
		Player Died;
		Team 1;
		All;
	}

	actions
	{
		Set Global Variable(A, Remove From Array(Global Variable(A), Hero Of(Event Player)));
	}
}

rule("Remove hereos from team 2")
{
	event
	{
		Player Died;
		Team 2;
		All;
	}

	actions
	{
		Set Global Variable(B, Remove From Array(Global Variable(B), Hero Of(Event Player)));
	}
}

I tried that code for one of my game modes and it didn’t do anything.