Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how to play music?

How do I make a song play using a script?

2 answers

Use the method Play. For example, if I wanted to play the song every time a TextButton was pressed, I would put -


script.Parent.MouseButton1Down:connect(function()
	Workspace.MySong:Play() --If the song is local then you would put wherever it is instead of Workspace

end)

The other Sound methods can be found here

1 comment

0

infalliblelemon it's not Workspace. It's either workspace or game.Workspace.

Well first put a sound into workspace. Then copy and paste a sound id into sound by putting it in the Sound ID place. Set the volume to 1 or 0.5. Then put a script in to workspace that has this inside. Inside the SoundName put the name of your sound instead of SoundName.

game.Workspace.SoundName:Play()

This discussion is preserved as it was. New answers, comments, and votes are closed.