PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

IsPaused

Sound

bool

This read-only property will return true when the Sound is not playing. Note that this property will not only return true once a sound has been paused using the Sound/Pause function but also if it has been stopped using the Sound/Stop function or never been played.

This property will only be true when Sound/IsPlaying is false.

As IsPaused is read only it can not be used to stop the sound, Sound/Stop and Sound/Pause should be used instead.


Code Samples


Sound IsPlaying and SoundIsPaused

This code sample contains demonstrates when the Sound.IsPlaying and Sound.IsPaused properties will be true or false.

A sound is instanced in the Workspace and the Sound.IsLoaded property is checked to ensure it has loaded, if it has not the Sound.Loaded event is used to yield the script until the sound has.

As the sound is played, paused and stopped the Sound.IsPlaying and Sound.IsPaused properties are printed to demonstrate how they respond to each of these functions. Note Sound.IsPaused will always be true if even if the sound has been stopped rather than paused.

local sound = Instance.new("Sound", game.Workspace)
sound.SoundId = "rbxassetid://301964312" 
sound.Looped = true

if not sound.isLoaded then
	sound.Loaded:wait()
end

sound:Play()
print(sound.IsPlaying, sound.IsPaused) -- true, false

wait(2)
sound:Pause()
print(sound.IsPlaying, sound.IsPaused) -- false, true

wait(2)
sound:Play()
print(sound.IsPlaying, sound.IsPaused) -- true, false

wait(2)
sound:Stop()
print(sound.IsPlaying, sound.IsPaused) -- false, true