How can I make a gui that reads the number of people on a team?

Hello, I was wondering how I could fix my GUI that reads teams, well here is my code.

script.Parent.MouseButton1Click:Connect(function()
	game.Players.LocalPlayer.Team = game.Teams.RedTeam
end)

local NumberOfPlayers = 0

script.Parent.MouseButton1Click:Connect(function()

	NumberOfPlayers = NumberOfPlayers + 1
	script.Parent.Text = NumberOfPlayers
	script.Parent.Parent.Parent.Parent.Visible = false
end)
1 Like

Is this a local script? I think the NumberOfPlayers Variable should be changed on the server.

2 Likes