All of the (name)=script.parent.(name) are Audios that are in a VehicleSeat with the script that contains this code. Ideally, when you touch the seat, the Start noise will play, and then if the current speed of the car is under .1 studs per second, the Idle noise will play on loop. If the car is above .1 studs per second(moving) than the Low audio will play on loop, and the Idle noise will stop....
The start sound works fine, then the Idle sound plays directly after the start sound stop, but it never stops after that point....
Gear=script.Parent.Gear
Start=script.Parent.EngineStart
Max=script.Parent.MaxEngine
High=script.Parent.HighEngine
Med=script.Parent.MediumEngine
Low=script.Parent.LowEngine
Idle=script.Parent.IdleEngine
function onTouched(hit)
Start:Play()
wait(2.586) --Time of start noise.
Idle:Stop()
Idle.Looped = false
Low:Stop()
Low.Looped = false
if
script.Parent.Velocity.Magnitude<= .1
then Idle.Looped = true
Idle:Play()
Start:Stop()
Low:Stop()
Low.Looped = false
elseif
script.Parent.Velocity.Magnitude>= .1
then Idle.Looped = false
Idle:Stop()
Start:Stop()
Low:Play()
Low.Looped = true
end
end
script.Parent.Touched:connect(onTouched)

1 comment
The answer to everything is not an infinite loop........