when you kill someone u get points.. but it only give points after the first kill.
here is the script
local Players = game.Players
local Template = Instance.new 'BoolValue'
Template.Name = 'leaderstats'
Instance.new('IntValue', Template).Name = "Kills"
Instance.new('IntValue', Template).Name = "Coins"
local db = 0
Players.PlayerAdded:connect(function(Player)
wait(1)
local Stats = Template:Clone()
Stats.Parent = Player
Player.CharacterAdded:connect(function(Character)
local Humanoid = Character:FindFirstChild "Humanoid"
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
if db == 0 then
db = db + 1
local Kills = Killer.leaderstats.Kills
local Coins = Killer.leaderstats.Coins
Kills.Value = Kills.Value + 1
Coins.Value = Coins.Value + 2
wait(1)
db = db - 1
else return end
end
return
end
end
end)
end
end)
end)

3 comments
oh ok wait
just checked, it was not the problem
wait it is the problem ok just fixed it thanks