Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Background = script.Parent.Background
- function create(class, parent)
- local cre = LoadLibrary("RbxUtility").Create
- return function(properties)
- local inst = cre(class)(properties)
- inst.Parent = parent
- return inst
- end
- end
- local function shuffleTable(t)
- math.randomseed(tick())
- assert(t, "shuffleTable() expected a table, got nil")
- local iterations = #t
- local j
- for i = iterations, 2, -1 do
- j = math.random(i)
- t[i], t[j] = t[j], t[i]
- end
- end
- local Songs = {
- }
- local SongNum = 0
- local http = game:GetService("HttpService")
- local songs = http:JSONDecode(http:GetAsync("https://api.trello.com/1/lists/586598f76101622fdd6b2ccc/cards"))
- for _, v in pairs(songs) do
- if v.name:match(":") ~= nil then
- local s, f = string.find(v.name, ":")
- table.insert(Songs, string.sub(v.name, f + 1))
- game:GetService("ContentProvider"):Preload("rbxassetid://" .. string.sub(v.name, f + 1))
- print(Songs[#Songs])
- end
- end
- shuffleTable(Songs)
- while wait() do
- SongNum = SongNum + 1
- if SongNum > #Songs then
- SongNum = 1
- end
- Background:TweenPosition(UDim2.new(0.5, -140, 0, 10), "Out", "Back", 0.5)
- Background.CurrentSong.Text = game:GetService("MarketplaceService"):GetProductInfo(Songs[SongNum]).Name
- wait(5)
- Background:TweenPosition(UDim2.new(0.5, -140, -0.5, 10), "Out", "Back", 0.5)
- local Song = "rbxassetid://" .. Songs[SongNum]
- create("Sound", script.Parent.Parent) {
- Volume = 1;
- SoundId = Song;
- Name = "Music";
- }
- local Sound = script.Parent.Parent:FindFirstChild("Music")
- Sound:Play()
- wait(120)
- Sound:Stop()
- wait()
- Sound:Destroy()
- end
- -- Copyrighted by Coltenlange111
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement