Modded
local TTorso
local DataStoreService = game:GetService(“DataStoreService”)
local HttpService = game:GetService(“HttpService”)
local tool = script:FindFirstAncestorWhichIsA(“Tool”)
local func = tool:FindFirstChildWhichIsA(“RemoteFunction”)
local store = DataStoreService:GetDataStore(“BoomboxFavourites”)
func.OnServerInvoke = function(player, action, data)
if action == "RequestSongs" then
if data.SearchKeyword == "favs" then
return "favs"
end
local songs = nil
--> Request songs list from proxy server:
repeat
local url = string.format("https://search.RoProxy.com/catalog/json?CatalogContext=2&Subcategory=16&CreatorID=1&SortAggregation=5&PageNumber=%i&Keyword=%s&LegendExpanded=true&Category=9&SearchId=3e31c553-b9e1-4811-8ba4-c0c511cf915f", data.PageNumber, data.SearchKeyword)
local success, errormsg = pcall(function()
songs = HttpService:JSONDecode(HttpService:RequestAsync({Url = url, Method = "GET"}).Body) --> Get songs from search.roblox.com result
end)
if not success then
warn(errormsg)
task.wait(.2)
end
until success
if not songs then
songs = { --> List of default audios to load:
{Name = "fnaf beatbox", AssetId = 8106213926, Description = "Length: 0s"},
{Name = "Heart and soul", AssetId = 6515159451, Description = "Length: 0s"},
{Name = "Good vibes", AssetId = 1836454862, Description = "Length: 0s"},
{Name = "Blue vibes", AssetId = 1835804758, Description = "Length: 0s"},
{Name = "fnaf beatbox", AssetId = 8106213926, Description = "Length: 0s"},
{Name = "fnaf beatbox", AssetId = 8106213926, Description = "Length: 0s"},
{Name = "fnaf beatbox", AssetId = 8106213926, Description = "Length: 0s"},
{Name = "fnaf beatbox", AssetId = 8106213926, Description = "Length: 0s"},
{Name = "fnaf beatbox", AssetId = 8106213926, Description = "Length: 0s"},
{Name = "fnaf beatbox", AssetId = 8106213926, Description = "Length: 0s"},
}
end
return songs
elseif action == "UpdateSound" then
if player.Character:FindFirstChild("HumanoidRootPart") ~= nil then
TTorso = player.Character.HumanoidRootPart
else
TTorso = player.Character.HumanoidRootPart
end
if TTorso:FindFirstChild("Sound") then
TTorso:FindFirstChild("Sound"):Remove()
end
local Sound = Instance.new'Sound'
Sound.Parent = TTorso
Sound.Volume = 0.8
Sound.Looped = true
Sound.Name = "Sound"
Sound.SoundId = string.format("rbxassetid://%i", data.Id)
Sound:Play()
elseif action == "Play" then
TTorso:FindFirstChild("Sound"):Resume()
–[[
elseif action == “Pause” then
TTorso:FindFirstChild(“Sound”):Pause()
–]]
elseif action == “ChangeTime” then
TTorso:FindFirstChild(“Sound”).TimePosition = data.TimePosition
elseif action == "GetFavourites" then
return store:GetAsync(tostring(player.UserId)) or {}
elseif action == "SaveFavourites" then
store:SetAsync(tostring(player.UserId), data)
end
return "Invalid action name!"
end