🡺 How to get a players followers by userId?

This function returns a table

local followers = getFollowersForUserId(2465383470);
for i, v in pairs(followers) do
	warn(i, v.name);
end

does it have to be run on the server by the way?

Yes, it must be run on the server, as the client can’t run any HTTP requests (from HttpService)

SCRIPT

local HttpService = game:GetService("HttpService");
local remote = game.ReplicatedStorage.RemoteEvent
remote.OnServerEvent:Connect(function(plr, UserId)
	local followers = {};
	local url = ("https://friends.roproxy.com/v1/users/%s/followers?limit=100"):format(tostring(UserId))
	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
	return followers;
end)

LOCAL SCRIPT

local MyFollowers = remote:FireServer(game.Players.LocalPlayer.UserId)
print(MyFollowers) --nil

i have a remote event that returns the value of the table however its always nil.
i tried doing

repeat wait(0.1) until MyFollowers ~= nil

however it never stopped the loop
something to note is i editted the script a lot so that i could return the value. for example its not a function anymore and i delete the part inside the script that called itself

RemoteEvent is not a valid choice, you must use RemoteFunction

RemoteEvent is a one-way communication, which means RemoteEvent can't return any* data from the server to the client
RemoteFunction is a two-way communication, which means RemoteFunction can return any* data from the server to the client

1 Like

No? It’s a web proxy, not a website.

Again, if you’ve read what I’ve said before you’d know that you can use literally any proxy. If you don’t like one, use another.