Panel made by rizki its me
Key RequiredUniversal

Panel made by rizki its me

Universal Scriptgw87gw87 2K views 7 executesUpdated Nov 2, 2025
Unrated
00
Lua Script•713 lines (24906 chars)
--[[
  Purple Neon Holo UI – Android Adaptive (Show/Hide Edition)
  Panel By Rizku (fixed: show/hide, swipe, toggle button + overlay dim + cleanup)
  Fixed by Grok for Executor: Activated, Tween Chain, No Errors
  Paste into StarterGui -> ScreenGui -> LocalScript
  Safe for Roblox Studio (mobile-friendly)
--]]

-- ===== SERVICES =====
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Debris = game:GetService("Debris")
local SoundService = game:GetService("SoundService")

-- ===== PLAYER GUI =====
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

-- ===== SCREENGUI ROOT =====
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "PurpleHoloUI_vShowHide"
screenGui.ResetOnSpawn = false
screenGui.IgnoreGuiInset = true
screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
screenGui.Parent = playerGui

-- Toggle dengan Insert key
UserInputService.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.Insert then
        screenGui.Enabled = not screenGui.Enabled
    end
end)

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

local function makeCorner(parent, radius)
    local c = Instance.new("UICorner")
    c.CornerRadius = UDim.new(0, radius or 12)
    c.Parent = parent
    return c
end

local function makeStroke(parent, thickness, color, trans)
    local s = Instance.new("UIStroke")
    s.Thickness = thickness or 1
    s.Color = color or Color3.fromRGB(200, 160, 255)
    s.Transparency = trans or 0.5
    s.Parent = parent
    return s
end

local function playClick()
    local s = Instance.new("Sound")
    s.SoundId = "rbxassetid://9118823105"
    s.Volume = 0.22
    s.Parent = SoundService
    s:Play()
    Debris:AddItem(s, 1.6)
end

-- Cleanup function for overlays/backgrounds
local function cleanupOverlays()
    for _, v in pairs(screenGui:GetChildren()) do
        if v:IsA("Frame") or v:IsA("ImageLabel") then
            if v.Name:lower():find("overlay") or v.Name:lower():find("background") then
                v.Visible = false
                v.BackgroundTransparency = 1
            end
        end
    end
end

-- ===== BACKGROUND & PARTICLE =====
local bg = Instance.new("Frame")
bg.Name = "Background"
bg.Size = UDim2.new(1, 0, 1, 0)
bg.Position = UDim2.new(0, 0, 0, 0)
bg.BackgroundColor3 = Color3.fromRGB(12, 10, 18)
bg.BackgroundTransparency = 0.30
bg.BorderSizePixel = 0
bg.Parent = screenGui

local bgGrad = Instance.new("UIGradient")
bgGrad.Color = ColorSequence.new{
    ColorSequenceKeypoint.new(0, Color3.fromRGB(60, 6, 110)),
    ColorSequenceKeypoint.new(1, Color3.fromRGB(8, 6, 22)),
}
bgGrad.Rotation = 270
bgGrad.Parent = bg

local particle = Instance.new("ImageLabel")
particle.Name = "Particle"
particle.Size = UDim2.new(0, 420, 0, 420)
particle.Position = UDim2.new(0.5, -210, 0.62, -130)
particle.AnchorPoint = Vector2.new(0.5, 0.5)
particle.Image = "rbxassetid://6881970292"
particle.ImageTransparency = 0.88
particle.BackgroundTransparency = 1
particle.ImageColor3 = Color3.fromRGB(160, 80, 220)
particle.ZIndex = 0
particle.Parent = bg

task.spawn(function()
    while true do
        local rot = math.random(-12, 12)
        tween(particle, {Rotation = rot}, 2.8, Enum.EasingStyle.Sine)
        task.wait(2.8)
    end
end)

-- ===== OVERLAY DIM =====
local overlay = screenGui:FindFirstChild("Overlay") or Instance.new("Frame")
overlay.Name = "Overlay"
overlay.Size = UDim2.new(1, 0, 1, 0)
overlay.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
overlay.BackgroundTransparency = 0.6
overlay.ZIndex = 0
overlay.Visible = true
overlay.Parent = screenGui

