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

How in a weapon do you find a Humanoid?

Asked by
IcyEvil 260 Moderation Voter
10 years ago

Im making a weapon and I need to figure out how you would find if the item shot has a Humanoid any explanations/Examples???

1 answer

Log in to vote
4
Answered by 10 years ago

Put this script in the tool not the handle

Damage = 50
script.Parent.Handle.Touched:connect(function(t)
if t.Parent and t.Parent:FindFirstChild("Humanoid") then
t.Parent:FindFirstChild("Humanoid").Health = t.Parent:FindFirstChild("Humanoid").Health - Damage
end
end)

There are no animations, though.

Ad

Answer this question