iluminacion V4
Key RequiredUniversal

iluminacion V4

Universal ScriptCleoooCleooo 756 views 436 executesUpdated Jan 23, 2026
Unrated
00
Lua Script•2145 lines (71783 chars)
-- LightingMenu.lua

-- Versión mejorada: Nombres específicos, entrada manual de números, animaciones Windows 11

-- CON BOTONES DE REINICIO INDIVIDUALES MEJORADOS

local Lighting = game:GetService("Lighting")

local UserInputService = game:GetService("UserInputService")

local RunService = game:GetService("RunService")

local Players = game:GetService("Players")

local Workspace = game:GetService("Workspace")

local StarterGui = game:GetService("StarterGui")

local TweenService = game:GetService("TweenService")

local LOCAL_PLAYER = Players.LocalPlayer

-----------------------------------------------------

-- Configuración inicial

-----------------------------------------------------

local LightingConfig = {
    Brightness = 0.8,
    ExposureCompensation = 0.5,
    ShadowSoftness = 1.2,
    EnvironmentDiffuseScale = 0.6,
    EnvironmentSpecularScale = 1.1,
    ClockTime = 14,
    FogStart = 10000,
    FogEnd = 10000,
    GlobalShadows = true,
    ColorShift_Top = Color3.fromRGB(190, 190, 190),
    ColorShift_Bottom = Color3.fromRGB(110, 110, 110),
    OutdoorAmbient = Color3.fromRGB(135, 135, 135),
    Ambient = Color3.fromRGB(115, 115, 115),
    Reflectance = 0.03,
}

for property, value in pairs(LightingConfig) do

    pcall(function() Lighting[property] = value end)

end

local function applyPartReflectance(part)
    if part:IsA("BasePart") then
        pcall(function() part.Reflectance = LightingConfig.Reflectance or 0.03 end)
    end
end

for _, part in ipairs(Workspace:GetDescendants()) do
    applyPartReflectance(part)
end

Workspace.DescendantAdded:Connect(applyPartReflectance)

-----------------------------------------------------

-- Efectos

-----------------------------------------------------

local EffectsConfig = {
    BloomEffect = { Name = "Bloom", Intensity = 0.35, Size = 22, Threshold = 2.4, Enabled = true },
    DepthOfFieldEffect = { Name = "DepthOfField", InFocusRadius = 80, NearIntensity = 0.25, FarIntensity = 0.35, FocusDistance = 18, Enabled = true },
    ColorCorrectionEffect = { Name = "ColorCorrection", Brightness = 0, Contrast = 0.2, Saturation = 0.25, TintColor = Color3.fromRGB(250, 250, 250), Enabled = true },
    SunRaysEffect = { Name = "SunRays", Intensity = 0.4, Spread = 2.8, Enabled = true },
    BlurEffect = { Name = "Blur", Size = 0, Enabled = false },
}

local function addOrUpdateEffect(effectType, properties)

    local effect = Lighting:FindFirstChildOfClass(effectType)

    if not effect then

        local ok, inst = pcall(function() return Instance.new(effectType, Lighting) end)

        effect = ok and inst or nil

    end

    if not effect then return nil end

    for property, value in pairs(properties) do

        if effect[property] ~= nil then

            pcall(function() effect[property] = value end)

        end

    end

    return effect

end

for effectType, properties in pairs(EffectsConfig) do

    addOrUpdateEffect(effectType, properties)

end

-----------------------------------------------------

-- Helpers

-----------------------------------------------------

local function clamp(n, a, b) return math.max(a, math.min(b, n)) end

local function formatValue(v)

    if type(v) ~= "number" then return tostring(v) end

    if math.abs(v - math.floor(v + 0.5)) < 1e-6 then

        return tostring(math.floor(v + 0.5))

    else

        return string.format("%.2f", v)

    end

end

local DEFAULT_WIDTH = 760

local DEFAULT_HEIGHT = 620

local SCREEN_MARGIN = 20

-----------------------------------------------------

-- Guardados originales

-----------------------------------------------------

local originalCoreGuiStates = {}

local originalNameDistance = nil

local originalPlayerGuiStates = {}

-- Estado temporal de las interfaces propias del juego.
-- Se captura JUSTO al ocultarlas, no al ejecutar el script, para poder restaurar
-- exactamente las que estaban visibles en ese momento. CoreGui de Roblox no se toca.
local gameInterfaceHidden = false
local hiddenGameGuiStates = {}
local gameGuiAddedConnection = nil

-- Estado temporal de la interfaz de Roblox/CoreGui.
-- Se captura justo al ocultarla para restaurar exactamente lo que estaba visible.
local robloxInterfaceHidden = false
local hiddenCoreGuiStates = {}

do

    local ok, val = pcall(function() return StarterGui:GetCore("NameDisplayDistance") end)

    originalNameDistance = (ok and type(val) == "number") and val or 100

    local coreTypes = { Enum.CoreGuiType.Chat, Enum.CoreGuiType.Backpack, Enum.CoreGuiType.PlayerList, Enum.CoreGuiType.Health }

    for _, t in ipairs(coreTypes) do

        local ok2, enabled = pcall(function() return StarterGui:GetCoreGuiEnabled(t) end)

        originalCoreGuiStates[t.Name] = (ok2 and type(enabled) == "boolean") and enabled or true

    end

    local playerGui = LOCAL_PLAYER:WaitForChild("PlayerGui")

    for _, gui in ipairs(playerGui:GetChildren()) do

        if gui:IsA("ScreenGui") then

            table.insert(originalPlayerGuiStates, { Name = gui.Name, IsScreenGui = true, Enabled = gui.Enabled })

        elseif gui:IsA("GuiObject") then

            table.insert(originalPlayerGuiStates, { Name = gui.Name, IsScreenGui = false, Visible = gui.Visible })

        end

    end

end

local function setCoreGuiEnabledSafe(coreType, enabled)

    pcall(function() StarterGui:SetCoreGuiEnabled(coreType, enabled) end)

end

local function setCoreSafe(name, value)

    pcall(function() StarterGui:SetCore(name, value) end)

end

-----------------------------------------------------

-- Variables de hora automática GLOBALES

-----------------------------------------------------

local autoClockRunning = false

local autoClockSpeed = 0.2

-- Conexión global para actualizar constantemente

local globalAutoClockLoop = nil

-----------------------------------------------------

-- Función para controlar la hora automática globalmente

-----------------------------------------------------

local function startGlobalAutoClock()

    if globalAutoClockLoop then return end

    globalAutoClockLoop = RunService.Heartbeat:Connect(function(deltaTime)

        if autoClockRunning then

            -- Actualizar la hora constantemente SOLO si está activado

            local newTime = (Lighting.ClockTime + (autoClockSpeed * deltaTime)) % 24

            Lighting.ClockTime = newTime

        end

    end)

end

startGlobalAutoClock()

-----------------------------------------------------

-- UI MENU

-----------------------------------------------------

local toggleMenu

