How to make custom guis in Roblox! (Part 1: Player List!)

PLAYER LIST

First, we’ll have to create a starter gui, to store our player list.
gui1
We’ll then create the essentials:

• A scrolling frame
14.06.2022_09.16.21_REC

• A local script (place in screen gui)
14.06.2022_09.17.36_REC

• A text label for where the players name is displayed (place in local script)
14.06.2022_09.18.23_REC

• A UiListLayout (place in scrolling frame)
14.06.2022_09.33.05_REC

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)

8 Likes