Team Changer FE is not working?

Ok so I made a team change gui today and I want to know how to fix this because I am trying to make the team change gui fe but when I play the game and pick my team it doesn’t work.

LocalScript: (This isn’t the full script but it is where the problem is)

  for i = 1, #selectableTeams do
    local column = math.floor(i / buttonsPerColumn)
      local button ="TextButton", selectionFrame)
      button.Visible = true
      button.Position = teamButtonOffset +, column * teamButtonXIncrement, 0, (i - column * buttonsPerColumn) * teamButtonYIncrement)
      if column == 0 then
        button.Position = button.Position -, 0, 0, teamButtonYIncrement)
      button.Size =, teamButtonSize.X, 0, teamButtonSize.Y)
      button.BackgroundTransparency = 1
      button.Text = selectableTeams[i]
      button.FontSize = Enum.FontSize.Size14
      button.TextXAlignment = "Left"
      button.TextColor3 =, 1, 1)
      local label ="TextLabel", button)
      label.Size =, 4, 1, 0)
      label.Position =, -8, 0, 0)
      label.Text = ""
      label.BackgroundColor3 =, 1, 1)
      label.BorderSizePixel = 0
      if Game:findFirstChild("Teams") then
        local team = Game.Teams:findFirstChild(selectableTeams[i])
          if team then
              label.BackgroundColor3 = Game.Teams:findFirstChild(selectableTeams[i]).TeamColor.Color
	if not confirmed then				
	  workspace.TeamEvents.TeamEvent:FireServer(player,team) -- The problem is here!!!			
	 --  player.TeamColor = team.TeamColor -- If I uncomment this then it will work but its not fe
      confirmed = true

Server Script that makes it FE:

        player.TeamColor = team.TeamColor

I don’t get why this isn’t working. I looked everywhere and I still cannot find the problem thats cuasing it.

Hello Sp00ked1,

Can you give me the error message?

There is no error message when I click the team it kills me (ingame) but it doesn’t change my team.

Try to replicate the team color and not the team.

FireServer(plr, TeamColor)
OnServerEvent:Connect(fnc(plr, color)
plr.TeamColor =

Nope not working doesn’t give an error and nothing happens.

It’s okay now because I fixed it.

This is what I did:



Its because I put player at the start and then it seemed to work.