-- ===== DOCK CONTAINER =====
local dockContainer = Instance.new("Frame")
dockContainer.Name = "DockContainer"
dockContainer.AnchorPoint = Vector2.new(0.5, 1)
dockContainer.Position = UDim2.new(0.5, 0, 1, -18)
dockContainer.Size = UDim2.new(0.94, 0, 0.16, 0)
dockContainer.BackgroundTransparency = 0
dockContainer.BorderSizePixel = 0
dockContainer.Parent = screenGui
makeCorner(dockContainer, 26)

local dockBG = Instance.new("Frame")
dockBG.Name = "DockBG"
dockBG.Size = UDim2.new(1, 0, 1, 0)
dockBG.Position = UDim2.new(0, 0, 0, 0)
dockBG.BackgroundColor3 = Color3.fromRGB(28, 6, 60)
dockBG.BackgroundTransparency = 0.36
dockBG.BorderSizePixel = 0
dockBG.Parent = dockContainer
makeCorner(dockBG, 26)
makeStroke(dockBG, 2, Color3.fromRGB(170, 100, 255), 0.45)

local glow = Instance.new("ImageLabel")
glow.Name = "GlowOverlay"
glow.Size = UDim2.new(1.2, 0, 1.6, 0)
glow.Position = UDim2.new(-0.1, 0, -0.3, 0)
glow.BackgroundTransparency = 1
glow.Image = "rbxassetid://1316045217"
glow.ImageTransparency = 0.95
glow.ZIndex = 0
glow.Parent = dockBG

local dockTitle = Instance.new("TextLabel")
dockTitle.Name = "DockTitle"
dockTitle.AnchorPoint = Vector2.new(0.5, 0)
dockTitle.Position = UDim2.new(0.5, 0, 0.04, 0)
dockTitle.Size = UDim2.new(0.6, 0, 0.2, 0)
dockTitle.BackgroundTransparency = 1
dockTitle.Font = Enum.Font.GothamBold
dockTitle.Text = "Panel By Rizku"
dockTitle.TextSize = 15
dockTitle.TextColor3 = Color3.fromRGB(232, 220, 255)
dockTitle.ZIndex = 3
dockTitle.Parent = dockBG

-- ===== TOGGLE BUTTON =====
local toggleBtn = Instance.new("TextButton")
toggleBtn.Size = UDim2.new(0, 140, 0, 44)
toggleBtn.AnchorPoint = Vector2.new(0.5, 1)
toggleBtn.Position = UDim2.new(0.5, 0, 1, -90)
toggleBtn.BackgroundColor3 = Color3.fromRGB(80, 30, 150)
toggleBtn.Text = "Show / Hide Panel"
toggleBtn.Font = Enum.Font.GothamBold
toggleBtn.TextSize = 18
toggleBtn.TextColor3 = Color3.fromRGB(255, 240, 255)
toggleBtn.Parent = screenGui

local toggleCorner = Instance.new("UICorner")
toggleCorner.CornerRadius = UDim.new(0, 12)
toggleCorner.Parent = toggleBtn

local panelVisible = true

toggleBtn.Activated:Connect(function()
    panelVisible = not panelVisible
    local goalPos = panelVisible and UDim2.new(0.5, 0, 1, -18) or UDim2.new(0.5, 0, 1.3, 0)
    local goalTransparency = panelVisible and 0.6 or 1

    local posTween = TweenService:Create(dockContainer, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Position = goalPos})
    local transTween = TweenService:Create(overlay, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = goalTransparency})
    posTween:Play()
    transTween:Play()

    posTween.Completed:Connect(function()
        overlay.Visible = panelVisible
        if not panelVisible then
            cleanupOverlays()  -- Cleanup sisa overlay
        end
        playClick()
    end)
end)

toggleBtn.MouseEnter:Connect(function()
    tween(toggleBtn, {BackgroundColor3 = Color3.fromRGB(100, 50, 170)}, 0.2)
end)
toggleBtn.MouseLeave:Connect(function()
    tween(toggleBtn, {BackgroundColor3 = Color3.fromRGB(80, 30, 150)}, 0.2)
end)

