Hello I am making a script for an explosion hitbox and I can’t figure out why it’s not working
The output only prints “baseplate”
function explode()
for i, v in pairs(script.Parent:GetTouchingParts()) do
print(v)
if v.Parent:WaitForChild("Humanoid") then
v.Parent.Humanoid.Health = 0
end
end
end
while true do
wait(1)
explode()
end
local Part = script.Parent -- save to optimize
Part.Touched:Connect(function(Hit)
local Hum = Hit and Hit.Parent and Hit.Parent:FindFirstChild("Humanoid")
if Hum then
Hum.Health = 0
end
end)