I’m trying to make a friends list gui for my game but I can’t figure out how to use GetFriendsAsync(), i’ve looked on other threads but i cant seem to figure it out
For the gui I’m wanting, the friend UserId, DisplayName and Username
script: (LocalScript)
local success, result = pcall(Player.GetFriendsOnline, Player, 10)
while wait(2.5) do
if success then
for _, friend in pairs(result) do
print(friend.Name)
local Clone = AllFriendsListTEMPLATE:Clone()
Clone.Parent = AllFriendsList
Clone.Name = Player.Name.."FRIEND"..friend.Name -- Line with error
Clone.DisplayName.Text = friend.DisplayName
Clone.UsernameTitle.Text = friend.Name.."#"..friend.UserId
end
else
warn("Failed to get online players: " .. result)
end
end
I took the code from Player | Documentation - Roblox Creator Hub
Error:
attempt to concatenate string with nil
All help is appreciated