I saw that there was a NumPlayers property, but it seems to be deprecated.
local numPlayers = #game.Players:GetChildren() -- Or GetPlayers() whatever your preference is