Noob questions(15 characters)

I was working on my lift ability for mercy, but I can’t force a hero up ward, they just get stuck in a direction that is not up

I have made a funny code for Sombra hero team 1 and 6 bots team 2. When Sombra is close to a bot ( minimum 10m ) she can use her Secondary Fire (replaced Hacking) to activate an antigrav-ray with low damage, stun it. The ray is activated til Sombra’s player holds button (Secondary Fire), stays in 10m or less from a bot and there is nothing between them. Same effect can be applied to all bots that comes to Sombra or Sombra comes to them.

Code: PWB15
or

code
variables
{
	player:
		0: BeingHacking
		1: BeamEffectID
		2: Hacker
}

rule("less time on start")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Is In Setup == True;
	}

	actions
	{
		Set Match Time(3);
	}
}

rule("Activate beam")
{
	event
	{
		Ongoing - Each Player;
		Team 2;
		All;
	}

	conditions
	{
		Is Game In Progress == True;
		Event Player.BeingHacking == False;
		Count Of(Players Within Radius(Event Player, 5, Team 1, Surfaces And All Barriers)) > 0;
		Is True For Any(Players Within Radius(Event Player, 10, Team 1, Surfaces And All Barriers), (Hero Of(Current Array Element)
			== Hero(Sombra) && Is Button Held(Current Array Element, Secondary Fire)) == True) == True;
	}

	actions
	{
		Event Player.Hacker = First Of(Filtered Array(All Players(Team 1), Hero Of(Current Array Element) == Hero(Sombra)
			&& Is Button Held(Current Array Element, Secondary Fire) == True && Is In Line of Sight(Eye Position(Event Player),
			Current Array Element, All Barriers Block LOS) == True && Distance Between(Event Player, Current Array Element) < 10));
		Abort If(Event Player.Hacker == Null);
		Create Beam Effect(All Players(All Teams), Good Beam, World Vector Of(Vector(0, 1, 0), Event Player, Rotation And Translation),
			World Vector Of(Vector(0, 1, 0), Event Player.Hacker, Rotation And Translation), White, Visible To Position and Radius);
		Event Player.BeamEffectID = Last Created Entity;
		Set Status(Event Player, Null, Stunned, 9999);
		Skip If(Is In Air(Event Player) == True, 1);
		Apply Impulse(Event Player, Up, 10, To World, Cancel Contrary Motion);
		Event Player.BeingHacking = True;
	}
}

rule("Reset beam if cannot see")
{
	event
	{
		Ongoing - Each Player;
		Team 2;
		All;
	}

	conditions
	{
		Event Player.BeingHacking == True;
		Is In Line of Sight(Event Player, Event Player.Hacker, All Barriers Block LOS) == False;
	}

	actions
	{
		Destroy Effect(Event Player.BeamEffectID);
		Event Player.BeingHacking = False;
		Event Player.Hacker = 0;
		Clear Status(Event Player, Stunned);
	}
}

rule("Reset beam if does not use secondary fire")
{
	event
	{
		Ongoing - Each Player;
		Team 2;
		All;
	}

	conditions
	{
		Event Player.BeingHacking == True;
		Is Button Held(Event Player.Hacker, Secondary Fire) == False;
	}

	actions
	{
		Destroy Effect(Event Player.BeamEffectID);
		Event Player.BeingHacking = False;
		Event Player.Hacker = 0;
		Clear Status(Event Player, Stunned);
	}
}

rule("Reset beam distanse > 10m")
{
	event
	{
		Ongoing - Each Player;
		Team 2;
		All;
	}

	conditions
	{
		Event Player.BeingHacking == True;
		Distance Between(Event Player, Event Player.Hacker) > 10;
	}

	actions
	{
		Destroy Effect(Event Player.BeamEffectID);
		Event Player.BeingHacking = False;
		Event Player.Hacker = 0;
		Clear Status(Event Player, Stunned);
	}
}

rule("Deal damage and impulse up")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Event Player.BeingHacking == True;
	}

	actions
	{
		Damage(Event Player, Null, 0.010);
		Skip If(Vertical Speed Of(Event Player) >= 0, 1);
		Apply Impulse(Event Player, Up, Vertical Speed Of(Event Player) * -1, To World, Cancel Contrary Motion);
		Wait(0.020, Ignore Condition);
		Loop If Condition Is True;
	}
}

rule("Gоd mod :D")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		Sombra;
	}

	actions
	{
		Set Status(Event Player, Null, Phased Out, 9999);
		Set Secondary Fire Enabled(Event Player, False);
		Wait(5, Ignore Condition);
		Small Message(All Players(All Teams), Custom String("Use Secondary Fire (Hacking) to catch bots ;]"));
	}
}

Anyway I’m done with the ult beams, they are now working as intended. Now I’m trying to implement Mercy’s lift which I am visualize as Mercy lifting hero a few metres into the air and they are locked in place there. I figured it would be as simple as rooting enemies but I don’t know how to put them up in the air

Manguy, check my code with “antigrav-ray” to learn how to hold a player in the air :]

I’m starting to get the hang of this workshop stuff. I think I really experienced a breakthrough when I eventually understood how arrays and variables worked and how they are used. Discovered subroutines which help a lot with the inspire buff though I still do have some work to do. Also just recently discovered how to change variable and subroutine names (so helpful!)

Good start, just keep it up :+1: