ReplicatedStorage
Shared storage that the server and every player can see: remotes, shared values and templates.
- Inherits: Service → Instance
- Creatable: No. It’s created with the game; use
ReplicatedStorage(import { ReplicatedStorage } from '@rally/sdk'). - Replication: Replicated: clients get a copy, and changes the server makes reach them.
Objects in ReplicatedStorage aren’t in the world (they aren’t simulated or drawn), but they replicate to every player’s device. Put RemoteEvents, RemoteFunctions, shared values and templates that clients also need here. Scripts inside it don’t run.
Properties
Section titled “Properties”Inherited from Instance: name, archivable, id, className, parent, destroyed
Methods
Section titled “Methods”Inherited from Instance: getPropertyChangedSignal, setAttribute, getAttribute, getAttributes, getAttributeChangedSignal, getChildren, getDescendants, findFirstChild, findFirstChildOfClass, findFirstChildWhichIsA, findFirstAncestor, findFirstAncestorWhichIsA, waitForChild, isA, isDescendantOf, isAncestorOf, getFullName, clearAllChildren, destroy, clone, toString
Events
Section titled “Events”Inherited from Instance: changed, childAdded, childRemoved, descendantAdded, descendantRemoving, ancestryChanged, destroying, attributeChanged
Examples
Section titled “Examples”Find a remote from both sides
Section titled “Find a remote from both sides”import { RemoteEvent, ReplicatedStorage, getChild, print, task, waitForChild } from '@rally/sdk';
// On the server the remote is there from the start.const announce = getChild(ReplicatedStorage, 'Announce', RemoteEvent);announce.fireAllClients('Welcome!');
// On a player's device it may still be arriving: wait for it.task.spawn(async () => { const sameRemote = await waitForChild(ReplicatedStorage, 'Announce', RemoteEvent); sameRemote.onClientEvent.connect((message) => print(message));});