Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Anti-AFK Script with GUI
- local function createGUI()
- -- Create a ScreenGui
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = game.Players.LocalPlayer.PlayerGui
- -- Create a frame for the GUI
- local frame = Instance.new("Frame")
- frame.Parent = screenGui
- frame.Size = UDim2.new(0, 300, 0, 100)
- frame.Position = UDim2.new(0.5, -150, 0.5, -50)
- frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- -- Create a label for the GUI
- local label = Instance.new("TextLabel")
- label.Parent = frame
- label.Size = UDim2.new(1, 0, 1, 0)
- label.BackgroundTransparency = 1
- label.Text = "Anti-AFK: Enabled"
- label.TextColor3 = Color3.fromRGB(255, 255, 255)
- label.TextScaled = true
- -- Create a toggle button
- local toggleButton = Instance.new("TextButton")
- toggleButton.Parent = frame
- toggleButton.Size = UDim2.new(0.8, 0, 0.2, 0)
- toggleButton.Position = UDim2.new(0.1, 0, 0.7, 0)
- toggleButton.Text = "Toggle AFK"
- toggleButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
- toggleButton.TextColor3 = Color3.fromRGB(0, 0, 0)
- -- Variable to track if Anti-AFK is enabled or disabled
- local isAntiAFKEnabled = true
- -- Toggle the Anti-AFK feature
- toggleButton.MouseButton1Click:Connect(function()
- isAntiAFKEnabled = not isAntiAFKEnabled
- if isAntiAFKEnabled then
- label.Text = "Anti-AFK: Enabled"
- toggleButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
- else
- label.Text = "Anti-AFK: Disabled"
- toggleButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- end
- end)
- -- Function to handle Anti-AFK behavior
- local function antiAFK()
- while isAntiAFKEnabled do
- -- Jump every 10 seconds
- game:GetService("Players").LocalPlayer.Character:WaitForChild("Humanoid").Jump = true
- wait(10) -- 10-second delay
- end
- end
- -- Start the Anti-AFK loop
- spawn(antiAFK)
- end
- -- Queue on teleport to load the script across all servers
- pcall(function()
- if queueonteleport then
- queueonteleport([[
- loadstring(game:HttpGet("https://pastebin.com/raw/62pxDit4"))()
- ]])
- end
- end)
- -- Create the GUI when the player joins
- createGUI()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement