I've just started practicing with Godot Engine, im trying some basic scripts to get used to the syntax,node systems and how everything should work.
I'm doing just some basic script in wich the enemy area emits a signal and identifies the player,if the player press a key ( something similar to attack ) the enemy will die ( get out of the scene ).
Here is my script so far :

extends KinematicBody2D
#var player = load("res://SCENE_001_PLAYER.tscn")
#var node_player = player.instance()
# getting a node
# var node = get_node("/root/scene_main_node/node_wanted")
# getting the node of the node
onready var node_player = get_tree().get_root().get_node("GAME").get_node("PLAYER")
onready var area = $Area2D
func _input(event):
if event.is_action_pressed("ui_ATTACK"):
print("key for attack was pressed")
func _ready():
area
#emits a sign for ENEMY node that something has entered in the Area2D
func _on_Area2D_body_entered(body):
var object = body
print(object," entered area")
if object == node_player :
# _on_Area2D_input_event()
if Input.is_action_just_pressed("ui_ATTACK") :
print("enemy was attacked")
queue_free()
#if object == node_player and Input.is_action_pressed("ui_ATTACK") :
# print("enemy was attacked")
# queue_free()