-- ===== SCROLL DOCK =====
local scroll = Instance.new("ScrollingFrame")
scroll.Name = "ScrollDock"
scroll.Parent = dockBG
scroll.AnchorPoint = Vector2.new(0.5, 0.5)
scroll.Position = UDim2.new(0.5, 0, 0.58, 0)
scroll.Size = UDim2.new(0.96, 0, 0.65, 0)
scroll.BackgroundTransparency = 1
scroll.BorderSizePixel = 0
scroll.ScrollBarThickness = 6
scroll.CanvasSize = UDim2.new(0, 0, 0, 0)
scroll.ScrollingDirection = Enum.ScrollingDirection.X
scroll.AutomaticCanvasSize = Enum.AutomaticSize.X
scroll.VerticalScrollBarInset = Enum.ScrollBarInset.Always
scroll.HorizontalScrollBarInset = Enum.ScrollBarInset.Always

local dockLayout = Instance.new("UIListLayout")
dockLayout.FillDirection = Enum.FillDirection.Horizontal
dockLayout.HorizontalAlignment = Enum.HorizontalAlignment.Left
dockLayout.SortOrder = Enum.SortOrder.LayoutOrder
dockLayout.Padding = UDim.new(0, 12)
dockLayout.Parent = scroll

local function updateScrollCanvas()
    local contentWidth = 0
    for _, c in ipairs(scroll:GetChildren()) do
        if c:IsA("Frame") then
            contentWidth = contentWidth + c.AbsoluteSize.X + dockLayout.Padding.Offset
        end
    end
    contentWidth = math.max(contentWidth, scroll.AbsoluteSize.X + 12)
    scroll.CanvasSize = UDim2.new(0, contentWidth + 24, 0, 0)
end

scroll:GetPropertyChangedSignal("AbsoluteSize"):Connect(updateScrollCanvas)
dockLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(updateScrollCanvas)

-- ===== BUTTON FACTORY =====
local BUTTON_TEMPLATE_SIZE = UDim2.new(0, 84, 0, 84)
local BUTTON_COLOR = Color3.fromRGB(150, 70, 255)

local function createDockButton(id, labelText, iconAssetId, onClick)
    local cont = Instance.new("Frame")
    cont.Name = "DockButton_" .. tostring(id)
    cont.Size = BUTTON_TEMPLATE_SIZE
    cont.BackgroundTransparency = 1
    cont.Parent = scroll

    local btn = Instance.new("ImageButton")
    btn.Name = "Btn"
    btn.Size = UDim2.new(0, 72, 0, 72)
    btn.Position = UDim2.new(0, 6, 0, 0)
    btn.BackgroundColor3 = BUTTON_COLOR
    btn.BackgroundTransparency = 0.18
    btn.BorderSizePixel = 0
    btn.AutoButtonColor = false
    btn.Parent = cont
    makeCorner(btn, 18)
    makeStroke(btn, 1.3, Color3.fromRGB(230, 190, 255), 0.45)

    local icon = Instance.new("ImageLabel")
    icon.Name = "Icon"
    icon.BackgroundTransparency = 1
    icon.Size = UDim2.new(0.56, 0, 0.56, 0)
    icon.Position = UDim2.new(0.22, 0, 0.22, 0)
    icon.AnchorPoint = Vector2.new(0, 0)
    icon.Image = iconAssetId and ("rbxassetid://" .. tostring(iconAssetId)) or ""
    icon.ImageColor3 = Color3.fromRGB(245, 230, 255)
    icon.Parent = btn

    local txt = Instance.new("TextLabel")
    txt.Name = "Label"
    txt.Size = UDim2.new(1, 0, 0, 16)
    txt.Position = UDim2.new(0, 0, 1, 2)
    txt.BackgroundTransparency = 1
    txt.Font = Enum.Font.GothamSemibold
    txt.TextSize = 12
    txt.Text = labelText or ""
    txt.TextColor3 = Color3.fromRGB(220, 200, 255)
    txt.Parent = cont

    btn.MouseEnter:Connect(function()
        tween(btn, {Size = UDim2.new(0, 78, 0, 78)}, 0.15)
        tween(btn, {BackgroundTransparency = 0.08}, 0.15)
    end)
    btn.MouseLeave:Connect(function()
        tween(btn, {Size = UDim2.new(0, 72, 0, 72)}, 0.15)
        tween(btn, {BackgroundTransparency = 0.18}, 0.15)
    end)
    btn.Activated:Connect(function()
        local ripple = Instance.new("Frame")
        ripple.Size = UDim2.new(1, 0, 1, 0)
        ripple.BackgroundColor3 = Color3.fromRGB(200, 140, 255)
        ripple.BackgroundTransparency = 0.7
        ripple.Parent = btn
        makeCorner(ripple, 18)
        local rippleTween = tween(ripple, {BackgroundTransparency = 1}, 0.45)
        rippleTween.Completed:Connect(function()
            Debris:AddItem(ripple, 0)
        end)

        playClick()
        if typeof(onClick) == "function" then
            local ok, err = pcall(onClick)
            if not ok then warn("DockButton callback error:", err) end
        end
    end)

    return cont, btn, icon, txt
