Skip to content

Sound

Plays audio from a URL, either everywhere or from a spot in the world.

  • Inherits: Instance
  • Creatable: Yes: new Sound(), or Instance.new('Sound', parent).
  • Replication: Replicated: clients get a copy, and changes the server makes reach them.

Sounds play on players’ devices. A Sound is only heard while it’s in the Workspace or inside the local player (for example in their PlayerGui); anywhere else it’s silent. Directly inside a BasePart it comes from the part and fades with distance; elsewhere it plays at the same volume everywhere.

Setting playing (or calling play()) on the server plays the sound for everyone; doing it in a LocalScript plays it for that player only. Browsers block audio until the player first clicks or presses a key: a sound that isn’t looped and starts before that is skipped, and looped sounds start then. When a sound that isn’t looped finishes, playing turns false on that device.

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

URL of the audio file (a format the browser can play, such as MP3, OGG or WAV). Players’ devices download it; if one can’t, a warning goes to the game’s output.

Type: number · Default: 0.5 · Range: 0 to 10 (clamped) · Access: read/write · Replicates: yes

Loudness: 0 is silent and 1 is the file’s own volume; higher values amplify.

Type: boolean · Default: false · Access: read/write · Replicates: yes

Starts over at the end instead of stopping.

Type: boolean · Default: false · Access: read/write · Replicates: yes

Set true to play (or call play()).

Set it to false to stop the sound.

Type: number · Default: 1 · Range: 0.1 to 4 (clamped) · Access: read/write · Replicates: yes

Playback rate: 2 plays twice as fast (and higher), 0.5 half as fast.

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

play(): void

Plays the sound from the start, restarting it if it’s already playing.

stop(): void

Stops the sound.

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 { Character, Part, Sound, getChild, workspace } from '@rally/sdk';
const bell = getChild(workspace, 'Bell', Part);
const ding = getChild(bell, 'Ding', Sound); // inside the part, so it's heard from the bell
bell.touched.connect((other) => {
if (other instanceof Character) ding.play();
});