So I’m trying to make a hunger games-style player count that checks for the number of players in a team and changes a number on a GUI. So if a player joins the team or leaves the game/leaves the team, the number goes up or down instantaneously.
I’ve tried a few different scripts and this is the final one I was able to come up with, with my limited scripting knowledge, I’m very lost on how I’d change the text’s value inside a TextButton.
I’ve looked through some of the developer forums for similar questions but I’m finding solutions to round-based game player counts when I’m trying to make a player count for players inside a team.
local Players = game:GetService('Players') local Teams = game:GetService('Teams') local PlayerCount = game.StarterGUI.PlayerCount.Number game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(chr) if plr.Team == Teams.Player then PlayerCount.Text = +1 end end) end)