end

-- ===== DEFAULT 9 BUTTONS =====
local defaultButtons = {
    {label = "Menu", icon = 6031094677},
    {label = "Inventory", icon = 6031229379},
    {label = "Shop", icon = 6031302911},
    {label = "Map", icon = 6031229379},
    {label = "Teleport", icon = 6031280883},
    {label = "Quests", icon = 6031265976},
    {label = "Friends", icon = 6031280882},
    {label = "Settings", icon = 6031280882},
    {label = "Profile", icon = 6031302911},
}

local dockButtons = {}
for i, v in ipairs(defaultButtons) do
    local cont, btn, icon, txt = createDockButton(i, v.label, v.icon, function()
        print("Clicked:", v.label)
        if v.label == "Settings" and screenGui:FindFirstChild("SettingsPanel") then
            screenGui.SettingsPanel.Visible = true
            screenGui.SettingsPanel.BackgroundTransparency = 0.95
            tween(screenGui.SettingsPanel, {BackgroundTransparency = 0.25}, 0.35)
        elseif v.label == "Profile" and screenGui:FindFirstChild("ProfilePanel") then
            screenGui.ProfilePanel.Visible = true
            screenGui.ProfilePanel.BackgroundTransparency = 0.95
            tween(screenGui.ProfilePanel, {BackgroundTransparency = 0.25}, 0.35)
        elseif v.label == "Menu" and screenGui:FindFirstChild("HelpPanel") then
            screenGui.HelpPanel.Visible = true
            screenGui.HelpPanel.BackgroundTransparency = 0.95
            tween(screenGui.HelpPanel, {BackgroundTransparency = 0.25}, 0.35)
        end
    end)
    cont.LayoutOrder = i
    table.insert(dockButtons, {cont = cont, btn = btn, label = v.label})
end

updateScrollCanvas()

local function addDockButton(label, iconId, callback)
    local order = #dockButtons + 1
    local cont, btn = createDockButton(order, label, iconId, callback)
    cont.LayoutOrder = order
    table.insert(dockButtons, {cont = cont, btn = btn, label = label})
    updateScrollCanvas()
    return cont, btn
end

-- ===== SWIPE-TO-HIDE =====
local touchStartY = nil
local touchThreshold = 50
local touchActive = false

scroll.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.Touch then
        touchStartY = input.Position.Y
        touchActive = true
    end
end)

scroll.InputChanged:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.Touch and touchActive and touchStartY then
        local dy = input.Position.Y - touchStartY
        if dy > touchThreshold and panelVisible then
            panelVisible = false
            local goalPos = UDim2.new(0.5, 0, 1.3, 0)
            local goalTransparency = 1
            local posTween = TweenService:Create(dockContainer, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Position = goalPos})
            local transTween = TweenService:Create(overlay, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = goalTransparency})
            posTween:Play()
            transTween:Play()
            posTween.Completed:Connect(function()
                overlay.Visible = false
                cleanupOverlays()
            end)
            touchActive = false
            touchStartY = nil
        end
    end
end)

scroll.InputEnded:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.Touch then
        touchStartY = nil
        touchActive = false
    end
