I was recently working on a plugin that is basically all sounds. Nope you’re not gonna get the plugin name yet🤷♂️. And I wanted to play a sound once a button is clicked. I tried to clone the sound to workspace and playing it there, but didn’t work. Is there a way to “preview” the sound thru scripts?
Glad I could help! In the documentation page, it provides this function:
local function playLocalSound(soundId)
-- Create a sound
local sound = Instance.new("Sound")
sound.SoundId = soundId
-- Play the sound locally
SoundService:PlayLocalSound(sound)
-- Once the sound has finished, destroy it
sound.Ended:Wait()
sound:Destroy()
end
Which allows you to put in a SoundId rather than a sound instance. It just makes it a bit easier if you’re working with SoundIds.