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

How do i make the music STOP after a given time?

ID = '145777704' -- Set the ID to the music you want to play.
Looped = false -- Set to false if you want non-looped music.

Music=Instance.new("Sound" ,Workspace)
Music.Name = "Music"
if Looped == true then
Music.Looped = true
end
Music.SoundId = "http://roblox.com/asset/?id=145777704" -- Set the ID to the music you want to play here also (I picked a recommended music by me :3)
Music:Play()

wait (87)



ID = '0' -- Set the ID to the music you want to play.
Looped = false -- Set to false if you want non-looped music.

Music=Instance.new("Sound" ,Workspace)
Music.Name = "Music"
if Looped == true then
Music.Looped = false
end
Music.SoundId = "http://roblox.com/asset/?id=0" -- Set the ID to the music you want to play here also (I picked a recommended music by me :3)
Music:Play()

I need the music to stop and another to start the same second. any help?

3 comments

0

it worked thx;)

0

I don't mean any harm-but it seems like you're trying to make some sort of music system for other people to use. Why make something of the sort if you are not proficient in how to make it?

0

im going to use it. im making a music track. it has to be vry precice

1 answer

✓ Accepted answer

You can stop a sound from playing by using the Stop function, shown as following:

ID = '145777704' -- Set the ID to the music you want to play.
Looped = false -- Set to false if you want non-looped music.

Music=Instance.new("Sound" ,Workspace)
Music.Name = "Music"
if Looped == true then
Music.Looped = true
end
Music.SoundId = "http://roblox.com/asset/?id=145777704" -- Set the ID to the music you want to play here also (I picked a recommended music by me :3)
Music:Play()

wait (87)

Music:Stop() --Simple right?

1 comment

0

you guys rly helped thx

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