local function createScreenGui()

    local old = LOCAL_PLAYER.PlayerGui:FindFirstChild("LightingMenu")

    if old then old:Destroy() end

    local ScreenGui = Instance.new("ScreenGui")

    ScreenGui.Name = "LightingMenu"

    ScreenGui.ResetOnSpawn = false

    ScreenGui.DisplayOrder = 1000

    ScreenGui.Parent = LOCAL_PLAYER:WaitForChild("PlayerGui")

    -- CAPA INVISIBLE PARA BLOQUEAR INPUTS (Toque en celular)

    local InputBlocker = Instance.new("Frame", ScreenGui)

    InputBlocker.Name = "InputBlocker"

    InputBlocker.Size = UDim2.new(1, 0, 1, 0)

    InputBlocker.Position = UDim2.new(0, 0, 0, 0)

    InputBlocker.BackgroundTransparency = 1

    InputBlocker.BorderSizePixel = 0

    InputBlocker.ZIndex = 500

    InputBlocker.Visible = false

    InputBlocker.Active = true

    -- BOTÓN FLOTANTE PARA CELULAR (PEQUEÑO)

    local FloatingButton = Instance.new("TextButton", ScreenGui)

    FloatingButton.Name = "FloatingButton"

    FloatingButton.Size = UDim2.new(0, 48, 0, 48)

    FloatingButton.Position = UDim2.new(1, -68, 1, -68)

    FloatingButton.BackgroundColor3 = Color3.fromRGB(29,29,34)

    FloatingButton.Text = ""

    FloatingButton.Font = Enum.Font.GothamBold

    FloatingButton.TextSize = 21

    FloatingButton.TextColor3 = Color3.fromRGB(225,230,240)

    FloatingButton.AutoButtonColor = false

    FloatingButton.ZIndex = 1200

    local FloatingCorner = Instance.new("UICorner", FloatingButton)

    FloatingCorner.CornerRadius = UDim.new(0, 14)

    local FloatingStroke = Instance.new("UIStroke", FloatingButton)

    FloatingStroke.Color = Color3.fromRGB(58,58,66)

    FloatingStroke.Thickness = 1.5

    local FloatingScale = Instance.new("UIScale", FloatingButton)
    FloatingScale.Scale = 1

    -- Icono de configuración dibujado, sin letras ni emojis.
    local gear = Instance.new("Frame", FloatingButton)
    gear.Size = UDim2.fromOffset(18,18)
    gear.Position = UDim2.new(.5,-9,.5,-9)
    gear.BackgroundTransparency = 1
    gear.BorderSizePixel = 0
    gear.ZIndex = 1201
    local gearStroke = Instance.new("UIStroke", gear)
    gearStroke.Color = Color3.fromRGB(205,208,216)
    gearStroke.Thickness = 1.7
    gearStroke.Transparency = 0.05
    Instance.new("UICorner", gear).CornerRadius = UDim.new(1,0)
    local gearCenter = Instance.new("Frame", gear)
    gearCenter.Size = UDim2.fromOffset(6,6)
    gearCenter.Position = UDim2.new(.5,-3,.5,-3)
    gearCenter.BackgroundColor3 = Color3.fromRGB(205,208,216)
    gearCenter.BorderSizePixel = 0
    gearCenter.ZIndex = 1202
    Instance.new("UICorner", gearCenter).CornerRadius = UDim.new(1,0)
    for i=0,7 do
        local tooth = Instance.new("Frame", gear)
        tooth.Size = UDim2.fromOffset(3,6)
        tooth.AnchorPoint = Vector2.new(.5,.5)
        local a = math.rad(i*45)
        tooth.Position = UDim2.new(.5,math.cos(a)*9,.5,math.sin(a)*9)
        tooth.Rotation = i*45
        tooth.BackgroundColor3 = Color3.fromRGB(205,208,216)
        tooth.BorderSizePixel = 0
        tooth.ZIndex = 1201
        Instance.new("UICorner", tooth).CornerRadius = UDim.new(1,0)
    end

    FloatingButton.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
            TweenService:Create(FloatingScale, TweenInfo.new(.08), {Scale = .94}):Play()
        end
    end)

    FloatingButton.MouseEnter:Connect(function()
        TweenService:Create(FloatingButton, TweenInfo.new(.15, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(38,38,44)}):Play()
        TweenService:Create(FloatingStroke, TweenInfo.new(.15), {Color = Color3.fromRGB(72,72,80)}):Play()
        TweenService:Create(gearStroke, TweenInfo.new(.15), {Transparency = 0}):Play()
        TweenService:Create(FloatingScale, TweenInfo.new(.15, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Scale = 1.04}):Play()
    end)

    FloatingButton.MouseLeave:Connect(function()
        TweenService:Create(FloatingButton, TweenInfo.new(.15), {BackgroundColor3 = Color3.fromRGB(29,29,34)}):Play()
        TweenService:Create(FloatingStroke, TweenInfo.new(.15), {Color = Color3.fromRGB(70,75,90)}):Play()
        TweenService:Create(FloatingScale, TweenInfo.new(.15), {Scale = 1}):Play()
    end)

    FloatingButton.InputEnded:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
            TweenService:Create(FloatingScale, TweenInfo.new(.16, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Scale = 1}):Play()
        end
    end)

    local Frame = Instance.new("Frame", ScreenGui)

    Frame.Name = "MainFrame"

    Frame.BackgroundColor3 = Color3.fromRGB(40,40,40)

    Frame.BorderSizePixel = 0

    Frame.ClipsDescendants = true

    Frame.ZIndex = 1000

    Frame.Visible = false

    local UICorner = Instance.new("UICorner", Frame)

    UICorner.CornerRadius = UDim.new(0, 10)

    local function adaptFrame()

        local cam = workspace.CurrentCamera

        if not cam then return end

        local vs = cam.ViewportSize

        local maxW = math.max(100, vs.X - SCREEN_MARGIN * 2)

        local maxH = math.max(100, vs.Y - SCREEN_MARGIN * 2)

        local w = math.min(DEFAULT_WIDTH, maxW)

        local h = math.min(DEFAULT_HEIGHT, maxH)

        Frame.Size = UDim2.new(0, w, 0, h)

        -- POSICIONAR EN EL CENTRO - Centrado verticalmente en la pantalla, pero más arriba

        -- Centro horizontal

        local xPos = (vs.X - w) / 2

        -- Centro vertical pero restando 200 para subirlo más de lo normal

        local yPos = (vs.Y - h) / 2 - 60

        Frame.Position = UDim2.new(0, xPos, 0, yPos)

    end

    RunService.RenderStepped:Connect(adaptFrame)

    adaptFrame()

    local Header = Instance.new("TextLabel", Frame)
    Header.Name = "Header"
    Header.Size = UDim2.new(1, -70, 0, 48)
    Header.Position = UDim2.new(0, 22, 0, 8)
    Header.BackgroundTransparency = 1
    Header.Text = "VISUAL"
    Header.TextColor3 = Color3.fromRGB(245,245,245)
    Header.Font = Enum.Font.GothamBold
    Header.TextSize = 21
    Header.TextXAlignment = Enum.TextXAlignment.Left
    Header.ZIndex = 1001

    local Subtitle = Instance.new("TextLabel", Frame)
    Subtitle.Size = UDim2.new(1, -70, 0, 22)
    Subtitle.Position = UDim2.new(0, 22, 0, 36)
    Subtitle.BackgroundTransparency = 1
    Subtitle.Text = "Configuración visual"
    Subtitle.TextColor3 = Color3.fromRGB(145,145,150)
    Subtitle.Font = Enum.Font.Gotham
    Subtitle.TextSize = 12
    Subtitle.TextXAlignment = Enum.TextXAlignment.Left
    Subtitle.ZIndex = 1001

    local CloseBtn = Instance.new("TextButton", Frame)
    CloseBtn.Name = "CloseButton"
    CloseBtn.Size = UDim2.fromOffset(36,36)
    CloseBtn.Position = UDim2.new(1,-50,0,12)
    CloseBtn.BackgroundColor3 = Color3.fromRGB(42,42,48)
    CloseBtn.Text = "×"
    CloseBtn.Font = Enum.Font.Gotham
    CloseBtn.TextSize = 24
    CloseBtn.TextColor3 = Color3.fromRGB(225,225,230)
    CloseBtn.AutoButtonColor = false
    CloseBtn.ZIndex = 1001
    Instance.new("UICorner", CloseBtn).CornerRadius = UDim.new(0,10)
    local closeStroke = Instance.new("UIStroke", CloseBtn)
    closeStroke.Color = Color3.fromRGB(75,75,82)
    closeStroke.Thickness = 1

    local closeHover = CloseBtn.MouseEnter:Connect(function()
        TweenService:Create(CloseBtn,TweenInfo.new(.12),{BackgroundColor3=Color3.fromRGB(52,52,58)}):Play()
    end)
    CloseBtn.MouseLeave:Connect(function()
        TweenService:Create(CloseBtn,TweenInfo.new(.12),{BackgroundColor3=Color3.fromRGB(42,42,48)}):Play()
    end)

    local function closeMenu()
        local tweenInfo = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
        local tween = TweenService:Create(Frame, tweenInfo, { Position = UDim2.new(0.5, -Frame.AbsoluteSize.X/2, 1, Frame.AbsoluteSize.Y) })
        tween:Play()
        tween.Completed:Connect(function()
            Frame.Visible = false
            InputBlocker.Visible = false
        end)
    end
    CloseBtn.MouseButton1Click:Connect(closeMenu)

    local Divider = Instance.new("Frame", Frame)
    Divider.Size = UDim2.new(1,-40,0,1)
    Divider.Position = UDim2.new(0,20,0,62)
    Divider.BackgroundColor3 = Color3.fromRGB(55,55,62)
    Divider.BorderSizePixel = 0
    Divider.ZIndex = 1001

    -- Sidebar: solo navega dentro del mismo ScrollFrame, nunca cambia de pestaña.
    local Sidebar = Instance.new("Frame", Frame)
    Sidebar.Name = "CategorySidebar"
    Sidebar.Size = UDim2.new(0,178,1,-90)
    Sidebar.Position = UDim2.new(0,15,0,75)
    Sidebar.BackgroundColor3 = Color3.fromRGB(29,29,34)
    Sidebar.BorderSizePixel = 0
    Sidebar.ZIndex = 1001
    Instance.new("UICorner", Sidebar).CornerRadius = UDim.new(0,12)

    local SideTitle = Instance.new("TextLabel", Sidebar)
    SideTitle.Size = UDim2.new(1,-24,0,26)
    SideTitle.Position = UDim2.new(0,12,0,12)
    SideTitle.BackgroundTransparency = 1
    SideTitle.Text = "CATEGORÍAS"
    SideTitle.TextColor3 = Color3.fromRGB(125,125,135)
    SideTitle.Font = Enum.Font.GothamBold
    SideTitle.TextSize = 10
    SideTitle.TextXAlignment = Enum.TextXAlignment.Left
    SideTitle.ZIndex = 1002

    local ScrollClip = Instance.new("Frame", Frame)
    ScrollClip.Name = "ScrollClip"
    ScrollClip.Size = UDim2.new(1,-218,1,-90)
    ScrollClip.Position = UDim2.new(0,203,0,75)
    ScrollClip.BackgroundColor3 = Color3.fromRGB(24,24,28)
    ScrollClip.BorderSizePixel = 0
    ScrollClip.ClipsDescendants = true
    ScrollClip.ZIndex = 999
    local scrollClipCorner = Instance.new("UICorner", ScrollClip)
    scrollClipCorner.CornerRadius = UDim.new(0,14)
    local scrollClipStroke = Instance.new("UIStroke", ScrollClip)
    scrollClipStroke.Color = Color3.fromRGB(48,48,55)
    scrollClipStroke.Thickness = 1

    local Scroll = Instance.new("ScrollingFrame", ScrollClip)
    Scroll.Name = "ScrollArea"
    Scroll.Size = UDim2.new(1,0,1,0)
    Scroll.Position = UDim2.fromOffset(0,0)
    Scroll.BackgroundTransparency = 1
    Scroll.BorderSizePixel = 0
    Scroll.ScrollBarThickness = 4
    Scroll.ScrollBarImageTransparency = 0.35
    Scroll.ScrollingDirection = Enum.ScrollingDirection.Y
    Scroll.CanvasSize = UDim2.new(0,0,0,0)
    Scroll.ZIndex = 1000
    Scroll.Active = true
    Scroll.ClipsDescendants = true

    local UIListLayout = Instance.new("UIListLayout", Scroll)
    UIListLayout.Padding = UDim.new(0,10)
    UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder

    local UIPadding = Instance.new("UIPadding", Scroll)
    UIPadding.PaddingLeft = UDim.new(0,2)
    UIPadding.PaddingRight = UDim.new(0,8)
    UIPadding.PaddingTop = UDim.new(0,2)
    UIPadding.PaddingBottom = UDim.new(0,10)

    local categoryButtons = {}
    local categorySections = {}
    local activeCategory = nil

    local function makeSection(key, titleText, descriptionText, order)
        local section = Instance.new("Frame", Scroll)
        section.Name = "Section_"..key
        section.Size = UDim2.new(1,0,0,0)
        section.AutomaticSize = Enum.AutomaticSize.Y
        section.BackgroundColor3 = Color3.fromRGB(27,27,31)
        section.BorderSizePixel = 0
        section.LayoutOrder = order
        section.ZIndex = 1000
        Instance.new("UICorner",section).CornerRadius = UDim.new(0,12)
        local stroke = Instance.new("UIStroke",section)
        stroke.Color = Color3.fromRGB(48,48,55)
        stroke.Thickness = 1
        local pad = Instance.new("UIPadding",section)
        pad.PaddingLeft = UDim.new(0,14)
        pad.PaddingRight = UDim.new(0,14)
        pad.PaddingTop = UDim.new(0,12)
        pad.PaddingBottom = UDim.new(0,8)
        local title = Instance.new("TextLabel",section)
        title.Size = UDim2.new(1,0,0,28)
        title.BackgroundTransparency = 1
        title.Text = titleText
        title.TextColor3 = Color3.fromRGB(245,245,245)
        title.Font = Enum.Font.GothamBold
        title.TextSize = 16
        title.TextXAlignment = Enum.TextXAlignment.Left
        title.ZIndex = 1001
        local desc = Instance.new("TextLabel",section)
        desc.Size = UDim2.new(1,0,0,22)
        desc.Position = UDim2.fromOffset(0,27)
        desc.BackgroundTransparency = 1
        desc.Text = descriptionText
        desc.TextColor3 = Color3.fromRGB(135,135,145)
        desc.Font = Enum.Font.Gotham
        desc.TextSize = 11
        desc.TextXAlignment = Enum.TextXAlignment.Left
        desc.ZIndex = 1001
        local controls = Instance.new("Frame",section)
        controls.Name = "Controls"
        controls.Size = UDim2.new(1,0,0,0)
        controls.Position = UDim2.fromOffset(0,57)
        controls.AutomaticSize = Enum.AutomaticSize.Y
        controls.BackgroundTransparency = 1
        controls.ZIndex = 1000
        local layout = Instance.new("UIListLayout",controls)
        layout.Padding = UDim.new(0,2)
        layout.SortOrder = Enum.SortOrder.LayoutOrder
        categorySections[key] = section
        return controls, section
    end

    local Sections = {}
    Sections.Lighting = makeSection("Lighting","Iluminación","Brillo, exposición y sombras",1)
    Sections.Time = makeSection("Time","Tiempo y niebla","Hora, ciclo automático y distancia visual",2)
    Sections.Environment = makeSection("Environment","Ambiente y reflejos","Entorno, escalas y reflectancia",3)
    Sections.Bloom = makeSection("Bloom","Bloom","Resplandor de las zonas luminosas",4)
    Sections.Color = makeSection("Color","Corrección de color","Contraste, saturación y brillo",5)
    Sections.Blur = makeSection("Blur","Desenfoque","Desenfoque general y profundidad de campo",6)
    Sections.Sun = makeSection("Sun","Rayos de sol","Intensidad y dispersión de los rayos",7)
    Sections.Interface = makeSection("Interface","Interfaz","Elementos de la interfaz de Roblox",8)

    local categoryData = {
        {"Lighting","Iluminación","Lighting"},
        {"Time","Tiempo","Clock"},
        {"Environment","Ambiente","Environment"},
        {"Bloom","Bloom","Bloom"},
        {"Color","Color","Color"},
        {"Blur","Desenfoque","Blur"},
        {"Sun","Rayos de sol","SunRays"},
        {"Interface","Interfaz","Window"},
    }

    -- Iconos vectoriales dibujados con Frames. No dependen de fuentes, emojis ni asset IDs.
    local function iconLine(parent, x, y, w, h, rotation)
        local line = Instance.new("Frame", parent)
        line.Size = UDim2.fromOffset(w, h)
        line.Position = UDim2.new(0.5, x, 0.5, y)
        line.AnchorPoint = Vector2.new(0.5, 0.5)
        line.BackgroundColor3 = Color3.fromRGB(178,180,190)
        line.BorderSizePixel = 0
        line.Rotation = rotation or 0
        line.ZIndex = 1004
        Instance.new("UICorner", line).CornerRadius = UDim.new(1,0)
        return line
    end

    local function drawIcon(parent, kind)
        local holder = Instance.new("Frame", parent)
        holder.Name = "VectorIcon"
        holder.Size = UDim2.fromOffset(24,24)
        holder.Position = UDim2.new(0,8,0.5,-12)
        holder.BackgroundTransparency = 1
        holder.BorderSizePixel = 0
        holder.ZIndex = 1003

        local strokeColor = Color3.fromRGB(178,180,190)
        local function circle(size, pos, thickness)
            local f = Instance.new("Frame", holder)
            f.Size = UDim2.fromOffset(size,size)
            f.Position = pos
            f.BackgroundTransparency = 1
            f.BorderSizePixel = 0
            f.ZIndex = 1004
            local st = Instance.new("UIStroke", f)
            st.Color = strokeColor
            st.Thickness = thickness or 1.5
            return f
        end
        if kind == "Lighting" then
            -- Bombilla/lámpara: icono exclusivo para Iluminación.
            local bulb = Instance.new("Frame", holder)
            bulb.Size = UDim2.fromOffset(10,10)
            bulb.Position = UDim2.fromOffset(7,5)
            bulb.BackgroundTransparency = 1
            bulb.BorderSizePixel = 0
            bulb.ZIndex = 1004
            local st = Instance.new("UIStroke", bulb)
            st.Color = strokeColor
            st.Thickness = 1.5
            Instance.new("UICorner", bulb).CornerRadius = UDim.new(1,0)
            iconLine(holder, 0, 5, 6, 1.5, 0)
            iconLine(holder, 0, 8, 5, 1.5, 0)
            iconLine(holder, 0, -8, 5, 1.3, 0)
            iconLine(holder, -7, -3, 4, 1.3, 45)
            iconLine(holder, 7, -3, 4, 1.3, -45)
        elseif kind == "SunRays" then
            -- Rayos de sol: abanico de haces diagonales, deliberadamente distinto.
            local center = Instance.new("Frame", holder)
            center.Size = UDim2.fromOffset(5,5)
            center.Position = UDim2.fromOffset(4,10)
            center.BackgroundColor3 = strokeColor
            center.BorderSizePixel = 0
            center.ZIndex = 1004
            Instance.new("UICorner", center).CornerRadius = UDim.new(1,0)
            iconLine(holder, 5, 5, 12, 1.6, -18)
            iconLine(holder, 6, 1, 11, 1.6, -35)
            iconLine(holder, 5, -3, 10, 1.6, -52)
            iconLine(holder, 3, -7, 8, 1.6, -68)
        elseif kind == "Clock" then
            circle(16, UDim2.fromOffset(4,4), 1.6)
            iconLine(holder, 0, -3, 7, 1.5, 90)
            iconLine(holder, 2.5, 1.5, 5, 1.5, 35)
        elseif kind == "Environment" then
            local a=Instance.new("Frame",holder); a.Size=UDim2.fromOffset(14,8); a.Position=UDim2.fromOffset(5,10); a.BackgroundTransparency=1; a.BorderSizePixel=0; a.ZIndex=1004
            local st=Instance.new("UIStroke",a); st.Color=strokeColor; st.Thickness=1.5
            iconLine(holder,0,-5,10,1.5,0); iconLine(holder,0,-2,7,1.5,0)
        elseif kind == "Bloom" then
            circle(8, UDim2.fromOffset(8,8), 1.5)
            for i=0,7 do
                local a=i*45; local rad=math.rad(a)
                local dot=Instance.new("Frame",holder); dot.Size=UDim2.fromOffset(4,4); dot.AnchorPoint=Vector2.new(.5,.5); dot.Position=UDim2.new(.5,math.cos(rad)*8,.5,math.sin(rad)*8); dot.BackgroundColor3=strokeColor; dot.BorderSizePixel=0; dot.ZIndex=1004; Instance.new("UICorner",dot).CornerRadius=UDim.new(1,0)
            end
        elseif kind == "Color" then
            local cols={{5,9},{9,5},{9,13}}
            for _,v in ipairs(cols) do
                local d=Instance.new("Frame",holder); d.Size=UDim2.fromOffset(9,9); d.Position=UDim2.fromOffset(v[1],v[2]); d.BackgroundTransparency=1; d.BorderSizePixel=0; d.ZIndex=1004; local st=Instance.new("UIStroke",d); st.Color=strokeColor; st.Thickness=1.3; Instance.new("UICorner",d).CornerRadius=UDim.new(1,0)
            end
        elseif kind == "Blur" then
            circle(13, UDim2.fromOffset(5,5), 1.4)
            local d=Instance.new("Frame",holder); d.Size=UDim2.fromOffset(5,5); d.Position=UDim2.fromOffset(9,9); d.BackgroundColor3=strokeColor; d.BackgroundTransparency=.25; d.BorderSizePixel=0; d.ZIndex=1004; Instance.new("UICorner",d).CornerRadius=UDim.new(1,0)
        elseif kind == "Window" then
            local w=Instance.new("Frame",holder); w.Size=UDim2.fromOffset(16,14); w.Position=UDim2.fromOffset(4,5); w.BackgroundTransparency=1; w.BorderSizePixel=0; w.ZIndex=1004; local st=Instance.new("UIStroke",w); st.Color=strokeColor; st.Thickness=1.5; Instance.new("UICorner",w).CornerRadius=UDim.new(0,3); iconLine(w,0,-3,12,1,0)
        end
        return holder
    end

    local CategoryList = Instance.new("Frame", Sidebar)
    CategoryList.Name = "CategoryList"
    CategoryList.Size = UDim2.new(1,0,1,-98)
    CategoryList.Position = UDim2.new(0,0,0,42)
    CategoryList.BackgroundTransparency = 1
    CategoryList.BorderSizePixel = 0
    CategoryList.ZIndex = 1001

    local sideLayout = Instance.new("UIListLayout",CategoryList)
    sideLayout.Padding = UDim.new(0,10)
    sideLayout.SortOrder = Enum.SortOrder.LayoutOrder
    sideLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
    local sidePad = Instance.new("UIPadding",CategoryList)
    sidePad.PaddingTop = UDim.new(0,2)
    sidePad.PaddingLeft = UDim.new(0,8)
    sidePad.PaddingRight = UDim.new(0,8)

    local function setCategoryActive(key)
        activeCategory = key
        for k,button in pairs(categoryButtons) do
            local selected = k == key
            button.BackgroundColor3 = selected and Color3.fromRGB(55,55,63) or Color3.fromRGB(29,29,34)
            button.TextColor3 = selected and Color3.fromRGB(245,245,250) or Color3.fromRGB(175,175,185)
            local label = button:FindFirstChild("Label")
            if label then label.TextColor3 = selected and Color3.fromRGB(245,245,250) or Color3.fromRGB(175,175,185) end
            local marker = button:FindFirstChild("Marker")
            if marker then marker.Visible = selected end
        end
    end

    local function scrollToCategory(key)
        local section = categorySections[key]
        if not section then return end
        task.defer(function()
            local y = math.max(0, section.AbsolutePosition.Y - Scroll.AbsolutePosition.Y + Scroll.CanvasPosition.Y - 2)
            local maxY = math.max(0, Scroll.CanvasSize.Y.Offset - Scroll.AbsoluteSize.Y)
            y = math.min(y, maxY)
            TweenService:Create(Scroll,TweenInfo.new(.32,Enum.EasingStyle.Quint,Enum.EasingDirection.Out),{CanvasPosition=Vector2.new(0,y)}):Play()
            setCategoryActive(key)
        end)
    end

    for index,data in ipairs(categoryData) do
        local key,name,icon = data[1],data[2],data[3]
        local button = Instance.new("TextButton",CategoryList)
        button.Name = "Category_"..key
        button.Size = UDim2.new(1,0,0,44)
        button.LayoutOrder = index
        button.BackgroundColor3 = Color3.fromRGB(29,29,34)
        button.BorderSizePixel = 0
        button.Text = ""
        button.TextColor3 = Color3.fromRGB(175,175,185)
        button.Font = Enum.Font.GothamMedium
        button.TextSize = 12
        button.TextXAlignment = Enum.TextXAlignment.Left
        button.AutoButtonColor = false
        button.ZIndex = 1002
        Instance.new("UICorner",button).CornerRadius = UDim.new(0,9)

        drawIcon(button, icon)

        local categoryLabel = Instance.new("TextLabel", button)
        categoryLabel.Name = "Label"
        categoryLabel.Size = UDim2.new(1,-48,1,0)
        categoryLabel.Position = UDim2.fromOffset(40,0)
        categoryLabel.BackgroundTransparency = 1
        categoryLabel.Text = name
        categoryLabel.TextColor3 = Color3.fromRGB(175,175,185)
        categoryLabel.Font = Enum.Font.GothamMedium
        categoryLabel.TextSize = 12
        categoryLabel.TextXAlignment = Enum.TextXAlignment.Left
        categoryLabel.TextTruncate = Enum.TextTruncate.AtEnd
        categoryLabel.ZIndex = 1004

        local marker = Instance.new("Frame",button)
        marker.Name = "Marker"
        marker.Size = UDim2.new(0,3,0,20)
        marker.Position = UDim2.new(0,0,.5,-10)
        marker.BackgroundColor3 = Color3.fromRGB(95,165,255)
        marker.BorderSizePixel = 0
        marker.Visible = false
        marker.ZIndex = 1003
        Instance.new("UICorner",marker).CornerRadius = UDim.new(1,0)
        categoryButtons[key] = button
        button.MouseEnter:Connect(function()
            if activeCategory ~= key then TweenService:Create(button,TweenInfo.new(.12),{BackgroundColor3=Color3.fromRGB(38,38,44)}):Play() end
        end)
        button.MouseLeave:Connect(function()
            if activeCategory ~= key then TweenService:Create(button,TweenInfo.new(.12),{BackgroundColor3=Color3.fromRGB(29,29,34)}):Play() end
        end)
        button.MouseButton1Click:Connect(function() scrollToCategory(key) end)
    end

    -- Pie del sidebar: reinicio separado de las categorías para que destaque
    local ResetSeparator = Instance.new("Frame", Sidebar)
    ResetSeparator.Size = UDim2.new(1,-20,0,1)
    ResetSeparator.Position = UDim2.new(0,10,1,-66)
    ResetSeparator.BackgroundColor3 = Color3.fromRGB(55,55,62)
    ResetSeparator.BackgroundTransparency = 0.25
    ResetSeparator.BorderSizePixel = 0
    ResetSeparator.ZIndex = 1002

    local ResetButton = Instance.new("TextButton", Sidebar)
    ResetButton.Name = "ResetButton"
    ResetButton.Size = UDim2.new(1,-20,0,42)
    ResetButton.Position = UDim2.new(0,10,1,-54)
    ResetButton.BackgroundColor3 = Color3.fromRGB(38,38,44)
    ResetButton.Text = "Reiniciar configuración"
    ResetButton.Font = Enum.Font.GothamMedium
    ResetButton.TextSize = 11
    ResetButton.TextColor3 = Color3.fromRGB(220,220,228)
    ResetButton.ZIndex = 1003
    ResetButton.AutoButtonColor = false
    Instance.new("UICorner",ResetButton).CornerRadius = UDim.new(0,10)
    local resetStroke = Instance.new("UIStroke",ResetButton)
    resetStroke.Color = Color3.fromRGB(70,70,78)
    resetStroke.Thickness = 1
    ResetButton.MouseEnter:Connect(function()
        TweenService:Create(ResetButton,TweenInfo.new(.12),{BackgroundColor3=Color3.fromRGB(46,46,52)}):Play()
        TweenService:Create(resetStroke,TweenInfo.new(.12),{Color=Color3.fromRGB(88,88,98)}):Play()
    end)
    ResetButton.MouseLeave:Connect(function()
        TweenService:Create(ResetButton,TweenInfo.new(.12),{BackgroundColor3=Color3.fromRGB(38,38,44)}):Play()
        TweenService:Create(resetStroke,TweenInfo.new(.12),{Color=Color3.fromRGB(70,70,78)}):Play()
    end)

    local CloseHint = Instance.new("TextLabel", Frame)
    CloseHint.Size = UDim2.new(0,170,0,20)
    CloseHint.Position = UDim2.new(1,-185,1,-24)
    CloseHint.BackgroundTransparency = 1
    CloseHint.Text = "Ctrl Derecho · abrir/cerrar"
    CloseHint.TextColor3 = Color3.fromRGB(115,115,125)
    CloseHint.Font = Enum.Font.Gotham
    CloseHint.TextSize = 10
    CloseHint.TextXAlignment = Enum.TextXAlignment.Right
    CloseHint.ZIndex = 1001

    -- Variables de arrastre del botón flotante
    local draggingFloatingButton = false
    local floatingButtonOffset = Vector2.new(0, 0)
    local clickStartTime = 0
    FloatingButton.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
            clickStartTime = tick()
            draggingFloatingButton = true
            local buttonPos = FloatingButton.AbsolutePosition
            local inputPos = input.Position
            floatingButtonOffset = Vector2.new(buttonPos.X-inputPos.X,buttonPos.Y-inputPos.Y)
        end
    end)
    local floatingDragConnection = nil
    FloatingButton.InputChanged:Connect(function(input)
        if (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) and draggingFloatingButton then
            if not floatingDragConnection then
                floatingDragConnection = RunService.RenderStepped:Connect(function()
                    if draggingFloatingButton and input.Position then
                        local cam = workspace.CurrentCamera
                        if not cam then return end
                        local vs = cam.ViewportSize
                        local newX = math.max(0,math.min(input.Position.X+floatingButtonOffset.X,vs.X-48))
                        local newY = math.max(0,math.min(input.Position.Y+floatingButtonOffset.Y,vs.Y-48))
                        FloatingButton.Position = UDim2.new(0,newX,0,newY)
                    end
                end)
            end
        end
    end)
    UserInputService.InputEnded:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
            if draggingFloatingButton then
                draggingFloatingButton=false
                if floatingDragConnection then floatingDragConnection:Disconnect(); floatingDragConnection=nil end
                if tick()-clickStartTime < .3 then
                    if toggleMenu then toggleMenu() end
                end
            end
        end
    end)

    local ScrollCapture = Instance.new("Frame", ScreenGui)
    ScrollCapture.Name = "ScrollCapture"
    ScrollCapture.Size = UDim2.new(1,0,1,0)
    ScrollCapture.BackgroundTransparency = 1
    ScrollCapture.BorderSizePixel = 0
    ScrollCapture.ZIndex = 501
    ScrollCapture.Visible = false
    ScrollCapture.Active = true
    local function updateScrollCaptureVisibility() ScrollCapture.Visible = Frame.Visible end
    Frame:GetPropertyChangedSignal("Visible"):Connect(updateScrollCaptureVisibility)
    local touchStartY, scrollStartCanvasPosition, lastTouchY, touchVelocity, scrollConnection = 0,0,0,0,nil
    ScrollCapture.InputBegan:Connect(function(input)
        if input.UserInputType==Enum.UserInputType.Touch and Frame.Visible then
            touchStartY=input.Position.Y; lastTouchY=input.Position.Y; scrollStartCanvasPosition=Scroll.CanvasPosition.Y; touchVelocity=0
            if scrollConnection then scrollConnection:Disconnect(); scrollConnection=nil end
        end
    end)
    ScrollCapture.InputChanged:Connect(function(input)
        if input.UserInputType==Enum.UserInputType.Touch and Frame.Visible then
            local currentY=input.Position.Y
            touchVelocity=lastTouchY-currentY
            local newY=scrollStartCanvasPosition+(touchStartY-currentY)
            newY=math.max(0,math.min(newY,math.max(0,Scroll.CanvasSize.Y.Offset-Scroll.AbsoluteSize.Y)))
            Scroll.CanvasPosition=Vector2.new(0,newY); lastTouchY=currentY
        end
    end)
    ScrollCapture.InputEnded:Connect(function(input)
        if input.UserInputType==Enum.UserInputType.Touch and Frame.Visible then
            local currentVelocity=touchVelocity
            if scrollConnection then scrollConnection:Disconnect() end
            scrollConnection=RunService.RenderStepped:Connect(function()
                if math.abs(currentVelocity)>.1 then
                    local newY=Scroll.CanvasPosition.Y+currentVelocity
                    newY=math.max(0,math.min(newY,math.max(0,Scroll.CanvasSize.Y.Offset-Scroll.AbsoluteSize.Y)))
                    Scroll.CanvasPosition=Vector2.new(0,newY); currentVelocity=currentVelocity*.92
                else
                    if scrollConnection then scrollConnection:Disconnect(); scrollConnection=nil end
                end
            end)
        end
    end)

