Scenarios Upon Using ReplicatedFirst?

The question is as the title suggests. What are you supposed to store in repfirst other than loading screens. Can I store server scripts and local scripts there? And does whatever inside there replicated to server and clients or only clients?
Thank You! :grinning:

1 Like

if i am correct replicatedfirst only replicates all content to all clients (but not back to the server).
Replicatedfirst is used for mostly localscripts. Once you join a game the content within the container will load and replicate to the client before all other scripts run.

I would recommend reading this post: ReplicatedFirst | Documentation - Roblox Creator Hub

3 Likes

As the name suggests, ReplicatedFirst is anything you want replicated to the client first (before anything else).

Really, it’s only useful for creating a custom loading screen and preloading content that users will see immediately on joining the game.

Anything you don’t need replicated when a player immediately joins should be stored in ReplicatedStorage.

6 Likes

So, is it good practice to put local scripts in there or somewhere else?

1 Like

It depends on context. If your LocalScript is purely preloading content and/or displaying a default loading screen, go for it.

Usually other types of LocalScript will go into one of following:

  • ReplicatedStorage (any)
  • StarterGui (UI)
  • StarterPack (tools)
  • StarterPlayerScripts (any)
  • StarterCharacterScripts (any)

But again, it wholly depends on what the function of the script is. As for server scripts, they should run exclusively inside ServerScriptService (unless you have a specific use-case for running them elsewhere).

2 Likes

Also to add on, StarterPlayerScripts can only store module scripts and local scripts. It replicates to the player in game.Players.PlayerName. And StarterCharacterScripts can store local scripts and local scripts and repliates to the game.Workspace.PlayerName

2 Likes

Pretty much, yes. I believe the StarterPlayerScripts are cloned into game.Players.PlayerName.PlayerScripts.

2 Likes

The big thing is that Local Scripts can not just be stored in Replicated First; they can run in Replicated First. Remember that Local Scripts can otherwise only run when parented to the client.