Skip to content

soundObjectPlay⚓︎

This event triggers before certain object sounds are about to be played. For example, item pickup sounds.

--- @param e soundObjectPlayEventData
local function soundObjectPlayCallback(e)
end
event.register(tes3.event.soundObjectPlay, soundObjectPlayCallback)

Tip

This event can be filtered based on the sound event data.

Tip

This event supports blocking by setting e.block to true or returning false. Blocking the event prevents vanilla behavior from happening. For example, blocking an equip event prevents the item from being equipped.

Tip

An event can be claimed by setting e.claim to true, or by returning false from the callback. Claiming the event prevents any lower priority callbacks from being called.

Event Data⚓︎

  • flags (number): A flag whether the sound is looping or not. 0 means the sound doesn't loop, 1 means the sound loops.
  • isNot3D (boolean):
  • pitch (number): The pitch-shift multiplier. For 22kHz audio (most typical) it can have the range [0.005, 4.5]; for 44kHz audio it can have the range [0.0025, 2.25].
  • sound (tes3sound): The sound about to be played.
  • volume (number): The volume of the sound. In range [1, 250].

playItemSound