I need to know how to keep this if
statement from looping until a condition is met where it stops looping
But I have tried repeat ... until
and while script.Parent.Value >= 40 do
and they do not work.
repeat wait(1) -- this is to prevent game script time out from occuring script.Parent.Parent.tornadowinds.intensify.Disabled = false script.Parent.Parent.tornado.ParticleEmitter.Enabled = true script.Parent.Parent.tornado.suckcloud.ParticleEmitter.Enabled = true script.Parent.Parent.tornadowinds.Value = 65 script.Parent.Parent.cloudmain.Stats.Frame.StormName.Text = "Tornado 1" script.Parent.Parent.tornadowinds.control.Disabled = false until script.Parent.Value >= 40
integrate the condition into the while loop. you could also watch the value for changes and check only then, that would probably be more efficient instead of running this every second until condition is met.
script.Parent.Changed:Connect(function() if script.Parent.Value >= 40 then script.Parent.Parent.tornadowinds.intensify.Disabled = false script.Parent.Parent.tornado.ParticleEmitter.Enabled = true script.Parent.Parent.tornado.suckcloud.ParticleEmitter.Enabled = true script.Parent.Parent.tornadowinds.Value = 65 script.Parent.Parent.cloudmain.Stats.Frame.StormName.Text = "Tornado 1" script.Parent.Parent.tornadowinds.control.Disabled = false end end)
while wait(1) do if script.Parent.Value >= 40 then break else script.Parent.Parent.tornadowinds.intensify.Disabled = false script.Parent.Parent.tornado.ParticleEmitter.Enabled = true script.Parent.Parent.tornado.suckcloud.ParticleEmitter.Enabled = true script.Parent.Parent.tornadowinds.Value = 65 script.Parent.Parent.cloudmain.Stats.Frame.StormName.Text = "Tornado 1" script.Parent.Parent.tornadowinds.control.Disabled = false end end