When true, the
Sound will play when it is removed from the game.
Note the sound will play when the
Instance/Parent property of the
Sound or one of its ancestors is set to nil. This means all of the following will cause the sound to play when PlayOnRemove is true. Note, this includes
Instance/Destroy as the destroy function sets the parent to nil.
sound:Destroy() sound.Parent = nil sound.Parent.Parent = nil
In this sample a sound is created in the workspace, PlayOnRemove is set to true and the sound is then destroyed.
As Sound.PlayOnRemove is true, the sound will play when it is removed.