do
local Enumeration = Enum
local Game = game
local Players = Game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local FriendsGui = Instance.new("ScreenGui")
FriendsGui.Name = "FriendsGui"
FriendsGui.ResetOnSpawn = false
local FriendsFrame = Instance.new("Frame")
FriendsFrame.Name = "FriendsFrame"
FriendsFrame.BackgroundTransparency = 1
FriendsFrame.Position = UDim2.new(0.35, 0, 0.5, 0)
FriendsFrame.Size = UDim2.new(0, 600, 0, 350)
FriendsFrame.Parent = FriendsGui
local BackgroundImageLabel = Instance.new("ImageLabel")
BackgroundImageLabel.Name = "BackgroundImageLabel"
BackgroundImageLabel.BackgroundTransparency = 1
BackgroundImageLabel.Image = "rbxasset://textures/ui/PlayerList/NewAvatarBackground@3x.png"
BackgroundImageLabel.Size = UDim2.new(1, 0, 1, 0)
BackgroundImageLabel.Parent = FriendsFrame
local FriendsTextLabel = Instance.new("TextLabel")
FriendsTextLabel.Name = "FriendsTextLabel"
FriendsTextLabel.Font = Enumeration.Font.LuckiestGuy
FriendsTextLabel.Position = UDim2.new(0.5, 0, 0, 40)
FriendsTextLabel.Size = UDim2.new(0, 0, 0, 0)
FriendsTextLabel.Text = "Friends"
FriendsTextLabel.TextColor3 = Color3.new(1, 1, 1)
FriendsTextLabel.TextSize = 40
FriendsTextLabel.Parent = FriendsFrame
local FriendsGridFrame = Instance.new("ScrollingFrame")
FriendsGridFrame.Name = "FriendsGridFrame"
FriendsGridFrame.AutomaticCanvasSize = "Y"
FriendsGridFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
FriendsGridFrame.BackgroundTransparency = 1
FriendsGridFrame.Position = UDim2.new(0, 0, 0, 60)
FriendsGridFrame.Size = UDim2.new(1, 0, 1, -60)
FriendsGridFrame.Parent = FriendsFrame
local UIGridLayout = Instance.new("UIGridLayout")
UIGridLayout.CellPadding = UDim2.new(0, 0, 0, 0)
UIGridLayout.CellSize = UDim2.new(0, 200, 0, 125)
UIGridLayout.HorizontalAlignment = Enumeration.HorizontalAlignment.Center
UIGridLayout.Parent = FriendsGridFrame
local Success, Result = pcall(Players.GetFriendsAsync, Players, 261)
if not Success then warn(Result) return end
while true do
local Page = Result:GetCurrentPage()
for _, Item in ipairs(Page) do
local FriendFrame = Instance.new("Frame")
FriendFrame.Name = "FriendFrame"
FriendFrame.BackgroundTransparency = 1
FriendFrame.Parent = FriendsGridFrame
local FriendImageLabel = Instance.new("ImageLabel")
FriendImageLabel.BackgroundTransparency = 1
FriendImageLabel.Position = UDim2.new(0, 50, 0, 0)
FriendImageLabel.Image = "rbxthumb://type=Avatar&w=150&h=150&id="..Item.Id
FriendImageLabel.Size = UDim2.new(0, 100, 0, 100)
FriendImageLabel.Parent = FriendFrame
local FriendTextLabel = Instance.new("TextLabel")
FriendTextLabel.Name = "FriendTextLabel"
FriendTextLabel.Font = Enumeration.Font.LuckiestGuy
FriendTextLabel.Position = UDim2.new(0.5, 0, 0, 115)
FriendTextLabel.Size = UDim2.new(0, 0, 0, 0)
FriendTextLabel.Text = Item.Username
FriendTextLabel.TextColor3 = Color3.new(1, 1, 1)
FriendTextLabel.TextSize = 20
FriendTextLabel.Parent = FriendFrame
end
if Result.IsFinished then
break
else
Result:AdvanceToNextPageAsync()
end
end
local PlayerGui = LocalPlayer:FindFirstChildOfClass("PlayerGui") or LocalPlayer:WaitForChild("PlayerGui", 10)
if not PlayerGui then return end
FriendsGui.Parent = PlayerGui
end
I quickly whipped this up, should be fairly easy to make modifications to it.
local Success, Result = pcall(Players.GetFriendsAsync, Players, 261)
Change this line to.
`local Success, Result = pcall(Players.GetFriendsAsync, Players, LocalPlayer.UserId)`
I used Shedletsky’s user ID for the purpose of testing.