Spotify
Key RequiredUniversal

Spotify

Universal Scriptvavonodvavonod 115 views 2.6K executesUpdated Aug 24, 2026
Unrated
00
Lua Script•436 lines (15925 chars)
--[[
    🎵 Roblox Spotify Player v5.3 (Up to 2.0x Speed + Smooth UI)
    - Скорость воспроизведения до 2.0x (⚡).
    - Плавная анимация сворачивания шторки (TweenService).
    - Кликабельная полоса прогресса (Seek Bar) и таймер.
    - Отображение чистых Audio ID.
]]

local Players = game:GetService("Players")
local SoundService = game:GetService("SoundService")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local localPlayer = Players.LocalPlayer

local SAVE_FILE_NAME = "RobloxSpotify_SavedPlaylists.json"

local musicPlayer = SoundService:FindFirstChild("SpotifyMusicPlayer")
if not musicPlayer then
    musicPlayer = Instance.new("Sound")
    musicPlayer.Name = "SpotifyMusicPlayer"
    musicPlayer.Volume = 0.5
    musicPlayer.Parent = SoundService
end

local playlists = {
    ["Liked Songs ❤️"] = {},
}
local currentPlaylistName = "Liked Songs ❤️"
local currentTrackIndex = 1
local isPlaying = false
local isLooping = false
local currentSpeedIndex = 1
local speeds = {1.0, 1.25, 1.5, 2.0, 0.8} -- Добавлена скорость x2.0

local function formatTime(seconds)
    if not seconds or seconds ~= seconds or seconds == math.huge then return "00:00" end
    local mins = math.floor(seconds / 60)
    local secs = math.floor(seconds % 60)
    return string.format("%02d:%02d", mins, secs)
end

local function loadData()
    if readfile and isfile and isfile(SAVE_FILE_NAME) then
        local success, decoded = pcall(function()
            return game:GetService("HttpService"):JSONDecode(readfile(SAVE_FILE_NAME))
        end)
        if success and decoded then playlists = decoded end
    end
end

local function saveData()
    if writefile then
        pcall(function()
            writefile(SAVE_FILE_NAME, game:GetService("HttpService"):JSONEncode(playlists))
        end)
    end
end

loadData()

-- ================= GUI ИНТЕРФЕЙС =================
local playerGui = localPlayer:WaitForChild("PlayerGui")
if playerGui:FindFirstChild("RobloxSpotifyGuiV5") then
    playerGui.RobloxSpotifyGuiV5:Destroy()
end

local screenGui = Instance.new("ScreenGui", playerGui)
screenGui.Name = "RobloxSpotifyGuiV5"
screenGui.ResetOnSpawn = false

local mainFrame = Instance.new("Frame", screenGui)
mainFrame.Size = UDim2.new(0, 320, 0, 440)
mainFrame.Position = UDim2.new(0.5, -160, 0.3, -220)
mainFrame.BackgroundColor3 = Color3.fromRGB(18, 18, 18)
mainFrame.Active = true
mainFrame.Draggable = true
mainFrame.ClipsDescendants = true
Instance.new("UICorner", mainFrame).CornerRadius = UDim.new(0, 12)

-- Шапка
local topBar = Instance.new("Frame", mainFrame)
topBar.Size = UDim2.new(1, 0, 0, 40)
topBar.BackgroundTransparency = 1
topBar.ZIndex = 2

local logoLabel = Instance.new("TextLabel", topBar)
logoLabel.Size = UDim2.new(0.6, 0, 1, 0)
logoLabel.Position = UDim2.new(0, 15, 0, 0)
logoLabel.BackgroundTransparency = 1
logoLabel.Text = "🟢 Spotify Pro"
logoLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
logoLabel.TextSize = 15
logoLabel.Font = Enum.Font.GothamBold
logoLabel.TextXAlignment = Enum.TextXAlignment.Left

local minimizeBtn = Instance.new("TextButton", topBar)
minimizeBtn.Size = UDim2.new(0, 30, 0, 30)
minimizeBtn.Position = UDim2.new(1, -70, 0, 5)
minimizeBtn.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
minimizeBtn.Text = "_"
minimizeBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
minimizeBtn.TextSize, minimizeBtn.Font = 14, Enum.Font.GothamBold
Instance.new("UICorner", minimizeBtn).CornerRadius = UDim.new(0, 6)

local closeBtn = Instance.new("TextButton", topBar)
closeBtn.Size = UDim2.new(0, 30, 0, 30)
closeBtn.Position = UDim2.new(1, -35, 0, 5)
closeBtn.BackgroundTransparency = 1
closeBtn.Text = "✕"
closeBtn.TextColor3 = Color3.fromRGB(150, 150, 150)
closeBtn.TextSize = 16
closeBtn.Font = Enum.Font.GothamBold

-- Скролл треков
local trackScroll = Instance.new("ScrollingFrame", mainFrame)
trackScroll.Size = UDim2.new(1, -30, 0, 120)
trackScroll.Position = UDim2.new(0, 15, 0, 45)
trackScroll.BackgroundColor3 = Color3.fromRGB(28, 28, 28)
trackScroll.BorderSizePixel = 0
trackScroll.AutomaticCanvasSize = Enum.AutomaticSize.Y
Instance.new("UICorner", trackScroll).CornerRadius = UDim.new(0, 8)

local uiList = Instance.new("UIListLayout", trackScroll)
uiList.SortOrder = Enum.SortOrder.LayoutOrder
uiList.Padding = UDim.new(0, 5)

-- Добавление трека
local inputFrame = Instance.new("Frame", mainFrame)
inputFrame.Size = UDim2.new(1, -30, 0, 35)
inputFrame.Position = UDim2.new(0, 15, 0, 175)
inputFrame.BackgroundTransparency = 1

local idTextBox = Instance.new("TextBox", inputFrame)
idTextBox.Size = UDim2.new(0.65, -5, 1, 0)
idTextBox.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
idTextBox.PlaceholderText = "Audio ID..."
idTextBox.Text = ""
idTextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
idTextBox.TextSize = 11
idTextBox.Font = Enum.Font.Gotham
Instance.new("UICorner", idTextBox).CornerRadius = UDim.new(0, 6)

local addBtn = Instance.new("TextButton", inputFrame)
addBtn.Size = UDim2.new(0.35, 0, 1, 0)
addBtn.Position = UDim2.new(0.65, 5, 0, 0)
addBtn.BackgroundColor3 = Color3.fromRGB(30, 215, 96)
addBtn.Text = "+ Добавить"
addBtn.TextColor3 = Color3.fromRGB(0, 0, 0)
addBtn.TextSize = 11
addBtn.Font = Enum.Font.GothamBold
Instance.new("UICorner", addBtn).CornerRadius = UDim.new(0, 6)

-- Блок управления плеером
local playerControlFrame = Instance.new("Frame", mainFrame)
playerControlFrame.Size = UDim2.new(1, -30, 0, 210)
playerControlFrame.Position = UDim2.new(0, 15, 0, 218)
playerControlFrame.BackgroundColor3 = Color3.fromRGB(24, 24, 24)
Instance.new("UICorner", playerControlFrame).CornerRadius = UDim.new(0, 8)

local currentTrackLabel = Instance.new("TextLabel", playerControlFrame)
currentTrackLabel.Size = UDim2.new(1, -20, 0, 20)
currentTrackLabel.Position = UDim2.new(0, 10, 0, 6)
currentTrackLabel.BackgroundTransparency = 1
currentTrackLabel.Text = "Трек не выбран"
currentTrackLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
currentTrackLabel.TextSize = 11
currentTrackLabel.Font = Enum.Font.GothamBold
currentTrackLabel.TextXAlignment = Enum.TextXAlignment.Left

