Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Random Studio Crash?

Hello. I have a question that needs to be answered.

So I was making a game.

I have a startergui with a frame and a textbox at the top of the screen. Inside of the textbox I have a script.

After that, I put a StringValue in ServerStorage.

In the script in the textbox, I put this:

while true do
script.Parent.Text = game.ServerStorage.StringValue.Value
wait()
end

When u try to play the game, the loading bar thing goes to 50%, then stops and ROBLOX Studio freezes.

BTW: I have a main script in workspace that is changing the value of StringValue but that isn't the problem.

3 comments

0

Check for other while true do loops without a wait

0

All 'loops' (while, repeat, for (sometimes 'for')) require a 'wait' (a function that will yield the code (in seconds) for a certain amount of time), but, if a 'loop' does not have one, then it will attempt and try to run the chunk (the code inside the loop) all at once infinitely, so please make sure there are 'wait's in the loops.

0

Are you doing this in a local script? If so, try changing the location of the StringValue to ReplicatedStorage. There are other options as well.

2 answers

Any true loop without a wait will crash the server. Try doing while wait() do instead of while true do.

1 comment

0

^ Ignore this, you already have a wait() in your while loop.

First of all, all GUI objects should be used with a LocalScript. LocalScripts can't access ServerStorage in an online game either. Please move your StringValue to ReplicatedStorage.


Your issue is caused by another script. Press Ctrl+Shift+F in Studio, and search for all scripts with "while true do". Make sure they all have a wait() inside of them.

This discussion is preserved as it was. New answers, comments, and votes are closed.