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

Help With A Music Script?

Asked by
Scootakip 299 Moderation Voter
9 years ago

I made this music script but it won't work.

while true do
    game.Workspace.Music:Play()
    wait(100)
end

Well... It does sorta work, but every time the player dies the music restarts. How do I prevent that from happening?

0
stick it in a localscript, and place it in startergui. woodengop 1134 — 9y
0
No that doesn't work. Scootakip 299 — 9y
0
fixed i t? HungryJaffer 1246 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago
local Players = game:GetService("Players")
Players.PlayerAdded:connect(function(player)
mus = game.Workspace.Music:clone()
mus.Parent = player.PlayerGui
mus.Looped = true
mus:Play()
end)

This script puts the music into the players' playergui. In here it should not be affected as the player dies.

0
Thanks, I'm sure that that will help but it doesn't solve the issue I'm having. My problem is that the music restarts when the character dies. Scootakip 299 — 9y
0
Nope, the music still restarts on death Scootakip 299 — 9y
0
NVM I got it working Scootakip 299 — 9y
Ad

Answer this question