
KeylessUniversal

-- Services
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local Workspace = game:GetService("Workspace")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
local Camera = Workspace.CurrentCamera or Workspace:WaitForChild("CurrentCamera")
-- Universal execution parent detection
local TargetParent = PlayerGui
if typeof(gethui) == "function" then
TargetParent = gethui()
elseif pcall(function() local _ = game:GetService("CoreGui").Name end) and not RunService:IsStudio() then
TargetParent = game:GetService("CoreGui")
end
-- Clean up older UI instances to prevent layering duplicates
if TargetParent:FindFirstChild("LiquidFOVZoomGui") then
TargetParent["LiquidFOVZoomGui"]:Destroy()
end
-- Create ScreenGui Container
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "LiquidFOVZoomGui"
ScreenGui.ResetOnSpawn = false
ScreenGui.Parent = TargetParent
-- Main Draggable Interface Window (Liquid Glass Design)
local MainFrame = Instance.new("Frame")
MainFrame.Name = "MainFrame"
MainFrame.Size = UDim2.new(0, 240, 0, 140)
MainFrame.Position = UDim2.new(0.5, -120, 0.4, -70)
MainFrame.BackgroundColor3 = Color3.fromRGB(20, 24, 35)
MainFrame.BackgroundTransparency = 0.35 -- Translucent glass effect
MainFrame.BorderSizePixel = 0
MainFrame.Active = true
MainFrame.Parent = ScreenGui
local MainCorner = Instance.new("UICorner")
MainCorner.CornerRadius = UDim.new(0, 14)
MainCorner.Parent = MainFrame
-- Glass Border Highlight
local MainStroke = Instance.new("UIStroke")
MainStroke.Thickness = 1.5
MainStroke.Color = Color3.fromRGB(255, 255, 255)
MainStroke.Transparency = 0.75 -- Subtle light reflection edge
MainStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
MainStroke.Parent = MainFrame
-- Liquid Sheen Gradient
local MainGradient = Instance.new("UIGradient")
MainGradient.Color = ColorSequence.new({
ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)),
ColorSequenceKeypoint.new(1, Color3.fromRGB(130, 140, 160))
})
MainGradient.Rotation = 45
MainGradient.Parent = MainFrame
-- Top Panel Header
local Title = Instance.new("TextLabel")
Title.Name = "Title"
Title.Size = UDim2.new(1, 0, 0, 35)
Title.BackgroundTransparency = 1
Title.Text = "GLASS FOV CONTROLLER"
Title.TextColor3 = Color3.fromRGB(240, 240, 255)
Title.TextSize = 11
Title.Font = Enum.Font.GothamBold
Title.TextTransparency = 0.3
Title.Parent = MainFrame
-- Zoom Inverted Display Indicator
local DisplayLabel = Instance.new("TextLabel")
DisplayLabel.Name = "DisplayLabel"
DisplayLabel.Size = UDim2.new(1, 0, 0, 40)
DisplayLabel.Position = UDim2.new(0, 0, 0, 30)
DisplayLabel.BackgroundTransparency = 1
DisplayLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
DisplayLabel.TextSize = 32
DisplayLabel.Font = Enum.Font.GothamBlack
DisplayLabel.Parent = MainFrame
-- Zoom Out Button (Minus)
local MinusBtn = Instance.new("TextButton")
MinusBtn.Name = "MinusBtn"
MinusBtn.Size = UDim2.new(0, 50, 0, 45)
MinusBtn.Position = UDim2.new(0.15, 0, 0, 75)
MinusBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
MinusBtn.BackgroundTransparency = 0.85
MinusBtn.Text = "-"
MinusBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
MinusBtn.TextSize = 28
MinusBtn.Font = Enum.Font.GothamBold
MinusBtn.AutoButtonColor = false
MinusBtn.Parent = MainFrame
local MinusCorner = Instance.new("UICorner")
MinusCorner.CornerRadius = UDim.new(0, 10)
MinusCorner.Parent = MinusBtn
local MinusStroke = Instance.new("UIStroke")
MinusStroke.Thickness = 1
MinusStroke.Color = Color3.fromRGB(255, 255, 255)
MinusStroke.Transparency = 0.8
MinusStroke.Parent = MinusBtn
-- Zoom In Button (Plus)
local PlusBtn = Instance.new("TextButton")
PlusBtn.Name = "PlusBtn"
PlusBtn.Size = UDim2.new(0, 50, 0, 45)
PlusBtn.Position = UDim2.new(0.65, 0, 0, 75)
PlusBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
PlusBtn.BackgroundTransparency = 0.85
PlusBtn.Text = "+"
PlusBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
PlusBtn.TextSize = 24
PlusBtn.Font = Enum.Font.GothamBold
PlusBtn.AutoButtonColor = false
PlusBtn.Parent = MainFrame
local PlusCorner = Instance.new("UICorner")
PlusCorner.CornerRadius = UDim.new(0, 10)
PlusCorner.Parent = PlusBtn
local PlusStroke = Instance.new("UIStroke")
PlusStroke.Thickness = 1
PlusStroke.Color = Color3.fromRGB(255, 255, 255)
PlusStroke.Transparency = 0.8
PlusStroke.Parent = PlusBtn
---------------------------------------------------------
-- FOV Modulating & Continuous Hold Logic
---------------------------------------------------------
local currentFOV = math.clamp(Camera.FieldOfView, 1, 100)
local holdingPlus = false
local holdingMinus = false
local function updateCameraZoom()
Camera.FieldOfView = currentFOV
-- Linear Inversion Formula: 1 FOV = 100x zoom, 100 FOV = 1x zoom
local calculatedZoom = 101 - currentFOV
DisplayLabel.Text = tostring(calculatedZoom) .. "x Zoom"
end
-- Force layout config step
updateCameraZoom()
-- Dynamic hold action processor loop
local function startZoomLoop(direction)
task.spawn(function()
while (direction == "in" and holdingPlus) or (direction == "out" and holdingMinus) do
if direction == "in" then
currentFOV = math.clamp(currentFOV - 1, 1, 100)
elseif direction == "out" then
currentFOV = math.clamp(currentFOV + 1, 1, 100)
end
updateCameraZoom()
task.wait(0.02) -- Smooth incremental loop delay
end
end)
end
-- Input Listeners for Plus Button
PlusBtn.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
holdingPlus = true
PlusBtn.BackgroundTransparency = 0.7
startZoomLoop("in")
end
end)
PlusBtn.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
holdingPlus = false
PlusBtn.BackgroundTransparency = 0.85
end
end)
-- Input Listeners for Minus Button
MinusBtn.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
holdingMinus = true
MinusBtn.BackgroundTransparency = 0.7
startZoomLoop("out")
end
end)
MinusBtn.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
holdingMinus = false
MinusBtn.BackgroundTransparency = 0.85
end
end)
-- Global safety release override to prevent locking loop if focus drops mid-click
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
holdingPlus = false
holdingMinus = false
PlusBtn.BackgroundTransparency = 0.85
MinusBtn.BackgroundTransparency = 0.85
end
end)
-- Locking Camera configuration layer safely across frame iterations
Camera:GetPropertyChangedSignal("FieldOfView"):Connect(function()
if Camera.FieldOfView ~= currentFOV then
Camera.FieldOfView = currentFOV
end
end)
---------------------------------------------------------
-- Universal Drag Engine
---------------------------------------------------------
local dragToggle = false
local dragStart, startPos
local function updatePosition(input)
local delta = input.Position - dragStart
MainFrame.Position = UDim2.new(
startPos.X.Scale,
startPos.X.Offset + delta.X,
startPos.Y.Scale,
startPos.Y.Offset + delta.Y
)
end
MainFrame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragToggle = true
dragStart = input.Position
startPos = MainFrame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragToggle = false
end
end)
end
end)
UserInputService.InputChanged:Connect(function(input)
if dragToggle and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
updatePosition(input)
end
end)No comments yet for this script.



