Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local UserInputService = game:GetService("UserInputService")
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Name = "LagToggleGui"
- ScreenGui.ResetOnSpawn = false
- ScreenGui.Parent = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
- local ToggleButton = Instance.new("TextButton")
- ToggleButton.Size = UDim2.new(0, 160, 0, 60)
- ToggleButton.Position = UDim2.new(0.5, -80, 0.5, -30)
- ToggleButton.BackgroundColor3 = Color3.fromRGB(255, 50, 50)
- ToggleButton.Text = "🔴 Start Lag"
- ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- ToggleButton.Font = Enum.Font.SourceSansBold
- ToggleButton.TextSize = 22
- ToggleButton.Parent = ScreenGui
- local DragDot = Instance.new("Frame")
- DragDot.Size = UDim2.new(0, 30, 0, 30)
- DragDot.Position = UDim2.new(0, 5, 0.5, -15)
- DragDot.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- DragDot.BorderSizePixel = 0
- DragDot.AnchorPoint = Vector2.new(0, 0)
- DragDot.Parent = ToggleButton
- DragDot.Active = true
- local dragging, dragInput, dragStart, startPos
- DragDot.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = ToggleButton.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- DragDot.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 - dragStart
- ToggleButton.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- end)
- local function causeLag()
- for i = -1, 1200 do
- ReplicatedStorage:WaitForChild("Guide"):FireServer()
- end
- for i = -1, 1200 do
- ReplicatedStorage:WaitForChild("Guide"):FireServer()
- end
- end
- local isLagging = false
- ToggleButton.MouseButton1Click:Connect(function()
- if not isLagging then
- isLagging = true
- ToggleButton.Text = "🟢 Lagging..."
- ToggleButton.BackgroundColor3 = Color3.fromRGB(50, 200, 50)
- causeLag()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement