Seems like you are missing indentations on 9th and 11th line? Godot uses indentation to determines body of loops, functions and such.