local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local Lighting = game:GetService("Lighting")
local CoreGui = game:GetService("CoreGui")
local TweenService = game:GetService("TweenService")
local HttpService = game:GetService("HttpService")
local player = Players.LocalPlayer
local fileName = "VisualSettings_Config.json"
local IsDraggingSlider = false
local originalFog = {
End = Lighting.FogEnd,
Start = Lighting.FogStart,
Color = Lighting.FogColor
}
local defaultSettings = {
Contrast = 0,
Saturation = 0,
Brightness = 2,
EffectsEnabled = false,
NoFog = false,
FPSUnlocker = false
}
local settingsTable = {}
for k, v in pairs(defaultSettings) do settingsTable[k] = v end
pcall(function()
if CoreGui:FindFirstChild("VisualMenu") then
CoreGui.VisualMenu:Destroy()
end
end)
local cc = Instance.new("ColorCorrectionEffect")
cc.Enabled = false
cc.Parent = Lighting
local function saveSettings()
local success, content = pcall(function() return HttpService:JSONEncode(settingsTable) end)
if success then writefile(fileName, content) end
end
local function loadSettings()
if isfile(fileName) then
local content = readfile(fileName)
local success, decoded = pcall(function() return HttpService:JSONDecode(content) end)
if success then for k, v in pairs(decoded) do settingsTable[k] = v end end
end
end
loadSettings()
local gui = Instance.new("ScreenGui", CoreGui)
gui.Name = "VisualMenu"
gui.ResetOnSpawn = false
local frame = Instance.new("Frame", gui)
frame.Size = UDim2.new(0, 320, 0, 420)
frame.Position = UDim2.new(0.5, -160, 0.2, 0)
frame.BackgroundColor3 = Color3.fromRGB(20,20,20)
frame.BorderSizePixel = 0
frame.Active = true
Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 10)
local dragStart, startPos
frame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 and not IsDraggingSlider then
dragStart = input.Position
startPos = frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragStart = nil
end
end)
end
end)
UIS.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement and dragStart and not IsDraggingSlider then
local delta = input.Position - dragStart
frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
end)
local title = Instance.new("TextLabel", frame)
title.Size = UDim2.new(1, 0, 0, 45)
title.Text = "Visual Settings"
title.TextColor3 = Color3.new(1,1,1)
title.BackgroundTransparency = 1
title.Font = Enum.Font.GothamBold
title.TextSize = 18
local checkboxes, sliders = {}, {}
local function createCheckbox(parent, posY, labelText, settingKey, callback)
local checkButton = Instance.new("TextButton", parent)
checkButton.Position = UDim2.new(0.1, 0, 0, posY)
checkButton.Size = UDim2.new(0, 22, 0, 22)
checkButton.Text = ""
checkButton.BackgroundColor3 = Color3.fromRGB(40,40,40)
Instance.new("UICorner", checkButton).CornerRadius = UDim.new(0, 5)
local checkFill = Instance.new("Frame", checkButton)
checkFill.AnchorPoint = Vector2.new(0.5, 0.5)
checkFill.Position = UDim2.new(0.5, 0, 0.5, 0)
checkFill.BackgroundColor3 = Color3.fromRGB(120, 120, 255)
Instance.new("UICorner", checkFill).CornerRadius = UDim.new(0, 4)
local checkText = Instance.new("TextLabel", parent)
checkText.Position = UDim2.new(0.1, 35, 0, posY)
checkText.Size = UDim2.new(0.7, 0, 0, 22)
checkText.Text = labelText
checkText.TextColor3 = Color3.new(1,1,1)
checkText.BackgroundTransparency = 1
checkText.Font = Enum.Font.GothamMedium
checkText.TextSize = 14
checkText.TextXAlignment = Enum.TextXAlignment.Left
local function updateUI(state)
TweenService:Create(checkFill, TweenInfo.new(0.15), {
Size = state and UDim2.new(1, -6, 1, -6) or UDim2.new(0, 0, 0, 0)
}):Play()
end
checkboxes[settingKey] = updateUI
updateUI(settingsTable[settingKey])
callback(settingsTable[settingKey])
checkButton.MouseButton1Click:Connect(function()
settingsTable[settingKey] = not settingsTable[settingKey]
updateUI(settingsTable[settingKey])
callback(settingsTable[settingKey])
saveSettings()
end)
end
local function createSlider(name, posY, settingKey, minVal, maxVal, callback)
local label = Instance.new("TextLabel", frame)
label.Position = UDim2.new(0.1, 0, 0, posY - 15)
label.Size = UDim2.new(0.8, 0, 0, 20)
label.TextColor3 = Color3.new(0.8,0.8,0.8)
label.BackgroundTransparency = 1
label.Font = Enum.Font.Gotham
label.TextSize = 13
local bar = Instance.new("Frame", frame)
bar.Position = UDim2.new(0.1, 0, 0, posY + 5)
bar.Size = UDim2.new(0.8, 0, 0, 6)
bar.BackgroundColor3 = Color3.fromRGB(45,45,45)
Instance.new("UICorner", bar).CornerRadius = UDim.new(1,0)
local fill = Instance.new("Frame", bar)
fill.BackgroundColor3 = Color3.fromRGB(120,120,255)
Instance.new("UICorner", fill).CornerRadius = UDim.new(1,0)
local function updateVisuals(val)
local percent = (val - minVal) / (maxVal - minVal)
fill.Size = UDim2.new(math.clamp(percent, 0, 1), 0, 1, 0)
label.Text = name .. ": " .. string.format("%.2f", val)
end
sliders[settingKey] = updateVisuals
updateVisuals(settingsTable[settingKey])
local function updateFromInput(input)
local percent = math.clamp((input.Position.X - bar.AbsolutePosition.X) / bar.AbsoluteSize.X, 0, 1)
local value = minVal + (percent * (maxVal - minVal))
settingsTable[settingKey] = value
updateVisuals(value)
callback(value)
saveSettings()
end
bar.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
IsDraggingSlider = true
updateFromInput(input)
local moveCon, endCon
moveCon = UIS.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
updateFromInput(input)
end
end)
endCon = UIS.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
IsDraggingSlider = false
moveCon:Disconnect()
endCon:Disconnect()
end
end)
end
end)
end
createCheckbox(frame, 60, "Enable Visual", "EffectsEnabled", function(state)
cc.Enabled = state
Lighting.Brightness = state and settingsTable.Brightness or 2
end)
createCheckbox(frame, 90, "No Fog", "NoFog", function(state)
Lighting.FogEnd = state and 1e9 or originalFog.End
Lighting.FogStart = state and 0 or originalFog.Start
end)
createCheckbox(frame, 120, "FPS Unlocker", "FPSUnlocker", function(state)
if setfpscap then setfpscap(state and 999 or 60) end
end)
createSlider("Contrast", 170, "Contrast", -1, 1, function(v) cc.Contrast = v end)
createSlider("Saturation", 220, "Saturation", -1, 1, function(v) cc.Saturation = v end)
createSlider("Brightness", 270, "Brightness", 0, 5, function(v) if settingsTable.EffectsEnabled then Lighting.Brightness = v end end)
local resetBtn = Instance.new("TextButton", frame)
resetBtn.Size = UDim2.new(0.8, 0, 0, 35)
resetBtn.Position = UDim2.new(0.1, 0, 0, 340)
resetBtn.BackgroundColor3 = Color3.fromRGB(180, 50, 50)
resetBtn.Text = "Reset Defaults"
resetBtn.TextColor3 = Color3.new(1,1,1)
resetBtn.Font = Enum.Font.GothamBold
Instance.new("UICorner", resetBtn).CornerRadius = UDim.new(0, 6)
resetBtn.MouseButton1Click:Connect(function()
for k, v in pairs(defaultSettings) do
settingsTable[k] = v
if checkboxes[k] then checkboxes[k](v) end
if sliders[k] then sliders[k](v) end
end
cc.Enabled, Lighting.Brightness, Lighting.FogEnd = false, 2, originalFog.End
if setfpscap then setfpscap(60) end
saveSettings()
end)
UIS.InputBegan:Connect(function(input, gp)
if not gp and input.KeyCode == Enum.KeyCode.Home then frame.Visible = not frame.Visible end
end)
Comments
No comments yet
Be the first to share your thoughts!