local FriendFollowers = {}
for AFollower, PageNumber in HTTP:JSONDecode(HTTP:GetAsync("https://friends.roproxy.com/v1/users/"..(Players:GetUserIdFromNameAsync(Player.Name)).."/followers/")) do
table.insert(FriendFollowers, AFollower.Username)
print(AFollower.Username)
end
Have you bothered checking at all what the properties of “AFollower” is. If you check the contents then you can see how to interact with it. If nothing appears then that means the code isn’t running because your request returned nothing meaning you’re not using a valid/correct endpoint or the (assuming its public) proxy failed to handle the request.
for AFollower, PageNumber in HTTP:JSONDecode(HTTP:GetAsync("https://friends.roproxy.com/v1/users/"..(Players:GetUserIdFromNameAsync(Player.Name)).."/followers/")) do
-- Check which friends follow the player and which friends the player follows
local UpTo = 1
local FriendsFollowingPlayer = {}
local PlayerFollowingFriends = {}
local FollowingEachother = {}
while UpTo <= NumberOfFriends do
local CheckFriend = Friends[UpTo]
for FollowingUser, PageNumber in HTTP:JSONDecode(HTTP:GetAsync("https://friends.roproxy.com/v1/users/"..(Players:GetUserIdFromNameAsync(CheckFriend)).."/followers/")) do
if FollowingUser.name == Player.Name then
table.insert(PlayerFollowingFriends, CheckFriend)
return end
end
for AFollower, PageNumber in HTTP:JSONDecode(HTTP:GetAsync("https://friends.roproxy.com/v1/users/"..(Players:GetUserIdFromNameAsync(Player.Name)).."/followers/")) do
if AFollower.name == CheckFriend then
table.insert(FriendsFollowingPlayer, Player.Name)
return end
end
UpTo = UpTo + 1
wait()
end
What? Like this? for i, v in pairs (PageNumber in HTTP:JSONDecode(HTTP:GetAsync("https://friends.roproxy.com/v1/users/"..(Players:GetUserIdFromNameAsync(Player.Name)).."/followers/"))) do
local FriendFollowers = {}
myTable = game:GetService("HttpService"):GetAsync("https://friends.roproxy.com/v1/users/"..(game.Players:GetUserIdFromNameAsync("DevGr8M8")).."/followers")
myTable = game:GetService("HttpService"):JSONDecode(myTable)
for i,v in pairs(myTable["data"]) do
print(v["name"])
if v["displayname"] ~= nil then
print(v["displayname"])
end
print(v["id"])
end
adaption of your code would be
for AFollower, PageNumber in pairs HTTP:JSONDecode(HTTP:GetAsync("https://friends.roproxy.com/v1/users/"..(Players:GetUserIdFromNameAsync(Player.Name)).."/followers/"))["data"] do
if AFollower["name"] == CheckFriend then
table.insert(FriendsFollowingPlayer, AFollower["name"])
return end
end
end
in future if you want to be able to do other stuff like this check roblox endpoints and see how the response content is laid out e.g
below is correct and i HIGHLY don’t recommend doing this for followers as followers/following can be botted/6-7 digits making it take a absurd amount of time to function to its proper intent making is ultimately useless especially for people who have legitimate followings and are somewhat famous
This endpoint has a limit on how many followers it will display.
You need to make a table, add the followers of one page to the table, then keep making requests with the next page cursor that you get from the previous request. Once you do that, you’ll need to make a loop and check for what you’re wanting to check for, then you need to do the whole process again for the other user.
Overall, there’s no way to really do it efficiently. Unless you’re willing to make back-to-back requests and risk getting rate limited, I wouldn’t do it.
For example, if you do this on me, you’d have to make 7 back-to-back requests just to get all my followers. Then let’s assume the other person also has over 600 followers, you’d have to do 7 requests for them as well making it 14 requests you’re doing.
Thanks for the info. It’s just for a silly game which would scan a players friends and followers / following to determine who their closest Roblox friend would be, nothing needs to be perfect anyways - I’ve already added this as a warning
for PlayerFollowing, PageNumber in pairs (HTTP:JSONDecode(HTTP:GetAsync("https://friends.roproxy.com/v1/users/"..(Players:GetUserIdFromNameAsync(CheckFriend)).."/followers/"))["data"]) do
print(PlayerFollowing["name"])
if PlayerFollowing["name"] == Player.Name then
table.insert(PlayerFollowingFriends, CheckFriend)
return end
end
swap around playerfollowing and pagenumber whoops lol
for index, AFollower in pairs HTTP:JSONDecode(HTTP:GetAsync("https://friends.roproxy.com/v1/users/"..(Players:GetUserIdFromNameAsync(Player.Name)).."/followers/"))["data"] do
if AFollower["name"] == CheckFriend then
table.insert(FriendsFollowingPlayer, AFollower["name"])
return end
end
use this
read the comment area to see op’s usage example. based off skim reading this should handle rate limits by waiting the exact timelength until another request can be sent without getting denied (after being denied) dont know if that will skip a page or user as i haven’t ever used roblox endpoints. @OreoTec_h will probably mention something if there is an issue with it skipping