StringValue
Holds a string that scripts and players can read and watch.
- Inherits: Instance
- Creatable: Yes:
new StringValue(), orInstance.new('StringValue', parent). - Replication: Replicated: clients get a copy, and changes the server makes reach them.
See NumberValue for how value objects are used. Inside a player’s
leaderstats folder, a StringValue shows its text on the leaderboard.
Properties
Section titled “Properties”Type: string · Default: '' · Access: read/write · Replicates: yes
The string it holds.
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”Shared round status
Section titled “Shared round status”import { ReplicatedStorage, StringValue, task } from '@rally/sdk';
// In ReplicatedStorage, so every player's device sees it change.const status = new StringValue();status.name = 'Status';status.value = 'Waiting for players';status.parent = ReplicatedStorage;
task.spawn(async () => { for (let i = 10; i > 0; i--) { status.value = `Round starts in ${i}`; await task.wait(1); } status.value = 'Go!';});