So I have a function on my sword that makes it so when it touches someone, they are supposed to take damage, but nothing seems to happen. Also, the handle is the whole sword. Please help.
Here is my script:
local sword = script.Parent local handle = sword:FindFirstChild("Handle") local event = sword:FindFirstChild("RemoteEvent") local player = sword.Parent.Parent local humanoid = player:FindFirstChild("Humanoid")
handle.Touched:connect(function(hit) if player and humanoid and humanoid.Health > 0 then local hitHumanoid = hit.Parent:FindFirstChild("Humanoid") if hitHumanoid and hitHumanoid.Health > 0 then hitHumanoid:TakeDamage(50) end end end)

1 comment
please use code block lol