[Resuelto]
Buenas, llevo apenas unos meses con Godot y aprendiendo de cero programación, me encontré con este problema intentado hacer una maquina de estados, seguí paso a paso los tutoriales:

pero me sigue tirando error, mas específicamente el "Invalid get index 'idle' (on base: 'Dictionary'), les dejo el código de la maquina de estados base y la que se encuentra como un nodo en el jugador por si alguno sabe bien, de antemano gracias.
pd: Ni idea como funciona bien el editor del foro jaja, por eso quedo asi

var state = null
var previous_state = null
var states = {} #Diccionario de estados

onready var parent = get_parent()

func _physics_process(delta):
	if state != null:
		_state_logic(delta)
		var transition = _get_transition(delta)
		if transition != null:
			set_state(transition)
	
func _state_logic(delta):
	pass

func _get_transition(delta):
	return null

func _enter_state(new_state , old_state):
	pass

func _exit_state(old_state , new_state):
	pass

func set_state(new_state):
	previous_state = state
	state = new_state
	
	if previous_state != null: 
		_exit_state(previous_state , new_state)
	if new_state != null:
		_enter_state(new_state , previous_state)

func add_state(state_name):
	pass

`

`
extends state_machine

func _ready():
	add_state("idle")
	add_state("run")
	add_state("jump")
	add_state("fall")
	call_deferred("set_state" , states.idle)

func _input(event):
	if [states.idle , states.run].has(state):
		if event.is_action_pressed("saltar"):
			parent.velocity.y = parent.jump_velocity

func _state_logic(delta):
	parent._handle_move_input()
	parent._apply_movement()
	parent._apply_gravity(delta)

func _get_transition(delta):
	match state:
		states.idle:
			if !parent.is_on_floor():
				if parent.velocity.y < 0:
					return states.jump
				elif parent.velocity.y > 0:
					return states.fall
			elif parent.velocity.x != 0:
				return states.run
		states.run:
			if !parent.is_on_floor():
				if parent.velocity.y < 0:
					return states.jump
				elif parent.velocity.y > 0:
					return states.fall
			elif parent.velocity.x == 0:
				return states.idle
		states.run:
			if parent.is_on_floor():
				return states.idle
			elif parent.velocity.y >= 0:
				return states.fall
		states.fall:
			if parent.is_on_floor():
				return states.idle
			elif parent.velocity.y < 0:
				return states.jump
	
	return null

func _enter_state(new_state , old_state):
	match new_state:
		states.idle:
			parent.anim_player.play("idle")
		states.run:
			parent.anim_player.play("run")
		states.jump:
			parent.anim_player.play("jump")
		states.fall:
			parent.anim_player.play("fall")

func _exit_state(old_state , new_state):
	pass

    Necroas Sorry, I don't speak Spanish so I'll respond in English.
    Your issue is the way you try to acces the dictionary.
    To retrieve a value from a dictionary you have to use dictionary[key] to retrieve the value associated to that key. For example in your code states["idle"].

    Having said that, it makes more sense to use an enumeration in this case instead of a dictionary for the states:

    enum states {
    idle,
    run,
    jump,
    fall
    }

    Then you can use states.idle, states.run, etc. The way the code was written was already using an enumeration and not a dictionary. But the method add_state(state_name) would be obsolete since you'd have to specify the states in the enumeration upon creation.

      RichNaoo
      My god, you don't know how long I've been waiting for it to work jajaj
      thank you very much, after adding the enum I deleted the states variable and it works, now I just have to fix some things but you are a genius, thank you very much again!