Back to home

Workshop Ruler

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

Category:
Training / Drills / Tools

Author:
sselesU

Rating:
0

Version:
1.0.0

Posted:
2 months ago

Tags:
ruler tool

Share this workshop!

Options

Workshop Ruler

This ruler was made by sselesU#1512 to help people find distance and coordinates very easily. It runs through player variables, so you can bring your friends in on your project and they can use their own ruler in the same game. That's it really! It's pretty simple- but using this means less work for you! You're welcome.

rule("Check distance between Variable(A) and Variable(B)")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	actions
	{
		Create HUD Text(Event Player, Null, Null, String("{0} {1}", String("Distance", Null, Null, Null), Distance Between(Player Variable(
			Event Player, A), Player Variable(Event Player, B)), Null), Left, 0, White, White, Blue, Visible To and String);
	}
}

rule("Right Click // Set Variable(A) to current position")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Primary Fire) == True;
	}

	actions
	{
		Set Player Variable(Event Player, A, Position Of(Event Player));
		Wait(0.250, Ignore Condition);
		Loop If Condition Is True;
	}
}

rule("Left Click // Set Variable(B) to current position")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

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

	actions
	{
		Set Player Variable(Event Player, B, Position Of(Event Player));
		Wait(0.250, Ignore Condition);
		Loop If Condition Is True;
	}
}

rule("Right Click and Variable(Y) = 0 // Set Variable(Y) to 1")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Primary Fire) == True;
		Player Variable(Event Player, Y) == 0;
	}

	actions
	{
		Set Player Variable(Event Player, Y, 1);
	}
}

rule("Left Click and Variable(Z) = 0 // Set Variable(Z) to 1")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Primary Fire) == True;
		Player Variable(Event Player, Z) == 0;
	}

	actions
	{
		Set Player Variable(Event Player, Z, 1);
	}
}

rule("Variable(Y) = 1 // Create orb tied to Variable(A) location.")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Player Variable(Event Player, Y) == 1;
	}

	actions
	{
		Create Effect(Event Player, Orb, Purple, Player Variable(Event Player, A), 0.500, Position and Radius);
		Create HUD Text(Event Player, Null, Null, String("{0}: {1}", 1, Player Variable(Event Player, A), Null), Right, 1, White, White,
			Purple, Visible To and String);
	}
}

rule("Variable(Z) = 1 // Create orb tied to Variable(B) location.")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Player Variable(Event Player, Z) == True;
	}

	actions
	{
		Create Effect(Event Player, Orb, Yellow, Player Variable(Event Player, B), 0.500, Position and Radius);
		Create HUD Text(Event Player, Null, Null, String("{0}: {1}", 2, Player Variable(Event Player, B), Null), Right, 2, White, White,
			Yellow, Visible To and String);
	}
}