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:
1 | while true do |
2 | if script.Parent.Parent.TextLabel.Time = = 50 |
3 | then script.Parent.Visible = true |
4 | script.Parent.Parent.Warning.Visible = true |
5 | end |
6 | 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
1 | while true do |
2 | wait(. 1 ) |
3 | if script.Parent.Parent.TextLabel.Time = = 50 |
4 | then script.Parent.Visible = true |
5 | script.Parent.Parent.Warning.Visible = true |
6 | end |
7 | end |
1 | while true do |
2 | wait() |
3 | if script.Parent.Parent.TextLabel.Time = = 50 |
4 | then script.Parent.Visible = true |
5 | script.Parent.Parent.Warning.Visible = true |
6 | end |
7 | 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