Quick actions

cmd+k|ctrl+k

Navigation

Languages

glot.io

Snippet info

Language

Lua

Visibility

public

Author

randomizedcode18

Created

2025-06-07T04:41:44.783864Z

Updated

2025-06-17T04:20:01.72555Z

-- This script has been moved to a more comfortable place for it :D
-- RawPlayer - Raw Link Music Player | by luauruler26 - Indonesia Scripter 🇮🇩
-- NGETEH ASU!

local versi = "3.4"
local TweenService = game:GetService("TweenService")
local UserInputService  = game:GetService("UserInputService")
local Players = game:GetService("Players")
local script_dibuat_oleh = "luauruler26"
local SoundService = game:GetService("SoundService")
local RunService = game:GetService("RunService")
local HttpService = game:GetService("HttpService")
local backpackGui = game:GetService("CoreGui"):WaitForChild("RobloxGui"):FindFirstChild("Backpack")
local visualizerSpesialAktif = false
local backpackOriginalPos = UDim2.new(0, 0, 0, 0)
local camera = workspace.CurrentCamera
local suaraYangDidock = {}
local sedang_dibisukan = false
local player = game.Players.LocalPlayer
local PlayerGui = player:WaitForChild("PlayerGui")
local guiNonaktif = {}
local guiStateBackup = {}
local suaraYangDibisukan = {}
local koneksiBisu = nil
local bass_diaktifkan = false
local sedang_mendownload = false
local sedang_dalam_masa_transisi = false
local volume_saat_ini = 1
local daftarOwner = {
	["fian_gaming953"] = true,
    ["isbsjdhksb"] = true,
    ["ineuabdoavsocbskwkeu"] = true,
    ["sD7nsInw1Knl61M7m"] = true,
    ["ysuskntl1"] = true,
    ["akun00"] = true,
    ["fian_00"] = true
}

task.spawn(
    function()
        setfpscap(90)
        task.wait()
    end
)

local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")

local notifGui = game.CoreGui:FindFirstChild("RawNotifGUI") or Instance.new("ScreenGui")
notifGui.Name = "RawNotifGUI"
notifGui.ResetOnSpawn = false
notifGui.IgnoreGuiInset = true
notifGui.DisplayOrder = 999999999999999999
local parentUI = (gethui and gethui()) or game:GetService("CoreGui")
notifGui.Parent = parentUI

local function tween(obj, props, time, style, dir)
    local info = TweenInfo.new(time, Enum.EasingStyle[style or "Quad"], Enum.EasingDirection[dir or "Out"])
    local t = TweenService:Create(obj, info, props)
    t:Play()
    return t
end

local function animasikanBackpack(offset)
    if backpackGui then
        TweenService:Create(
            backpackGui,
            TweenInfo.new(0.3, Enum.EasingStyle.Quad),
            {
                Position = UDim2.new(0, 0, 0, offset)
            }
        ):Play()
    end
end

function TampilkanNotifikasi(text, duration)
    duration = duration or 2

    local label = Instance.new("TextLabel")
    label.Text = text
    label.Size = UDim2.new(0, 0, 0, 40)
    label.Position = UDim2.new(0.5, 0, 1, 50)
    label.AnchorPoint = Vector2.new(0.5, 1)
    label.BackgroundTransparency = 1
    label.TextColor3 = Color3.new(1, 1, 1)
    label.TextStrokeTransparency = 0.5
    label.TextSize = 18
    label.Font = Enum.Font.GothamBold
    label.TextWrapped = true
    label.ZIndex = 20
    label.Parent = notifGui

    local bg = Instance.new("Frame")
    bg.BackgroundColor3 = Color3.new(0, 0, 0)
    bg.BackgroundTransparency = 0.4
    bg.Size = UDim2.new(1, 20, 1, 0)
    bg.Position = UDim2.new(0, -10, 0, 0)
    bg.ZIndex = 19
    bg.Parent = label
    Instance.new("UICorner", bg).CornerRadius = UDim.new(0, 16)

    local stroke = Instance.new("UIStroke")
    stroke.Thickness = 1.3
    stroke.Color = Color3.fromRGB(110, 110, 110)
    stroke.Transparency = 0.1
    stroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
    stroke.Parent = bg

    local gradientBg = Instance.new("UIGradient")
    gradientBg.Color = ColorSequence.new{
    	ColorSequenceKeypoint.new(0, Color3.fromRGB(110, 110, 110)),
    	ColorSequenceKeypoint.new(1, Color3.fromRGB(220, 220, 220)),
    }
    gradientBg.Rotation = 0
    gradientBg.Parent = stroke

    task.spawn(
        function()
	        while true do
		        gradientBg.Rotation = (gradientBg.Rotation + 10) % 360
		        task.wait(0.05)
	        end
        end
    )
    
    label.Size = UDim2.new(0, 300, 0, 40)
    tween(label, {Position = UDim2.new(0.5, 0, 0.85, 0)}, 0.5, "Back", "Out")

    task.delay(
        duration,
        function()
            tween(label, {Position = UDim2.new(0.5, 0, 1.2, 0)}, 0.4, "Quad", "In")
            task.wait(0.5)
            label:Destroy()
        end
    )
end

local gui = Instance.new("ScreenGui")
gui.Name = "RawPlayerUI"
gui.ResetOnSpawn = false
gui.IgnoreGuiInset = true
gui.DisplayOrder = 999999999999999
local parentUI = (gethui and gethui()) or game:GetService("CoreGui")
gui.Parent = parentUI

local blur = Instance.new("BlurEffect", game.Lighting)
blur.Name = "RawBlur"
blur.Size = 0
blur.Enabled = false

local apakah_sedang_diputar = false
local isLooping = false
local suara_saat_ini = nil

local function animasikan(obj, goal, dur)
    return TweenService:Create(obj, TweenInfo.new(dur, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), goal):Play()
end

local floatingBtn = Instance.new("TextButton", gui)
floatingBtn.Size = UDim2.new(0, 44, 0, 44)
floatingBtn.Position = UDim2.new(0, 175, 0.5, -200)
floatingBtn.Text = "🎵"
floatingBtn.BackgroundColor3 = Color3.fromRGB(18, 18, 21)
floatingBtn.TextColor3 = Color3.fromRGB(90, 90, 90)
floatingBtn.Font = Enum.Font.GothamBold
floatingBtn.TextSize = 22
floatingBtn.Visible = true
floatingBtn.BackgroundTransparency = 0.08
floatingBtn.Draggable = true
floatingBtn.AutoButtonColor = true
Instance.new("UICorner", floatingBtn).CornerRadius = UDim.new(1, 0)

local creditLabel = Instance.new("TextButton", gui)
creditLabel.Size = UDim2.new(0, 200, 0, 16)
creditLabel.Position = UDim2.new(1, -210, 1, -20)
creditLabel.AnchorPoint = Vector2.new(0, 0)
creditLabel.BackgroundTransparency = 1
creditLabel.Text = "by ".. script_dibuat_oleh .." - Version ".. versi
creditLabel.TextColor3 = Color3.new(1, 1, 1)
creditLabel.TextTransparency = 1
creditLabel.Visible = false
creditLabel.Font = Enum.Font.Gotham
creditLabel.TextSize = 12
creditLabel.TextXAlignment = Enum.TextXAlignment.Right

local songTitleLabel = Instance.new("TextLabel", gui)
songTitleLabel.Size = UDim2.new(0, 360, 0, 24)
songTitleLabel.Position = UDim2.new(0.5, -180, 0, -30)
songTitleLabel.BackgroundTransparency = 1
songTitleLabel.TextColor3 = Color3.new(1, 1, 1)
songTitleLabel.Font = Enum.Font.Gotham
songTitleLabel.TextSize = 14
songTitleLabel.TextTransparency = 1
songTitleLabel.TextXAlignment = Enum.TextXAlignment.Center
songTitleLabel.Text = ""

local welcomeLabel = Instance.new("TextLabel", gui)
welcomeLabel.Size = UDim2.new(0, 250, 0, 30)
welcomeLabel.Position = UDim2.new(0.5, -125, 0, -60)
welcomeLabel.BackgroundTransparency = 1
welcomeLabel.TextColor3 = Color3.new(1, 1, 1)
welcomeLabel.Font = Enum.Font.GothamBold
welcomeLabel.TextSize = 18
welcomeLabel.TextTransparency = 1
welcomeLabel.TextXAlignment = Enum.TextXAlignment.Center

local volumeSlider = Instance.new("Frame", gui)
volumeSlider.Position = UDim2.new(0.5, -100, 0.5, -100 - 30)
volumeSlider.Size = UDim2.new(0, 200, 0, 24)
volumeSlider.Transparency = 1
volumeSlider.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
volumeSlider.BackgroundTransparency = 0.25
volumeSlider.Visible = false
volumeSlider.BackgroundTransparency = 1
Instance.new("UICorner", volumeSlider).CornerRadius = UDim.new(0, 16)

local strokeSlider = Instance.new("UIStroke")
strokeSlider.Thickness = 1.3
strokeSlider.Color = Color3.fromRGB(110, 110, 110)
strokeSlider.Transparency = 1
strokeSlider.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
strokeSlider.Parent = volumeSlider

