Hey Hey,
im making a plugin wich plays sound (music)
to play the audio in studio i use this method:
local function PlayLocalSound(soundId)
if currentPlaying ~= nil then
print("there is a sound")
SoundService:
currentPlaying:Destroy()
currentPlaying = nil
end
local idToDestroy = soundId
currentPlaying = Instance.new("Sound")
currentPlaying.SoundId = soundId
-- Play the sound locally
SoundService:PlayLocalSound(currentPlaying)
currentPlaying.Ended:Wait()
if currentPlaying.SoundId == idToDestroy then
currentPlaying:Destroy()
end
end
and if i destroy the sound thats loaded into “SoundService” the audio keeps playing. Does someone know how to achieve: Stopping/Pausing the sound ???