I want to play audio from the ROBLOX Library in a script. How do I do that?
✓ ANSWER ACCEPTED
How do I play audio in my game?
2 answers
✓ Accepted answer
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://YOURID"
sound.Parent = workspace
sound:Play()
2 comments
0
That worked, thank you!
0
no problem.
Step One: Make a folder in Workspace and name it 'Sounds'
Step Two: Insert a Sound into the Sounds Folder and name it 'Song1'. Change the SoundId in Properties to the ID you want it to be.
Step Three: Insert a Script. A good place for this would be game.ServerScriptService. In the script, type in:
local waitTime = 1 --Change this to the amount of seconds until the song starts
game.Workspace.Sounds.Song1:Play()
Hope this helps. Notify me if it doesn't work, and I'll find a new way. Upvote and mark as complete if it helps!
2 comments
0
lol rip
0
:(
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
create a sound instance and set its id to your song id then click play, script the rest... but thats how you play a sound in studio
so like local id = 1234 id:Play() ?
yes but you would need to do id.SoundId = "1234"