I've got a while true loop that detects a change in a value and implements that change onto a vehicle seat, It used to work perfectly but now can't seem to detect the change in value. It works while the value is at 0 but once it hits 10 then it doesn't detect that change. I'm abit baffled and another while true loop that detects value changes works perfectly to this day so i'm a tad baffled as to where I've gone wrong, anyways here's the code:
while true do
wait(.5)
if script.Parent.Accel.Value==0 then
script.Parent.Parent.VehicleSeat.Torque=0
end
if script.Parent.Accel.Value==10 then
script.Parent.Parent.VehicleSeat.Torque=0.3
end
end
The script shares the same parent as the value, so everything is where its supposed to be, its been months of nothing working so any feedback would be highly appreciated, cheers for your time guys!

5 comments
I'll give it a try, thanks for the reply!
Hasn't seemed to work, had a look at the output and that isn't showing any errors, I'm stumped on what the problem could be lmao
Then it has to do with something outside of the code, is the Accel.Value being changed anywhere else in your code?
I don't think so, the value changes to 10 as it should when the E key is presses, at that point the script should detect that change and apply the torque to the seat.
The accel value itself is changed inside a gui in the seat that the user is sat in, like i said above it all works and does as it should there