I don't want the music to repeat when the person dies
MUSIC01 = game.Workspace.AmbientMus01 MUSIC02 = game.Workspace.AmbientMus02 while wait() do wait(1) MUSIC01:Play() print("FIRST STARTED") wait(118) MUSIC01:Stop() print("DONE") wait(2.5) MUSIC02:Play() print("SECOND STARTED") wait(96) MUSIC02:Stop() print("DONE") end
I've tried making a checker but that didn't work i also tried waiting for the character (both times the sound didn't even play) I looked for a property in Humanoid
or anywhere else in character and i tried putting it in Workspace
and ServerScriptStorage
Is there anyway to stop this from restarting?
http://wiki.roblox.com/index.php?title=API:Class/Humanoid/Died
Died
event is fired when the player dies
game:GetService('Players').PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character:WaitForChild("Humanoid").Died:connect(function() MUSIC:Pause() --To whatever your music name is end) end) end)
http://wiki.roblox.com/index.php?title=API:Class/Sound/Pause