local ReplicatedStorage = game:GetService("ReplicatedStorage") local LMSSongs = ReplicatedStorage :WaitForChild("Sounds") :WaitForChild("Songs") :WaitForChild("LMSSongs") local LOCAL_FOLDER = "GameSounds" -- what folder the downloaded assets go to, in workspace local DEFAULT_VOLUME = 1 local SoundMap = { [LMSSongs.Eternity] = "https://files.catbox.moe/i5f9k1.ogg", [LMSSongs["Teapot Paradise"]] = "https://files.catbox.moe/41iu2i.ogg", [LMSSongs.Omegaware] = "https://files.catbox.moe/lzl8q3.ogg", [LMSSongs.Forsaken] = "https://files.catbox.moe/w4l4o1.ogg", [LMSSongs.Careless] = "https://files.catbox.moe/1cvytn.ogg", [LMSSongs.RevolverVsKilldroid] = "https://files.catbox.moe/88mmjf.ogg", [LMSSongs.BananaVsArtful] = "https://files.catbox.moe/k1fz16.ogg", [LMSSongs["Double Trouble"]] = "https://files.catbox.moe/095qjl.ogg", [LMSSongs.Y2K] = "https://files.catbox.moe/sgcq5n.ogg", [LMSSongs["One Bounce"]] = "https://files.catbox.moe/a8vi4b.ogg", } local function fetchUrl(url) if syn and syn.request then local r = syn.request({ Url = url, Method = "GET" }) if r and r.Body then return true, r.Body end end if http and http.request then local r = http.request({ Url = url, Method = "GET" }) if r and r.Body then return true, r.Body end end if request then local r = request({ Url = url, Method = "GET" }) if r and r.Body then return true, r.Body end end return false end local function writeFile(name, data) if not (makefolder and writefile) then return nil end if not isfolder(LOCAL_FOLDER) then makefolder(LOCAL_FOLDER) end local path = LOCAL_FOLDER .. "/" .. name writefile(path, data) return path end local function pathToAsset(path) if getcustomasset then return getcustomasset(path) elseif getsynasset then return getsynasset(path) end end local function applySound(sound, assetId) if not sound:IsA("Sound") then return end local wasPlaying = sound.IsPlaying sound.SoundId = assetId sound.Volume = DEFAULT_VOLUME if wasPlaying then sound:Stop() sound:Play() end end for sound, url in pairs(SoundMap) do if sound and sound:IsA("Sound") then print("[LMSSongs] Replacing:", sound.Name) local ok, data = fetchUrl(url) if not ok then warn("Failed to fetch:", url) continue end local filename = sound.Name:gsub("%s+", "_") .. ".ogg" local path = writeFile(filename, data) if not path then warn("Failed to write file for:", sound.Name) continue end local assetId = pathToAsset(path) if not assetId then warn("Failed to create asset for:", sound.Name) continue end applySound(sound, assetId) end end print("[LMSSongs] All mapped sounds replaced.")