onready needs an @ in Godot 4.x, sadly ChatGPT often recommends mixing 3.x and 4.x code
onready
@
Make sure to paste code with proper formatting