Why am I getting these errors in my code? Строка 1:Unexpected "Identifier" in class body. Строка 4:Unexpected "Identifier" in class body.

Godot Version

4.3

Question

Ask your question here! Try to give as many details as possible

Why am I getting these errors in my code?:

extends Control

onready var nickname_input = $LineEdit

onready var confirm_button = $Button

func _ready():
confirm_button.connect(“pressed”, self, “_on_confirm_button_pressed”)

func _on_confirm_button_pressed():
var nickname = nickname_input.text

if nickname.strip_edges() == "":
    print("Никнейм не может быть пустым!")
    return

Global.player_nickname = nickname

get_tree().change_scene("res://GameScene.tscn")

In godot4 I think it’s @onready not just onready.

You’re using Godot 3 GDScript syntax in a Godot 4 environment. Use @onready instead of onready.

Also,

confirm_button.connect(“pressed”, self, “_on_confirm_button_pressed”)

This still works but is outdated syntax. You can simply do this instead:

confirm_button.connect(_on_confirm_button_pressed.bind())