We use cookies on this site to enhance your user experience

ReplicatedStorage

ReplicatedStorage

A container whose contents are replicated to all connected clients. Objects descending from ReplicatedStorage can be accessed from Scripts and LocalScripts on both the server and client.

Complex games often require a range of assets that are to be held in storage until they are required. ReplicatedStorage allows such objects to be stored until they are required. ReplicatedStorage is also an ideal location for RemoteFunctions and RemoteEvents as they can be found on both the client and server.

Objects can be replicated to the client, by parenting them to ReplicatedStorage.

object.Parent = game:GetService("ReplicatedStorage") -- from the server

Although the client can access and modify ReplicatedStorage, provided Experimental Mode is disabled these changes will not replicate to the server or other clients.

Scripts and LocalScripts will not run when they are parented to ReplicatedStorage, although ModuleScripts contained within it can be accessed and ran. There are a number of alternative containers where client side scripts will be ran, such as StarterPlayerScripts and ReplicatedFirst.

For objects that only the server requires access to, developers are recommended to use ServerStorage to save network traffic.

Developers are advised not to use Lighting as a storage container. Although historically some developers used it for this purpose prior to ReplicatedStorage being introduced, its use as a container is not supported by Roblox.