PLAYER LIST
First, we’ll have to create a starter gui, to store our player list.
We’ll then create the essentials:
• A scrolling frame
• A local script (place in screen gui)
• A text label for where the players name is displayed (place in local script)
• A UiListLayout (place in scrolling frame)
Finally we’ll start scripting.
First, we have to remove the original roblox player list:
game:GetService(“StarterGui”):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
We then create a local function for updating the player list.
game:GetService(“StarterGui”):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
local function updatePlayerList()
Now in the function, we create a for loop so every player is inside of the player list.
game:GetService(“StarterGui”):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
local function updatePlayerList()
for i, plr in pairs(game.Players:GetPlayers()) do
Now the for loop will run for every player in the server.
Next up we’ll clone the TextLabel, place it inside of the scrolling frame, and finally change the text to the players name.
game:GetService(“StarterGui”):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
local function updatePlayerList()
for i, plr in pairs(game.Players:GetPlayers()) do
local item = script.PlayerNameDisplay:Clone()
item.Parent = script.Parent.ScrollingFrame
item.Text = plr.Name
end
end
And to end it off, we’ll run the function everytime a player is added and removed
game:GetService(“StarterGui”):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
local function reload()
for i, plr in pairs(game.Players:GetPlayers()) do
local item = script.Item:Clone()
item.Parent = script.Parent.ScrollingFrame.Content
item.Text = plr.Name.lower(plr.Name)
end
end
game.Players.PlayerAdded:Connect(reload)
game.Players.PlayerRemoving:Connect(reload)