This is an example I created, also you dont need to create an account to use roproxy as far as I am aware because I dont have one.
local url = "https://friends.RoProxy.com/v1/users/1/followers/count"
local httpservice = game:GetService("HttpService")
local gettable = httpservice:GetAsync(url)
local decodedtable = httpservice:JSONDecode(gettable)
for i, v in pairs(decodedtable) do
print(i, v)
end
In the url we are making a url with the userId of a player, in this case I have the number 1 which is the userId of Roblox which has aproxx 8M followers right now.
In the second line we are just referring to the game’s service, while on the thrid like we are getting the url. In simple terms what the third line is doing is just copying the url that we give it and copy pastes it into the search bar and brings us back the result. On the fourth line because most websites return the values in JSON we need to decode it into a normal lua table which we are then accessing from a loop.
In the above place where it wars Request URL, just before the word followers you can see a number which is the userId, which in this case is 1 for ROBLOX. And the response that we get is below that which you can use.
okay but how do i get the name of every indiviual player and not just a number count. they already have built in functions for the count i just need every individual players name for my game
this is exactly what i want. just a table off all the names of the followers. iv seen other games do this as well i just dont know what roblox was smoking when they made this as a resource for devs
This is a basic example of how to do this. This example is not the best because it is slow.
local HttpService = game:GetService("HttpService");
function getFollowersForUserId(userId, cursor)
local followers = {};
local url = ("https://friends.roproxy.com/v1/users/%s/followers?limit=100"):format(tostring(userId));
if(typeof(cursor) == "string") then
url = ("%s&cursor=%s"):format(url, cursor);
end
local success, output = pcall(function() return HttpService:JSONDecode(HttpService:GetAsync(url)) end);
if not (success) then
return followers;
end
for _, v in pairs(output.data) do
table.insert(followers, {
name = v.name;
displayName = v.displayName;
userId = v.id;
});
end
if(output.nextPageCursor) then
local nextFollowers = getFollowersForUserId(userId, output.nextPageCursor);
for _, v in pairs(nextFollowers) do
table.insert(followers, v);
end
end
return followers;
end
--// With over 2,000 followers, it may take more than 23 seconds
local start = os.time();
warn("Followers:", getFollowersForUserId(2465383470));
warn("Process took", (os.time() - start), "seconds");
You must enable the “Allow HTTP requests” option in "Game Settings > Security"
wait(4)
local url = "https://friends.RoProxy.com/v1/users/"..game.Players:FindFirstChildOfClass("Player").UserId .."/followers"
local httpservice = game:GetService("HttpService")
local gettable = httpservice:GetAsync(url)
local decodedtable = httpservice:JSONDecode(gettable)
for i, v in pairs(decodedtable) do
print(i, v)
end
okay i got it so yours is better then since mine sucks even though mine is by roblox (im suprised roblox made it if it only even gets the first page lol)