end)

-- ===== POPUP PANELS =====
local function createPanel(name, title)
    local panel = Instance.new("Frame")
    panel.Name = name .. "Panel"
    panel.Size = UDim2.new(0.9, 0, 0.6, 0)
    panel.Position = UDim2.new(0.5, 0, 0.5, 0)
    panel.AnchorPoint = Vector2.new(0.5, 0.5)
    panel.BackgroundColor3 = Color3.fromRGB(22, 6, 46)
    panel.BackgroundTransparency = 0.95
    panel.BorderSizePixel = 0
    panel.Visible = false
    panel.Parent = screenGui
    makeCorner(panel, 18)
    makeStroke(panel, 2, Color3.fromRGB(170, 110, 255), 0.45)

    local content = Instance.new("Frame")
    content.Size = UDim2.new(0.96, 0, 0.86, 0)
    content.Position = UDim2.new(0.02, 0, 0.11, 0)
    content.BackgroundTransparency = 1
    content.Parent = panel

    local lbl = Instance.new("TextLabel")
    lbl.Size = UDim2.new(1, -40, 0, 36)
    lbl.Position = UDim2.new(0, 20, 0, 12)
    lbl.BackgroundTransparency = 1
    lbl.Font = Enum.Font.GothamBold
    lbl.TextSize = 20
    lbl.Text = title or name
    lbl.TextColor3 = Color3.fromRGB(240, 230, 255)
    lbl.TextXAlignment = Enum.TextXAlignment.Left
    lbl.Parent = panel

    local close = Instance.new("TextButton")
    close.Size = UDim2.new(0, 40, 0, 36)
    close.Position = UDim2.new(1, -52, 0, 12)
    close.AnchorPoint = Vector2.new(0, 0)
    close.Text = "✕"
    close.Font = Enum.Font.GothamBold
    close.TextSize = 20
    close.BackgroundColor3 = Color3.fromRGB(80, 28, 130)
    close.TextColor3 = Color3.fromRGB(240, 230, 255)
    close.BackgroundTransparency = 0.2
    makeCorner(close, 8)
    close.Parent = panel
    close.Activated:Connect(function()
        local fadeTween = tween(panel, {BackgroundTransparency = 0.95}, 0.28)
        fadeTween.Completed:Connect(function()
            panel.Visible = false
        end)
    end)

    return panel, content
end

local settingsPanel, settingsContent = createPanel("Settings", "⚙ Settings")
local profilePanel, profileContent = createPanel("Profile", "👤 Profile")
local helpPanel, helpContent = createPanel("Help", "❓ Help & Tips")

-- Populate settings
do
    local t = Instance.new("TextLabel")
    t.Size = UDim2.new(1, 0, 0, 20)
    t.Position = UDim2.new(0, 0, 0, 0)
    t.BackgroundTransparency = 1
    t.Font = Enum.Font.SourceSans
    t.TextSize = 15
    t.TextColor3 = Color3.fromRGB(210, 200, 240)
    t.Text = "Choose Theme:"
    t.Parent = settingsContent
    local btn = Instance.new("TextButton")
    btn.Size = UDim2.new(0, 140, 0, 34)
    btn.Position = UDim2.new(0, 0, 0, 28)
    btn.Text = "Pulse Glow"
    btn.Font = Enum.Font.GothamSemibold
    btn.TextSize = 14
    btn.BackgroundColor3 = Color3.fromRGB(130, 60, 240)
    btn.TextColor3 = Color3.fromRGB(240, 230, 255)
    makeCorner(btn, 8)
    btn.Parent = settingsContent
    btn.Activated:Connect(function()
        playClick()
        local pulseIn = tween(glow, {ImageTransparency = 0.85}, 0.12)
        pulseIn.Completed:Connect(function()
            tween(glow, {ImageTransparency = 0.95}, 0.22)
        end)
    end)
end

