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

How can I make music play in my game?

Asked by 11 years ago

Cause whenever I do this?

1while true do
2wait(1)
3script.Music.Pitch = 1
4script.Music:play()

end

it keeps repeating the music over and over and over again?

And it sounds like a herd of kids trying to sing at the same time but failing?

Help?

2 answers

Log in to vote
2
Answered by
samfun123 235 Moderation Voter
11 years ago

If you are trying to make the music loop just remove the while true do and set the Looped property of the music to be true.

1game:GetService("ContentProvider"):Preload(script.Music.SoundId)
2script.Music.Pitch = 1
3script.Music:Play()
4script.Music.Looped = true

if you don't want the music to loop just remove the script.Music.Looped = false

1game:GetService("ContentProvider"):Preload(script.Music.SoundId)
2script.Music.Pitch = 1
3script.Music:Play()

If you have any questions, concerns or just need some help with this PM me on ROBLOX!

Ad
Log in to vote
1
Answered by 11 years ago

Just do

1script.Music.Pitch = 1
2script.Music:play()

No need for a loop in your script. Just set the Music's Looped *property *to true.

0
Alright, thanks. SuperMushroom8 15 — 11y

Answer this question