How do I find if a player follows another player?

How would I find out if a player in my game currently follows another player? (I don’t mean follow as in joining another friend, I mean like following people on the app / website)

I’ve tried searching but I don’t understand anything, some sample code would be helpful.

3 Likes

You can use Proxy like RoProxy to access Roblox API’s. https://followings.roblox.com/

1 Like

How would this look like in code?

1 Like
local http = game:GetService("HttpService")
local players = game:GetService("Players")

players.PlayerAdded:Connect(function(player)
 local result = http:GetAsync("https://friends.roproxy.com/v1/users/"..player.UserId.."/followings")
 local json = http:JSONDecode(result)
 print(json)
end)

it should work i guess

2 Likes

I get the error: HttpError: SslConnectFail

1 Like

It works⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

I used it but it gave me the error; I always get that error when using RoProxy, are there any alternatives?

Test this in CommandBar, paste it and hit enter as it is, it should print the players you follow:

local http = game:GetService("HttpService")

local result = http:GetAsync("https://friends.roproxy.com/v1/users/3542146575/followings")
local json = http:JSONDecode(result)
warn(json)

OUTPUT:

{
	["data"] = {
		[1] = {
			["created"] = "0001-01-01T05:51:00Z",
			["displayName"] = "xer0",
			["friendFrequentRank"] = 201,
			["friendFrequentScore"] = 0,
			["hasVerifiedBadge"] = false,
			["id"] = 524972567,
			["isBanned"] = false,
			["isDeleted"] = false,
			["name"] = "cyrsiing"
		},
		[2] = {
			["created"] = "0001-01-01T05:51:00Z",
			["displayName"] = "dz_aymanito",
			["friendFrequentRank"] = 201,
			["friendFrequentScore"] = 0,
			["hasVerifiedBadge"] = false,
			["id"] = 1317234761,
			["isBanned"] = false,
			["isDeleted"] = false,
			["name"] = "dz_aymanito"
		},
		[3] = {
			["created"] = "0001-01-01T05:51:00Z",
			["displayName"] = "Mysterious_Traveler",
			["friendFrequentRank"] = 201,
			["friendFrequentScore"] = 0,
			["hasVerifiedBadge"] = false,
			["id"] = 991275194,
			["isBanned"] = false,
			["isDeleted"] = false,
			["name"] = "nasko_12"
		},
		[4] = {
			["created"] = "0001-01-01T05:51:00Z",
			["displayName"] = "d3r",
			["friendFrequentRank"] = 201,
			["friendFrequentScore"] = 0,
			["hasVerifiedBadge"] = false,
			["id"] = 5070197615,
			["isBanned"] = false,
			["isDeleted"] = false,
			["name"] = "d3rd3rd3r"
		},
		[5] = {
			["created"] = "0001-01-01T05:51:00Z",
			["displayName"] = "beezy",
			["friendFrequentRank"] = 201,
			["friendFrequentScore"] = 0,
			["hasVerifiedBadge"] = false,
			["id"] = 5159649988,
			["isBanned"] = false,
			["isDeleted"] = false,
			["name"] = "beezyjrr"
		},
		[6] = {
			["created"] = "0001-01-01T05:51:00Z",
			["displayName"] = "BetterKeepReal",
			["friendFrequentRank"] = 201,
			["friendFrequentScore"] = 0,
			["hasVerifiedBadge"] = false,
			["id"] = 1900717416,
			["isBanned"] = false,
			["isDeleted"] = false,
			["name"] = "ItsSimplyJayy"
		},
		[7] = {
			["created"] = "0001-01-01T05:51:00Z",
			["displayName"] = "leshawnas pad",
			["friendFrequentRank"] = 201,
			["friendFrequentScore"] = 0,
			["hasVerifiedBadge"] = false,
			["id"] = 4076113463,
			["isBanned"] = false,
			["isDeleted"] = false,
			["name"] = "ILovyna34"
		},
		[8] = {
			["created"] = "0001-01-01T05:51:00Z",
			["displayName"] = "Isaias",
			["friendFrequentRank"] = 201,
			["friendFrequentScore"] = 0,
			["hasVerifiedBadge"] = false,
			["id"] = 2238972746,
			["isBanned"] = false,
			["isDeleted"] = false,
			["name"] = "crislindo_2012"
		},
		[9] = {
			["created"] = "0001-01-01T05:51:00Z",
			["displayName"] = "Maya",
			["friendFrequentRank"] = 201,
			["friendFrequentScore"] = 0,
			["hasVerifiedBadge"] = false,
			["id"] = 1091512511,
			["isBanned"] = false,
			["isDeleted"] = false,
			["name"] = "lanieblane"
		},
		[10] = {
			["created"] = "0001-01-01T05:51:00Z",
			["displayName"] = "emvius",
			["friendFrequentRank"] = 201,
			["friendFrequentScore"] = 0,
			["hasVerifiedBadge"] = false,
			["id"] = 1132589110,
			["isBanned"] = false,
			["isDeleted"] = false,
			["name"] = "emvius"
		}
	},
	["nextPageCursor"] = "11556914528_1_2e87808a61ee7ceb5dd5416a25a16a41"
}

Try it, and show the Ouput even if its an error

2 Likes

image
I get this error whenever I’m using RoProxy. (I just got it again)

is your place published?
did you enabled Https request from the GameSettings on that place?

after checking that, test this code:

local http = game:GetService("HttpService")

local success, result = pcall(function()
    return http:GetAsync("https://friends.roproxy.com/v1/users/3542146575/followings")
end)

if success then
    local json = http:JSONDecode(result)
    warn(json)
else
    warn("HTTP request failed with error:", result)
end

same, from commandbar

image
Still, same error. I know this is an error with roproxy as before, when I was trying to send messages through a webhook roproxy had the same error, whereas when I used WebhookProxy, it worked.

local function get(url: string): string
	--you can add your retry-logic and error handling here
	return game.HttpService:GetAsync(url)
end

local function userFollowsUser(userId: number, targetId: number): boolean 
	local url = "https://friends.roproxy.com/v1/users/%d/followings?limit=100"
	local cursor = ""
	while cursor do
		local response = get(url:format(userId).."&cursor="..cursor)
		local data = game.HttpService:JSONDecode(response)
		for _, user in pairs(data.data) do
			if user.id == tonumber(targetId) then return true end
		end
		cursor = data.nextPageCursor 
	end
	return false 
end

local id1 = 1 --Roblox
local id2 = 156 --builderman

print(userFollowsUser(id1, id2)) --false, Roblox doesn't follow builderman
1 Like

image
Still the same error. (It’s RoProxy, it never works for me.)

It will work in-game. This is related to your network(perhaps a VPN you use, firewall, etc.) and should not replicate within an actual server. You can test the script in an actual game-server(not Roblox studio), for example a private place.

For clarity, when testing in studio the game server is your own PC, so the “server IP” is your own IP. That’s what is causing that error.

2 Likes

Are there any ways to test this without it being public? (EDIT: Team test works, thanks!)

Nyron is right, any code provided will work when not used directly from your pc, cause maybe there are some issues firewalls, vpn, country limits, things that doesnt allow you to test it from studio being your server.

Just keep the place in private, join your place in live servers in roblox, test it from there. You dont need to make it public, but probably you wont be able to test it in studio

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.