Play

Constructor:

Play()

Description

Play the current audio. If the audio is paused, it will continue to play.

Examples

Create an Audiosource player. Assign the audio path to the player to play, and pause playing the current audio after 2 seconds. Then resume playing after 3 seconds. Observe whether the audio continues to play or not.

local AS = RWObject.Create("AudioSource")  -- create a player
AS.PlayOnAwake =false
AS.AudioClip = "rwid://L1vtZTBThT1RCvBVdK"  -- assign a path
AS:Play() -- play the audio
wait(2) -- wait 2
AS:Pause() -- wait 2
wait(3) -- wait 3
AS:Play() -- play the audio