Why my code is not working?

Godot Version 4.2.2

Why my code is not working?

Code:

extends Node

var save_path = “user://Save&Load./Save.save”

var NickName = Nickname.nickname

func _save():
var file = FileAccess.open(save_path, FileAccess.WRITE)
file.store_var(Nickname.name)

func _load():
var file = FileAccess.open(save_path, FileAccess.READ)
NickName = file.get_var(save_path)

func _ready():
if FileAccess.file_exists(save_path):
if NickName != “Dev”:
get_tree().change_scene_to_file(“res://Menuuu/Menu.tscn”)

func _on_button_pressed():
_save()
get_tree().change_scene_to_file(“res://Menuuu/Menu”)

Please be specific when you say something doesn’t work. Messages? Also would help if you pasted your code using the </> formatter on the menu.

2 Likes

maybe this is mising a .tscn

This seems like an invalid path, & is I think illegal on windows.


Make sure to state what isn’t working by say what you expected to happen vs what really happened, otherwise I’ve only got these scatter shot ideas.