GUI not updating for all players

I have a menu team creation gui, it all works mostly except for a part that is meant to, when a button is clicked, remove a player from the team they are in, and update the gui so that they are no longer in the team on the screen. This all works, for all the players except for the player that clicks the button, they’re ui doesn’t update like the rest of the players and for that player, they still see themselves in that team in the gui. Anyone know why?

(this isn’t the full script, just the part that does this)

local function PlayerLeaveTeam(player)
	warn(player.Name .. " has left " .. player.Team.Name)
	local CurTeamUI = Menu:FindFirstChild(player.Team.Name)
	if CurTeamUI:FindFirstChild("Username 1").Text == player.Name then
		CurTeamUI:FindFirstChild("Username 1").Text = CurTeamUI:FindFirstChild("Username 2").Text
		CurTeamUI:FindFirstChild("Username 2").Text = CurTeamUI:FindFirstChild("Username 3").Text
		CurTeamUI:FindFirstChild("Username 3").Text = ""
	elseif CurTeamUI:FindFirstChild("Username 2").Text == player.Name then
		CurTeamUI:FindFirstChild("Username 2").Text = CurTeamUI:FindFirstChild("Username 3").Text
		CurTeamUI:FindFirstChild("Username 3").Text = ""
	elseif CurTeamUI:FindFirstChild("Username 3").Text == player.Name then
		CurTeamUI:FindFirstChild("Username 3").Text = ""
	end
	if CurTeamUI:FindFirstChild("Username 1").Text == "" then
		CurTeamUI.Visible = false
end
	player.Team = game.Teams:FindFirstChild("Hunters")	
end
PLT.OnServerEvent:Connect(PlayerLeaveTeam)

Are you sure it works for all players except the one who clicked it?
In this code I see, that server is listening for remote event, and then proceeds to change UI.
UI cannot be changed on server. Why is that? The UI is duplicated for every new player in the game, that means every player has its own UI. You have to send a remote event to every player that a player left such team so they have to update their UI. It’s very logical, since every player in every game needs their own unique UI because they have their own amount of money, etc… So Roblox never bothered replicating UI changes from server to clients.

Simple solution for this would be making another remote event which will be fired from server to all clients forcing them to run your update function.

From what I’ve seen yeah it changes for all players but the one who clicked, I had my friends test it with me, one of us creates a team, the new team ui appears for everyone else and if they delete that team, it deletes for us but remains for them. Been trying to get this whole team ui thing to work for 2 days now, making everything appear the same for all players has confused me so much.

Honestly, Maybe that isn’t even the problem, I think I just completely screwed up my script and it’s filled with endless bugs.