Can someone help me
make this
And here's the original code
@export var save =load("res://Scene/Zones/BaseZone.tscn")
@export var time =load("res://Scene/Zones/BaseZoneAct2.tscn")
@export var music = ["res://Audio/Soundtrack/LevelSelect.ogg", "res://Audio/Soundtrack/extras/Sonic Superstars OST - Main Menu.mp3","res://Audio/Soundtrack/extras/SD-Select_mid_Q4_Arachno SoundFont - Version 1.0.sf2.ogg","res://Audio/Soundtrack/extras/STT-Select_mid_Q4_Arachno SoundFont - Version 1.0.sf2.ogg","res://Audio/Soundtrack/extras/Sonic 3 HD Demo Track 2_38_ Data Select [YTmp3.net].mp3","res://Audio/Soundtrack/extras/25 Menu.mp3","res://Audio/Soundtrack/extras/Cascade Cave Zone, Act 1 (Menu, Variation 1) - Dr. Robotnik's Ring Racers Soundtrack [YTmp3.net].mp3"]
@export var music16 = ["res://Audio/Soundtrack/genisis/Sonic_2_-_Options_Screen_mid_Q4_SEGAudio.sf2.ogg", "res://Audio/Soundtrack/genisis/Sonic_Superstars.ogg","res://Audio/Soundtrack/genisis/SD-Select_mid_Q4_SEGAudio.sf2.ogg","res://Audio/Soundtrack/genisis/STT-Select_mid_Q4_SEGAudio.sf2.ogg","res://Audio/Soundtrack/genisis/Sonic_3_-_Data_Select_Screen_mid_Q4_SEGAudio.sf2.ogg","res://Audio/Soundtrack/genisis/Sonic4Ep1_Main_Menu_mid_Q4_SEGAudio.sf2.ogg","res://Audio/Soundtrack/extras/Cascade Cave Zone, Act 1 (Menu, Variation 1) - Dr. Robotnik's Ring Racers Soundtrack [YTmp3.net].mp3"]
@export var musicrem = ["res://Audio/Soundtrack/remixed/Options - Sonic 2 HD Demo 2.0 Music [YTmp3.net].mp3", "res://Audio/Soundtrack/remixed/Main Menu - Sonic Superstars Tune-Up Soundtrack _ Remix [YTmp3.net].mp3","res://Audio/Soundtrack/extras/SD-Select_mid_Q4_Arachno SoundFont - Version 1.0.sf2.ogg","res://Audio/Soundtrack/remixed/Sonic Triple Trouble 16 Bit - Decisions Decisions - Player Select - Fan Remix [YTmp3.net].mp3","res://Audio/Soundtrack/remixed/Sonic 3 Re-Imagined - Data Select Screen [YTmp3.net].mp3","res://Audio/Soundtrack/remixed/Sonic 4 Main Menu Remix (Old) [YTmp3.net].mp3","res://Audio/Soundtrack/extras/Cascade Cave Zone, Act 1 (Menu, Variation 1) - Dr. Robotnik's Ring Racers Soundtrack [YTmp3.net].mp3"]
@export var music16est = ["res://Audio/Soundtrack/genisis/Sonic_2_-_Options_Screen_mid_Q4_SEGAudio.sf2.ogg", "res://Audio/Soundtrack/genisis/Sonic_Superstars.ogg","res://Audio/Soundtrack/genisis/SD-Select_mid_Q4_SEGAudio.sf2.ogg","res://Audio/Soundtrack/genisis/STT-Select_mid_Q4_SEGAudio.sf2.ogg","res://Audio/Soundtrack/genisis/Easter egg/genesis/2024_02_26-18_57_11-PM_mid_Q4_SEGAudio.sf2.ogg","res://Audio/Soundtrack/genisis/Sonic4Ep1_Main_Menu_mid_Q4_SEGAudio.sf2.ogg","res://Audio/Soundtrack/extras/Cascade Cave Zone, Act 1 (Menu, Variation 1) - Dr. Robotnik's Ring Racers Soundtrack [YTmp3.net].mp3"]
@export var musicremest = ["res://Audio/Soundtrack/remixed/Options - Sonic 2 HD Demo 2.0 Music [YTmp3.net].mp3", "res://Audio/Soundtrack/remixed/Main Menu - Sonic Superstars Tune-Up Soundtrack _ Remix [YTmp3.net].mp3","res://Audio/Soundtrack/extras/SD-Select_mid_Q4_Arachno SoundFont - Version 1.0.sf2.ogg","res://Audio/Soundtrack/remixed/Sonic Triple Trouble 16 Bit - Decisions Decisions - Player Select - Fan Remix [YTmp3.net].mp3","res://Audio/Soundtrack/remixed/Easter egg/freakyMenu.ogg","res://Audio/Soundtrack/remixed/Sonic 4 Main Menu Remix (Old) [YTmp3.net].mp3","res://Audio/Soundtrack/extras/Cascade Cave Zone, Act 1 (Menu, Variation 1) - Dr. Robotnik's Ring Racers Soundtrack [YTmp3.net].mp3"]
@export var musicId = 0
@onready var selector_one = $"level names/test zone act selected/1"
@onready var selector_two = $"level names/test zone act selected/2"
@onready var selector_three = $"level names/Green sunset zone act selected/1"
@onready var selector_four = $"level names/Green sunset zone act selected/2"
@onready var selector_five = $"level names/soundtest selected/1"
var characterLabels = ["Sonic and Tails", "Sonic", "Tails", "Knuckles", "Amy"]
var characterID = 0
var selected = false
var songOptions =["res://Audio/Soundtrack/Test.ogg","res://Audio/Soundtrack/extras/Sunrise gate act 1.mp3","res://Audio/Soundtrack/extras/Sunrise gate act 2.mp3","res://Audio/Soundtrack/extras/Sunrise Gate Zone - Act 3.mp3", "res://Audio/Soundtrack/extras/y2mate.is - Mission Balloon Park Sonic Generations OST -OPDqj-qz58E-192k-1693809625.mp3","res://Audio/Soundtrack/extras/endless-mine-mania.ogg","res://Audio/Soundtrack/extras/Azure Lake Zone Act 1 - Sonic Mania Remix [YTmp3.net].mp3","res://Audio/Soundtrack/extras/Sonic Superstars OST - Bridge Island Zone Act 1 [YTmp3.net].mp3","res://Audio/Soundtrack/extras/Sonic Superstars OST - Bridge Island Zone Act 2 [YTmp3.net].mp3","res://Audio/Soundtrack/extras/Sonic Superstars OST - Pinball Carnival Zone Act 1 [YTmp3.net].mp3","res://Audio/Soundtrack/extras/Sonic Superstars OST - Pinball Carnival Zone Act 2 [YTmp3.net].mp3","res://Audio/Soundtrack/extras/Green Hill Zone - Lego Dimensions_ Sonic Pack [YTmp3.net].mp3","res://Audio/Soundtrack/extras/Green Hill (Classic) - Sonic Generations [OST] [YTmp3.net].mp3","res://Audio/Soundtrack/extras/Green Hill (Modern) - Sonic Generations [OST] [YTmp3.net].mp3","res://Audio/Soundtrack/extras/1-07 Green Hill Zone - Act 1.mp3","res://Audio/Soundtrack/extras/GreenHill2.ogg","res://Audio/Soundtrack/extras/Sonic Utopia OST - Green Hill Zone (1080p) [YTmp3.net].mp3","res://Audio/Soundtrack/extras/City Escape (Classic) - Sonic Generations [OST] [YTmp3.net].mp3","res://Audio/Soundtrack/extras/City Escape (Modern) - Sonic Generations [OST] [YTmp3.net].mp3","res://Audio/Soundtrack/extras/Casino Night Pinball - Sonic Generations [OST] [YTmp3.net].mp3","res://Audio/Soundtrack/extras/GG_Sonic_Triple_Trouble_Sunset_Park_mid_Q4_Arachno SoundFont - Version 1.0.sf2.ogg","res://Audio/Soundtrack/extras/GG_Sonic_Triple_Trouble_Sunset_Park_mid_Q4_Arachno SoundFont - Version 1.0.sf2.ogg","res://Audio/Soundtrack/extras/STT-Great_Turquoise_mid_Q4_Arachno SoundFont - Version 1.0.sf2.ogg","res://Audio/Soundtrack/extras/STT-Great_Turquoise_mid_Q4_Arachno SoundFont - Version 1.0.sf2.ogg","res://Audio/Soundtrack/extras/S4EP1_00_Z1A1_Normal_Mixed4816_wav.mp3","res://Audio/Soundtrack/extras/S4EP1_01_Z1A2_Normal_Mixed4816_wav.mp3","res://Audio/Soundtrack/extras/S4EP1_02_Z1A3_Normal_Mixed4816_wav.mp3","res://Audio/Soundtrack/extras/03 - Mixed03_EP2_Z1A1.mp3","res://Audio/Soundtrack/extras/04 - Mixed04_EP2_Z1A2.mp3","res://Audio/Soundtrack/extras/05 - Mixed05_EP2_Z1A3.mp3","res://Audio/Soundtrack/extras/07 - Mixed07_EP2_Z2A2.mp3"]
var Songtext =["00","01","02","03","04","05","06","07","08","09","010","011","012","013","014","015","016","017","018","019","020","021","022","023","024","025","026","027","028","029","030"]
var SONG_COUNT = 30
var current_selection = 0
func _ready():
if Global.music_style ==0:
var thisMusic = load(music[Global.MenuMusicChoiceArray[musicId]])
Global.music.stream = thisMusic
Global.music.play()
if Global.music_style ==1 and Global.easter ==0:
var thisMusic = load(music16[Global.MenuMusicChoiceArray[musicId]])
Global.music.stream = thisMusic
Global.music.play()
if Global.music_style ==2 and Global.easter ==0:
var thisMusic = load(musicrem[Global.MenuMusicChoiceArray[musicId]])
Global.music.stream = thisMusic
Global.music.play()
if Global.music_style ==1 and Global.easter ==1:
var thisMusic = load(music16est[Global.MenuMusicChoiceArray[musicId]])
Global.music.stream = thisMusic
Global.music.play()
if Global.music_style ==2 and Global.easter ==1:
var thisMusic = load(musicremest[Global.MenuMusicChoiceArray[musicId]])
Global.music.stream = thisMusic
Global.music.play()
set_current_selection(0)
func _process(delta):
if Input.is_action_just_pressed("gm_down") and current_selection < 4:
current_selection += 1
set_current_selection(current_selection)
elif Input.is_action_just_pressed("gm_up") and current_selection > 0:
current_selection -= 1
set_current_selection(current_selection)
elif Input.is_action_just_pressed("gm_pause"):
handle_selection(current_selection)
if !selected:
if Input.is_action_just_pressed("gm_action3"): # This is your character change button
characterID = wrapi(characterID + 1, 0, characterLabels.size())
update_character_visibility()
if Input.is_action_just_pressed("gm_action2") and (characterID == 0):
$CharacterOrigin/Tails.visible = not $CharacterOrigin/Tails.visible
if Input.is_action_just_pressed("gm_action") and current_selection ==4:
play_song()
match characterID:
0:
Global.PlayerChar1 = Global.CHARACTERS.SONIC
if $UI/Labels/CharacterOrigin/Tails.visible:
Global.PlayerChar2 = Global.CHARACTERS.TAILS
if not $UI/Labels/CharacterOrigin/Tails.visible:
Global.PlayerChar2 = Global.CHARACTERS.NONE
1:
Global.PlayerChar1 = Global.CHARACTERS.TAILS
Global.PlayerChar2 = Global.CHARACTERS.NONE
2:
Global.PlayerChar1 = Global.CHARACTERS.KNUCKLES
Global.PlayerChar2 = Global.CHARACTERS.NONE
3:
Global.PlayerChar1 = Global.CHARACTERS.AMY
Global.PlayerChar2 = Global.CHARACTERS.NONE
func update_character_visibility():
match characterID:
0:
$CharacterOrigin/Sonic.visible = true
$CharacterOrigin/Tails.visible = false
$CharacterOrigin/Knuckles.visible = false
$CharacterOrigin/Amy.visible = false
1:
$CharacterOrigin/Sonic.visible = false
$CharacterOrigin/Tails.visible = true
$CharacterOrigin/Knuckles.visible = false
$CharacterOrigin/Amy.visible = false
2:
$CharacterOrigin/Sonic.visible = false
$CharacterOrigin/Tails.visible = false
$CharacterOrigin/Knuckles.visible = true
$CharacterOrigin/Amy.visible = false
3:
$CharacterOrigin/Sonic.visible = false
$CharacterOrigin/Tails.visible = false
$CharacterOrigin/Knuckles.visible = false
$CharacterOrigin/Amy.visible = true
func update_charactersound_visibility():
match characterID:
0:
$"level icons/sound test icons/Sonic".visible = true
$"level icons/sound test icons/Tails".visible = false
$"level icons/sound test icons/Knuckles".visible = false
$"level icons/sound test icons/Amy".visible = false
1:
$"level icons/sound test icons/Sonic".visible = false
$"level icons/sound test icons/Tails".visible = true
$"level icons/sound test icons/Knuckles".visible = false
$"level icons/sound test icons/Amy".visible = false
2:
$"level icons/sound test icons/Sonic".visible = false
$"level icons/sound test icons/Tails".visible = false
$"level icons/sound test icons/Knuckles".visible = true
$"level icons/sound test icons/Amy".visible = false
3:
$"level icons/sound test icons/Sonic".visible = false
$"level icons/sound test icons/Tails".visible = false
$"level icons/sound test icons/Knuckles".visible = false
$"level icons/sound test icons/Amy".visible = true
func handle_selection(_current_selection):
if _current_selection == 0:
Global.main.change_scene_to_file(save, "FadeOut", "FadeOut", 1)
elif _current_selection == 1:
Global.main.change_scene_to_file(time, "FadeOut", "FadeOut", 1)
elif _current_selection == 2:
get_tree().quit()
elif _current_selection == 3:
get_tree().quit()
func set_current_selection(_current_selection):
selector_one.hide()
$"level names/test zone act selected".hide()
selector_two.hide()
$"level names/Green sunset zone act selected".hide()
selector_three.hide()
$"level names/soundtest selected".hide()
if _current_selection == 0:
$"level names/test zone act selected".show()
selector_one.show()
elif _current_selection == 1:
$"level names/test zone act selected".show()
selector_two.show()
elif _current_selection == 2:
$"level names/Green sunset zone act selected".show()
selector_three.show()
elif _current_selection == 3:
$"level names/Green sunset zone act selected".show()
selector_four.show()
elif _current_selection == 4:
$"level names/soundtest selected".show()
selector_five.show()
update_charactersound_visibility()
func _input(event):
if Input.is_action_just_pressed("gm_right"):
if Global.LevelSelectMusicChoiceArray[0] < SONG_COUNT - 1:
Global.LevelSelectMusicChoiceArray[0] += 1
$Label.text = Songtext[Global.LevelSelectMusicChoiceArray[0]]
if Input.is_action_just_pressed("gm_left"):
if Global.LevelSelectMusicChoiceArray[0] > 0:
Global.LevelSelectMusicChoiceArray[0] -= 1
$Label.text = Songtext[Global.LevelSelectMusicChoiceArray[0]]
if Songtext[Global.LevelSelectMusicChoiceArray[0]] == "04" && Songtext[Global.LevelSelectMusicChoiceArray[0]] == "01" && Songtext[Global.LevelSelectMusicChoiceArray[0]] == "02" && Songtext[Global.LevelSelectMusicChoiceArray[0]] == "06":
if Global.music_style ==0:
$Node2D3/AudioStreamPlayer2.play()
Global.emeralds = 127
if Global.music_style ==1:
$Node2D3/AudioStreamPlayer3.play()
Global.emeralds = 127
if Global.music_style ==2:
$Node2D3/AudioStreamPlayer4.play()
Global.emeralds = 127
$"level names/soundtest selected/1".text = Songtext[Global.LevelSelectMusicChoiceArray[0]]
func play_song():
Global.music.stream =load(songOptions[Global.LevelSelectMusicChoiceArray[0]])
Global.music.play()```