local gradientSlider = Instance.new("UIGradient")
gradientSlider.Color = ColorSequence.new{
	ColorSequenceKeypoint.new(0, Color3.fromRGB(110, 110, 110)),
	ColorSequenceKeypoint.new(1, Color3.fromRGB(220, 220, 220)),
}
gradientSlider.Rotation = 0
gradientSlider.Parent = strokeSlider

local sliderBar = Instance.new("Frame", volumeSlider)
sliderBar.Size = UDim2.new(1, -20, 0, 4)
sliderBar.Position = UDim2.new(0, 10, 0.5, -2)
sliderBar.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
sliderBar.BackgroundTransparency = 0
sliderBar.Active = true
sliderBar.Selectable = false
sliderBar.BackgroundTransparency = 1
Instance.new("UICorner", sliderBar)

local thumb = Instance.new("TextButton", volumeSlider)
thumb.Size = UDim2.new(0, 16, 0, 16)
thumb.Position = UDim2.new(1, -18, 0.5, -8)
thumb.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
thumb.Text = "100%"
thumb.TextSize = 10
thumb.TextScaled = true
thumb.TextColor3 = Color3.new(1, 1, 1)
thumb.Font = Enum.Font.GothamBold
thumb.BackgroundTransparency = 0
thumb.Visible = true
thumb.BackgroundTransparency = 1
thumb.TextTransparency = 1
Instance.new("UICorner", thumb)

local frame = Instance.new("Frame", gui)
frame.Size = UDim2.new(0, 300, 0, 200)
frame.Position = UDim2.new(0.5, -150, 0.5, -100)
frame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
frame.BackgroundTransparency = 1
frame.Visible = false
Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 20)

local bassBtn = Instance.new("TextButton", frame)
bassBtn.Size = UDim2.new(0, 100, 0, 30)
bassBtn.Position = UDim2.new(1, -110, 1, -40)
bassBtn.BackgroundTransparency = 1
bassBtn.Text = "Bass"
bassBtn.TextColor3 = Color3.new(1, 1, 1)
bassBtn.Font = Enum.Font.GothamBold
bassBtn.TextSize = 18
bassBtn.TextTransparency = 1

local muteBtn = Instance.new("TextButton", frame)
muteBtn.Size = UDim2.new(0, 100, 0, 30)
muteBtn.Position = UDim2.new(0, 10, 1, -40)
muteBtn.BackgroundTransparency = 1
muteBtn.Text = "🔇 Mute"
muteBtn.TextTransparency = 1
muteBtn.TextColor3 = Color3.new(1, 1, 1)
muteBtn.Font = Enum.Font.GothamBold
muteBtn.TextSize = 18

local progressLabel = Instance.new("TextLabel", frame)
progressLabel.Size = UDim2.new(1, 0, 0, 20)
progressLabel.Position = UDim2.new(0, 0, 0, 135)
progressLabel.Text = "00:00 / 00:00"
progressLabel.BackgroundTransparency = 1
progressLabel.TextTransparency = 1
progressLabel.TextColor3 = Color3.new(1, 1, 1)
progressLabel.Font = Enum.Font.Gotham
progressLabel.TextSize = 14
progressLabel.TextXAlignment = Enum.TextXAlignment.Center

local strokeFrame = Instance.new("UIStroke")
strokeFrame.Thickness = 1.3
strokeFrame.Color = Color3.fromRGB(110, 110, 110)
strokeFrame.Transparency = 1
strokeFrame.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
strokeFrame.Parent = frame

local gradient = Instance.new("UIGradient")
gradient.Rotation = 0
gradient.Color = ColorSequence.new{
	ColorSequenceKeypoint.new(0, Color3.fromRGB(110,110,110)),
	ColorSequenceKeypoint.new(1, Color3.fromRGB(220,220,220)),
}
gradient.Parent = strokeFrame

local title = Instance.new("TextLabel", frame)
title.Text = "RawPlayer - Raw Link Music Player"
title.Size = UDim2.new(1, 0, 0, 30)
title.Position = UDim2.new(0, 0, 0, 10)
title.BackgroundTransparency = 1
title.TextTransparency = 1
title.TextColor3 = Color3.new(1, 1, 1)
title.Font = Enum.Font.GothamBold
title.TextSize = 16

local inputBox = Instance.new("TextBox", frame)
inputBox.PlaceholderText = "Paste raw .mp3 URL here"
inputBox.Size = UDim2.new(1, -40, 0, 30)
inputBox.Position = UDim2.new(0.5, -130, 0, 50)
inputBox.BackgroundTransparency = 1
inputBox.TextTransparency = 1
inputBox.PlaceholderColor3 = Color3.fromRGB(200, 200, 200)
inputBox.TextColor3 = Color3.new(1, 1, 1)
inputBox.Font = Enum.Font.Gotham
inputBox.ClearTextOnFocus = false
inputBox.TextSize = 14
inputBox.Text = ""
inputBox.TextScaled = true

