So the script down below makes the engine sound pitch be based on the car velocity but the problem is that the pitch doesn’t have limit. So for example if the car goes 200 km/h engine sound will get messed up.
How to set the max possible sound pitch?
local maxSpeed = 30
game:GetService("RunService").Heartbeat:Connect(function()
local velocity = script.Parent.Parent.Velocity.Magnitude
script.Parent.PlaybackSpeed = (velocity / maxSpeed) + 0.6 end)
local maxSpeed = 30
game:GetService("RunService").Heartbeat:Connect(function()
local velocity = script.Parent.Parent.Velocity.Magnitude
local calculation = (velocity / maxSpeed) + 0.6
local min = 1
local max = 3
script.Parent.PlaybackSpeed = math.clamp(calculation,min,max)
end)
Just change the 1 in min and 3 in max to whatever values you want