-- Шкала прогресса (Seek Bar)
local progressBarBg = Instance.new("Frame", playerControlFrame)
progressBarBg.Size = UDim2.new(1, -20, 0, 6)
progressBarBg.Position = UDim2.new(0, 10, 0, 32)
progressBarBg.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
Instance.new("UICorner", progressBarBg).CornerRadius = UDim.new(0, 3)

local progressBarFill = Instance.new("Frame", progressBarBg)
progressBarFill.Size = UDim2.new(0, 0, 1, 0)
progressBarFill.BackgroundColor3 = Color3.fromRGB(30, 215, 96)
Instance.new("UICorner", progressBarFill).CornerRadius = UDim.new(0, 3)

local progressBtn = Instance.new("TextButton", progressBarBg)
progressBtn.Size = UDim2.new(1, 0, 1, 0)
progressBtn.BackgroundTransparency = 1
progressBtn.Text = ""

local timerLabel = Instance.new("TextLabel", playerControlFrame)
timerLabel.Size = UDim2.new(1, -20, 0, 16)
timerLabel.Position = UDim2.new(0, 10, 0, 42)
timerLabel.BackgroundTransparency = 1
timerLabel.Text = "00:00 / 00:00"
timerLabel.TextColor3 = Color3.fromRGB(150, 150, 150)
timerLabel.TextSize = 10
timerLabel.Font = Enum.Font.GothamMedium

-- Кнопки плеера
local btnBack = Instance.new("TextButton", playerControlFrame)
btnBack.Size = UDim2.new(0, 35, 0, 32)
btnBack.Position = UDim2.new(0, 10, 0, 65)
btnBack.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
btnBack.Text = "⏮"
btnBack.TextColor3 = Color3.fromRGB(255, 255, 255)
Instance.new("UICorner", btnBack).CornerRadius = UDim.new(0, 6)

local btnPlay = Instance.new("TextButton", playerControlFrame)
btnPlay.Size = UDim2.new(0, 70, 0, 32)
btnPlay.Position = UDim2.new(0, 50, 0, 65)
btnPlay.BackgroundColor3 = Color3.fromRGB(30, 215, 96)
btnPlay.Text = "▶ Play"
btnPlay.TextColor3 = Color3.fromRGB(0, 0, 0)
btnPlay.TextSize, btnPlay.Font = 12, Enum.Font.GothamBold
Instance.new("UICorner", btnPlay).CornerRadius = UDim.new(0, 6)

local btnNext = Instance.new("TextButton", playerControlFrame)
btnNext.Size = UDim2.new(0, 35, 0, 32)
btnNext.Position = UDim2.new(0, 125, 0, 65)
btnNext.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
btnNext.Text = "⏭"
btnNext.TextColor3 = Color3.fromRGB(255, 255, 255)
Instance.new("UICorner", btnNext).CornerRadius = UDim.new(0, 6)

-- Кнопка повтора (Loop)
local loopBtn = Instance.new("TextButton", playerControlFrame)
loopBtn.Size = UDim2.new(0, 55, 0, 32)
loopBtn.Position = UDim2.new(0, 165, 0, 65)
loopBtn.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
loopBtn.Text = "🔁 OFF"
loopBtn.TextColor3 = Color3.fromRGB(180, 180, 180)
loopBtn.TextSize = 10
loopBtn.Font = Enum.Font.GothamBold
Instance.new("UICorner", loopBtn).CornerRadius = UDim.new(0, 6)

-- Кнопка скорости (теперь с x2.0)
local speedBtn = Instance.new("TextButton", playerControlFrame)
speedBtn.Size = UDim2.new(0, 60, 0, 32)
speedBtn.Position = UDim2.new(0, 225, 0, 65)
speedBtn.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
speedBtn.Text = "⚡ 1.0x"
speedBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
speedBtn.TextSize = 10
speedBtn.Font = Enum.Font.GothamBold
Instance.new("UICorner", speedBtn).CornerRadius = UDim.new(0, 6)

-- Громкость
local volLabel = Instance.new("TextLabel", playerControlFrame)
volLabel.Size = UDim2.new(0, 100, 0, 25)
volLabel.Position = UDim2.new(0, 10, 0, 110)
volLabel.BackgroundTransparency = 1
volLabel.Text = "Громкость: 50%"
volLabel.TextColor3 = Color3.fromRGB(180, 180, 180)
volLabel.TextSize = 11
volLabel.TextXAlignment = Enum.TextXAlignment.Left

local volDown = Instance.new("TextButton", playerControlFrame)
volDown.Size = UDim2.new(0, 35, 0, 22)
volDown.Position = UDim2.new(1, -85, 0, 110)
volDown.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
volDown.Text = "-"
volDown.TextColor3 = Color3.fromRGB(255, 255, 255)
Instance.new("UICorner", volDown).CornerRadius = UDim.new(0, 4)

local volUp = Instance.new("TextButton", playerControlFrame)
volUp.Size = UDim2.new(0, 35, 0, 22)
volUp.Position = UDim2.new(1, -45, 0, 110)
volUp.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
volUp.Text = "+"
volUp.TextColor3 = Color3.fromRGB(255, 255, 255)
Instance.new("UICorner", volUp).CornerRadius = UDim.new(0, 4)


-- ================= ПЛАВНАЯ АНИМАЦИЯ СВОРАЧИВАНИЯ =================
local isMinimized = false
minimizeBtn.MouseButton1Click:Connect(function()
    isMinimized = not isMinimized
    
    local targetSize = isMinimized and UDim2.new(0, 320, 0, 40) or UDim2.new(0, 320, 0, 440)
    local tweenInfo = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
    
    local tween = TweenService:Create(mainFrame, tweenInfo, {Size = targetSize})
    tween:Play()
    
    minimizeBtn.Text = isMinimized and "□" or "_"
end)

closeBtn.MouseButton1Click:Connect(function() screenGui.Enabled = false end)


-- ================= ЛОГИКА ПЛЕЕРА =================

local function playTrack(index)
    local currentList = playlists[currentPlaylistName]
    if not currentList or #currentList == 0 then return end
    
    if index < 1 then index = #currentList end
    if index > #currentList then index = 1 end
    
    currentTrackIndex = index
    local trackId = currentList[index]
    
    musicPlayer.SoundId = "rbxassetid://" .. tostring(trackId)
    musicPlayer:Play()
    isPlaying = true
    btnPlay.Text = "⏸ Pause"
    currentTrackLabel.Text = "▶ ID: " .. tostring(trackId)
end

local function refreshTrackList()
    for _, child in ipairs(trackScroll:GetChildren()) do
        if child:IsA("Frame") then child:Destroy() end
    end
    
    local currentList = playlists[currentPlaylistName]
    for i, trackId in ipairs(currentList) do
        local itemFrame = Instance.new("Frame", trackScroll)
        itemFrame.Size = UDim2.new(1, -10, 0, 28)
        itemFrame.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
        Instance.new("UICorner", itemFrame).CornerRadius = UDim.new(0, 4)

        local trackBtn = Instance.new("TextButton", itemFrame)
        trackBtn.Size = UDim2.new(0.8, 0, 1, 0)
        trackBtn.BackgroundTransparency = 1
        trackBtn.Text = "  #" .. i .. " | ID: " .. tostring(trackId)
        trackBtn.TextColor3 = Color3.fromRGB(220, 220, 220)
        trackBtn.TextSize = 11
        trackBtn.Font = Enum.Font.Gotham
        trackBtn.TextXAlignment = Enum.TextXAlignment.Left

        local delBtn = Instance.new("TextButton", itemFrame)
        delBtn.Size = UDim2.new(0, 24, 0, 24)
        delBtn.Position = UDim2.new(1, -26, 0, 2)
        delBtn.BackgroundColor3 = Color3.fromRGB(180, 50, 50)
        delBtn.Text = "✕"
        delBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
        delBtn.TextSize = 10
        Instance.new("UICorner", delBtn).CornerRadius = UDim.new(0, 4)

        trackBtn.MouseButton1Click:Connect(function() playTrack(i) end)
        delBtn.MouseButton1Click:Connect(function()
            table.remove(currentList, i)
            saveData()
            refreshTrackList()
        end)
    end
