Trying to make a lightning strike

I don’t know why but the beam effect is vertical like I want it to be, but it only spawns at (0, 0, 0). Why’s that? Here’s my code:

rule("[THOR]: Summon Lightning")
{
event
{
Ongoing - Each Player;
Team 2;
Reinhardt;
}

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

actions
{
	Set Player Variable(Event Player, P, 13.200);
	Create Beam Effect(All Players(All Teams), Bad Beam, Vector(X Component Of(Event Player), Add(Y Component Of(Event Player), 50),
		Z Component Of(Event Player)), Vector(X Component Of(Event Player), Y Component Of(Event Player), Z Component Of(
		Event Player)), Blue, Visible To Position and Radius);
	Set Player Variable(Event Player, A, Last Created Entity);
	Play Effect(All Players(All Teams), Ring Explosion, Blue, Event Player, 32);
	Play Effect(All Players(All Teams), Explosion Sound, White, Event Player, 10000);
	Wait(0.100, Ignore Condition);
	Destroy Effect(Player Variable(Event Player, A));
	Play Effect(All Players(All Teams), Explosion Sound, White, Event Player, 10000);
	Wait(0.100, Ignore Condition);
	Play Effect(All Players(All Teams), Explosion Sound, White, Event Player, 10000);
	Wait(2, Ignore Condition);
	disabled Create Effect(All Players(All Teams), Light Shaft, Blue, Player Closest To Reticle(Event Player, Team 1), 1,
		Visible To Position and Radius);
	Create Beam Effect(All Players(All Teams), Bad Beam, Vector(X Component Of(Player Closest To Reticle(Event Player, Team 1)), Add(
		Y Component Of(Player Closest To Reticle(Event Player, Team 1)), 50), Z Component Of(Player Closest To Reticle(Event Player,
		Team 1))), Vector(X Component Of(Player Closest To Reticle(Event Player, Team 1)), Y Component Of(Player Closest To Reticle(
		Event Player, Team 1)), Z Component Of(Player Closest To Reticle(Event Player, Team 1))), Blue,
		Visible To Position and Radius);
	Set Player Variable(Event Player, A, Last Created Entity);
	Play Effect(All Players(All Teams), Ring Explosion, Blue, Player Closest To Reticle(Event Player, Team 1), 32);
	Play Effect(All Players(All Teams), Explosion Sound, White, Player Closest To Reticle(Event Player, Team 1), 10000);
	Damage(Player Closest To Reticle(Event Player, Team 1), Event Player, 150);
	Set Status(Player Closest To Reticle(Event Player, Team 1), Event Player, Knocked Down, 2);
	Wait(0.100, Ignore Condition);
	Destroy Effect(Player Variable(Event Player, A));
	Play Effect(All Players(All Teams), Explosion Sound, White, Player Closest To Reticle(Event Player, Team 1), 10000);
	Wait(0.100, Ignore Condition);
	Play Effect(All Players(All Teams), Explosion Sound, White, Player Closest To Reticle(Event Player, Team 1), 10000);
	disabled Wait(13, Ignore Condition);
}

}

I don’t understand what you are trying to do.

same thing as a light shaft but with a beam effect

actions
{
Create Beam Effect(All Players(All Teams), Bad Beam, Vector(X Component Of(Event Player), Add(Y Component Of(Event Player), 50),
Z Component Of(Event Player)), Vector(X Component Of(Event Player), Y Component Of(Event Player), Z Component Of(
Event Player)), Blue, Visible To Position and Radius);

Create Beam Effect(All Players(All Teams), Bad Beam, Vector(X Component Of(Player Closest To Reticle(Event Player, Team 1)), Add(
	Y Component Of(Player Closest To Reticle(Event Player, Team 1)), 50), Z Component Of(Player Closest To Reticle(Event Player,
	Team 1))), Vector(X Component Of(Player Closest To Reticle(Event Player, Team 1)), Y Component Of(Player Closest To Reticle(
	Event Player, Team 1)), Z Component Of(Player Closest To Reticle(Event Player, Team 1))), Blue,
	Visible To Position and Radius);

}

actions
{
	Create Beam Effect(All Players(All Teams), Bad Beam, Add(Event Player, Vector(0, 50, 0)), Event Player, Blue,
		Visible To Position and Radius);
	Create Beam Effect(All Players(All Teams), Bad Beam, Add(Player Closest To Reticle(Event Player, Opposite Team Of(Team Of(
		Event Player))), Vector(0, 50, 0)), Player Closest To Reticle(Event Player, Opposite Team Of(Team Of(Event Player))), Blue,
		Visible To Position and Radius);
}

Should work

2 Likes

It worked, but why??? Also thank you.

Instead of

your code
Create Beam Effect(All Players(All Teams), Bad Beam, Vector(X Component Of(Event Player), Add(Y Component Of(Event Player), 50),
		Z Component Of(Event Player)), Vector(X Component Of(Event Player), Y Component Of(Event Player), Z Component Of(
		Event Player)), Blue, Visible To Position and Radius);

easier to use

other but same code
actions
{
	Create Beam Effect(All Players(All Teams), Bad Beam, World Vector Of(Vector(0, 50, 0), Event Player, Rotation And Translation),
		Position Of(Event Player), Blue, None);
}

I don’t why your code didn’t work, but instead of input a vector, i added 2 of them. when you add to vector, you add each component of them, so essentially the same thing you did but more compact, I also used team of opposite team of to make the code work for both team, that’s probably why it didn’t work before.