Help with updating a GUI across all clients

So; the issue with this script I am doing is that it detects a firing event across all clients. That would result in multiple maps spawning which I do not want to have happening. Do you guys know of any way I can get all the GUIs and update them from somewhere else?

Here’s the script.

local deb = true
    local v = #game.Players:GetPlayers()
    local inter = false
    local gamE = true

-- 30 seconds for intermission and 90 for map exist
while wait(1) do
	if v < 2 then
--wait for players
		script.Parent.Text = "Waiting for players..."
	elseif v >= 2 and (deb == true) and (inter == false) then 
		inter = true
		deb = false
			script.Parent.Text = "Intermission:"..script.Value.Value
			script.Value.Value = script.Value.Value -1
		script.Value.Value == 0 and inter == true
		inter = false
		gamE = true
-- choosing the map/ gametime
		script.Parent.Text = "Choosing map.."
		script.Value.Value = 90
			script.Parent.Text = "Game time:"..script.Value.Value
			script.Value.Value = script.Value.Value -1
		script.Value.Value == 0 and gamE == true
		gamE = false
		deb = true
-- end of script

Sorry about the spaghetti code; I’ve added some notes to help distinguish parts.

Well, I still haven’t found any way to do this. I mean does anyone know of any way to do it?

“Do you guys know of any way I can get all the GUIs and update them from somewhere else?”

you can access the player gui`s trough a server-sided script,

Players = game:GetService("Players")

for i,player in pairs(Players) do
	local gui = player.Playergui
	--code that you want to happen

just make sure there are no local scripts messing with that gui

1 Like

Thank you. I’ve been looking around other threads but found nothing to basically equate to what I needed for my game.