handle.Touched:connect(function(hit) if not pause2 then pause2 = true if Mouse.Button1Down then if humanoid and hit and not hit:isDescendantOf(person) and Mouse.Button1Down then local target = hit.Parent:FindFirstChild("Humanoid") print("Target variable added.") target:TakeDamage(damage) print("Target took damage!") wait(0.7) pause2 = false print("Hit Function Finished!") else end end end end)
I can't really figure out why this is happening. The error happens on the line that says "target:TakeDamage(damage)". Any help?
try using WaitForChild() instead of FindFirstChild