RemoteEvent only firing once

So I have been making a script where a gui hides until main menu is over and the player enters intermission for a round based system game (The GUI will also hide when the round starts). Well, once someone wins the game and returns to intermission, the remote events I put in the code won’t run again for some reason. It only works when the player first enters intermission after main menu is over and I do not know why this is happening, can someone please help me? It will be great if you are willingly to stop by to help me.

Here’s my part of the code:

if you need anymore code feel free to ask me!

Try removing that if statement where it checks the team, I think its useless because you’re literally assigning the team the line before and maybe something from the ES and SS remotes could be causing the problem (i got this on the top of my i doubt what i said works)

i just tried what you recommended for me to do but still no success.

here are more photos of my code if you need them:

mistake2
picture of the remote event receiving the FireAllClients

mistake3
picture of RemoteEvent sending message to all clients to make the gui invisble

can you send/ copy paste the text on the image please? i want to try something

okay one second be right back (30 letter)

do you mean all of the code or just the 2 image i just sent you

all, no need to send anything else just that one script

game.ReplicatedStorage.ChangeTeam.OnServerEvent:Connect(function()
	for i, v in pairs(Players:GetChildren()) do
		if v:IsA("Player") then
			v.Team = game.Teams["Not Playing"]
			ES:FireAllClients()
			SS:FireAllClients()
		end
	end
end)

SS.OnClientEvent:Connect(function()

button.Visible = true

end)

SH.OnClientEvent:Connect(function()

button.Visible = false

end)

for i, player in pairs(plrs) do 
	player.Team = game.Teams.Playing
	EH:FireAllClients()
	SH:FireAllClients()

You have an unnecessary conditional for checking the team.

Also, that’s gonna fire for all players multiple times, why not use one big server script to do it?

Yeah that was what I was saying

The thing I was trying to do didnt work so I just removed the condition and changed the Children to Players so it doesnt get any other object other than a player

game.ReplicatedStorage.ChangeTeam.OnServerEvent:Connect(function()
	for i, player in pairs(game:GetService("Players"):GetPlayers()) do
		player.Team = game.Teams["Not Playing"]
		ES:FireAllClients()
		SS:FireAllClients()
	end
end)

idk man im a new scripter thats all

Its a loop idk whats wrong it seems fine it shouldnt be firing once

That’s gonna fire all clients multiple times.
Put your events outside the for loop instead:

for i, player in pairs(plrs) do 
	player.Team = game.Teams.Playing
end
EH:FireAllClients()
SH:FireAllClients()

I think he WANTS them to run multiple times?

that seems like a sensible thing to do, be right back I’m checking if it works

idk really, I’m just going to test if it works or not

That would be strange, since that’d probably be the initialization multiple times, or something.