My studio and game was running completely smooth untile I decided to do a little work to a GUI in the game. After I made this change and I ran a test play in studio it made it crash. Also, when I try to actually play the game the game wont even load. When I remove this script, everything runs fine. Can someone explain?
Script:
while true do if script.Parent.Parent.TextLabel.Time == 50 then script.Parent.Visible = true script.Parent.Parent.Warning.Visible = true end end
If you make a while true do
loop without any wait() in it, it will loop so fast it will crash studio!
Just add a wait into it. :P
while true do wait(.1) if script.Parent.Parent.TextLabel.Time == 50 then script.Parent.Visible = true script.Parent.Parent.Warning.Visible = true end end
while true do wait() if script.Parent.Parent.TextLabel.Time == 50 then script.Parent.Visible = true script.Parent.Parent.Warning.Visible = true end end
You have to add that wait() there or else it loops infinitely without any waiting in-between which is too much for Roblox to handle