xyz
Wait so it's only when the game is exported that you can't write in res://? Wow, I never made a distinction between running from the editor and from the exported game.

The error is "0". This was the code:

func _ready() -> void:
	var config = ConfigFile.new();
	var error = config.save("res://Game/Config/testfile.vars");
	print(error);

Result: 0, and no file saved

    Godoten This was the code:

    That code creates an empty ConfigFile object and then writes it to a file.

    Try populating the object with some data.

    var config := ConfigFile.new()
    config.set_value("Player1", "player_name", "Steve")
    var error: Error = config.save("res://Game/Config/testfile.vars")
    print("config.save result=", error)

    Also, verify that this directory exists: res://Game/Config.

      DaveTheCoder I just found out what the problem was! Godot was not recognizing my .vars extension, so it doesn't show up in the Filesystem! I checked through Windows explorer and there are my files!

      Thank you so much to everyone for the help, I learned a lot about Godot with this issue! Also, some people on Reddit told me that there is not much point on encrypting my files since people will just decompile my game looking for the passwords. But I think I will stick with a basic encrypted ConfigFile anyways.

        Godoten some people told on Reddit told me that there is not much point on encrypting my files since people will just decompile my game looking for the passwords

        That's like saying there's no point in locking your car or house doors, since people will just break a window to get in.