I have this in a Server script:
game.Players.PlayerAdded:connect(function(player) repeat wait() until player:FindFirstChild("leaderstats") local lives = player.leaderstats.Respawns player.CharacterAdded:connect(function(char) char:FindFirstChild("Humanoid").Died:connect(function() wait() lives.Value = lives.Value - 1 player:FindFirstChild("Backpack").Death:Play() children = player.Backpack:GetChildren() for _,v in pairs(children) do if v:IsA("Sound") then v:Stop() v:Destroy() wait() end end end) end) end)
I'm attempting to do two things here: Remove one life from the player when he dies, as well as play a "death" sound when he dies. Problem is that this rarely works during online mode. I think it's because the death event takes too long to function but I'm not really sure. Any ideas?