When I am about to test my new game I am creating in roblox studio, I press "play" a couple seconds later when it is trying to load, a message comes up, it says, "a script has been running for a long time, and may be hanging." Underneath this message it has to options, "kill script or break." I have tried both of these options several times, and my problem has not been resolved, please help me. Thank you!
You are using a while true do loop that is running infinitely non-stop for e.g if you were changing the BrickColor of a part you would need a wait() before it changes colour again or it will crash the server. Fix - Put a wait() somewhere between 2 things that changes and enter a value inside the brackets (it's for how long it should wait it isn't essential)
EXAMPLE -
1 | while true do |
2 | workspace.Part.BrickColor = BrickColor.new( 'Pearl' ) |
3 | wait( 0.1 ) |
4 | workspace.Part.BrickColor = BrickColor.new( 'Lapis' ) |
If you can't figure out where to put the wait give me the script and I'll reply with a more detailed answer
Hope it helped.
its because you're using a while loop or some other loop that repeats itself. put a wait in the loop because then it runs too fast for your (or anyone's) computer to handle
1 | while true do |
2 | -- some stuff |
3 | wait( 0.01 ) |
4 | end |
i think that's the case, anyway.