What I'm trying to do is that if the car goes forward, it goes back to it's normal speed and when it goes in reverse, it changes the value.
local seat = script.Parent
local car = seat.Parent
local M = seat.Position.Magnitude
local LD = car.RL.WheelMount.Drive
local RD = car.RR.WheelMount.Drive
local LS = car.FL.SpringMount.Steer
local RS = car.FR.SpringMount.Steer
local MS = seat.Speed.Value
local SA = seat.Angle.Value
local function onChanged(property)
if property == "Throttle" then
LD.AngularVelocity = MS * seat.Throttle
RD.AngularVelocity = -MS * seat.Throttle
end
if property == "Steer" then
LS.TargetAngle = SA * seat.Steer
RS.TargetAngle = SA * seat.Steer
end
if M > 1 then
MS = 77
end
if M < 1 then
MS = 30
end
end
seat.Changed:Connect(onChanged)

1 comment
It worked, but it didn't changed the NumberValue's value