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

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

Asked by 3 years ago
Edited by JesseSong 3 years ago
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)
0
What exactly is the problem? Any errors? MarkedTomato 810 — 3y
0
No, not any that I know of. It just wont do any Damage to my dummies Nateynate20 -2 — 3y
0
I tried your code and it worked for me. Have you named one of the parts in the tool to Handle? MarkedTomato 810 — 3y
0
I put the script in the wrong place so it didnt work. Sorry for wasting your time Nateynate20 -2 — 3y

Locked by JesseSong

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 3 years ago

When answering, if your answer does not fully solve the question, it should be written as a comment to the question instead of as an answer.

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

Ad