I want to change a NumberValue's value whenever the car goes backwards and forwards.
The NumberValue
local MS = seat.Speed.Value
The function that has to change the NumberValue's value.
local function onChanged(property)
if property == "Throttle" then
LD.AngularVelocity = MS * seat.Throttle
RD.AngularVelocity = -MS * seat.Throttle
if seat.Throttle >= 0 then
MS = 77
print("going forward")
else
MS = 30
print("going backward")
end
end
if property == "Steer" then
LS.TargetAngle = SA * seat.Steer
RS.TargetAngle = SA * seat.Steer
end
end
seat.Changed:Connect(onChanged)

3 comments
So do I have to remove the MS variable?
It worked, but it didn't change the cars' speed
nvm, I managed to fix it