Damage not consistent and script breaks in a Damage script?
Hi, i have a pretty weird problem with my script:
Basically, I'm making a weapon, and it should only take damage when it's activated. The purpose of this is to avoid the player from just walking to a humanoid, and it takes damage, so they have to activate it. It works the first time, but then after a few times I don't have to activate the tool for it to do damage, and it does like 100 damage
01 | local Hammer = script.Parent |
02 | local DamagePart = Hammer.Handle.DamagePart |
04 | Hammer.Activated:Connect( function () |
05 | DamagePart.Touched:Connect( function (Hit) |
06 | local Humanoid = Hit.Parent:FindFirstChild( "Humanoid" ) |
08 | Humanoid:TakeDamage( 2 ) |