← all posts

Roblox Player:IsFriendsWith() Explained — Limits, Bugs, and Alternatives

If you're writing a Roblox game and you want to check whether two players are Roblox friends, the obvious choice is Player:IsFriendsWith(). It's been part of the Roblox API since the platform's early days. It also has a longer-than-you'd-expect list of caveats — it only works on currently-online players, has had multi-year reliability bugs, and can't be used for the things developers usually actually want to do. Here's the full breakdown, with sources.
Short answer
Player:IsFriendsWith(userId) returns true/false for whether a Player instance is friends with another user. Limit: it only works on currently-online players in your server — you can't check friendship between two arbitrary user IDs. For that, use the FriendPath API or Players:GetFriendsAsync().

What the function does (and the signature)

From the official Roblox documentation:

Player:IsFriendsWith(userId: number): boolean

The method is called on a Player instance representing someone currently in the server, and it takes the numeric user ID of another Roblox account. It returns true if the two are Roblox friends, false if not. Example use:

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
    local ownerId = 156  -- Builderman, for example
    if player:IsFriendsWith(ownerId) then
        print(player.Name .. " is friends with the place owner")
    end
end)

The biggest catch: it needs a Player instance

The method is defined on Player, which means you must have an instance of a player currently in your server. You can't call IsFriendsWith() for two arbitrary user IDs where neither is in the game. As one developer put it on the DevForum thread "Checking if two players are friends without a Player instance", this is a hard limitation of the API.

This rules out a whole class of use cases:

Known bug history

The function has had several reliability issues over the years that are still discussed on the DevForum:

None of these are formally deprecated — Roblox still ships the function — but the reliability is genuinely uneven, and many developers have moved to other approaches.

What you can use instead

1. Player:GetFriendsOnlineAsync()

For the "who's online and a friend" use case, GetFriendsOnlineAsync returns a list of currently-online friends. More reliable than IsFriendsWith for online-friend lookups. Important caveat: Roblox announced in early 2025 that the IsOnline property is being deprecated as part of broader Friends API restructuring.

2. Players:GetFriendsAsync(userId)

Returns a paginated list of all a user's friends, not just online ones. Works regardless of whether the player is in your server. This is the closest in-Lua equivalent to what you can do via the Roblox friends HTTP API.

3. HttpService:RequestAsync() against the FriendPath Scan API

For anything more complex than "is X friends with Y" — like "are these two arbitrary users connected within 3 hops" or "how many degrees of separation between them" — you almost certainly want to hit the FriendPath Scan API. It requires an API key (issued to arbastro Suite subscribers) but exposes the full bidirectional-BFS lookup as a single HTTP call:

local HttpService = game:GetService("HttpService")
local response = HttpService:RequestAsync({
    Url = "https://arbastro.com/api/v1/friendpath/path?from=Builderman&to=david.baszucki",
    Method = "GET",
    Headers = {
        ["Authorization"] = "Bearer ak_live_YOUR_KEY",
    },
})
local data = HttpService:JSONDecode(response.Body)
print(string.format("%d degrees of separation", data.result.degrees))

This handles bidirectional BFS, proxy rotation, UK-account detection, and rate-limit handling on the server side. Get an API key from your arbastro account API keys page (requires Suite; 50 free Scan calls/day + $0.005/call beyond). Full reference at friendpath.arbastro.com/docs.

When IsFriendsWith is still fine

For a simple "is this player who just joined my server a friend of the owner" check, IsFriendsWith() still works and is dead-simple. It's only when you start trying to extend it beyond its single-server-online-players design that you run into walls. Use it for what it's good at, and use the FriendPath API or GetFriendsAsync for everything else.

Note on the 2024-2025 Friend API changes

Roblox made significant changes to the Friends API in late 2024 and 2025, including raising the friend limit from 200 to 1,000 and renaming "friends" to "connections" in the UI. If you're maintaining old code, make sure your test cases cover the higher friend counts — some game implementations assumed the 200 cap and have edge-case bugs at 250+.

Use the FriendPath API in your game

Friend-path lookups in one HTTP call, no Player-instance requirement.

Read the API docs →

Quick FAQ

What is FriendPath?

FriendPath is a free web tool that finds the shortest chain of friends between any two Roblox accounts using bidirectional breadth-first search over Roblox's public friends API. Runs in your browser, no install, no Roblox login required.

What does "degrees of separation" mean on Roblox?

It's the number of friend links between two accounts. If you're friends with someone who's friends with David Baszucki, you are 2 degrees of separation from David Baszucki. Most active Roblox players are within 3–5 hops of any famous account.

Is FriendPath free?

Yes. The web tool at friendpath.arbastro.com is 100% free, ad-supported. The public API offers 50 free calls per day with paid tiers beyond. See the API docs for details.

Does FriendPath work with banned or terminated accounts?

Yes — Roblox's friends API still returns friend lists for banned/terminated accounts, so FriendPath can traverse through them. The path is computed on the public friend graph, not on a player's active session.