Skip to content

SoundPlayer

SoundPlayers, when actviated, emit a sound effect inferred from it’s attributes or children. The SoundPlayer will play the first thing found in order:

  1. A PlayFromAssets key
  2. A Sound attribute
  3. A Sound instance named “Sound”
SoundPlayer = {
-- Attributes
PlayFromAssets: std.Attribute<keyof<typeof(std.audio.AUDIO_ASSETS)>?>,
Sound: std.Attribute<string?>,
Spatial: std.Attribute<boolean>,
Speed: std.Attribute<number?>,
Volume: std.Attribute<number?>,
Activatable: std.Attribute<boolean>,
ActivationBehavior: std.Attribute<ActivationBehavior>,
}
SoundPlayer.PlayFromAssets: std.Attribute<keyof<typeof(std.audio.AUDIO_ASSETS)>?>

Plays a sound directly from Welcome To Hell’s audio assets. If specified, this attribute overrides any Sound attribute or Sound instance parented under the SoundPlayer.

SoundPlayer.Sound: std.Attribute<string?>

An asset ID that should be used if a PlayFromAssets attribute or a Sound instance isn’t present.

SoundPlayer.Spatial: std.Attribute<boolean>

Toggles if the sound should be parented to the part, so played “spatially”, or parented to nil, so played “globally”.

SoundPlayer.Speed: std.Attribute<number?>

Divides the sound’s duration, ie. value of 1 means normal speed, value of 2 means double speed, value of 0.5 means half speed. If specified, this overrides the PlaybackSpeed property in any Sound instance.

SoundPlayer.Volume: std.Attribute<number?>

How loud should the sound be. If specified, this overrides the Volume property in any Sound instance.

SoundPlayer.Activatable: std.Attribute<boolean>

Whether this object can be activated. See the Activation page.

SoundPlayer.ActivationBehavior: std.Attribute<ActivationBehavior>

How should this object be activated. See the Activation page.