Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

how to play music?

Asked by 10 years ago

How do I make a song play using a script?

2 answers

Log in to vote
0
Answered by 10 years ago

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

0
infalliblelemon it's not Workspace. It's either workspace or game.Workspace. DogHouseForMe 0 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

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()

Answer this question