Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I'm Trying to make a damage script and it wont work? [Solved]

local tool = script.Parent

local function Attack(otherPart)
    local partParent = otherPart.Parent
    local humanOther = partParent:FindFirstChild("Humanoid")
    if humanOther then
        humanOther:TakeDamage(1)

    end
end

tool.Handle.Touched:Connect(Attack)

4 comments

0

What exactly is the problem? Any errors?

0

No, not any that I know of. It just wont do any Damage to my dummies

0

I tried your code and it worked for me. Have you named one of the parts in the tool to Handle?

0

I put the script in the wrong place so it didnt work. Sorry for wasting your time

1 answer

just to stop this from being in the unanswered page, since this is simply just a parenting problem

This discussion is preserved as it was. New answers, comments, and votes are closed.