Why doesnt explosion work

so what I want to achieve is using an explosion. hit function which allows explosions Detect parts in their range which allows for an easy way to damage a separatist ship’s health that’s why the health stuff is for but it’s not detecting anything and I’ll show a video if needed

debounce = false

print(“explosion is runing”)
script.Parent.Hit:Connect(function(part)

	if part.Parent.Name == "seperatistbattleship" then
		local healthbar = part.Healthpart.Healthbar
		local healthvalue = part.Healthvalue
			print("working sepbattleship")
		
			if healthvalue.Value <= 0.70 then
				healthbar.Frame.Full.BackgroundColor3 = Color3.new(0,200/255,0)
				healthvalue.Value = healthvalue.Value - 0.1
				
				healthbar.Frame.Full.Size = UDim2.new(healthvalue.Value)
				
			elseif healthvalue.Value <= 0.40 then
				healthbar.Frame.Full.BackgroundColor3 = Color3.new(200/255,200/255,0)

				healthvalue.Value = healthvalue.Value - 0.1
				healthbar.Frame.Full.Size = UDim2.new(healthvalue.Value)
				
				
			elseif healthvalue.Value <= 0.1 then
				healthbar.Frame.Full.BackgroundColor3 = Color3.new(200/255,0,0)
				healthvalue.Value = healthvalue.Value - 0.1
				healthbar.Frame.Full.Size = UDim2.new(healthvalue.Value)
				
			elseif healthvalue.Value == 0 then
				part.Script:Destroy()
			
						


			end
	
	end
	
	
end	

end)
print(“ive vbeen destroyed”)

Try adding print commands so that you can see exactly where the script stops working as intended, does every part of the ship have a child BasePart instance named “Healthpart”? Does this child have its own child named “Healthbar”? Is the parent instance of the hit part named “seperatistbattleship”? Make sure everything is referenced correctly including spelling an instance hierarchy (organisation).

ok so here is the problem I found out alone, explosion.Hit does not work on parts where parents are not a character with a humanoid So I decided to use raycasting instead

You could just create a humanoid instance inside the ship.

thank you for the idea and I’ve already done its but I’ve decided to just use raycasting Its was easy and I completed my needs