local activeSlider = nil

    local function createToggleControl(name, defaultValue, parent, onToggle)

        local Container = Instance.new("Frame", parent)

        Container.Size = UDim2.new(1,0,0,60)

        Container.BackgroundTransparency = 1

        Container.ZIndex = 1000

        local Label = Instance.new("TextLabel", Container)

        Label.Size = UDim2.new(0.65,0,0,30)

        Label.Position = UDim2.new(0,10,0,0)

        Label.BackgroundTransparency = 1

        Label.Text = name

        Label.Font = Enum.Font.SourceSansBold

        Label.TextSize = 14

        Label.TextColor3 = Color3.new(1,1,1)

        Label.TextXAlignment = Enum.TextXAlignment.Left

        Label.TextYAlignment = Enum.TextYAlignment.Center

        Label.ZIndex = 1001

        local Button = Instance.new("TextButton", Container)

        Button.Size = UDim2.new(0.3, 0, 0, 30)

        Button.Position = UDim2.new(0.65, 10, 0, 0)

        Button.Font = Enum.Font.SourceSans

        Button.TextSize = 13

        Button.ZIndex = 1001

        local corner = Instance.new("UICorner", Button)

        corner.CornerRadius = UDim.new(0,6)

        local current = defaultValue

        local function setValueInternal(v, callToggle)

            current = v and true or false

            Button.Text = current and "Activo" or "Inactivo"

            Button.BackgroundColor3 = current and Color3.fromRGB(0,180,0) or Color3.fromRGB(180,40,40)

            if callToggle and onToggle then pcall(function() onToggle(current) end) end

        end

        setValueInternal(defaultValue, false)

        Button.MouseButton1Click:Connect(function() setValueInternal(not current, true) end)

        return { button = Button, label = Label, setValue = function(v) setValueInternal(v, true) end, setValueSilent = function(v) setValueInternal(v, false) end, getValue = function() return current end, container = Container }

    end

    local function createSliderControl(name, defaultValue, parent, minVal, maxVal, onChange, step)

        if minVal == nil then minVal = -100 end

        if maxVal == nil then maxVal = 100 end

        if minVal > maxVal then minVal, maxVal = maxVal, minVal end

        if step == nil then step = 0.01 end

        defaultValue = clamp(defaultValue, minVal, maxVal)

        local Container = Instance.new("Frame", parent)

        Container.Size = UDim2.new(1,0,0,70)

        Container.BackgroundTransparency = 1

        Container.ZIndex = 1000

        -- LABEL (Nombre) - Al lado izquierdo del slider

        local Label = Instance.new("TextLabel", Container)

        Label.Size = UDim2.new(0.5,0,0,20)

        Label.Position = UDim2.new(0,10,0,25)

        Label.BackgroundTransparency = 1

        Label.Font = Enum.Font.SourceSansBold

        Label.TextSize = 14

        Label.TextXAlignment = Enum.TextXAlignment.Left

        Label.TextColor3 = Color3.new(1,1,1)

        Label.ZIndex = 1001

        -- CUADRO DE TEXTO (Número) - Al lado derecho sobre el slider

        local ValueLabel = Instance.new("TextButton", Container)

        ValueLabel.Size = UDim2.new(0,65,0,28)

        ValueLabel.Position = UDim2.new(1, -80,0,18)

        ValueLabel.BackgroundColor3 = Color3.fromRGB(50,50,50)

        ValueLabel.BorderSizePixel = 0

        ValueLabel.Font = Enum.Font.SourceSans

        ValueLabel.TextSize = 16

        ValueLabel.TextXAlignment = Enum.TextXAlignment.Center

        ValueLabel.TextColor3 = Color3.fromRGB(200,200,200)

        ValueLabel.ZIndex = 1001

        ValueLabel.Text = formatValue(defaultValue)

        local ValueCorner = Instance.new("UICorner", ValueLabel)

        ValueCorner.CornerRadius = UDim.new(0, 6)

        local ValueStroke = Instance.new("UIStroke", ValueLabel)

        ValueStroke.Color = Color3.fromRGB(100,100,100)

        ValueStroke.Thickness = 1

        -- BOTÓN DE REINICIO INDIVIDUAL - Al lado izquierdo del cuadro de texto

        local ResetBtn = Instance.new("TextButton", Container)

        ResetBtn.Size = UDim2.new(0, 35, 0, 28)

        ResetBtn.Position = UDim2.new(1, -120, 0, 18)

        ResetBtn.BackgroundColor3 = Color3.fromRGB(0, 180, 0)

        ResetBtn.BorderSizePixel = 0

        ResetBtn.Font = Enum.Font.SourceSansBold

        ResetBtn.Text = "Ret"

        ResetBtn.TextSize = 12

        ResetBtn.TextColor3 = Color3.fromRGB(255, 255, 255)

        ResetBtn.ZIndex = 1001

        local ResetCorner = Instance.new("UICorner", ResetBtn)

        ResetCorner.CornerRadius = UDim.new(0, 6)

        local ResetStroke = Instance.new("UIStroke", ResetBtn)

        ResetStroke.Color = Color3.fromRGB(0, 120, 0)

        ResetStroke.Thickness = 1

        -- SLIDER TRACK

        local Track = Instance.new("Frame", Container)

        Track.Size = UDim2.new(1, -20, 0, 12)

        Track.Position = UDim2.new(0,10,0,50)

        Track.BackgroundColor3 = Color3.fromRGB(70,70,70)

        Track.ZIndex = 1000

        local TrackCorner = Instance.new("UICorner", Track)

        TrackCorner.CornerRadius = UDim.new(0,6)

        local TrackStroke = Instance.new("UIStroke", Track)

        TrackStroke.Color = Color3.fromRGB(45,45,45)

        TrackStroke.Thickness = 1

        local Fill = Instance.new("Frame", Track)

        Fill.Size = UDim2.new(0,0,1,0)

        Fill.Position = UDim2.new(0,0,0,0)

        Fill.BackgroundColor3 = Color3.fromRGB(50,160,255)

        Fill.ZIndex = 1001

        local FillCorner = Instance.new("UICorner", Fill)

        FillCorner.CornerRadius = UDim.new(0,6)

        local Knob = Instance.new("ImageButton", Track)

        Knob.Size = UDim2.new(0,20,0,20)

        Knob.Position = UDim2.new(0, -10, 0.5, -10)

        Knob.BackgroundTransparency = 1

        Knob.ZIndex = 1002

        local KnobFrame = Instance.new("Frame", Knob)

        KnobFrame.Size = UDim2.new(1,0,1,0)

        KnobFrame.BackgroundColor3 = Color3.fromRGB(240,240,240)

        local KnobCorner = Instance.new("UICorner", KnobFrame)

        KnobCorner.CornerRadius = UDim.new(0,10)

        local KnobStroke = Instance.new("UIStroke", KnobFrame)

        KnobStroke.Color = Color3.fromRGB(200,200,200)

        KnobStroke.Thickness = 1

        local origTrackStrokeColor = TrackStroke.Color

        local origTrackStrokeThickness = TrackStroke.Thickness

        local origKnobStrokeColor = KnobStroke.Color

        local origKnobStrokeThickness = KnobStroke.Thickness

        local dragging = false

        local dragInput = nil

        local mouseMoveConn = nil

        local targetRel = 0

        local visualRel = 0

        local animConn = nil

        local function setVisualPositions(rel)

            rel = clamp(rel, 0, 1)

            Fill.Size = UDim2.new(rel, 0, 1, 0)

            Knob.Position = UDim2.new(rel, -10, 0.5, -10)

        end

        local function startAnim()

            if animConn then return end

            animConn = RunService.RenderStepped:Connect(function(dt)

                local speed = 14

                visualRel = visualRel + (targetRel - visualRel) * math.min(1, speed * dt)

                setVisualPositions(visualRel)

            end)

        end

        local function stopAnim()

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

        end

        local function applyVisualsImmediate(value)

            if step and step > 0 then

                value = math.floor((value - minVal) / step + 0.5) * step + minVal

                value = clamp(value, minVal, maxVal)

            end

            local rel = 0

            if maxVal > minVal then rel = (value - minVal) / (maxVal - minVal) end

            targetRel = rel

            visualRel = rel

            setVisualPositions(rel)

            Label.Text = name

            ValueLabel.Text = formatValue(value)

            if onChange then pcall(function() onChange(value) end) end

        end

        local function applyVisuals(value)

            if step and step > 0 then

                value = math.floor((value - minVal) / step + 0.5) * step + minVal

                value = clamp(value, minVal, maxVal)

            end

            local rel = 0

            if maxVal > minVal then rel = (value - minVal) / (maxVal - minVal) end

            targetRel = rel

            Label.Text = name

            ValueLabel.Text = formatValue(value)

            if onChange then pcall(function() onChange(value) end) end

            startAnim()

        end

        local function setValueFromRelative(rel)

            rel = clamp(rel, 0, 1)

            local value = minVal + rel * (maxVal - minVal)

            applyVisuals(value)

        end

        local function updateFromInputPosition(x)

            local absX = Track.AbsolutePosition.X

            local width = Track.AbsoluteSize.X

            if width <= 0 then return end

            local rel = (x - absX) / width

            setValueFromRelative(rel)

        end

        local function stopMouseMoveConn()

            if mouseMoveConn then

                mouseMoveConn:Disconnect()

                mouseMoveConn = nil

            end

        end

        local function updateResetButtonColor()

            local currentValue = tonumber(ValueLabel.Text) or tonumber(inputTextBox.Text) or defaultValue

            if math.abs(currentValue - defaultValue) < 0.001 then

                -- En valor por defecto - Verde

                ResetBtn.BackgroundColor3 = Color3.fromRGB(0, 180, 0)

                ResetStroke.Color = Color3.fromRGB(0, 120, 0)

            else

                -- No está en valor por defecto - Rojo

                ResetBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 40)

                ResetStroke.Color = Color3.fromRGB(120, 20, 20)

            end

        end

        local function beginDrag(input)

            if activeSlider ~= nil and activeSlider ~= Container then return end

            activeSlider = Container

            dragging = true

            dragInput = input

            TrackStroke.Color = Color3.fromRGB(40,255,40)

            TrackStroke.Thickness = 2

            KnobStroke.Color = Color3.fromRGB(40,255,40)

            KnobStroke.Thickness = 2

            startAnim()

            if input.UserInputType == Enum.UserInputType.MouseButton1 then

                stopMouseMoveConn()

                mouseMoveConn = RunService.RenderStepped:Connect(function()

                    if not dragging then return end

                    local mouseLoc = UserInputService:GetMouseLocation()

                    updateFromInputPosition(mouseLoc.X)

                end)

            end

            input.Changed:Connect(function()

                if input.UserInputState == Enum.UserInputState.End then

                    dragging = false

                    dragInput = nil

                    stopMouseMoveConn()

                    visualRel = targetRel

                    setVisualPositions(visualRel)

                    stopAnim()

                    TrackStroke.Color = origTrackStrokeColor

                    TrackStroke.Thickness = origTrackStrokeThickness

                    KnobStroke.Color = origKnobStrokeColor

                    KnobStroke.Thickness = origKnobStrokeThickness

                    activeSlider = nil

                    updateResetButtonColor()

                end

            end)

        end

        Knob.InputBegan:Connect(function(input)

            if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then

                beginDrag(input)

            end

        end)

        Track.InputBegan:Connect(function(input)

            if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then

                if activeSlider == nil then

                    beginDrag(input)

                    if input.Position then

                        updateFromInputPosition(input.Position.X)

                    elseif input.UserInputType == Enum.UserInputType.MouseButton1 then

                        local mouseLoc = UserInputService:GetMouseLocation()

                        updateFromInputPosition(mouseLoc.X)

                    end

                end

            end

        end)

        UserInputService.InputChanged:Connect(function(input)

            if not dragging then return end

            if input.UserInputType == Enum.UserInputType.Touch then

                if dragInput and input == dragInput then

                    updateFromInputPosition(input.Position.X)

                end

            elseif input.UserInputType == Enum.UserInputType.MouseMovement then

                if dragInput and dragInput.UserInputType == Enum.UserInputType.MouseButton1 then

                    updateFromInputPosition(input.Position.X)

                end

            end

        end)

        UserInputService.InputEnded:Connect(function(input)

            if not dragging then return end

            if input == dragInput or input.UserInputType == Enum.UserInputType.MouseButton1 then

                dragging = false

                dragInput = nil

                stopMouseMoveConn()

                visualRel = targetRel

                setVisualPositions(visualRel)

                stopAnim()

                TrackStroke.Color = origTrackStrokeColor

                TrackStroke.Thickness = origTrackStrokeThickness

                KnobStroke.Color = origKnobStrokeColor

                KnobStroke.Thickness = origKnobStrokeThickness

                activeSlider = nil

                updateResetButtonColor()

            end

        end)

        -- INPUT MANUAL (Click en el número para editar)

        local editingInput = false

        local inputTextBox = Instance.new("TextBox", Container)

        inputTextBox.Size = UDim2.new(0, 65, 0, 28)

        inputTextBox.Position = UDim2.new(1, -80, 0, 18)

        inputTextBox.BackgroundColor3 = Color3.fromRGB(30,30,30)

        inputTextBox.BorderSizePixel = 0

        inputTextBox.Font = Enum.Font.SourceSans

        inputTextBox.TextSize = 16

        inputTextBox.TextXAlignment = Enum.TextXAlignment.Center

        inputTextBox.TextColor3 = Color3.fromRGB(255,200,0)

        inputTextBox.Visible = false

        inputTextBox.ZIndex = 1002

        inputTextBox.ClearTextOnFocus = false

        local inputCorner = Instance.new("UICorner", inputTextBox)

        inputCorner.CornerRadius = UDim.new(0, 6)

        local inputStroke = Instance.new("UIStroke", inputTextBox)

        inputStroke.Color = Color3.fromRGB(255,200,0)

        inputStroke.Thickness = 1.5

        ValueLabel.MouseButton1Click:Connect(function()

            if editingInput then return end

            editingInput = true

            ValueLabel.Visible = false

            inputTextBox.Visible = true

            inputTextBox.Text = ValueLabel.Text

            inputTextBox:CaptureFocus()

            inputTextBox.SelectionStart = 1

            inputTextBox.CursorPosition = #inputTextBox.Text + 1

        end)

        local function finishEditing()

            if not editingInput then return end

            editingInput = false

            inputTextBox.Visible = false

            ValueLabel.Visible = true

            local inputText = inputTextBox.Text:gsub(" ", "")

            local inputValue = tonumber(inputText)

            if inputValue then

                inputValue = clamp(inputValue, minVal, maxVal)

                applyVisualsImmediate(inputValue)

                updateResetButtonColor()

            end

        end

        inputTextBox.FocusLost:Connect(finishEditing)

        inputTextBox.InputBegan:Connect(function(input)

            if input.KeyCode == Enum.KeyCode.Return then

                finishEditing()

            elseif input.KeyCode == Enum.KeyCode.Escape then

                editingInput = false

                inputTextBox.Visible = false

                ValueLabel.Visible = true

            end

        end)

        -- Solo permitir números y punto

        inputTextBox.Changed:Connect(function(property)

            if property == "Text" and editingInput then

                local filtered = inputTextBox.Text:gsub("[^0-9.-]", "")

                if filtered ~= inputTextBox.Text then

                    inputTextBox.Text = filtered

                end

            end

        end)

        -- BOTÓN DE REINICIO: Vuelve al valor por defecto

        ResetBtn.MouseButton1Click:Connect(function()

            applyVisualsImmediate(defaultValue)

            updateResetButtonColor()

        end)

        RunService.Heartbeat:Wait()

        applyVisualsImmediate(defaultValue)

        updateResetButtonColor()

        return { setValue = function(v) applyVisualsImmediate(clamp(v, minVal, maxVal)) end, getValue = function() return tonumber(ValueLabel.Text) or tonumber(inputTextBox.Text) or defaultValue end, container = Container }

    end

    local controlRefs = {}

    -- CONTROLES PRINCIPALES

    controlRefs.Brightness = { ctrl = createSliderControl("Brillo Global", Lighting.Brightness or 0.8, Sections.Lighting, 0, 3, function(v) Lighting.Brightness = v end, 0.01), getter = function() return Lighting.Brightness end }

    controlRefs.Exposure = { ctrl = createSliderControl("Exposición", Lighting.ExposureCompensation or 0.5, Sections.Lighting, -10, 10, function(v) Lighting.ExposureCompensation = v end, 0.01), getter = function() return Lighting.ExposureCompensation end }

    controlRefs.ShadowSoftness = { ctrl = createSliderControl("Suavidad de Sombras", Lighting.ShadowSoftness or 1.2, Sections.Lighting, 0, 1, function(v) Lighting.ShadowSoftness = v end, 0.01), getter = function() return Lighting.ShadowSoftness end }

    -- CONTROL DE HORA MEJORADO

    local clockSlider = createSliderControl("Hora del Día", Lighting.ClockTime or 14, Sections.Time, 0, 24, function(v)

        if not autoClockRunning then

            Lighting.ClockTime = v

        end

    end, 0.01)

    controlRefs.ClockTime = { ctrl = clockSlider, getter = function() return Lighting.ClockTime end }

    -- HORA AUTOMÁTICA

    local autoClockBtn = createToggleControl("Hora Automática", false, Sections.Time, function(enabled)

        autoClockRunning = enabled

    end)

    controlRefs.AutoClock = { ctrl = autoClockBtn, getter = function() return autoClockBtn.getValue() end }

    -- VELOCIDAD DE HORA (En horas por segundo) - Rango de 0.01 a 5, predeterminado 0.2

    controlRefs.ClockSpeed = { ctrl = createSliderControl("Velocidad de Hora", 0.2, Sections.Time, 0.01, 5.0, function(v) autoClockSpeed = v end, 0.01), getter = function() return autoClockSpeed end }

    controlRefs.FogStart = { ctrl = createSliderControl("Inicio de Niebla", Lighting.FogStart or 10000, Sections.Time, 0, 4000, function(v) Lighting.FogStart = v end, 0.01), getter = function() return Lighting.FogStart end }

    controlRefs.FogEnd = { ctrl = createSliderControl("Final de Niebla", Lighting.FogEnd or 10000, Sections.Time, 0, 4000, function(v) Lighting.FogEnd = v end, 0.01), getter = function() return Lighting.FogEnd end }

    controlRefs.EnvironmentDiffuseScale = { ctrl = createSliderControl("Escala Difusa", Lighting.EnvironmentDiffuseScale or 0.6, Sections.Environment, 0, 1, function(v) Lighting.EnvironmentDiffuseScale = v end, 0.01), getter = function() return Lighting.EnvironmentDiffuseScale end }

    controlRefs.EnvironmentSpecularScale = { ctrl = createSliderControl("Escala Especular", Lighting.EnvironmentSpecularScale or 1.1, Sections.Environment, 0, 2, function(v) Lighting.EnvironmentSpecularScale = v end, 0.01), getter = function() return Lighting.EnvironmentSpecularScale end }

    controlRefs.Reflectance = { ctrl = createSliderControl("Reflejos de Partes", LightingConfig.Reflectance or 0.03, Sections.Environment, 0, 1, function(v)
        LightingConfig.Reflectance = v
        for _, part in ipairs(Workspace:GetDescendants()) do applyPartReflectance(part) end
    end, 0.01), getter = function() return LightingConfig.Reflectance or 0.03 end }

    -- INTERFAZ DEL JUEGO + INTERFAZ DE ROBLOX

    local function restoreGameInterface()
        if not gameInterfaceHidden then return end

        gameInterfaceHidden = false

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

        -- Restaurar SOLO el estado capturado al pulsar ocultar.
        for gui, state in pairs(hiddenGameGuiStates) do
            if gui and gui.Parent then
                pcall(function() gui.Enabled = state.Enabled end)
            end
        end

        hiddenGameGuiStates = {}
    end

    local function hideGameInterface()
        if gameInterfaceHidden then return end

        gameInterfaceHidden = true
        hiddenGameGuiStates = {}

        local playerGui = LOCAL_PLAYER:WaitForChild("PlayerGui")

        -- Captura el estado exacto en este momento.
        for _, gui in ipairs(playerGui:GetChildren()) do
            if gui:IsA("ScreenGui") and gui ~= ScreenGui then
                hiddenGameGuiStates[gui] = { Enabled = gui.Enabled }
                pcall(function() gui.Enabled = false end)
            end
        end

        -- Las interfaces nuevas que aparezcan mientras está oculto también
        -- permanecen ocultas y NO se agregan al snapshot de restauración.
        gameGuiAddedConnection = playerGui.ChildAdded:Connect(function(child)
            if not gameInterfaceHidden then return end
            if child:IsA("ScreenGui") and child ~= ScreenGui then
                task.defer(function()
                    if gameInterfaceHidden and child.Parent then
                        pcall(function() child.Enabled = false end)
                    end
                end)
            end
        end)
    end

    local function restoreRobloxInterface()
        if not robloxInterfaceHidden then return end

        robloxInterfaceHidden = false

        -- Restaurar exactamente el estado que tenía cada CoreGui antes de ocultar.
        for name, enabled in pairs(hiddenCoreGuiStates) do
            local coreType = Enum.CoreGuiType[name]
            if coreType then
                setCoreGuiEnabledSafe(coreType, enabled)
            end
        end

        hiddenCoreGuiStates = {}
    end

    local function hideRobloxInterface()
        if robloxInterfaceHidden then return end

        robloxInterfaceHidden = true
        hiddenCoreGuiStates = {}

        local coreTypes = {
            Enum.CoreGuiType.Chat,
            Enum.CoreGuiType.Backpack,
            Enum.CoreGuiType.PlayerList,
            Enum.CoreGuiType.Health
        }

        -- Capturamos el estado ACTUAL, no el que tenía al ejecutar el script.
        for _, coreType in ipairs(coreTypes) do
            local ok, enabled = pcall(function()
                return StarterGui:GetCoreGuiEnabled(coreType)
            end)

            hiddenCoreGuiStates[coreType.Name] =
                (ok and type(enabled) == "boolean") and enabled or true

            setCoreGuiEnabledSafe(coreType, false)
        end
    end

    local hideGameInterfaceBtn = createToggleControl("Ocultar interfaz del juego", false, Sections.Interface, function(v)
        if v then
            hideGameInterface()
        else
            restoreGameInterface()
        end
    end)

    controlRefs.HideGameInterface = {
        ctrl = hideGameInterfaceBtn,
        getter = function() return gameInterfaceHidden end
    }

    local hideRobloxInterfaceBtn = createToggleControl("Ocultar interfaz de Roblox", false, Sections.Interface, function(v)
        if v then
            hideRobloxInterface()
        else
            restoreRobloxInterface()
        end
    end)

    controlRefs.HideRobloxInterface = {
        ctrl = hideRobloxInterfaceBtn,
        getter = function() return robloxInterfaceHidden end
    }

    -- EFECTOS: BLOOM

    do

        local bloomInst = addOrUpdateEffect("BloomEffect", EffectsConfig.BloomEffect)

        if bloomInst then

            controlRefs.Bloom_Intensity = { ctrl = createSliderControl("Brillo Bloom", bloomInst.Intensity or 0.35, Sections.Bloom, 0, 5, function(v) pcall(function() bloomInst.Intensity = v end) end, 0.01), getter = function() return bloomInst.Intensity end }

            controlRefs.Bloom_Threshold = { ctrl = createSliderControl("Umbral Bloom", bloomInst.Threshold or 2.4, Sections.Bloom, 0, 5, function(v) pcall(function() bloomInst.Threshold = v end) end, 0.01), getter = function() return bloomInst.Threshold end }

            controlRefs.Bloom_Size = { ctrl = createSliderControl("Tamaño Bloom", bloomInst.Size or 22, Sections.Bloom, 0, 100, function(v) pcall(function() bloomInst.Size = v end) end, 0.01), getter = function() return bloomInst.Size end }

            controlRefs.Bloom_Enabled = { ctrl = createToggleControl("Efecto Bloom", bloomInst.Enabled, Sections.Bloom, function(v) pcall(function() bloomInst.Enabled = v end) end), getter = function() return bloomInst.Enabled end }

        end

    end

    -- EFECTOS: COLOR CORRECTION

    do

        local ccInst = addOrUpdateEffect("ColorCorrectionEffect", EffectsConfig.ColorCorrectionEffect)

        if ccInst then

            controlRefs.CC_Brightness = { ctrl = createSliderControl("Brillo Color", ccInst.Brightness or 0, Sections.Color, -1, 1, function(v) pcall(function() ccInst.Brightness = v end) end, 0.01), getter = function() return ccInst.Brightness end }

            controlRefs.CC_Contrast = { ctrl = createSliderControl("Contraste Color", ccInst.Contrast or 0.2, Sections.Color, -2, 2, function(v) pcall(function() ccInst.Contrast = v end) end, 0.01), getter = function() return ccInst.Contrast end }

            controlRefs.CC_Saturation = { ctrl = createSliderControl("Saturación Color", ccInst.Saturation or 0.25, Sections.Color, -2, 2, function(v) pcall(function() ccInst.Saturation = v end) end, 0.01), getter = function() return ccInst.Saturation end }

            controlRefs.CC_Enabled = { ctrl = createToggleControl("Corrección de Color", ccInst.Enabled, Sections.Color, function(v) pcall(function() ccInst.Enabled = v end) end), getter = function() return ccInst.Enabled end }

        end

    end

    -- EFECTOS: BLUR

    do

        local blurInst = addOrUpdateEffect("BlurEffect", EffectsConfig.BlurEffect)

        if blurInst then

            controlRefs.Blur_Size = { ctrl = createSliderControl("Intensidad Desenfoque", blurInst.Size or 0, Sections.Blur, 0, 50, function(v) pcall(function() blurInst.Size = v end) end, 0.01), getter = function() return blurInst.Size end }

            controlRefs.Blur_Enabled = { ctrl = createToggleControl("Efecto Desenfoque", blurInst.Enabled, Sections.Blur, function(v) pcall(function() blurInst.Enabled = v end) end), getter = function() return blurInst.Enabled end }

        end

    end

    -- EFECTOS: DOF (Solo PC)

    if not UserInputService.TouchEnabled then

        do

            local dofInst = addOrUpdateEffect("DepthOfFieldEffect", EffectsConfig.DepthOfFieldEffect)

            if dofInst then

                controlRefs.DOF_Radius = { ctrl = createSliderControl("Radio Enfoque", dofInst.InFocusRadius or 80, Sections.Blur, 0, 350, function(v) pcall(function() dofInst.InFocusRadius = v end) end, 0.01), getter = function() return dofInst.InFocusRadius end }

                controlRefs.DOF_NearIntensity = { ctrl = createSliderControl("Intensidad Cercano", dofInst.NearIntensity or 0.25, Sections.Blur, 0, 10, function(v) pcall(function() dofInst.NearIntensity = v end) end, 0.01), getter = function() return dofInst.NearIntensity end }

                controlRefs.DOF_FarIntensity = { ctrl = createSliderControl("Intensidad Lejano", dofInst.FarIntensity or 0.35, Sections.Blur, 0, 1, function(v) pcall(function() dofInst.FarIntensity = v end) end, 0.01), getter = function() return dofInst.FarIntensity end }

                controlRefs.DOF_FocusDistance = { ctrl = createSliderControl("Distancia Enfoque", dofInst.FocusDistance or 18, Sections.Blur, 0, 200, function(v) pcall(function() dofInst.FocusDistance = v end) end, 0.01), getter = function() return dofInst.FocusDistance end }

                controlRefs.DOF_Enabled = { ctrl = createToggleControl("Efecto DOF", dofInst.Enabled, Sections.Blur, function(v) pcall(function() dofInst.Enabled = v end) end), getter = function() return dofInst.Enabled end }

            end

        end

        do

            local sunInst = addOrUpdateEffect("SunRaysEffect", EffectsConfig.SunRaysEffect)

            if sunInst then

                controlRefs.Sun_Intensity = { ctrl = createSliderControl("Intensidad Rayos Sol", sunInst.Intensity or 0.4, Sections.Sun, 0, 5, function(v) pcall(function() sunInst.Intensity = v end) end, 0.01), getter = function() return sunInst.Intensity end }

                controlRefs.Sun_Spread = { ctrl = createSliderControl("Dispersión Rayos Sol", sunInst.Spread or 2.8, Sections.Sun, 0, 10, function(v) pcall(function() sunInst.Spread = v end) end, 0.01), getter = function() return sunInst.Spread end }

                controlRefs.Sun_Enabled = { ctrl = createToggleControl("Efecto Rayos Sol", sunInst.Enabled, Sections.Sun, function(v) pcall(function() sunInst.Enabled = v end) end), getter = function() return sunInst.Enabled end }

            end

        end

    end

    -- CANVAS SIZE + detección de sección visible
    local function updateCanvasSize()
        Scroll.CanvasSize = UDim2.new(0,0,0,UIListLayout.AbsoluteContentSize.Y+16)
    end
    UIListLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(updateCanvasSize)
    Scroll.ChildAdded:Connect(function() task.defer(updateCanvasSize) end)
    Scroll.ChildRemoved:Connect(function() task.defer(updateCanvasSize) end)
    Scroll:GetPropertyChangedSignal("CanvasPosition"):Connect(function()
        local viewportY = Scroll.AbsolutePosition.Y + 20
        local bestKey, bestDistance = activeCategory, math.huge
        for key,section in pairs(categorySections) do
            local d = math.abs(section.AbsolutePosition.Y - viewportY)
            if section.AbsolutePosition.Y <= viewportY + 80 and d < bestDistance then bestKey=key; bestDistance=d end
        end
        if bestKey then setCategoryActive(bestKey) end
    end)
    RunService.Heartbeat:Wait()
    updateCanvasSize()
    setCategoryActive("Lighting")

