#How to print the number of players on a team?

7 messages · Page 1 of 1 (latest)

modest viper
#
    local count = 0
    
    for _, player in pairs(game.Players:GetPlayers()) do
        local boolvalue = player.PlayerGui:FindFirstChild("teamboolvalue")
        
        if boolvalue and boolvalue:IsA("boolvalue") then
            count = count + 1
        end
    end
    
    return count
end


local teamcount = TeamCount()
print(teamCount)```
split quest
#

yes but I want it to constantly update for every player join

split quest
#

ok

modest viper
#
game.Players.PlayerAdded:Connect(function()

end)```
split quest
#

thank you I’ll try it rn

#

OH MY GOD IT WORKED I THINK