I get this error "Expected end of statement after expression, found ":" instead."

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By givenmnisi6
try:
	$AudioStreamPlayer.stream = load("res://Audio/Voice/" + story[i_story] + str(tot_count) + ".wav")
	$AudioStreamPlayer.play()
except:
	pass
$PageTurn.frame = 0
:bust_in_silhouette: Reply From: Mr. Gamezz

I’m pretty sure it’s because Godot doesn’t offer try or except. You need to use if err == OK: when you attempt to load it, try this:

error = load("res://Audio/Voice/" + story[i_story] + str(tot_count) + ".wav")
if error == OK:
    $AudioStreamPlayer.stream = load("res://Audio/Voice/" + story[i_story] + str(tot_count) + ".wav")
    $AudioStreamPlayer.play()