local playPauseBtn = Instance.new("TextButton", frame)
playPauseBtn.Size = UDim2.new(0.5, -25, 0, 30)
playPauseBtn.Position = UDim2.new(0, 20, 0, 100)
playPauseBtn.BackgroundTransparency = 1
playPauseBtn.Text = "▶ Play"
playPauseBtn.TextTransparency = 1
playPauseBtn.TextColor3 = Color3.new(1, 1, 1)
playPauseBtn.Font = Enum.Font.GothamBold
playPauseBtn.TextSize = 20

local loopBtn = Instance.new("TextButton", frame)
loopBtn.Size = UDim2.new(0.5, -25, 0, 30)
loopBtn.Position = UDim2.new(0.5, 5, 0, 100)
loopBtn.BackgroundTransparency = 1
loopBtn.Text = "🔁 Looped"
loopBtn.TextTransparency = 1
loopBtn.TextColor3 = Color3.new(1, 1, 1)
loopBtn.Font = Enum.Font.GothamBold
loopBtn.TextSize = 20

local closeBtn = Instance.new("TextButton", frame)
closeBtn.Size = UDim2.new(0, 100, 0, 30)
closeBtn.Position = UDim2.new(0.5, -50, 1, -40)
closeBtn.BackgroundTransparency = 1
closeBtn.Text = "Close"
closeBtn.TextTransparency = 1
closeBtn.TextColor3 = Color3.new(1, 1, 1)
closeBtn.Font = Enum.Font.GothamBold
closeBtn.TextSize = 20

local blurGui = Instance.new("ScreenGui")
blurGui.Name = "RawPlayerBlurUI"
blurGui.ResetOnSpawn = false
blurGui.IgnoreGuiInset = true
blurGui.DisplayOrder = 999999999
local parentUI = (gethui and gethui()) or game:GetService("CoreGui")
blurGui.Parent = parentUI

local blurLayer = Instance.new("Frame")
blurLayer.Size = UDim2.new(1, 0, 1, 0)
blurLayer.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
blurLayer.BackgroundTransparency = 0.7
blurLayer.Visible = false
blurLayer.ZIndex = 9
blurLayer.Parent = blurGui

frame.MouseEnter:Connect(function()
	cursorHovering = true
end)

frame.MouseLeave:Connect(function()
	cursorHovering = false
end)

local rotasi = 0
local kecepatanRotasi = 10
local cursorHovering = false

RunService.RenderStepped:Connect(function()
	if suara_saat_ini and suara_saat_ini.Playing then
		kecepatanRotasi = 10 + math.clamp(suara_saat_ini.PlaybackLoudness / 300, 0, 1) * 90
	else
		if cursorHovering then
			kecepatanRotasi = 100
		else
			kecepatanRotasi = 10
		end
	end

	rotasi = (rotasi + kecepatanRotasi * RunService.RenderStepped:Wait()) % 360
	gradient.Rotation = rotasi
end)

task.spawn(function()
	while true do
		gradientSlider.Rotation = (gradientSlider.Rotation + 10) % 360
		task.wait(0.05)
	end
end)

local function urldecode(str)
	return str:gsub("%%(%x%x)", function(hex)
		local byte = tonumber(hex, 16)
		if byte then
			return string.char(byte)
		else
			return "%" .. hex
		end
	end)
end

local function enableFloatingDrag(button)
	local dragging = false
	local dragStartPos
	local startBtnPos
	local velocity = Vector2.zero
	local lastPos = Vector2.zero
	local lastTime = 0
	local damping = 0.88
	local renderConn

	local function updateMomentum(dt)
		if not dragging then
			if velocity.Magnitude > 0.5 then
				local pos = button.Position
				pos = UDim2.new(pos.X.Scale, pos.X.Offset + velocity.X * dt, pos.Y.Scale, pos.Y.Offset + velocity.Y * dt)
				button.Position = pos
				velocity *= math.pow(damping, dt * 60)
			else
				velocity = Vector2.zero
				if renderConn then renderConn:Disconnect() end
			end
		end
	end

	button.InputBegan:Connect(function(input)
		if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
			dragging = true
			dragStartPos = input.Position
			startBtnPos = button.Position
			lastPos = input.Position
			lastTime = tick()

			if renderConn then renderConn:Disconnect() end
			renderConn = RunService.RenderStepped:Connect(updateMomentum)

			input.Changed:Connect(function()
				if input.UserInputState == Enum.UserInputState.End then
					dragging = false
					local deltaTime = tick() - lastTime
					if deltaTime > 0 then
						velocity = (input.Position - lastPos) / deltaTime
					end
				end
			end)
		end
	end)

	button.InputChanged:Connect(function(input)
		if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
			local delta = input.Position - dragStartPos
			local newPosition = UDim2.new(startBtnPos.X.Scale, startBtnPos.X.Offset + delta.X, startBtnPos.Y.Scale, startBtnPos.Y.Offset + delta.Y)
			button.Position = newPosition
			lastPos = input.Position
			lastTime = tick()
		end
	end)
