Advertisement
This is comment for paste
Kills/Death Script
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game.Players
- Players.PlayerAdded:Connect(function(player)
- local kills = Instance.new("IntValue")
- kills.Name = "Kills"
- kills.Value = 0
- kills.Parent = leaderstats
- local Deaths = Instance.new("IntValue")
- Deaths.Name = "Deaths"
- Deaths.Value = 0
- Deaths.Parent = leaderstats
- wait(1)
- local Stats = leaderstats:Clone()
- Stats.Parent = player
- player.CharacterAdded:connect(function(Character)
- local Humanoid = Character:FindFirstChild "Humanoid"
- Deaths.Value = Deaths.Value + 1
- if Humanoid then
- Humanoid.Died:connect(function()
- for i, Child in pairs(Humanoid:GetChildren()) do
- if Child:IsA('ObjectValue') and Child.Value and Child.Value:IsA('Player') then
- local Killer = Child.Value
- if Killer:FindFirstChild 'leaderstats' and Killer.leaderstats:FindFirstChild "Kills" then
- local Kills = Killer.leaderstats.Kills
- Kills.Value = Kills.Value + 1
- end
- return
- end
- end
- end)
- end
- end)
- end)
- If I already have the leaderstats "Folder" thingy should I make it this? Or should I make it a different way? ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement