I want to make a player count that can show the players how many people are in a server in a place inside the game
Im unsure on how to create it and what how will it find the player count
I want to make a player count that can show the players how many people are in a server in a place inside the game
Im unsure on how to create it and what how will it find the player count
If you want to count the amount of players in the current server, you could use #Players:GetPlayers()
(Players:GetPlayers() returns array of players in the server and we count the amount of them using the # operator to get the length of the array)
Example:
local Players = game:GetService("Players")
local function updateLabel()
label.Text = "Players: " .. #Players:GetPlayers()
end
updateLabel()
Players.PlayerAdded:Connect(updateLabel)
Players.PlayerRemoving:Connect(updateLabel)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.