It was working last night and somehow it doesnt work
function win() -- This is empty on purpose end game.Players.PlayerAdded:connect(function(p) repeat wait() until p.Character print "character found i think" p.Character.Humanoid.Died:connect(function() if p.Name == script.Parent.Player1.Value then local p1 = game.Players:FindFirstChild(script.Parent.Player1.Value) local p2 = game.Players:FindFirstChild(script.Parent.Player2.Value) print "p1 ded" wait(1) if p2.Character.Humanoid.Health ~= 0 then script.Parent.Player2.score.Value = script.Parent.Player2.score.Value + 1 wait(0.5) print "p2 gets point" if script.Parent.Player2.score.Value == 5 then win(script.Parent.Player2.Value) end p2:LoadCharacter() p1:LoadCharacter() elseif p2.Character.Humanoid.Health == 0 then end elseif p.Name == script.Parent.Player2.Value then local p1 = game.Players:FindFirstChild(script.Parent.Player1.Value) local p2 = game.Players:FindFirstChild(script.Parent.Player2.Value) print "p2 ded" wait(1) if p1.Character.Humanoid.Health ~= 0 then script.Parent.Player1.score.Value = script.Parent.Player1.score.Value + 1 wait(0.5) print "p1 gets point" if script.Parent.Player1.score.Value == 5 then win(script.Parent.Player1.Value) end p2:LoadCharacter() p1:LoadCharacter() elseif p1.Character.Humanoid.Health == 0 then end end end) end)
It does not print p1 gets point , or p2 gets point. There are no errors in F9
Also for explorer hiearchy(if thats how you spell it) http://prntscr.com/a59osj
Thank you
I think I know why, you only are checking if the humanoid health is 0 after 1 second, I would recommend an event
p2.Character.Humanoid.Changed:connect(function() if p2.Character.Humanoid.Health == 0 then -- out what happens when p2 dies here end end)