How to build with a friend in roblox studio

It can be challenging to locate friends in-experience. The FriendsLocator developer module lets players easily find and teleport to their friends inside a place.

Uh oh! Your browser doesn't appear to support embedded videos! Here is a direct link to the video instead.

If you're using developer modules in your experiences and would like to help build the future of co-experience on Roblox, fill out this form to request access to a private DevForum category. You can also submit feedback here.

To use the FriendsLocator module in an experience:

  1. Visit the FriendsLocator marketplace page, click the green Get button, and confirm the transaction.
  2. In Studio, open the toolbox (ViewToolbox).
  3. Select your toolbox Inventory section.
How to build with a friend in roblox studio
  1. Locate the module item and click it or drag-and-drop it into the 3D view.
  2. In the Explorer window, move the entire FriendsLocator folder into ServerScriptService. Upon running the experience, the module will distribute itself to various services and begin running.
How to build with a friend in roblox studio

This and other developer modules come with an Install script that runs the installer and distributes the contents of the module to the same services that the folders are named after.

How to build with a friend in roblox studio

The Install script can be utilized as follows:

EnableLogging — Set to true to enable debug logging for the current developer module. This lets you see how the module gets distributed, along with how each package is linked.

InstallStarted — Fires when the installer first starts up. You can hook into this event to run any pre-install steps.

InstallFinished — Fires when the installer has finished installing the module. By this point, the contents of each service folder has been distributed. You can also hook into this event to run any post-install steps.

The source developer module (parent of the Install script) has Instance/Destroy|Destroy() run on it immediately after this event is fired.

Install() — Installs the given developer module by overlaying each of the service folders over existing services. For example, a folder named ReplicatedStorage containing a FriendsLocator script will be distributed to game.ReplicatedStorage.FriendsLocator when installing.


To test the module in Studio, the FriendsLocator module must be run in a multi-client simulation, since no friends will be present in a solo playtest.

  1. In StarterPlayerScripts, create a new LocalScript and rename it ConfigureFriendsLocator.
How to build with a friend in roblox studio
  1. Paste the following code into the new ConfigureFriendsLocator script. The setting on line 7 ensures that locators are shown for all users while testing in Studio, but not in a published place.

  1. From the Test tab, select the following combination for Clients and Servers.
How to build with a friend in roblox studio
  1. Click the Start button and three instances of Studio will open; one simulated server and two simulated clients.
How to build with a friend in roblox studio
  1. Go into either of the client Studio instances, move a distance of 100 studs away from the other character, and you should see a locator icon appear over its head.
How to build with a friend in roblox studio

Due to the way user IDs are handled in Studio, avatar images will not appear on the locator icons during testing.

By default, interacting with an icon will teleport your character to that friend's location. Currently, experiences using Workspace/StreamingEnabled|StreamingEnabled should implement custom content pre-streaming around the teleport location, although this behavior will be built into future versions of the module.

The FriendsLocator module exposes events so that you can introduce custom behaviors when users interact with a locator icon.

  1. Make sure that you’ve created the ConfigureFriendsLocator script outlined in Testing in Studio.
  2. Add the highlighted lines to the script:

  1. Conduct a multi-client test and click on another character’s locator icon. Notice that your character does not teleport to that location, and the event triggers to allow for custom handling of icon clicks.

If the default style does not fit your experience, you can replace the default avatar portrait UI with your own UI.

How to build with a friend in roblox studio

To replace the default UI:

  1. Create a new ScreenGui instance inside the StarterGui container.
How to build with a friend in roblox studio
  1. Create a Frame instance named FriendLocator as a child of the new ScreenGui.
How to build with a friend in roblox studio
  1. Design your custom UI by adding ImageLabel|ImageLabels, TextLabel|TextLabels, etc. to the FriendLocator frame.
How to build with a friend in roblox studio
  1. When finished, disable the parent ScreenGui so that the module doesn’t show the custom locator UI until needed.
How to build with a friend in roblox studio

If you want the friend’s avatar portrait and Player/DisplayName|DisplayName to show up somewhere in the custom UI, you can place the following instances inside the FriendLocator frame:

  • An ImageLabel of the name Portrait.
  • A TextLabel of the name DisplayName.
How to build with a friend in roblox studio

The module will look for these items and display the friend’s avatar portrait and/or display name respectively.

void configure ( table config )

Overrides the default configurations with the given values.

Key Default Description
alwaysOnTop true If true, shows locator icons on top of everything, preventing them from being blocked by 3D world objects.
showAllPlayers false If true, shows locations for all players, not just friends. Setting this to true can help verify the module's functionality in Studio.
teleportToFriend true Teleports player character to the friend's location when their locator icon is clicked or tapped.
thresholdDistance 100 Camera distance threshold at which locator icons appear; friends closer than this distance will not display icons.
maxLocators 10 Maximum number of locator icons shown at any given time.

RBXScriptConnection clicked ( Player player, CFrame playerCFrame )

Fires when a locator icon is clicked/activated by the local player.

Parameter Description
player Player object that the locator icon belongs to.
playerCFrame datatype/CFrame of the player's Humanoid/RootPart that the locator icon belongs to.

Fires when a locator icon is shown/hidden on the local player’s screen.

Parameter Description
player Player object that the locator icon belongs to.
playerCFrame datatype/CFrame of the player's Humanoid/RootPart that the locator icon belongs to.
isVisible Whether the locator icon is currently visible on the local player's screen. Note that this will still be true if alwaysOnTop is false and the locator renders behind an object in the 3D world.