Exactly what the title says. I'll elaborate more. Let's say I kill a player with 100 points. when the player is killed, it resets the dead player's points to zero and you get all of the player's points.
Here's what I have so far.
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
-- Display an 'IntValue' on leaderboard
local Power = Instance.new("IntValue")
Power.Name = "Power"
Power.Value = 150
Power.Parent = leaderstats
player.CharacterAdded:connect(function(character)
character:WaitForChild("Humanoid").Died:connect(function()
local tag = character.Humanoid:FindFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
Power.Value = Power.Value +10
end
end
end)
end)
end)

2 comments
thats cruel
i know ;)