local ui = script.Parent
local config = ui.Config
local events = ui.Events
local stage = ui.Stage.Value
local userinput = events.UserInput
local side = ui.PlayerSide.Value
local settings = require(stage.GameSettings)
side = ui.Game:FindFirstChild(side)
repeat wait() until stage.Config.Song.Value -- SONG CHOSEN HERE. Start up the game.
local song = stage.Config.Song.Value.Value
song = game.HttpService:JSONDecode(song).song
local bps, bpm = 60 / (song.bpm or 120), song.bpm
local songholder = stage.Config.Song.Value:FindFirstAncestorOfClass("StringValue") or stage.Config.Song.Value
local songholdera = stage.Config.Song.Value
script.Parent.Game.Playing.Text ="Playing: "..songholdera.Name
script.Parent.Game.Credits.Text = "By: "..stage.Songs[songholdera.Name].Credits.Value
script.Parent.SoundBar.Disabled = false
if songholder:FindFirstChild("Instrumental") then
game.SoundService.Inst.SoundId = songholder.Instrumental.Value
game.SoundService.Inst.PlaybackSpeed = songholder.Instrumental.PlaybackSpeed.Value
game.SoundService.Inst.Volume = songholder.Instrumental.Volume.Value
end
if songholder:FindFirstChild("Sound") then
game.SoundService.Vocals.SoundId = songholder.Sound.Value
game.SoundService.Vocals.PlaybackSpeed = songholder.Sound.PlaybackSpeed.Value
game.SoundService.Vocals.Volume = songholder.Sound.Volume.Value
end
spawn(function()
repeat wait() until stage.MusicPart["Go"].Played:Wait()
stage.MusicPart.Music.Volume = 0
stage.MusicPart.Vocals.Volume = 0
stage.MusicPart.Music.TimePosition = stage.Songs[songholder.Name].WhichSecItStarts.Value
stage.MusicPart.Vocals.TimePosition = stage.Songs[songholder.Name].WhichSecItStarts.Value
game.SoundService.Vocals:Play()
game.SoundService.Inst:Play()
game.SoundService.Inst.TimePosition = stage.Songs[songholder.Name].WhichSecItStarts.Value
game.SoundService.Vocals.TimePosition = stage.Songs[songholder.Name].WhichSecItStarts.Value
end)```