I'm trying to make a sword.
Blade = script.Parent.Saber2
damage = 10
Blade.Touched:connect(function(hit)
hit.Parent:findFirstChild("Humanoid"):TakeDamage(damage)
end)
Will the above code deal damage to another player when hit?
Thanks.
I'm trying to make a sword.
Blade = script.Parent.Saber2
damage = 10
Blade.Touched:connect(function(hit)
hit.Parent:findFirstChild("Humanoid"):TakeDamage(damage)
end)
Will the above code deal damage to another player when hit?
Thanks.
Blade = script.Parent.Saber2
damage = 10
Blade.Touched:connect(function(hit)
local human = hit.Parent:FindFirstChild("Humanooid")
if human then
human:TakeDamage(damage)
end
end)
Don't forgot to check if the hit is not the player using the sword
How do you do that?
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Have you tested it?