I am trying to make a script like in ud where the wheel hits a different color surface then plays a sound that changes pitches when going faster. I have tried

while true do local velocity = carSeat.Velocity.magnitude carSeat.Motor.Pitch = (velocity/250) + 0.3

local velocity = carSeat.Velocity.magnitude
local ray = Ray.new(
Vector3.new(carSeat.Parent.Flip.Position.X, carSeat.Parent.Flip.Position.Y, carSeat.Parent.Flip.Position.Z),
Vector3.new(0, -10, 0))
local part, int, surface = game.Workspace:FindPartOnRayWithIgnoreList(ray, ignore, false)

if part ~= nil then
	if part.Name == "Road" then
		if part.BrickColor.Name == "Brick yellow" then
			carSeat.Concrete.Volume = ((velocity / 200) * 1.5)
			carSeat.Concrete.Pitch = (velocity / 200) + .2
			carSeat.Asphalt.Volume = 0
		else
			carSeat.Asphalt.Volume = ((velocity / 200) * 1.5)
			carSeat.Asphalt.Pitch = (velocity / 200) + .2
			carSeat.Concrete.Volume = 0
		end
	elseif part.Name ~= "Line" and part.Name ~= "Arrow" and part.Name ~= "BridgeJoint" then
		carSeat.Asphalt.Volume = 0
		carSeat.Concrete.Volume = 0
	elseif carSeat.Asphalt.Volume == 0 then
		carSeat.Concrete.Volume = ((velocity / 200) * 1.5)
		carSeat.Concrete.Pitch = (velocity / 200) + .2
	elseif carSeat.Concrete.Volume == 0 then
		carSeat.Asphalt.Volume = ((velocity / 200) * 1.5)
		carSeat.Asphalt.Pitch = (velocity / 200) + .2
	end
end
wait(.1)

end

but it still didn't work. is there a workable script out there I can try?