This is my damage script to my fire ball tool and it works with the damage but when I try to add it so that if the Player kills another person their Exp stat in the leader board raises the damage still works but the Exp stat in leader board doesn't raise. I used the Variable PlayerName to find the name of the Player in the Players Folder so I can access the player
PlayerName = script.Parent.Parent.Parent.Name
function onDamage(Part)
if Part.Parent:FindFirstChild("Humanoid") ~= nil and Part.Parent.Name ~= "script.Parent.Name" then
script.Disabled = true
f = Instance.new("Fire", Part)
for i = 1,25 do
f.Size = f.Size +0.25
Part.Parent.Humanoid.Health = Part.Parent.Humanoid.Health -1
wait(0.05)
end
Part.Parent.Humanoid.Sit = true
if Part.Parent.Humanoid.Health <= 0 then
game.Players.PlayerName.leaderstats.Exp = game.Players.PlayerName.leaderstats.Exp +1
end
f:remove()
script.Parent:remove()
end
wait(0.025)
end
script.Parent.Touched:connect(onDamage)

2 comments
Look closely at line 4, what
Part.Parent.Nameis doing. :PTry a 'humanoid.Died' connect line. It's in the tips on this website.