-- Populate profile
do
    local av = Instance.new("ImageLabel")
    av.Size = UDim2.new(0, 92, 0, 92)
    av.Position = UDim2.new(0, 0, 0, 6)
    av.Image = "rbxthumb://type=AvatarHeadShot&id=" .. player.UserId .. "&w=420&h=420"
    av.BackgroundTransparency = 1
    makeCorner(av, 46)
    av.Parent = profileContent

    local nameLabel = Instance.new("TextLabel")
    nameLabel.Size = UDim2.new(1, -110, 0, 28)
    nameLabel.Position = UDim2.new(0, 112, 0, 10)
    nameLabel.BackgroundTransparency = 1
    nameLabel.Font = Enum.Font.GothamBold
    nameLabel.TextSize = 18
    nameLabel.Text = player.Name
    nameLabel.TextColor3 = Color3.fromRGB(240, 230, 255)
    nameLabel.Parent = profileContent
end

-- Populate help
do
    local helpText = Instance.new("TextLabel")
    helpText.Size = UDim2.new(1, 0, 1, 0)
    helpText.BackgroundTransparency = 1
    helpText.Font = Enum.Font.SourceSans
    helpText.TextSize = 14
    helpText.TextColor3 = Color3.fromRGB(210, 200, 240)
    helpText.TextWrapped = true
    helpText.Text = "Tips:\n• Swipe left/right inside the dock to access more tools.\n• Swipe down on the dock to hide the panel.\n• Tap 'Show / Hide Panel' to bring it back.\n• Use Settings to tweak visuals."
    helpText.Parent = helpContent
end

-- Hookup buttons to panels
for _, info in ipairs(dockButtons) do
    if info.label == "Settings" then
        info.btn.Activated:Connect(function()
            playClick()
            settingsPanel.Visible = true
            settingsPanel.BackgroundTransparency = 0.95
            tween(settingsPanel, {BackgroundTransparency = 0.25}, 0.35)
        end)
    elseif info.label == "Profile" then
        info.btn.Activated:Connect(function()
            playClick()
            profilePanel.Visible = true
            profilePanel.BackgroundTransparency = 0.95
            tween(profilePanel, {BackgroundTransparency = 0.25}, 0.35)
        end)
    elseif info.label == "Menu" then
        info.btn.Activated:Connect(function()
            playClick()
            helpPanel.Visible = true
            helpPanel.BackgroundTransparency = 0.95
            tween(helpPanel, {BackgroundTransparency = 0.25}, 0.35)
        end)
    end
end

-- ===== TOAST =====
local toast = Instance.new("Frame")
toast.Name = "Toast"
toast.Size = UDim2.new(0, 280, 0, 52)
toast.AnchorPoint = Vector2.new(1, 1)
toast.Position = UDim2.new(1, -18, 1, -18)
toast.BackgroundColor3 = Color3.fromRGB(22, 6, 46)
toast.BackgroundTransparency = 0.95
toast.BorderSizePixel = 0
toast.Visible = false
toast.Parent = screenGui
makeCorner(toast, 10)
makeStroke(toast, 1, Color3.fromRGB(170, 110, 255), 0.45)

local toastLabel = Instance.new("TextLabel")
toastLabel.Size = UDim2.new(1, -20, 1, -10)
toastLabel.Position = UDim2.new(0, 10, 0, 6)
toastLabel.BackgroundTransparency = 1
toastLabel.Font = Enum.Font.Gotham
toastLabel.TextSize = 16
toastLabel.TextColor3 = Color3.fromRGB(230, 220, 255)
toastLabel.Text = ""
toastLabel.Parent = toast

local function showToast(message, timeSec)
    timeSec = timeSec or 2.2
    toastLabel.Text = message
    toast.Position = UDim2.new(1, -18, 1, 80)
    toast.Visible = true
    local slideIn = tween(toast, {Position = UDim2.new(1, -18, 1, -18)}, 0.35)
    task.delay(timeSec, function()
        local slideOut = tween(toast, {Position = UDim2.new(1, -18, 1, 80)}, 0.3)
        slideOut.Completed:Connect(function()
            toast.Visible = false
        end)
    end)
end

