-- Очистка старого меню при перезапуске
local CoreGui = game:GetService("CoreGui")
if CoreGui:FindFirstChild("NumberRollHub") then
CoreGui.NumberRollHub:Destroy()
end
print("[Hub] Запуск скрипта...")
-- Создание главного окна (ScreenGui)
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "NumberRollHub"
ScreenGui.Parent = CoreGui
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
local MainFrame = Instance.new("Frame")
MainFrame.Parent = ScreenGui
MainFrame.BackgroundColor3 = Color3.fromRGB(16, 16, 22)
MainFrame.BorderSizePixel = 0
MainFrame.Position = UDim2.new(0.5, -140, 0.5, -115)
MainFrame.Size = UDim2.new(0, 280, 0, 210)
local MainCorner = Instance.new("UICorner")
MainCorner.CornerRadius = UDim.new(0, 14)
MainCorner.Parent = MainFrame
-- Неоновая обводка
local MainStroke = Instance.new("UIStroke")
MainStroke.Color = Color3.fromRGB(110, 80, 255)
MainStroke.Transparency = 0.4
MainStroke.Thickness = 1.5
MainStroke.Parent = MainFrame
-- Шапка окна (Область для перетаскивания)
local TopBar = Instance.new("Frame")
TopBar.Parent = MainFrame
TopBar.BackgroundColor3 = Color3.fromRGB(22, 22, 30)
TopBar.BorderSizePixel = 0
TopBar.Size = UDim2.new(1, 0, 0, 42)
local TopCorner = Instance.new("UICorner")
TopCorner.CornerRadius = UDim.new(0, 14)
TopCorner.Parent = TopBar
local TopFix = Instance.new("Frame")
TopFix.Parent = TopBar
TopFix.BackgroundColor3 = Color3.fromRGB(22, 22, 30)
TopFix.BorderSizePixel = 0
TopFix.Position = UDim2.new(0, 0, 0.5, 0)
TopFix.Size = UDim2.new(1, 0, 0.5, 0)
-- Название
local Title = Instance.new("TextLabel")
Title.Parent = TopBar
Title.BackgroundTransparency = 1
Title.Position = UDim2.new(0, 16, 0, 0)
Title.Size = UDim2.new(1, -50, 1, 0)
Title.Font = Enum.Font.GothamBold
Title.Text = "💎 NUMBER HUB"
Title.TextColor3 = Color3.fromRGB(255, 255, 255)
Title.TextSize = 14
Title.TextXAlignment = Enum.TextXAlignment.Left
-- Кнопка закрытия
local CloseButton = Instance.new("TextButton")
CloseButton.Parent = TopBar
CloseButton.BackgroundTransparency = 1
CloseButton.Position = UDim2.new(1, -36, 0, 6)
CloseButton.Size = UDim2.new(0, 30, 0, 30)
CloseButton.Font = Enum.Font.GothamBold
CloseButton.Text = "✕"
CloseButton.TextColor3 = Color3.fromRGB(150, 150, 170)
CloseButton.TextSize = 13
CloseButton.MouseButton1Click:Connect(function()
getgenv().AutoRoll = false
getgenv().AntiAFK = false
ScreenGui:Destroy()
end)
-- ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ
getgenv().AutoRoll = false
getgenv().AntiAFK = false
local RollDelay = 0.5
-- ЛОГИКА ANTI-AFK
local VirtualUser = game:GetService("VirtualUser")
local afkConnection
local function toggleAntiAFK(state)
if state then
if not afkConnection then
afkConnection = game:GetService("Players").LocalPlayer.Idled:Connect(function()
if getgenv().AntiAFK then
VirtualUser:CaptureController()
VirtualUser:ClickButton2(Vector2.new(0, 0))
print("[Hub] Anti-AFK сработал!")
end
end)
end
else
if afkConnection then
afkConnection:Disconnect()
afkConnection = nil
end
end
end
-- Вспомогательная функция поиска Roll
local function getRollRemote()
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remotes = ReplicatedStorage:FindFirstChild("Remotes")
if remotes then
return remotes:FindFirstChild("Roll")
end
return ReplicatedStorage:FindFirstChild("Roll")
end
-- 1. КНОПКА АВТО-КРУТКИ
local RollBtn = Instance.new("TextButton")
RollBtn.Parent = MainFrame
RollBtn.BackgroundColor3 = Color3.fromRGB(26, 26, 36)
RollBtn.Position = UDim2.new(0, 14, 0, 54)
RollBtn.Size = UDim2.new(1, -28, 0, 44)
RollBtn.Font = Enum.Font.GothamBold
RollBtn.Text = "⚡ Авто-крутка: ВЫКЛ"
RollBtn.TextColor3 = Color3.fromRGB(180, 180, 200)
RollBtn.TextSize = 13
local RollCorner = Instance.new("UICorner")
RollCorner.CornerRadius = UDim.new(0, 10)
RollCorner.Parent = RollBtn
local RollStroke = Instance.new("UIStroke")
RollStroke.Color = Color3.fromRGB(50, 50, 70)
RollStroke.Thickness = 1
RollStroke.Parent = RollBtn
RollBtn.MouseButton1Click:Connect(function()
getgenv().AutoRoll = not getgenv().AutoRoll
if getgenv().AutoRoll then
RollBtn.Text = "⚡ Авто-крутка: ВКЛ"
RollBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
RollBtn.BackgroundColor3 = Color3.fromRGB(40, 180, 95)
RollStroke.Color = Color3.fromRGB(70, 220, 120)
task.spawn(function()
while getgenv().AutoRoll do
local rollRemote = getRollRemote()
if rollRemote then
pcall(function()
rollRemote:InvokeServer()
end)
end
task.wait(RollDelay)
end
end)
else
RollBtn.Text = "⚡ Авто-крутка: ВЫКЛ"
RollBtn.TextColor3 = Color3.fromRGB(180, 180, 200)
RollBtn.BackgroundColor3 = Color3.fromRGB(26, 26, 36)
RollStroke.Color = Color3.fromRGB(50, 50, 70)
end
end)
-- 2. КНОПКА ANTI-AFK
local AfkBtn = Instance.new("TextButton")
AfkBtn.Parent = MainFrame
AfkBtn.BackgroundColor3 = Color3.fromRGB(26, 26, 36)
AfkBtn.Position = UDim2.new(0, 14, 0, 106)
AfkBtn.Size = UDim2.new(1, -28, 0, 44)
AfkBtn.Font = Enum.Font.GothamBold
AfkBtn.Text = "🛡️ Anti-AFK: ВЫКЛ"
AfkBtn.TextColor3 = Color3.fromRGB(180, 180, 200)
AfkBtn.TextSize = 13
local AfkCorner = Instance.new("UICorner")
AfkCorner.CornerRadius = UDim.new(0, 10)
AfkCorner.Parent = AfkBtn
local AfkStroke = Instance.new("UIStroke")
AfkStroke.Color = Color3.fromRGB(50, 50, 70)
AfkStroke.Thickness = 1
AfkStroke.Parent = AfkBtn
AfkBtn.MouseButton1Click:Connect(function()
getgenv().AntiAFK = not getgenv().AntiAFK
toggleAntiAFK(getgenv().AntiAFK)
if getgenv().AntiAFK then
AfkBtn.Text = "🛡️ Anti-AFK: ВКЛ"
AfkBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
AfkBtn.BackgroundColor3 = Color3.fromRGB(110, 80, 255) -- Фиолетовый
AfkStroke.Color = Color3.fromRGB(150, 120, 255)
else
AfkBtn.Text = "🛡️ Anti-AFK: ВЫКЛ"
AfkBtn.TextColor3 = Color3.fromRGB(180, 180, 200)
AfkBtn.BackgroundColor3 = Color3.fromRGB(26, 26, 36)
AfkStroke.Color = Color3.fromRGB(50, 50, 70)
end
end)
-- Подпись снизу
local Footer = Instance.new("TextLabel")
Footer.Parent = MainFrame
Footer.BackgroundTransparency = 1
Footer.Position = UDim2.new(0, 14, 1, -26)
Footer.Size = UDim2.new(1, -28, 0, 20)
Footer.Font = Enum.Font.GothamMedium
Footer.Text = "Status: Active • Rscripts Edition"
Footer.TextColor3 = Color3.fromRGB(90, 90, 110)
Footer.TextSize = 10
Footer.TextXAlignment = Enum.TextXAlignment.Center
-- Система перетаскивания (Drag & Drop)
local UserInputService = game:GetService("UserInputService")
local dragging = false
local dragInput, mousePos, framePos
TopBar.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
mousePos = input.Position
framePos = MainFrame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
TopBar.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
UserInputService.InputChanged:Connect(function(input)
if input == dragInput and dragging then
local delta = input.Position - mousePos
MainFrame.Position = UDim2.new(
framePos.X.Scale,
framePos.X.Offset + delta.X,
framePos.Y.Scale,
framePos.Y.Offset + delta.Y
)
end
end)
print("[Hub] Меню с управляемым Anti-AFK создано!")