This is the script I am working with, it is in the roblox classic sword sword script
function Blow(Hit)
if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped then
return
end
local RightArm = Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand")
if not RightArm then
return
end
local RightGrip = RightArm:FindFirstChild("RightGrip")
if not RightGrip or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then
return
end
local character = Hit.Parent
if character == Character then
return
end
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid or humanoid.Health == 0 then
return
end
local player = Players:GetPlayerFromCharacter(character)
if player and (player == Player or IsTeamMate(Player, player)) then
return
end
UntagHumanoid(humanoid)
TagHumanoid(humanoid, Player)
humanoid:TakeDamage(Damage)
-- everything past here is the part where it gives the stat
local plr = game.Players:GetPlayerFromCharacter(humanoid.Parent)
humanoid.Died:Connect(function()
local killer = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
plr:FindFirstChild("leaderstats"):WaitForChild("Deaths").Value +=1
killer:FindFirstChild("leaderstats"):WaitForChild("Kills").Value +=1
end)
end
The problem with this is that it keeps repeating giving the player a higher number of kills than I would like, same with the number of deaths.