end

local function formatSongTitle(raw)
	local noExt = raw:gsub("%.mp3$", "") -- hapus .mp3
	local decoded = urldecode(noExt)

	local full = "Now Playing: " .. decoded
	if #full > 55 then
		full = full:sub(1, 55) .. "..."
	end
	return full
end

local cacheFolder = "music_cache"
if not isfolder(cacheFolder) then
    makefolder(cacheFolder)
end

local function extractFileName(url)
    return url:match(".+/([^/?#]+)$") or ("file_" .. HttpService:GenerateGUID(false) .. ".mp3")
end

function PlayMusicFromURL(url)
    if typeof(url) ~= "string" or not url:match("^https?://") then
        TampilkanNotifikasi("Invalid URL.", 4)
        return nil
    end

    local fileName = extractFileName(url)
    local filePath = cacheFolder .. "/" .. fileName

    if not isfile(filePath) then
        TampilkanNotifikasi("Downloading...", 4)
        playPauseBtn.Text = "⏳ Please wait..."
        local ok, data =
            pcall(
            function()
                return game:HttpGet(url)
            end
        )

        if not ok then
            TampilkanNotifikasi("Download failed.", 4)
            return nil
        end

        writefile(filePath, data)
        TampilkanNotifikasi("✅ Download completed", 4)
    else
        TampilkanNotifikasi("📁 File already exists", 4)
    end

    local songName = extractFileName(url)
    songTitleLabel.Text = formatSongTitle(songName)

    songTitleLabel.Position = UDim2.new(0.5, -180, 0, -30)
    songTitleLabel.TextTransparency = 1
    animasikan(songTitleLabel, {TextTransparency = 0}, 0.4)
    animasikan(songTitleLabel, {Position = UDim2.new(0.5, -180, 0, 40)}, 0.4)

    local sound = Instance.new("Sound")
    sound.Name = "RawSound"
    sound.SoundId = getcustomasset(filePath)
    sound.Volume = volume_saat_ini
    sound.Looped = false
    sound.Parent = game.SoundService
    sound:Play()

    return sound
end

local function updatePlayText()
    playPauseBtn.Text = apakah_sedang_diputar and "|| Pause" or "▶ Play"
end

local function updateLoopColor()
    loopBtn.TextColor3 = isLooping and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 255, 255)
end

local function MuteOtherSounds(exceptSound)
    suaraYangDibisukan = {}
    sedang_dibisukan = true

    for _, s in ipairs(game:GetDescendants()) do
        if s:IsA("Sound") and s ~= exceptSound and s.Volume > 0 then
            suaraYangDibisukan[s] = s.Volume
            TweenService:Create(s, TweenInfo.new(0.3), {Volume = 0}):Play()
        end
    end

    if koneksiBisu then
        koneksiBisu:Disconnect()
    end
    koneksiBisu =
        game.DescendantAdded:Connect(
        function(obj)
            if obj:IsA("Sound") and obj ~= exceptSound then
                task.wait()
                if sedang_dibisukan then
                    suaraYangDibisukan[obj] = obj.Volume
                    obj.Volume = 0
                end
            end
        end
    )
end

local function nonaktifkanSemuaGui()
	guiStateBackup = {}

	for _, gui in ipairs(Players.LocalPlayer:WaitForChild("PlayerGui"):GetChildren()) do
		if gui:IsA("ScreenGui") and gui.Name ~= "RawPlayerUI" and gui.Name ~= "RawNotifGUI" and gui.Name ~= "Backpack" then
			guiStateBackup[gui] = gui.Enabled
			gui.Enabled = false
		end
	end
end

local function pulihkanSemuaGui()
	for gui, originalState in pairs(guiStateBackup) do
		if gui and gui:IsDescendantOf(Players.LocalPlayer:FindFirstChild("PlayerGui")) then
			gui.Enabled = originalState
		end
	end
	guiStateBackup = {}
end

