bf6-portal-mod-types
    Preparing search index...

    Function PlaySound

    • Plays a 2D sound that was spawned via mod.SpawnObject, for a specific team. Passing a 3D sound to this function will fail silently.

      Parameters

      • sound: SFX

        The sound object to play.

      • amplitude: number

        The amplitude of the sound.

      • team: Team

        The team to play the sound for.

      Returns void

      // Spawned position and rotation for an SFX has no effect.
      const sfx = mod.SpawnObject(RuntimeSpawn_Common.SFX_Gadgets_C4_Activate_OneShot2D, mod.CreateVector(0, 0, 0), mod.CreateVector(0, 0, 0)) as mod.SFX;
      mod.PlaySound(sfx, 1.0, mod.GetTeam(1));
    • Plays a 2D sound that was spawned via mod.SpawnObject, for a specific squad. Passing a 3D sound to this function will fail silently.

      Parameters

      • sound: SFX

        The sound object to play.

      • amplitude: number

        The amplitude of the sound.

      • squad: Squad

        The squad to play the sound for.

      Returns void

      // Spawned position and rotation for an SFX has no effect.
      const sfx = mod.SpawnObject(RuntimeSpawn_Common.SFX_Gadgets_C4_Activate_OneShot2D, mod.CreateVector(0, 0, 0), mod.CreateVector(0, 0, 0)) as mod.SFX;
      mod.PlaySound(sfx, 1.0, mod.GetSquad(1, 1));
    • Plays a 2D sound that was spawned via mod.SpawnObject, for a specific player. Passing a 3D sound to this function will fail silently.

      Parameters

      • sound: SFX

        The sound object to play.

      • amplitude: number

        The amplitude of the sound.

      • player: Player

        The player to play the sound for.

      Returns void

      // Spawned position and rotation for an SFX has no effect.
      const sfx = mod.SpawnObject(RuntimeSpawn_Common.SFX_Gadgets_C4_Activate_OneShot2D, mod.CreateVector(0, 0, 0), mod.CreateVector(0, 0, 0)) as mod.SFX;
      mod.PlaySound(sfx, 1.0, somePlayer);
    • Plays a 2D sound that was spawned via mod.SpawnObject, for everyone. Passing a 3D sound to this function will fail silently.

      Parameters

      • sound: SFX

        The sound object to play.

      • amplitude: number

        The amplitude of the sound.

      Returns void

      // Spawned position and rotation for an SFX has no effect.
      const sfx = mod.SpawnObject(RuntimeSpawn_Common.SFX_Gadgets_C4_Activate_OneShot2D, mod.CreateVector(0, 0, 0), mod.CreateVector(0, 0, 0)) as mod.SFX;
      mod.PlaySound(sfx, 1.0);
    • Plays a 3D sound that was spawned via mod.SpawnObject, at a location, for a specific team. Passing a 2D sound to this function will fail silently.

      Parameters

      • sound: SFX

        The sound object to play.

      • amplitude: number

        The amplitude of the sound.

      • location: Vector

        The location to play the sound at.

      • attenuationRange: number

        The attenuation range of the sound.

      • team: Team

        The team to play the sound for.

      Returns void

      // Spawned position and rotation for an SFX has no effect.
      const sfx = mod.SpawnObject(RuntimeSpawn_Common.SFX_Gadgets_C4_Activate_OneShot2D, mod.CreateVector(0, 0, 0), mod.CreateVector(0, 0, 0)) as mod.SFX;
      mod.PlaySound(sfx, 1.0, mod.CreateVector(100, -100, 200), 2.0, mod.GetTeam(1));
    • Plays a 3D sound that was spawned via mod.SpawnObject, at a location, for a specific squad. Passing a 2D sound to this function will fail silently.

      Parameters

      • sound: SFX

        The sound object to play.

      • amplitude: number

        The amplitude of the sound.

      • location: Vector

        The location to play the sound at.

      • attenuationRange: number

        The attenuation range of the sound.

      • squad: Squad

        The squad to play the sound for.

      Returns void

      // Spawned position and rotation for an SFX has no effect.
      const sfx = mod.SpawnObject(RuntimeSpawn_Common.SFX_Gadgets_C4_Activate_OneShot2D, mod.CreateVector(0, 0, 0), mod.CreateVector(0, 0, 0)) as mod.SFX;
      mod.PlaySound(sfx, 1.0, mod.CreateVector(100, -100, 200), 2.0, mod.GetSquad(1, 1));
    • Plays a 3D sound that was spawned via mod.SpawnObject, at a location, for a specific player. Passing a 2D sound to this function will fail silently.

      Parameters

      • sound: SFX

        The sound object to play.

      • amplitude: number

        The amplitude of the sound.

      • location: Vector

        The location to play the sound at.

      • attenuationRange: number

        The attenuation range of the sound.

      • player: Player

        The player to play the sound for.

      Returns void

      // Spawned position and rotation for an SFX has no effect.
      const sfx = mod.SpawnObject(RuntimeSpawn_Common.SFX_Gadgets_C4_Activate_OneShot2D, mod.CreateVector(0, 0, 0), mod.CreateVector(0, 0, 0)) as mod.SFX;
      mod.PlaySound(sfx, 1.0, mod.CreateVector(100, -100, 200), 2.0, somePlayer);
    • Plays a 3D sound that was spawned via mod.SpawnObject, at a location, for everyone. Passing a 2D sound to this function will fail silently.

      Parameters

      • sound: SFX

        The sound object to play

      • amplitude: number

        The amplitude of the sound.

      • location: Vector

        The location to play the sound at.

      • attenuationRange: number

        The attenuation range of the sound.

      Returns void

      // Spawned position and rotation for an SFX has no effect.
      const sfx = mod.SpawnObject(RuntimeSpawn_Common.SFX_Gadgets_C4_Activate_OneShot2D, mod.CreateVector(0, 0, 0), mod.CreateVector(0, 0, 0)) as mod.SFX;
      mod.PlaySound(sfx, 1.0, mod.CreateVector(100, -100, 200), 2.0);
    • Plays a sound using runtime spawner tech.

      Parameters

      • sound: SFX
      • amplitude: number
      • team: Team

      Returns void

    • Plays a sound using runtime spawner tech.

      Parameters

      Returns void

    • Plays a sound using runtime spawner tech.

      Parameters

      Returns void

    • Plays a sound using runtime spawner tech.

      Parameters

      • sound: SFX
      • amplitude: number

      Returns void

    • Plays a sound using runtime spawner tech.

      Parameters

      • sound: SFX
      • amplitude: number
      • location: Vector
      • attenuationRange: number
      • team: Team

      Returns void

    • Plays a sound using runtime spawner tech.

      Parameters

      • sound: SFX
      • amplitude: number
      • location: Vector
      • attenuationRange: number
      • squad: Squad

      Returns void

    • Plays a sound using runtime spawner tech.

      Parameters

      • sound: SFX
      • amplitude: number
      • location: Vector
      • attenuationRange: number
      • player: Player

      Returns void

    • Plays a sound using runtime spawner tech.

      Parameters

      • sound: SFX
      • amplitude: number
      • location: Vector
      • attenuationRange: number

      Returns void