How to make a tween stop in a dialogue system??

Godot 4.2.1 =

Hello, i am working in a dialogue system to my game. This dialog system uses tweens to create the text of dialogue letter by letter in the richtextlabel.

The problem is in the function that skips these dialogue. This function should make all the letters of the rich text label be visible, however it does not works.

func smooth_dialogue( text, tween):
	dialog_line_label.visible_characters = 0
        var one_letter_time :float = 0.05
	var time_needed : float =  one_letter_time * len(text)
	tween = create_tween()
	one_letter_time = 0.05
	tween.connect("finished", on_tween_finished)

        tween.tween_property(dialog_line_label, "visible_characters", 
	len(text), time_needed)


How do i stop this tween and make the letters of dialogue be visible all at once or in a short period of time?

If I understand you correctly, you want the text to be instantly visible if player f.e. presses a button to skip appearing animation. In that case, I believe, this should work:

dialog_line_label.visible_characters = dialog_line_label.text.length()
func skip_text(tween: Tween, text: String) -> void:
	if is_instance_valid(tween):
		tween.kill()

	dialog_line_label.visible_characters = text.length()

	on_tween_finished() #I don't know if you also need this, depends on what it does