VehicleMove Hook + VCMod

Hello!

I am trying to make a speed indicator for cars. The displaying of the speed works but when I change seats with vcmod then my client crashs. I am only running the server script.

Here the code:



util.AddNetworkString("Speed")

local function PlayerMovedVehicle( player, vehicle, mv)

	local veh = vehicle

	local speed = veh:GetSpeed()

	net.Start("Speed")
	net.WriteString(speed)
	net.Send(player)

end

hook.Add("VehicleMove", "VehicleMoved", PlayerMovedVehicle)

I hope somebody can help me :slight_smile:

Ps: Sorry for my bad english. I am german

Afaik, you will need to use this:

Thanks! It works now <3