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

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

Asked by 3 years ago

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

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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.

Ad
Log in to vote
0
Answered by 3 years ago

try

game.SoundService.Escape:Play()
wait (5)
game.SoundService.Escape:Stop()
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 tymon4don 6 — 3y
0
doesnt work? balooncool 6 — 3y
0
thx for the chat, put in workspace, now it works tymon4don 6 — 3y

Answer this question