mirror of
https://github.com/Cookie-CHR/OfficeMadness-LD51.git
synced 2024-11-22 06:44:18 +00:00
17 lines
304 B
GDScript3
17 lines
304 B
GDScript3
|
extends AudioStreamPlayer
|
||
|
|
||
|
|
||
|
|
||
|
func _play(sound):
|
||
|
volume_db = 2
|
||
|
self.stream = load("res://Music/"+sound+".mp3")
|
||
|
if(not Muter.get_mute()):
|
||
|
play()
|
||
|
|
||
|
if connect("finished", self, "reset_to_default"):
|
||
|
print("An error has occurred: could not connect the sound")
|
||
|
|
||
|
|
||
|
func reset_to_default():
|
||
|
queue_free()
|