Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Random Studio Crash?

Asked by 9 years ago

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.

0
Check for other while true do loops without a wait EzraNehemiah_TF2 3552 — 9y
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. TheeDeathCaster 2368 — 9y
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. Lacryma 548 — 9y

2 answers

Log in to vote
5
Answered by 9 years ago

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

0
^ Ignore this, you already have a wait() in your while loop. epicbreaker 95 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

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.

Answer this question