From ZDoom Wiki
Jump to: navigation, search

void PlaySound (int tid, str sound [, int channel [, fixed volume [, bool looping [, fixed attenuation [, bool local]]]]])


Plays a sound at a thing. This is similar to the A_PlaySound action function except it will not default to playing "weapons/pistol" sound. If tid is 0, the sound will be played by the activator of the script.


  • tid: The TID of the actor to play the sound from.
  • sound: The sound to play, as defined in SNDINFO.
  • channel: The channel to play the sound on. Default is CHAN_BODY.
  • volume: The volume of the sound. This ranges from 0.0 (mute) to 1.0 (full volume). Default is 1.0.
  • looping: Whether the sound is to be looped or not. If TRUE, the sound loops, otherwise it does not. Default is FALSE.
  • attenuation: This is how quickly the sound fades with distance from its source. The higher the value the quicker the sound fades out. The following are the standard attenuation values:
    • ATTN_NONE — 0 (no attenuation; the sound can be heard regardless of the distance).
    • ATTN_NORM — 1.0 (normal attenuation; this is the default value).
    • ATTN_IDLE — 1.001
    • ATTN_STATIC — 3.0 (the sound diminish very rapidly with distance).
  • local: If true, the sound is played if the player is either looking out the eyes of the actor from which the sound is coming, or said actor is the player and the player is looking out the eyes of a non-monster actor. Also, the sound is played with ATTN_NONE. Default is false.


Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contibutions are greatly appreciated.