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

How to play and stop music that every player hears using a script?

I have been trying to make music turned on by a script. used SoundService like this

game.SoundService.Escape.Playing = true
wait(5)
game.SoundService.Escape.Playing = false

is there a way to make a simple way to make all players hear music and be able to stop it at any time?

2 answers

✓ Accepted answer

Hey there!

If your sound is located in

game.Workspace

do the following:

game.Workspace.Escape:Play() -- Plays sound.
wait(5) -- Wait 5 seconds before stopping the audio.
game.Workspace.Escape:Stop() -- Stops sound.

If this worked for you, please mark this answer as solved!

If it didn't work, let me know and I'll try to help ya!

Edit: If it didn't work, let me know where your sound is located.

try

game.SoundService.Escape:Play()
wait (5)
game.SoundService.Escape:Stop()

3 comments

0

i tried but when i put wait command before it the music doesn't work, the script does, because i tested it with print

0

doesnt work?

0

thx for the chat, put in workspace, now it works

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