-- RESET BUTTON

    ResetButton.MouseButton1Click:Connect(function()

        autoClockRunning = false

        for property, value in pairs(LightingConfig) do

            pcall(function() Lighting[property] = value end)

        end

        for _, part in ipairs(Workspace:GetDescendants()) do
            applyPartReflectance(part)
        end

        for effectType, properties in pairs(EffectsConfig) do

            addOrUpdateEffect(effectType, properties)

        end

        -- Restaurar ambas clases de interfaz sin inventar estados nuevos.
        if gameInterfaceHidden then
            restoreGameInterface()
        end

        if robloxInterfaceHidden then
            restoreRobloxInterface()
        else
            -- Si no estaba temporalmente oculta, mantener la restauración
            -- original del script para el botón de reinicio.
            for name, val in pairs(originalCoreGuiStates) do
                local enumVal = Enum.CoreGuiType[name]
                if enumVal then setCoreGuiEnabledSafe(enumVal, val) end
            end
        end

        for k, ref in pairs(controlRefs) do

            if ref.ctrl and ref.ctrl.setValue then

                local ok, value = pcall(function() return ref.getter and ref.getter() end)

                if ok and value ~= nil then pcall(function() ref.ctrl.setValue(value) end) end

            elseif ref.ctrl and ref.ctrl.setValueSilent then

                local ok, value = pcall(function() return ref.getter and ref.getter() end)

                if ok and value ~= nil then pcall(function() ref.ctrl.setValueSilent(value) end) end

            end

        end

    end)

    return ScreenGui, Frame

