Make the enemy's die when shot by bullet

Question

So I am making a 2d shooter game where you can Use the gun to Make platform’s and also shoot bullet’s to kill enemy’s i am a beginner though and I have gotten stuck making the combat system in can make the enemy’s die when shot but if there is two enemy’s and player kills one and then gets killed by the other one when respawned player can’t kill the enemy’s anymore

bullet code :

extends Area2D
 
 # varibels
const SPEED: int =1000

 #moves the bullet
func _process(delta: float) -> void:
		position += transform.x * SPEED *delta 
#destroy when not visible
func _on_visible_on_screen_enabler_2d_screen_exited() -> void:
	queue_free()
 	

enemy code:

extends CharacterBody2D

var health = 10


func _on_hitbox_area_entered(area: Area2D) -> void:
	if area.name == "bullet":
		queue_free()

what should i do?

The node names must be unique, and instanced scenes will often be assigned random-ish names, so ultimately using .name would support at most one bullet at a time. You could use groups to filter bullets, make sure to assign the bullet scene to a group.

if area.is_in_group("bullet"):

thanks