Updates

Roblox GetFriendsInServerAsync: New Friends List APIs Explained

Roblox added GetFriendsInServerAsync and GetFriendsInUniverseAsync. Learn what each one returns, privacy limits, and how to build a teleport-to-friend button.

Roblox GetFriendsInServerAsync: New Friends List APIs Explained
On this page
  1. What changed
  2. Get friends in the same server
  3. Find friends anywhere in your experience
  4. Build a teleport-to-friend button
  5. Why friends are missing from the results
  6. If it still doesn’t work
  7. Related guides
  8. Sources

Building an in-game friends list used to mean looping through every player and asking Roblox, one by one, whether they were friends with you. On November 23, 2026, Roblox released two Player methods that do this for you: GetFriendsInServerAsync and GetFriendsInUniverseAsync. This guide explains what each returns, the privacy rules that affect the results, and how to use them for a friend list or a teleport-to-friend button.

What changed

Roblox announced both methods as a full release on the DevForum, and they are listed under the Player class in the Engine API Reference. Both yield, so they behave like other Async calls and should be wrapped in pcall.

MethodCoversReturnsWhere to call it
GetFriendsInServerAsyncThe current server onlyArray of Player objectsShown on LocalPlayer in Roblox’s example
GetFriendsInUniverseAsyncAll places in your experienceArray of tables: User, PlaceId, GameIdOnly on Players.LocalPlayer
GetFriendsOnlineAsyncAnywhere on RobloxArray of tables with VisitorId, UserName, PlaceId, GameId and moreExisting API
Players:GetFriendsAsyncAll friends, online or offlinePaged resultsExisting API

The old methods aren’t going away. Roblox’s own FAQ says to keep using GetFriendsOnlineAsync when you need friends online anywhere on Roblox, and GetFriendsAsync when you need the full friends list. The new methods are shortcuts for the two most common in-game cases.

Get friends in the same server

GetFriendsInServerAsync replaces the classic pattern of calling Players:GetPlayers() and then IsFriendsWithAsync on each result. Because it returns real Player objects, you can read DisplayName, UserId, and Character straight away.

local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer

local ok, result = pcall(function()
	return localPlayer:GetFriendsInServerAsync()
end)

if not ok then
	warn("Could not load friends in this server:", result)
	return
end

if #result == 0 then
	print("No friends in this server right now")
end

for _, friend in result do
	print(friend.DisplayName, friend.UserId)
end

What each part does:

  • pcall catches a failed request so your script keeps running. If it fails, result holds the error message instead of a list.
  • #result == 0 is the “nobody here” case. Roblox says an empty array is a normal result, not an error.
  • The loop reads properties directly from each Player. From here you could fill a UI list or add a highlight to friend.Character.

Put this in a LocalScript (for example in StarterPlayerScripts). If you’re used to checking Players.LocalPlayer properties and getting nil errors, the guide on fixing “attempt to index nil with” covers the usual causes.

Find friends anywhere in your experience

GetFriendsInUniverseAsync looks across every place in your experience, including the current server. Friends who are playing a different game are not included. Each entry is a table with three fields:

  • User: the friend’s User object. Read User.Id for their user ID.
  • PlaceId: the place the friend is currently in.
  • GameId: the JobId of the friend’s current server, as a string. Despite the name, it is not the experience’s ID.
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer

local ok, result = pcall(function()
	return localPlayer:GetFriendsInUniverseAsync()
end)

if ok then
	for _, friend in result do
		local placeId = tonumber(friend.PlaceId)
		local sameServer = friend.GameId == game.JobId
		print(friend.User.Id, placeId, sameServer)
	end
end

The tonumber call is there because the sources disagree. The Creator Hub reference lists PlaceId as a number, while Roblox’s announcement says the engine currently returns it as a string. Converting it covers both. Comparing GameId with game.JobId tells you whether that friend is already in your server.

Build a teleport-to-friend button

The PlaceId and GameId from GetFriendsInUniverseAsync are exactly what a “join friend” button needs. Teleports must start on the server, because TeleportService:TeleportAsync can only be called from the server. So the client sends the target to the server through a RemoteEvent.

