How do I make so as some value becomes bigger, other one does too?

Here’s what I mean.
For example car’s speed rises and I want the engine sound’s pitch to rise too. So I want the engine sound’s pitch be addicted to the speed so if speed lowers, then pitch lowers and etc.

local vehicleSeat = script.Parent
local speed

game:GetService("RunService").RenderStepped(deltaTime) --Server-sided
    speed = seat.Velocity.magnitude
    print(speed) 
    -- if this is not accurate then you should use
    -- speed = seat.Velocity.magnitude / deltaTime
end)

if you want this to be in a local script use RunService.HeartBeat instead.

2 Likes