Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to fix audio play loop on a while true do script?

Asked by 4 years ago

Hi, I'm making a re entry/exiting the atmosphere script where the cone of the ship has particles that appear and audio to it. The audio only plays in a loop.

local p = script.Parent

while true do
    wait(.01)
    if p.Velocity.Y >= 890 then
        p.AirCompress:Play()

p.Alarm:Play()
p.ParticleEmitter.Enabled = true
script.Parent.Temperature.Value = script.Parent.Temperature.Value + 5
    else
        p.Alarm:Stop()
p.ParticleEmitter.Enabled = false
p.AirCompress:Stop()
script.Parent.Temperature.Value = 20
    end
end
0
This is a very vague question with not a lot of detail to help answer the question. I need to know what it is your putting this code into and how its suppose to function. TheWiseAndGreat 50 — 4y
0
An "if/then" function doesn't work in the loops. That's why MradmannMvip 50 — 4y

Answer this question