Skip to content

StringValue

Holds a string that scripts and players can read and watch.

  • Inherits: Instance
  • Creatable: Yes: new StringValue(), or Instance.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.

Type: string · Default: '' · Access: read/write · Replicates: yes

The string it holds.

Inherited from Instance: name, archivable, id, className, parent, destroyed

Inherited from Instance: getPropertyChangedSignal, setAttribute, getAttribute, getAttributes, getAttributeChangedSignal, getChildren, getDescendants, findFirstChild, findFirstChildOfClass, findFirstChildWhichIsA, findFirstAncestor, findFirstAncestorWhichIsA, waitForChild, isA, isDescendantOf, isAncestorOf, getFullName, clearAllChildren, destroy, clone, toString

Inherited from Instance: changed, childAdded, childRemoved, descendantAdded, descendantRemoving, ancestryChanged, destroying, attributeChanged

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!';
});