[SOLVED] Speed Camera

Hey Hey, im not new with scripting in roblox studio but sometimes i do stuck anyway, most of the Time i find a soloution but now, i don’t.

I want to make a speed Camera, but i never worked with RayCast before. On YT i dont find Tutorials for speed cams so i need to ask for help here.

My Cars using A-Chassis, so id like to know, how to make a speed Camera and where the script need to search in the Car to find the current speed.

4 Likes

You can find the cars velocity value by finding the drivers player in the player list, then going into their PlayerGui > A-Chassis Interface > Values > Velocity. You could use BasePart.Touched to fire a function that get’s this value when the player touches the speed camera detection part (if they are driving of course).

The interface script that controls the UI’s speed display works out the cars speed through using:

local UNITS	= {
	{
		Units = "MPH",
		Scaling = (10/12) * (60/88),
	},

	{
		Units = "KM/H",
		Scaling	= (10/12) * 1.09728,
	},

	{
		Units = "SPS",
		Scaling	= 1,
	}
}

math.floor(UNITS[CurrentUnits].Scaling * Values.Velocity.Value.Magnitude) -- Values.Velocity is just getting that value I mentioned above

I hope this helps

1 Like

Does that need to be done locally?

Like a normal speed camera, the player drives too fast and get caugh by the speed camera than a gui appears with “you was driving too fast.”

My question is does it need to be done locally in a local script or can values be accessed by the server.

Maybe local is better because i can easilie get the local player in server scripts trough fire events then.

Example: give the Player bounty etc or remove money whatever…
But that i don’t need (I can do it self)

I only need the Speed camera that flashes you when you drive over the speed limit.

Thanks👍🏽

1 Like