end

local ScreenGui, Frame = createScreenGui()

toggleMenu = function()

    if Frame then

        if Frame.Visible then

            -- SALIDA (fluida)

            local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)

            local tween = TweenService:Create(Frame, tweenInfo, {

                Position = UDim2.new(0.5, -Frame.AbsoluteSize.X/2, 1, Frame.AbsoluteSize.Y),

                BackgroundTransparency = 1

            })

            tween:Play()

            tween.Completed:Connect(function()

                Frame.Visible = false

                ScreenGui.InputBlocker.Visible = false

            end)

        else

            -- ENTRADA (realmente animada)

            Frame.Visible = true

            ScreenGui.InputBlocker.Visible = true

            Frame.BackgroundTransparency = 1

            local cam = workspace.CurrentCamera

            if cam then

                local vs = cam.ViewportSize

                local w = math.min(760, math.max(100, vs.X - 40))

                local h = math.min(620, math.max(100, vs.Y - 40))

                Frame.Size = UDim2.new(0, w, 0, h)

                local xPos = (vs.X - w) / 2

                local yPos = (vs.Y - h) / 2 - 60

                -- posición final (centro)

                local finalPos = UDim2.new(0, xPos, 0, yPos)

                -- posición inicial (abajo, fuera de pantalla)

                Frame.Position = UDim2.new(0, xPos, 1, h)

                local tweenInfo = TweenInfo.new(0.6, Enum.EasingStyle.Back, Enum.EasingDirection.Out)

                local tween = TweenService:Create(Frame, tweenInfo, {

                    Position = finalPos,

                    BackgroundTransparency = 0

                })

                tween:Play()

            end

        end

    end

end

UserInputService.InputBegan:Connect(function(input, gameProcessed)

    if gameProcessed then return end

    if input.KeyCode == Enum.KeyCode.RightControl then toggleMenu() end

end)

task.delay(5, function()

    pcall(function()

        StarterGui:SetCore("SendNotification", {

            Title = "Menú de Iluminación",

            Text = "Presiona Ctrl Derecho para abrir/cerrar o usa el botón ⚙",

            Duration = 6

        })

    end)

end)

local function ensureUI()

    if not LOCAL_PLAYER.PlayerGui:FindFirstChild("LightingMenu") then

        ScreenGui, Frame = createScreenGui()

    end

end

LOCAL_PLAYER.CharacterAdded:Connect(function() RunService.RenderStepped:Wait(); ensureUI() end)

LOCAL_PLAYER.PlayerGui.ChildRemoved:Connect(function(child) if child.Name == "LightingMenu" then RunService.RenderStepped:Wait(); ensureUI() end end)

Features & Information

este script es para mejorar o cambiar algunos aspectos visuales en los juegos en pc se presiona la tecla ctrl derecha y en móviles el botón de menú

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts