Player Velocity Cap?

Hello I am working on a velocity cap for our server because people are bhoping and pretty much breaking the sound barrier :p. Sorry it’s been months since I’ve done anything coding related and I wasn’t any good at it to begin with.



timer.Create( "Velocity_Check", 1, 0, function()

	for k, v in pairs(player.GetAll()) do
		if v:GetVelocity():Length() > 500 then
			print ("SLOW THE FUCK DOWN")
			v:SetVelocity(Vector(10,10,10))
		end
	end
end)


Right now I can detect when a player goes over a specific speed, but I don’t know how to set the players speed/velocity. Any help would be greatly appreciated!

Well I figured out how to set the velocity. I don’t know the terminology for this so try to stick with me :stuck_out_tongue:

Lets say you do:
speed = LocalPlayer():GetVelocity()

The outpout would be:
250, 0, 0 or w/e it may be but you get the idea.

How would I separate that output? So it would look something like:

A=250
B=0
C=0

Sorry for being a retard =D

vector.x
vector.y
vector.z
will give you the values

Thanks bud!