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

Making GUIs to be the same for everyone?

Asked by
nilVector 812 Moderation Voter
9 years ago

I'm trying to have rounds in my game, but the problem is with the GUIs. They don't stay consistent for all the players. Let me show you the code first (it's a regular script, not a LocalScript).

sp = script.Parent

if game.Players.NumPlayers < 2 then
    sp.Text = "Waiting for there to be at least 2 players..."
else
    sp.Text = "There are enough players"
    wait(5)
    sp.Text = "The Round Is In Progress"
    wait(300) --5 Minutes
    sp.Text = sp.Text = "Round over"
    wait(30)
end

The problem is that when a player dies in the middle of it saying "The Round Is In Progress" and respawns, the GUI starts all over from the beginning by saying "There are enough players"

How do I make it consistent throughout all the players so that the GUI stays the same for all?

1 answer

Log in to vote
2
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
9 years ago

There are a few options. The gist is to have one centralized way of determining what the text is, and for all GUIs to use that centralized decision (rather than do all the work figuring out what it is over time)


The simplest way to implement that is to use the above code, but store the result to a StringValue, in, for example, the Workspace.

Each GUI, then, rather than doing the thinking itself, just copies the text to the GUI from that StringValue.

0
Thank you very much! By the way, I love your Portal re-make! Keep up the good work! nilVector 812 — 9y
Ad

Answer this question