Welcome to the forums @IzZI127!
You could use a signal and a boolean to stop code execution until a button is pressed. It wouldn't be using yield, but it should achieve the same effect. Something like this (untested):
extends Control
# Will be used to check if the buttons are pressed or not
var is_buttons_pressed = false
func _ready():
# Get the button(s) and connect their pressed signal
get_node("ButtonNodeHere").connect("pressed", self, "_on_button_pressed")
func _process():
# check if the buttons have been pressed
if is_buttons_pressed == true:
print ("Button was pressed!)
# do whatever you need to do when a button is pressed here!
# set is_buttons_pressed to false so the code only gets called once per button press.
is_buttons_pressed = false
func _on_button_pressed():
is_buttons_pressed = true