Results title for admin panel

Hi.

So i am trying to make a player count and i would like to make a feature such as (20) results show ( which is how many players are in the server. e.g. if theres 5 players the frame should say: (5) results.

I have tried using a int/num value to get this. Although if there’s another method to doing.

In JavaScript it’s .size which i am wondering if there is a method SIMILAR to that to gain the amount of frames.

Let me know any methods to getting so.

This should be able to change the number every second if the player joins or leaves.

Thanks in advance!

function GetPlayerCount()
   return #game.Players:GetPlayers() -- returns the number of players in the game currently
end

while wait() do
   object.Text = "("..GetPlayerCount()..") results." -- Note ('object') is non existent, just an example.
end

I will try this now. Hoping this should work!

Only use the function I gave you, the while loop I gave you was an implementation example.

Alright yeah i understand the last part. Thanks it works !!

Here’s a simple script I made for you that updates everytime a player leaves or join. :grinning_face_with_smiling_eyes:

local Players = game:GetService("Players")
local GetPlayers = Players:GetChildren() -- get players
local TextUi = script.Parent

TextUi.Text = "There are " .. #GetPlayers " players in this server".

Players.PlayerAdded:Connect(function()
 TextUi.Text = "There are " .. #GetPlayers " players in this server".
end

Players.PlayerRemoved:Connect(function()
 TextUi.Text = "There are " .. #GetPlayers " players in this server".
end

No problem! Let me know if you need anything else. Do you mind marking my answer as a solution?