Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game:GetService("Players").LocalPlayer
- local UIS = game:GetService("UserInputService")
- local CoreGui = game:GetService("CoreGui")
- local TweenService = game:GetService("TweenService")
- -- Настройки
- local spamDelay = 0.5 -- Задержка между нажатиями (в секундах)
- local buttonSize = UDim2.new(0, 120, 0, 50) -- Размер кнопки
- local buttonColor = Color3.fromRGB(52, 152, 219) -- Цвет кнопки
- local buttonTransparency = 0.3 -- Прозрачность кнопки
- -- Создаем GUI
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "ESpamGUI"
- screenGui.Parent = CoreGui
- local frame = Instance.new("Frame")
- frame.Size = buttonSize
- frame.Position = UDim2.new(0.5, -60, 0.7, 0) -- Центр внизу экрана
- frame.AnchorPoint = Vector2.new(0.5, 0.5)
- frame.BackgroundColor3 = buttonColor
- frame.BackgroundTransparency = buttonTransparency
- frame.BorderSizePixel = 0
- frame.Parent = screenGui
- local textButton = Instance.new("TextButton")
- textButton.Size = UDim2.new(1, 0, 1, 0)
- textButton.Text = "Спам E: ВЫКЛ"
- textButton.TextColor3 = Color3.new(1, 1, 1)
- textButton.BackgroundTransparency = 1
- textButton.Font = Enum.Font.SourceSansBold
- textButton.TextSize = 16
- textButton.Parent = frame
- -- Система перетаскивания
- local dragging, dragInput, dragStart, startPos
- textButton.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- dragStart = input.Position
- startPos = frame.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- textButton.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement then
- dragInput = input
- end
- end)
- UIS.InputChanged:Connect(function(input)
- if input == dragInput and dragging 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)
- -- Анимации
- textButton.MouseEnter:Connect(function()
- TweenService:Create(frame, TweenInfo.new(0.2), {
- BackgroundTransparency = 0.1
- }):Play()
- end)
- textButton.MouseLeave:Connect(function()
- TweenService:Create(frame, TweenInfo.new(0.2), {
- BackgroundTransparency = buttonTransparency
- }):Play()
- end)
- -- Логика спама
- local isSpamming = false
- local virtualInputManager = game:GetService("VirtualInputManager")
- local function pressE()
- -- Нажимаем E
- virtualInputManager:SendKeyEvent(true, "E", false, nil)
- task.wait(0.05)
- -- Отпускаем E
- virtualInputManager:SendKeyEvent(false, "E", false, nil)
- end
- local function toggleSpam()
- isSpamming = not isSpamming
- if isSpamming then
- textButton.Text = "Спам E: ВКЛ"
- frame.BackgroundColor3 = Color3.fromRGB(46, 204, 113)
- -- Запускаем спам в отдельном потоке
- coroutine.wrap(function()
- while isSpamming and task.wait(spamDelay) do
- pressE()
- end
- end)()
- else
- textButton.Text = "Спам E: ВЫКЛ"
- frame.BackgroundColor3 = buttonColor
- end
- end
- -- Управление
- textButton.MouseButton1Click:Connect(toggleSpam)
- textButton.MouseButton2Click:Connect(function()
- screenGui:Destroy()
- end)
- print("Интерфейс создан! ЛКМ - вкл/выкл спам E, ПКМ - закрыть")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement