Language

Sound.play


Sound.play(string filename)
Sound.play(string filename, boolean custom_sound = false)
Sound.play(string filename, boolean custom_sound = false, int volume = 100)

Description

Play a sound. Formats like WAV or OGG are supported. This function is made for playing small and short sounds. For music, see Sound.playMusic()

Parameters

filename
The name of the file to play
custom_sound
If the sound is with the map (cmaps/mymap/sounds), put this to true, false otherwise.
volume
The volume of the sound. Between 0 and 100.

Examples

Play a sound when player start or reset the map

  1. function onReset(elapsed)
  2.     Sound.play("itsboshytime.ogg", true)
  3. end