flowchart LR
  A["LocalScript: GetFriendsInUniverseAsync"] --> B["FireServer(placeId, jobId)"]
  B --> C["Server checks the values"]
  C --> D["TeleportAsync with ServerInstanceId"]

Create a RemoteEvent named JoinFriend in ReplicatedStorage, then add this Script to ServerScriptService:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TeleportService = game:GetService("TeleportService")

local joinFriend = ReplicatedStorage:WaitForChild("JoinFriend")

joinFriend.OnServerEvent:Connect(function(player, placeId, jobId)
	placeId = tonumber(placeId)
	if not placeId or typeof(jobId) ~= "string" then
		return
	end
	if jobId == game.JobId then
		return -- already in that server
	end

	local options = Instance.new("TeleportOptions")
	options.ServerInstanceId = jobId

	local ok, err = pcall(function()
		return TeleportService:TeleportAsync(placeId, { player }, options)
	end)
	if not ok then
		warn("Teleport to friend failed:", err)
	end
end)

On the client, your button just calls JoinFriend:FireServer(friend.PlaceId, friend.GameId) with an entry from the universe list.

How the server part works:

  • The server never trusts the client blindly. It converts placeId to a number and checks that jobId is a string before using them.
  • TeleportOptions.ServerInstanceId holds the JobId of the server to join. Roblox only allows one server-routing field per teleport, so don’t also set ReservedServerAccessCode or ShouldReserveServer on the same options.
  • TeleportAsync is wrapped in pcall because teleports can fail, for example if the friend’s server has filled up or shut down.

If you want to restrict teleports to your own places, compare placeId against a list of your experience’s place IDs before teleporting. If the event never reaches the server, see why a RemoteEvent isn’t firing. To try the teleport without publishing, Studio now supports testing teleports in playtests.

Why friends are missing from the results

Both methods respect privacy settings, so an empty or short list doesn’t always mean a bug:

  • Friends who set Online status or Show current game to No One are not returned by either method.
  • For Australian users under 16 who have set their developer friends list access to “No”, both methods return no friends. Roblox covers this in a separate announcement about friends list API access for those users.
  • An empty array is normal when no friends are in that server or experience.

If it still doesn’t work

  1. Error when calling on another player: GetFriendsInUniverseAsync must be called on Players.LocalPlayer. Move the call into a LocalScript.
  2. Method doesn’t exist: Update Roblox Studio and make sure you’re calling it on a Player, not the Players service. These are Player methods.
  3. Results look stale or empty in Studio: Solo playtests usually have only you in the server, so there are no friends to find. Test in a live server or with friends in a Team Test.
  4. Teleport fails: Check the Output for the TeleportAsync error, confirm the place belongs to your experience, and make sure only one routing field is set on TeleportOptions.

As always, test these snippets in Studio and in a live server before shipping. A small friends panel that hides itself when the call fails is a safe first step, and you can add the join button once that works.

Sources

Frequently asked questions

What does GetFriendsInServerAsync return?

It returns an array of Player objects for the player's friends who are in the same server. The player you call it on is not included, and an empty array simply means no friends are in that server.

What is the difference between GetFriendsInServerAsync and GetFriendsInUniverseAsync?

GetFriendsInServerAsync only covers the current server and gives you Player objects. GetFriendsInUniverseAsync covers every place in your experience and returns tables with the friend's User, PlaceId, and GameId (the server's JobId).

Can I call GetFriendsInUniverseAsync from a server script?

Not for an arbitrary player. Roblox's announcement says it must be called on Players.LocalPlayer and that calling it on any other player causes an error, so it belongs in a LocalScript.

Why are some of my friends missing from the results?

Friends who set Online status or Show current game to No One are not returned. Roblox also returns no friends for Australian users under 16 who have turned off developer access to their friends list.

Is PlaceId a number or a string?

The Creator Hub reference lists it as a number, but Roblox's announcement says the engine currently returns it as a string. Wrapping it in tonumber() handles both cases.

Related guides