Lua:SmartSound

From Fortress Forever Wiki
Jump to navigationJump to search


SmartSound

Plays one sound for a specified player, another for that player's teammates, and another for the other team(s).

Usage

SmartSound(player, playersound, teamsound, otherteamsound)

Input

  • player(CFFPlayer) A player (such as the one who just grabbed a flag)
  • playersound(string) Sound to play for the player
  • teamsound(string) Sound to play for the player's team
  • otherteamsound(string) Sound to play for the other team(s)

Use an entry from one of the game_sounds files in Fortressforever\scripts\. All sounds used by lua should be precached.

Output

Returns: nothing.

Example

SmartSound(player, "yourteam.flagstolen", "yourteam.flagstolen", "otherteam.flagstolen")