-- ===== AUTO-HIDE IDLE =====
local idleTime = 0
local hiddenByIdle = false
RunService.RenderStepped:Connect(function(dt)
    idleTime = idleTime + dt
    if idleTime > 10 and not hiddenByIdle and panelVisible then
        hiddenByIdle = true
        panelVisible = false
        local goalPos = UDim2.new(0.5, 0, 1.3, 0)
        local goalTransparency = 1
        local posTween = TweenService:Create(dockContainer, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Position = goalPos})
        local transTween = TweenService:Create(overlay, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = goalTransparency})
        posTween:Play()
        transTween:Play()
        posTween.Completed:Connect(function()
            overlay.Visible = false
            cleanupOverlays()
        end)
    elseif idleTime < 10 and hiddenByIdle then
        hiddenByIdle = false
    end
end)
UserInputService.InputBegan:Connect(function()
    idleTime = 0
end)

-- ===== SWIPE INDICATORS =====
local leftArrow = Instance.new("ImageLabel")
leftArrow.Size = UDim2.new(0, 28, 0, 28)
leftArrow.Position = UDim2.new(0.02, 0, 0.5, -14)
leftArrow.Image = "rbxassetid://6031265976"
leftArrow.BackgroundTransparency = 1
leftArrow.ImageColor3 = Color3.fromRGB(200, 170, 255)
leftArrow.ZIndex = 4
leftArrow.Parent = dockBG

local rightArrow = Instance.new("ImageLabel")
rightArrow.Size = UDim2.new(0, 28, 0, 28)
rightArrow.Position = UDim2.new(0.98, -28, 0.5, -14)
rightArrow.AnchorPoint = Vector2.new(1, 0)
rightArrow.Image = "rbxassetid://6031265976"
rightArrow.BackgroundTransparency = 1
rightArrow.Rotation = 180
rightArrow.ImageColor3 = Color3.fromRGB(200, 170, 255)
rightArrow.ZIndex = 4
rightArrow.Parent = dockBG

local function updateArrows()
    local max = scroll.CanvasSize.X.Offset - scroll.AbsoluteSize.X
    if max <= 10 then
        leftArrow.Visible = false
        rightArrow.Visible = false
    else
        leftArrow.Visible = scroll.CanvasPosition.X > 8
        rightArrow.Visible = scroll.CanvasPosition.X < max - 8
    end
end
scroll:GetPropertyChangedSignal("CanvasPosition"):Connect(updateArrows)
scroll:GetPropertyChangedSignal("CanvasSize"):Connect(updateArrows)

-- ===== SAFE START =====
dockContainer.Position = UDim2.new(0.5, 0, 1.18, 0)
dockContainer.BackgroundTransparency = 1
tween(dockContainer, {Position = UDim2.new(0.5, 0, 1, -18), BackgroundTransparency = 0}, 0.68)

task.delay(0.6, function()
    showToast("Welcome to Panel By Rizku", 2.2)
end)

-- ===== PUBLIC API =====
local API = {}
function API.AddButton(label, iconId, callback)
    return addDockButton(label, iconId, callback)
end
function API.ShowToast(msg, t)
    showToast(msg, t)
end
function API.HidePanel()
    if panelVisible then
        panelVisible = false
        local goalPos = UDim2.new(0.5, 0, 1.3, 0)
        local goalTransparency = 1
        local posTween = TweenService:Create(dockContainer, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Position = goalPos})
        local transTween = TweenService:Create(overlay, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = goalTransparency})
        posTween:Play()
        transTween:Play()
        posTween.Completed:Connect(function()
            overlay.Visible = false
            cleanupOverlays()
        end)
    end
end
function API.ShowPanel()
    if not panelVisible then
        panelVisible = true
        overlay.Visible = true
        local goalPos = UDim2.new(0.5, 0, 1, -18)
        local goalTransparency = 0.6
        local posTween = TweenService:Create(dockContainer, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Position = goalPos})
        local transTween = TweenService:Create(overlay, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = goalTransparency})
        posTween:Play()
        transTween:Play()
    end
end

_G.PurpleHoloAPI = API
screenGui:SetAttribute("PurpleHoloUI", true)
screenGui:SetAttribute("Version", "v8-Lite-ShowHide")

print("[PurpleHoloUI] Loaded — Panel By Rizku (Show/Hide Edition). Tekan Insert untuk toggle.")

Features & Information

Panel made by rizki(me)
#Panel

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts