UserInputService.InputBegan:Connect(function(input)
if listening then
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.Escape or input.KeyCode == Enum.KeyCode.Backspace then
Config[bindKey] = Enum.KeyCode.Unknown
else
Config[bindKey] = input.KeyCode
end
elseif input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.MouseButton2 or input.UserInputType == Enum.UserInputType.MouseButton3 then
Config[bindKey] = input.UserInputType
end
bBtn.Text = formatBindName(Config[bindKey]); bBtn.TextColor3 = Color3.fromRGB(200, 200, 200)
listening = false
end
end)
return updateToggle
end
-- Переключатель опций (Моды, Цели и тд)
local function createOptionButton(parent, prefix, stateKey, optionsTable)
local btn = Instance.new("TextButton")
btn.Size = UDim2.new(1, 0, 0, 25)
btn.BackgroundColor3 = Color3.fromRGB(65, 65, 65); btn.BorderColor3 = Color3.fromRGB(0, 0, 0)
btn.Text = prefix .. ": " .. Config[stateKey]
btn.TextColor3 = Color3.fromRGB(255, 255, 0); btn.Font = Enum.Font.SourceSansBold; btn.TextSize = 13
btn.Parent = parent
local currentIndex = 1
for i, v in ipairs(optionsTable) do if v == Config[stateKey] then currentIndex = i break end end
btn.MouseButton1Click:Connect(function()
currentIndex = currentIndex + 1
if currentIndex > #optionsTable then currentIndex = 1 end
Config[stateKey] = optionsTable[currentIndex]
btn.Text = prefix .. ": " .. Config[stateKey]
end)
end
-- Слайдер (Ползунок)
local function createSlider(parent, text, min, max, stateKey, isInt, step)
step = step or 1
local frame = Instance.new("Frame")
frame.Size = UDim2.new(1, 0, 0, 35)
frame.BackgroundColor3 = Color3.fromRGB(45, 45, 45); frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
frame.Parent = parent
local label = Instance.new("TextLabel")
label.Size = UDim2.new(1, -10, 0, 15); label.Position = UDim2.new(0, 5, 0, 2)
label.BackgroundTransparency = 1; label.Text = text .. ": " .. tostring(Config[stateKey])
label.TextColor3 = Color3.fromRGB(255, 255, 255); label.TextXAlignment = Enum.TextXAlignment.Left
label.Font = Enum.Font.SourceSans; label.TextSize = 13; label.Parent = frame
local bg = Instance.new("Frame")
bg.Size = UDim2.new(1, -10, 0, 6); bg.Position = UDim2.new(0, 5, 0, 22)
bg.BackgroundColor3 = Color3.fromRGB(30, 30, 30); bg.BorderSizePixel = 0; bg.Parent = frame
local fill = Instance.new("Frame")
fill.Size = UDim2.new((Config[stateKey] - min) / (max - min), 0, 1, 0)
fill.BackgroundColor3 = Color3.fromRGB(0, 170, 255); fill.BorderSizePixel = 0; fill.Parent = bg
local btn = Instance.new("TextButton")
btn.Size = UDim2.new(1, 0, 1, 0); btn.BackgroundTransparency = 1; btn.Text = ""; btn.Parent = bg
local isDragging = false
local function updateSlider(input)
local pct = math.clamp((input.Position.X - bg.AbsolutePosition.X) / bg.AbsoluteSize.X, 0, 1)
fill.Size = UDim2.new(pct, 0, 1, 0)
local val = min + (max - min) * pct
val = math.floor((val / step) + 0.5) * step
val = math.clamp(val, min, max)
if isInt then val = math.floor(val) end
Config[stateKey] = val
label.Text = text .. ": " .. (isInt and tostring(val) or string.format("%.2f", val))
end
btn.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then isDragging = true; updateSlider(input) end
end)
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then isDragging = false end
end)
UserInputService.InputChanged:Connect(function(input)
if isDragging and input.UserInputType == Enum.UserInputType.MouseMovement then updateSlider(input) end
end)
end
-- ==========================================
-- СБОРКА МЕНЮ
-- ==========================================
Post #4
15