Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does it keep damaging me?

Asked by
neoG457 315 Moderation Voter
8 years ago
local debounce = false

DMGPart.Touched:connect(function(part)
    local h = part.Parent:FindFirstChild("Humanoid")
    if h and (h.WalkSpeed == 3) and (not debounce) and (h.Parent ~= Player) then
        h:TakeDamage(1) 

The script works fine however it damages me and the person I use it on. How do I stop this from happening?

Answer this question