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

Help With Gui?

Asked by
Scootakip 299 Moderation Voter
9 years ago
01gmbox = game.StarterGui.TextGui.Frame.TextBox
02gm = game.Workspace.GMstat.Intermission
03 
04while true do
05while gm.Name == "Intermission" do
06    gmbox.Text = "Intermission"
07    wait()
08while gm.Name == "Game In Progress" do
09    gmbox.Text = "Game In Progress"
10    wait()
11end
12end
13wait()
14end

I have this script that's basically supposed to tell the player what's going on in the game, if there is an intermission or if the game is in session, but the problem is that for some reason the Gui only updates when the player dies. Can someone help me fix this issue?

1 answer

Log in to vote
1
Answered by 9 years ago

The problem is that you are stuck outside of the loop. You wont hit game in progress because once it changes out of intermission you don't have a way to check for if it says in game because the loop is inside of the first loop still checking for intermission.

I would do this instead, so it constantly checks for intermission, if not intermission then it checks if game in progress:

1while wait(1/45) do
2    if gm.Name == "Intermission" then
3        gmbox.Text = "Intermission"
4    elseif gm.Name == "Game In Progress" do
5        gmbox.Text = "Game In Progress"
6    end
7end
Ad

Answer this question