Exactly what the title says.
I have this sword and I want the damage to be based off a player's leaderstat. For example, if I have 700 power, it's multiplied by .07 and then that's the damage value.
Here's the script I have in the sword:
wait(0.01)
CanDamage = true
script.Parent.Handle.Touched:connect(function(hum) -- Changed "part" to "hum"
if hum and hum.Parent:FindFirstChild("Humanoid") then -- "hum" is the Player who touched the part/Sword.
local player = game.Players:GetPlayerFromCharacter(hum.Parent)
local plr = player.leaderstats.Power.Value
if CanDamage == true then
CanDamage = false
hum.Parent.Humanoid:TakeDamage(plr * 0.07) -- I forgot to add the "Parent.Humanoid" part after "hum"1
wait(0.8)
CanDamage = true
end
end
end)
No errors pop up aswell.
I'd appreciate the help!

2 comments
Try and debug first. Set up print()'s around the script, especially after each if statement. See where it stops printing.
I think you are taking the hit players value, I understand that you want to take yours value I think.