how can I do that when the audio is finished only then will all of this script will take place?

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

I’m making an horror game and I want to make a voiceline that only when the script will work. what should i do
this is the script, im stuck on it and idk what to do.

extends Node2D

var selected = false

func _ready():
pass
func _process(delta):
if selected:
followMouse()

var Points = 0

func followMouse():
position = get_global_mouse_position()

func _on_Area2D_input_event(viewport, event, shape_idx):
if event is InputEventMouseButton and event.button_index == BUTTON_LEFT:
if event.pressed:
selected = true
else:
selected = false