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

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

Asked by 9 years ago
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?

0
it worked thx;) USArmyRanger2003 0 — 9y
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? unmiss 337 — 9y
0
im going to use it. im making a music track. it has to be vry precice USArmyRanger2003 0 — 8y

1 answer

Log in to vote
0
Answered by 9 years ago

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?
0
you guys rly helped thx USArmyRanger2003 0 — 9y
Ad

Answer this question