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

Making GUIs to be the same for everyone?

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

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.

1 comment

0

Thank you very much! By the way, I love your Portal re-make! Keep up the good work!

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