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

2 comments

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.

0

An "if/then" function doesn't work in the loops. That's why