This is my script:
script.Parent.MouseButton1Click:Connect(function()
game.Players.LocalPlayer.Team = game.Teams["Class-D"]
game.Players.LocalPlayer.Character.Humanoid.Health = game.StarterGui.TeamSelector.Enabled = false
end)
I also have multiple other Gui buttons having the same Script but different team.

2 comments
Edit: Put code in a code block
Is there anything in the output? Click F9. Is your game Filtering Enabled?