I got a error caled "Identifire not declared in curent scope"I dont know what to do


func _process(delta):
	$Label.text = p1_score
	$Label2.text = str(Main.p2_score)

func _on_top_body_entered(body):
	body.direction.y *= -1 

func _on_bottom_body_entered(body):
	body.direction.y *= -1 

func _on_left_body_entered(body):
	body.queue_free()
	var e = preload("res://ball.tscn").instantiate()
	e.global_position = Vector2(576,320)
	add_child(e)
	Main.p2_score += 1

func _on_right_body_entered(body):
	body.queue_free()
	var e = preload("res://ball.tscn").instantiate()
	e.global_position = Vector2(576,320)
	add_child(e)
	Main.p1_score += 1

```The problem is here :
$Label.text = p1_score
$Label2.text = str(Main.p2_score)
And here:
Main.p2_score += 1
Main.p1_score += 1

It means that the identifiers p1_score and p2_score are not declared.

Do you have something like this to set them initially?

var p1_score: int = 0
var p2_score: int = 0
(assuming you want them to be integers)

PS Put this at the top of your file, just below the extends line and before your first function.

EDIT: Just to explain, if I asked you to put the ZOZO in the cupboard, you would say “what is the ZOZO”. But if I said a ZOZO was a loaf of bread, now can you put the ZOZO in the cupboard, you would understand. For your code, if you refer to a variable, you have to tell the machine what that variable is. I hope that helps.
(In scope and out of scope is too much to describe here, google it, it is something you will have to understand either now or later, the sooner the better.)