Need help with resurrect

so in my mercy 2.0 code i have 2 issues listed here

  • able to rez someone even on a 30 second cooldown
  • when two people next to eachother died they both get resurrected even after it’s been used on one soul

if anyone could help that would be great :heart: code is 3HSC2

conditions
{
Is Using Ability 2(Players On Hero(Hero(Mercy), Team Of(Event Player))) == True;
Is Dead(Event Player) == True;
Is Alive(Players On Hero(Hero(Mercy), Team Of(Event Player))) == True;
Distance Between(Event Player, Players On Hero(Hero(Mercy), Team Of(Event Player))) < Global.B;
}

You’re checking from the player to be resurrected, if there’s any mercy nearby using resurrect and within distance.
This allows multiple people at the same to trigger the snippet.

rule("Rule 18")
{
	event
	{
		Ongoing - Each Player;
		All;
		Mercy;
	}

	conditions
	{
		Is Using Ability 2(Event Player) == True;
	}

	actions
	{
		Event Player.I = Filtered Array(Player Closest To Reticle(Event Player, Team Of(Event Player)), Is Dead(Current Array Element));
	}
}

And then resurrecting / inflicting the status effects with Player Variable I and for Mercy with Event Player.

Only way I see this able to be a possibility is triggering “valk rez cd” and Valk running out of time.

And the “valk rez cd reset” triggering again for the seconds Valk cast to extend the duration.

2 Likes

thank you! also is the “rule 18” thing a new rule or did you remake it from an old rule?

i’m guessing the

wont work unless specific conditions/actions have to have the I variable?

Yes; it would replace rez cast time and resurrected player status's in that case.


rule("Rule 18")
{
	event
	{
		Ongoing - Each Player;
		All;
		Mercy;
	}

	conditions
	{
		Is Using Ability 2(Event Player) == True;
	}

	actions
	{
		Event Player.I = Filtered Array(Player Closest To Reticle(Event Player, Team Of(Event Player)), Is Dead(Current Array Element));
		Wait(0.032, Ignore Condition);
		Loop If(!Event Player.I);
		Stop Holding Button(Event Player, Button(Ability 2));
		Play Effect(All Players(Team Of(Event Player)), Good Pickup Effect, Color(Red), Event Player, 1);
		Play Effect(All Players(Team Of(Event Player)), Bad Pickup Effect, Color(Yellow), Event Player, 1);
		Resurrect(Event Player.I);
		Wait(0, Ignore Condition);
		Kill(Event Player.I, Event Player);
		Resurrect(Event Player.I);
		Set Status(Event Player.I, Null, Invincible, 2.250);
		Set Status(Event Player.I, Null, Burning, 2.250);
		Set Status(Event Player.I, Null, Rooted, 2.250);
		Set Status(Event Player.I, Null, Phased Out, 2.250);
		Disallow Button(Event Player, Button(Ability 2));
	}
}
1 Like

thank you so much! this works perfectly and exactly how i wanted. you are the best teawy :heart::heart:

1 Like