So, I've been stuck with this small bit of code, which is vital for making a driving system work for me. When the value is changed, the code is meant to detect that change depending on the number the value holds. I've also noticed on load that the first while statement runs fine. Anyways here's the code:
while script.Parent.Accel.Value==0 do
wait(.5)
script.Parent.Parent.VehicleSeat.Torque=0
break
end
while script.Parent.Accel.Value==10 do
wait(.5)
script.Parent.Parent.VehicleSeat.Torque=.1
break
end
I have no idea how this isn't working as in theory it should. Any help would be greatly appreciated. Cheers!
EDIT -- I noticed i messed up a little bit of the code, now i know that it doesn't work as i've trialed with it corrected. Sorry for any confusion!

1 comment
You may want to look into the "Changed" event for Values whether it is an NumberValue, IntValue, or any other value. When the event fires, the event handler will then check if the value is equal to 0. Also, you are setting the Torque twice, for 0 to .1 every time the value is 0.