game:GetService('Players').PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
print("h")
player.leaderstats.Deaths.Value = player.leaderstats.Deaths.Value + 1
end)
end)
end)
✓ ANSWER ACCEPTED
No error, tryingt to add 1 to a leaderstat after player has died?
1 answer
✓ Accepted answer
Put this script in ServerScriptService:
game:GetService("Players").PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
char:WaitForChild("Humanoid").Died:Connect(function()
player.leaderstats.Deaths.Value = player.leaderstats.Deaths.Value + 1
end)
end)
end)
Hope it helps!
2 comments
1
Make sure it is a normal script, not a local one
0
aa, thanks
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Is this a local script, or a server script?
local
Oh