local function UnmuteOtherSounds()
    sedang_dibisukan = false

    if koneksiBisu then
        koneksiBisu:Disconnect()
        koneksiBisu = nil
    end

    for sound, originalVolume in pairs(suaraYangDibisukan) do
        if sound and sound:IsDescendantOf(game) then
            TweenService:Create(sound, TweenInfo.new(0.3), {Volume = originalVolume}):Play()
        end
    end

    suaraYangDibisukan = {}
end

local function updateVolumeUI(x)
    local relX = math.clamp(x - sliderBar.AbsolutePosition.X, 0, sliderBar.AbsoluteSize.X)
    local percent = relX / sliderBar.AbsoluteSize.X
    volume_saat_ini = math.clamp(percent, 0, 1)

    thumb.Position = UDim2.new(0, relX + 2 - thumb.Size.X.Offset / 2, 0.5, -8)
    thumb.Text = math.floor(volume_saat_ini * 100 + 0.5) .. "%"

    if suara_saat_ini then
        suara_saat_ini.Volume = volume_saat_ini
    end
end

game:GetService("UserInputService").InputEnded:Connect(
    function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            dragging = false
        end
    end
)

game:GetService("RunService").RenderStepped:Connect(
    function()
        if dragging then
            updateVolumeUI(game:GetService("UserInputService"):GetMouseLocation().X)
        end
    end
)

game:GetService("UserInputService").InputEnded:Connect(
    function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            dragging = false
        end
    end
)

game:GetService("RunService").RenderStepped:Connect(
    function()
        if dragging then
            local mouseX = game:GetService("UserInputService"):GetMouseLocation().X
            updateVolumeUI(mouseX)
        end
    end
)

local dragging = false

sliderBar.InputBegan:Connect(
    function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
            dragging = true
            updateVolumeUI(input.Position.X)
        end
    end
)

sliderBar.InputChanged:Connect(
    function(input)
        if
            dragging and
                (input.UserInputType == Enum.UserInputType.MouseMovement or
                    input.UserInputType == Enum.UserInputType.Touch)
         then
            updateVolumeUI(input.Position.X)
        end
    end
)

game:GetService("UserInputService").InputEnded:Connect(
    function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
            dragging = false
        end
    end
)

local function fadeInVolumeSlider()
    volumeSlider.Visible = true

    animasikan(volumeSlider, {BackgroundTransparency = 0.25}, 0.3)
    animasikan(sliderBar, {BackgroundTransparency = 0}, 0.3)
    animasikan(thumb, {BackgroundTransparency = 0, TextTransparency = 0}, 0.3)
    animasikan(strokeSlider, {Transparency = 0.1}, 0.3)
end

local function fadeOutVolumeSlider()
    animasikan(volumeSlider, {BackgroundTransparency = 1}, 0.3)
    animasikan(sliderBar, {BackgroundTransparency = 1}, 0.3)
    animasikan(thumb, {BackgroundTransparency = 1, TextTransparency = 1}, 0.3)
    animasikan(strokeSlider, {Transparency = 1}, 0.3)

    task.delay(
        0.3,
        function()
            volumeSlider.Visible = false
        end
    )
end

local function aturFov()
    animasikan(camera, {FieldOfView = 100}, 0.2)
    task.wait(0.3)
    animasikan(camera, {FieldOfView = 40}, 0.4)
end

local function aturUlangFov()
    animasikan(camera, {FieldOfView = 70}, 0.4)
end

local playerName = game.Players.LocalPlayer.Name

if daftarOwner[playerName] then
	welcomeLabel.Text = "Ahoy! Captain " .. playerName
elseif not getgenv().RawPlayerWelcomed then
	welcomeLabel.Text = "Welcome! " .. playerName
	getgenv().RawPlayerWelcomed = true
else
	welcomeLabel.Text = "Welcome back! " .. playerName
end

