My current script that does not work
repeat wait() until game:GetService("Players").LocalPlayer local Character = workspace:FindFirstChild(game.Players.LocalPlayer.Name) while wait() do if Character:FindFirstChild("Humanoid") then if Character.Humanoid.Health.Value <= 0 then game.Workspace.Medium.MusicCrazy:Stop() end end end
Just use the died event instead
game:GetService('Players').PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) character:WaitForChild("Humanoid").Died:Connect(function() game.Workspace.Medium.MusicCrazy:Stop() end) end) end)