#HttpService is your friend
You can use the HttpService to get all the friends the user has. Using the ROBLOX API, you can send a get request which returns the user's friends in a JSON format that can be decoded to be used in your code as a normal array.
Since you can't make HTTP requests to the roblox.com domain, you may use a proxy such as rprxy.xyz to make these HTTP requests.
Here's an example link that returns a list of Shedletsky's friends.
You can also find documentation for this API here.
To use this in a script, you have to enable the HttpEnabled property which can be found in the HttpService in the explorer menu.
From there, you will be able to make HTTP requests. Here's an example which prints all of Shedletsky's friends into the output window:
Be sure that you make HTTP requests in a server script instead of a local script, otherwise this will not work.
local http = game:GetService("HttpService")
local id = 261
local friends = http:GetAsync("https://api.rprxy.xyz/users/" .. id .. "/friends",true)
friends = http:JSONDecode(friends)
for i = 1,#friends do
print(friends[i]["Username"])
end
I hope my answer helped you.
EDIT: Fixed code and links to show that ROBLOX APIs can be accessed through a proxy.
2 comments
NOTE: Completely forgot ROBLOX blocks requests to their website, I'll edit my answer to reflect this.
i cant find httpservice in my friends list :(