local function tampilkan_UI()
    if sedang_dalam_masa_transisi then
        return
    end
    sedang_dalam_masa_transisi = true

    frame.Visible = true
    blur.Enabled = true
    animasikan(blur, {Size = 24}, 0.5)
    aturFov()
    animasikan(frame, {BackgroundTransparency = 0.25}, 0.4)
    animasikan(title, {TextTransparency = 0}, 0.4)
    animasikan(inputBox, {TextTransparency = 0}, 0.4)
    animasikan(playPauseBtn, {TextTransparency = 0}, 0.4)
    animasikan(loopBtn, {TextTransparency = 0}, 0.4)
    animasikan(closeBtn, {TextTransparency = 0}, 0.4)
    animasikan(strokeFrame, {Transparency = 0}, 0.3)
    animasikan(progressLabel, {TextTransparency = 0}, 0.4)
    animasikan(muteBtn, {TextTransparency = 0}, 0.4)
    animasikan(bassBtn, {TextTransparency = 0}, 0.4)
    animasikan(creditLabel, {TextTransparency = 0.5}, 0.4)
    animasikan(songTitleLabel, {TextTransparency = 0}, 0.4)
    animasikan(songTitleLabel, {Position = UDim2.new(0.5, -180, 0, 40)}, 0.4)
    animasikan(floatingBtn, {Transparency = 1}, 0.5)
    blurLayer.Visible = true
    animasikan(blurLayer, {BackgroundTransparency = 0.7}, 0.3)
    animasikanBackpack(90)
    nonaktifkanSemuaGui()
    fadeInVolumeSlider()

    welcomeLabel.Position = UDim2.new(0.5, -125, 0, -60)
    welcomeLabel.TextTransparency = 1

    animasikan(welcomeLabel, {TextTransparency = 0}, 0.4)
    animasikan(welcomeLabel, {Position = UDim2.new(0.5, -125, 0, 10)}, 0.4)
    creditLabel.Visible = true

    task.delay(
        0.5,
        function()
            sedang_dalam_masa_transisi = false
        end
    )
end

local function sembunyikan_UI()
    if sedang_dalam_masa_transisi then
        return
    end
    sedang_dalam_masa_transisi = true

    animasikan(blur, {Size = 0}, 0.4)
    aturUlangFov()
    animasikan(frame, {BackgroundTransparency = 1}, 0.3)
    animasikan(title, {TextTransparency = 1}, 0.3)
    animasikan(inputBox, {TextTransparency = 1}, 0.3)
    animasikan(playPauseBtn, {TextTransparency = 1}, 0.3)
    animasikan(loopBtn, {TextTransparency = 1}, 0.3)
    animasikan(closeBtn, {TextTransparency = 1}, 0.3)
    animasikan(strokeFrame, {Transparency = 1}, 0.3)
    animasikan(progressLabel, {TextTransparency = 1}, 0.3)
    animasikan(muteBtn, {TextTransparency = 1}, 0.3)
    animasikan(bassBtn, {TextTransparency = 1}, 0.3)
    animasikan(creditLabel, {TextTransparency = 1}, 0.3)
    animasikan(songTitleLabel, {TextTransparency = 1}, 0.3)
    animasikan(songTitleLabel, {Position = UDim2.new(0.5, -180, 0, -30)}, 0.3)
    animasikan(floatingBtn, {Transparency = 0}, 0.4)
    animasikan(floatingBtn, {BackgroundTransparency = 0.08}, 0.4)
    animasikan(welcomeLabel, {TextTransparency = 1}, 0.3)
    animasikan(welcomeLabel, {Position = UDim2.new(0.5, -125, 0, -60)}, 0.3)
    animasikanBackpack(0)
    pulihkanSemuaGui()
    fadeOutVolumeSlider()

    task.delay(
        0.4,
        function()
            blur.Enabled = false
            frame.Visible = false
            sedang_dalam_masa_transisi = false
            creditLabel.Visible = false
        end
    )

    animasikan(blurLayer, {BackgroundTransparency = 1}, 0.3)
    task.delay(
        0.3, 
        function()
	        blurLayer.Visible = false
        end
    )
end

bassBtn.MouseButton1Click:Connect(
    function()
        bass_diaktifkan = not bass_diaktifkan
        bassBtn.TextColor3 = bass_diaktifkan and Color3.fromRGB(0, 255, 100) or Color3.new(1, 1, 1)

        if suara_saat_ini then
            for _, child in pairs(suara_saat_ini:GetChildren()) do
                if child:IsA("EqualizerSoundEffect") then
                    child:Destroy()
                end
            end

            if bass_diaktifkan then
                local bassFX = Instance.new("EqualizerSoundEffect")
                bassFX.Name = "RawBass"
                bassFX.LowGain = 10
                bassFX.MidGain = 0
                bassFX.HighGain = 0
                bassFX.Parent = suara_saat_ini
            end
        end
    end
)

local function formatTime(sec)
    local m = math.floor(sec / 60)
    local s = math.floor(sec % 60)
    return string.format("%02d:%02d", m, s)
end

local updateConnection = nil

local function startUpdatingProgress()
    if updateConnection then
        updateConnection:Disconnect()
    end

    tween(progressLabel, {TextTransparency = 0}, 0.4)

    updateConnection =
        RunService.RenderStepped:Connect(
        function()
            if visualizerSpesialAktif and suara_saat_ini and suara_saat_ini.Playing and backpackGui then
                local strength = math.abs(math.sin(tick() * 15)) * 6
                local targetPos = backpackOriginalPos + UDim2.new(0, 0, 0, -strength)
                backpackGui.Position = targetPos
            end
            if suara_saat_ini and suara_saat_ini:IsDescendantOf(SoundService) then
                local pos = suara_saat_ini.TimePosition
                local len = suara_saat_ini.TimeLength
                progressLabel.Text = formatTime(pos) .. " / " .. formatTime(len)
            end
        end
    )
