Can I take multiple inputs from the same LineEdit?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By firefall55

Currently I’m taking an input from the LineEdit node and using an ‘if’ statement for the response, but after the first ‘if’ statement the new input isn’t being registered? I was wondering if getting multiple inputs from the same LineEdit is possible.

Here is the code:

func _on_input_text_entered(new_text: String):		
if new_text == "forage":
	text = "You decide to forage for supplies."
	yield(get_tree().create_timer(2.0), "timeout")
	var value = test.randi_range(1,1)
	if value == 1:
		text = berry_text
		# NEW INPUT HERE
		if new_text == "yes":
			text = berry_accept
		if new_text == "no":
			text = berry_decline

Right now nothing happens when I try to input ‘yes’ or ‘no’ into the LineEdit after the text. I’m on version 3.3.2 if that helps.

:bust_in_silhouette: Reply From: Help me please

Yes LineEdit can take multiple inputs.
If you reread the code then you will find that all the code will work only if the new_text is forage. If the new_text is yes or no then that code will not even be executed.

Oh ok, I think I understand. Thanks for the help!

firefall55 | 2021-07-09 04:58