local http = game:GetService("HttpService") --Variable that holds a reference to the HTTP service. local id = 261 --This is the ID of the user. This can be found in the player under the UserId property. local friends = http:GetAsync("https://api.rprxy.xyz/users/" .. id .. "/friends",true) --We can use concatenation to add the id variable into the link. The true value is to make sure that old results aren't used if we've already requested from the link before (AKA caching). friends = http:JSONDecode(friends) --Decode the JSON array that's returned from the request so the script can read it. for i = 1,#friends do --Run this loop depending on how many entries there are in the table. print(friends[i]["Username"]) --Prints each username into the console. end
How would i properly get it to display the friends usernames and userIDs? What my ultimate goal is to get the usernames of all a user's friends, and then those friend's friends. I only want the userID so that it can fetch the usernames for the friends it originally got.