Exploding Zombie

local zombie = script.Parent

local exploded = false


for _, part in pairs(zombie:GetChildren()) do

if part:IsA("BasePart") then

part.Touched:Connect(function(otherPart)

local player = game.Players:FindFirstChild(otherPart.Parent.Name)

if player and not exploded then

exploded = true

local explosion = Instance.new("Explosion")

explosion.Parent = game.Workspace

explosion.BlastRadius = 5

explosion.Position = part.Position

end

end)

end

end