local clickdetector = workspace.Part.ClickDetector
local function onMouseClick(otherPart)
local partParent = otherPart.Parent
local humanoid = partParent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
end
end
clickdetector.MouseClick:connect(onMouseClick)
I want the code to set humanoid's health to 0 when clickdetector is fired but nothing happens. Any fix?
