— — — — —
— — — — —
— — — — —
— — — — —
— — — — —
— — — — —
— — — — —
— — — — —
This is an old revision of the document!
Plays the specified sound effect once.
play_sound(sound_name, loop, interval)
Argument | Description | Type | Required |
---|---|---|---|
sound_name | Name of the sound effect to play. | String | Yes |
loop | . | Boolean | No |
interval | . | Number | No |
Return Value | Description | Type |
---|---|---|
Sound ID | Returns the actual number of items that were given to the player. This could be less than the count supplied to the function, for example if the player's inventory becomes full. | Number |
The built-in Sound FX Generator, accessed from the main toolbar along the top of the application, can be used to generate some basic 8-bit style sound effects.
play_sound("alarm", true, 1);
Results: Plays the sound effect named “alarm” once per second until stopped.
Use the Play Sound function to trigger a sound effect when the player opens a door or a treasure chest, or an event occurs that you'd like the player to hear regardless of their location.