SoundPlayed

Constructor:

SoundPlayed()

Description

This event is triggered when the audio object is played.

Examples

Create an Audiosource player. Assign the audio path to the player and play it. Observe whether the event of audio playing is triggered or not.

function SoundPlayEvent() -- define the method when the audio is played
    print("The event that the audio is played is triggered")
end
local AS = RWObject.Create("AudioSource") -- create a player
AS.PlayOnAwake =false
AS.AudioClip = "rwid://L1vtZTBThT1RCvBVdK"  -- assign a path
AS.SoundPlayed:Connect(SoundPlayEvent) -- register the event that the audio is played
AS:Play() -- play the audio