end

addBtn.MouseButton1Click:Connect(function()
    local text = idTextBox.Text
    local id = tonumber(text)
    if not id then return end

    local currentList = playlists[currentPlaylistName]
    for _, existingId in ipairs(currentList) do
        if existingId == id then
            currentTrackLabel.Text = "ID уже есть в списке!"
            return
        end
    end

    table.insert(currentList, id)
    saveData()
    refreshTrackList()
    idTextBox.Text = ""
    currentTrackLabel.Text = "Добавлен ID: " .. tostring(id)
end)

progressBtn.MouseButton1Click:Connect(function()
    if musicPlayer.TimeLength > 0 then
        local mousePos = UserInputService:GetMouseLocation().X
        local barAbsolutePos = progressBarBg.AbsolutePosition.X
        local barAbsoluteSize = progressBarBg.AbsoluteSize.X
        
        local relativeX = math.clamp((mousePos - barAbsolutePos) / barAbsoluteSize, 0, 1)
        musicPlayer.TimePosition = relativeX * musicPlayer.TimeLength
    end
end)

RunService.RenderStepped:Connect(function()
    if musicPlayer.IsLoaded and musicPlayer.TimeLength > 0 then
        local currentPos = musicPlayer.TimePosition
        local totalLen = musicPlayer.TimeLength
        timerLabel.Text = formatTime(currentPos) .. " / " .. formatTime(totalLen)
        progressBarFill.Size = UDim2.new(currentPos / totalLen, 0, 1, 0)
    else
        timerLabel.Text = "00:00 / 00:00"
        progressBarFill.Size = UDim2.new(0, 0, 1, 0)
    end
end)

musicPlayer.Ended:Connect(function()
    if isLooping then
        musicPlayer:Play()
    else
        playTrack(currentTrackIndex + 1)
    end
end)

btnPlay.MouseButton1Click:Connect(function()
    if musicPlayer.SoundId == "" then return end
    isPlaying = not isPlaying
    if isPlaying then
        musicPlayer:Resume()
        btnPlay.Text = "⏸ Pause"
    else
        musicPlayer:Pause()
        btnPlay.Text = "▶ Play"
    end
end)

btnNext.MouseButton1Click:Connect(function() playTrack(currentTrackIndex + 1) end)
btnBack.MouseButton1Click:Connect(function() playTrack(currentTrackIndex - 1) end)

loopBtn.MouseButton1Click:Connect(function()
    isLooping = not isLooping
    loopBtn.Text = isLooping and "🔁 ON" or "🔁 OFF"
    loopBtn.TextColor3 = isLooping and Color3.fromRGB(30, 215, 96) or Color3.fromRGB(180, 180, 180)
end)

speedBtn.MouseButton1Click:Connect(function()
    currentSpeedIndex = (currentSpeedIndex % #speeds) + 1
    local speed = speeds[currentSpeedIndex]
    musicPlayer.PlaybackSpeed = speed
    speedBtn.Text = "⚡ " .. tostring(speed) .. "x"
end)

volUp.MouseButton1Click:Connect(function()
    musicPlayer.Volume = math.clamp(musicPlayer.Volume + 0.1, 0, 1)
    volLabel.Text = "Громкость: " .. math.floor(musicPlayer.Volume * 100) .. "%"
end)

volDown.MouseButton1Click:Connect(function()
    musicPlayer.Volume = math.clamp(musicPlayer.Volume - 0.1, 0, 1)
    volLabel.Text = "Громкость: " .. math.floor(musicPlayer.Volume * 100) .. "%"
end)

refreshTrackList()

Features & Information

Spotify в роблокс слушайте свою музыку во время игры ведите id музыки и все

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts