InGame Admin Count Help

Hi! For my admin panel I am adding a feature where you can see how many admins are in a game. I know I have to account for

game.Players.PlayerAdded & game.Players.PlayerRemoving

anyways, I have no idea how to make it. If anyone can help that would be great. :slight_smile:

You can simply have a table of admins and check when a player joins if they are a part of the table.

local Admins = {3255235235, 124312042, 2144124214} -- UserIds
local currentAdmins = 0

Players.PlayerAdded:Connect(function(player)
   if table.find(Admins, player.UserId) then
      currentAdmins += 1
   end
end)

Player.PlayerRemoving:Connect(function(player)
   if table.find(Admins, player.UserId) then
      currentAdmins -= 1
   end
end

Alright, thank you!

character limit

Hey! I was away when I asked about this, anyways I just tried it and it didn’t work.

I did exactly what you did but used a table from a Module Script I know how to connect them and added a bit that goes like

script.Parent.Text = currentAdmins