Pretty simple script I've got, but I still can't understand GDScripts way of assinging values/strings etc. and it seems to have a problem every single time I try to do anything and says it's a null value and can't do anything with it.

extends TextureProgressBar

@onready var timer:float = 1.0
var main = load("res://Scripts/MoneyScript.gd").new()

###########################

func _ready():
	pass
func _process(delta):
	pass

###########################

func progressBarGo():
	timer = await get_tree().create_timer(1.0).timeout
	self.value = timer

func onAzureTimerDone():
	pass

This is more of a help me understand rather than give me a solution because I just can't seem to get how this language works.
What does it mean can't call on a null value? That it can't do anything because the 'timer' variable is null? But it's assigned as a 'float' with the '@onready' value at the start. I've tried looking through a couple tutorials on youtube or forum posts but my pea brain isn't getting it. Any documentation of sorts you recommend to help me avoid basic issues like this would be nice thank you.

    What are you trying to achieve? And please post the exact error message if you get one.

    TigwerSparkz But it's assigned as a 'float' with the '@onready' value at the start.

    Yes, at the start timer is a float but later on you assign it something new here:

    timer = await get_tree().create_timer(1.0).timeout

    What does that even return? I suppose that is where your null is coming from.

    1. You don't need to use @onready for timer as you did in your script. @onready is required only for variables depending on scene tree (like for example children of your node), but if you want to assign some constant value you can do it without @onready.
    2. Not sure what you exactly expect from this line timer = await get_tree().create_timer(1.0).timeout. This part await get_tree().create_timer(1.0).timeout is just waiting for timeout signal to be emitted by timer you created in scene tree. I don't know what is return value of await in case of waiting for signal, probably null, so you assign timer = null and then you try to use that.

    GDScript is very similar to Python. Remember that variables may change their type, so there is no problem with something like:

    var test = "string" # test is String
    $myLabel.text = test # Ok because test is String and text is also String
    test = 12.5 # test is float now
    transform.origin.y =  test # Ok, because y is float and test is also float now

    TigwerSparkz What does it mean can't call on a null value?

    "Invalid call" and "Invalid get index" are the most common runtime errors a beginner will encounter. They are actually the same error that has to do with accessing properties or methods using the dot syntax. You normally do it like this:

    object.property # get object's property
    object.method() # call object's method

    All is well if the variable object does indeed contain a reference to an object posessing a given property or a method. However if the object doesn't have it, one of the above errors will be thrown; invalid get index when accessing a property or invalid call when calling a method.

    The worst case of this is when the object is not defined at all, like when you declare a variable but don't initialize it.

    So here are some examples:

    var s = "hello" 
    s.my_property

    ^ Invalid get index "my_property' (on base: 'String') - you're trying to access a non exsistent property of class String named my_property. Built in class String does not have my_property.

    var s
    s.my_property

    ^ Invalid get index "my_property' (on base: 'Nil') - you're trying to access a property of a undefined variable, whose value is null or Nil as the error calls it.

    var s = null
    s.my_property

    ^ Invalid get index "my_property' (on base: 'Nil') - exactly the same as previous error but here the null value is explicitly assigned

    The invalid call error is analogous to this but happens when you call a nonexistent method or the base object on which you're calling it is null.

    var s = "hello"
    s.my_method()

    ^ Invalid call. Nonexistent function "my_method' (on base: 'String') - you're trying to call a non exsistent method of class String named my_method. Built in class String does not have my_method.

    var s
    s.my_method()

    ^ Invalid call. Nonexistent function "my_method' (on base: 'Nil') - you're trying to call a method on a undefined variable whose value is null.

    So when you get one of those errors always check if the variable you're using with the dot syntax is of expected type and its value is not null. The error message is actually quite informative and straightforward, if you know how to read it.