end

local function stopUpdatingProgress()
    if updateConnection then
        updateConnection:Disconnect()
    end
    updateConnection = nil
    tween(progressLabel, {TextTransparency = 1}, 0.3)
end

floatingBtn.MouseButton1Click:Connect(
    function()
        if sedang_dalam_masa_transisi then
            return
        end
        floatingBtn.Visible = false
        tampilkan_UI()
    end
)

floatingBtn.MouseEnter:Connect(
    function()
        animasikan(floatingBtn, {BackgroundColor3 = Color3.fromRGB(54, 54, 63)}, 0.3)
    end
)

floatingBtn.MouseLeave:Connect(
    function()
        animasikan(floatingBtn, {BackgroundColor3 = Color3.fromRGB(18, 18, 21)}, 0.3)
    end
)

closeBtn.MouseButton1Click:Connect(
    function()
        if sedang_dalam_masa_transisi then
            return
        end
        sembunyikan_UI()
        floatingBtn.Visible = true
    end
)

local lastPlayedURL = ""
playPauseBtn.MouseButton1Click:Connect(
    function()
        local url = inputBox.Text:match("^%s*(.-)%s*$")

        if url == "" or not url:match("^https?://") then
            TampilkanNotifikasi("Please enter something in the TextBox!", 3)
            return
        end

        if suara_saat_ini and url ~= lastPlayedURL then
            suara_saat_ini:Stop()
            suara_saat_ini:Destroy()
            suara_saat_ini = nil
            apakah_sedang_diputar = false
        end

        lastPlayedURL = url

        if not suara_saat_ini then
            suara_saat_ini = PlayMusicFromURL(url)
            startUpdatingProgress()
            if suara_saat_ini then
                suara_saat_ini.Looped = isLooping
                apakah_sedang_diputar = true
            end
        else
            if apakah_sedang_diputar then
                suara_saat_ini:Pause()
                apakah_sedang_diputar = false
                stopUpdatingProgress()
                animasikan(songTitleLabel, {TextTransparency = 1}, 0.3)
                animasikan(songTitleLabel, {Position = UDim2.new(0.5, -180, 0, -30)}, 0.3)
                animasikanBackpack(90)
            else
                suara_saat_ini:Play()
                apakah_sedang_diputar = true
                startUpdatingProgress()
            end
        end

        suara_saat_ini.Ended:Connect(
            function()
                suara_saat_ini = nil
                apakah_sedang_diputar = false
                updatePlayText()
                stopUpdatingProgress()
                animasikanBackpack(0)

                if suara_saat_ini then
                    suara_saat_ini:Stop()
                    suara_saat_ini:Destroy()
                    suara_saat_ini = nil
                end

                animasikan(songTitleLabel, {TextTransparency = 1}, 0.3)
                animasikan(songTitleLabel, {Position = UDim2.new(0.5, -180, 0, -30)}, 0.3)
            end
        )

        updatePlayText()
    end
)

loopBtn.MouseButton1Click:Connect(
    function()
        isLooping = not isLooping
        if suara_saat_ini then
            suara_saat_ini.Looped = isLooping
        end
        updateLoopColor()
    end
)

muteBtn.MouseButton1Click:Connect(
    function()
        if sedang_dibisukan then
            UnmuteOtherSounds()
            sedang_dibisukan = false
            muteBtn.Text = "🔇 Mute"
            muteBtn.TextColor3 = Color3.new(1, 1, 1)
        else
            MuteOtherSounds(suara_saat_ini)
            sedang_dibisukan = true
            muteBtn.Text = "🔊 UnMute"
            muteBtn.TextColor3 = Color3.new(0, 1, 0)
        end
    end
)

creditLabel.MouseButton1Click:Connect(
    function()
        visualizerSpesialAktif = not visualizerSpesialAktif
        TampilkanNotifikasi(visualizerSpesialAktif and "SPECIAL | 🎒 Backpack visualizer ON!" or "SPECIAL | ❌ Visualizer off.", 3)
        task.wait(3)
        TampilkanNotifikasi("❤️ Thank you for your concern for us!", 4)

        if not visualizerSpesialAktif and backpackGui then
            animasikanBackpack(90)
        end
    end
)

if backpackGui then
    backpackOriginalPos = backpackGui.Position
end

updatePlayText()
updateLoopColor()
enableFloatingDrag(floatingBtn)

-- End of the script | Thanks for using this script!
INFO