-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAntiAFK.lua
More file actions
1 lines (1 loc) · 3.15 KB
/
AntiAFK.lua
File metadata and controls
1 lines (1 loc) · 3.15 KB
1
local a=game:GetService("Players")local b=game:GetService("VirtualUser")local c=game:GetService("UserInputService")local d=a.LocalPlayer;if not d then repeat task.wait()d=a.LocalPlayer until d end;local e=d:FindFirstChild("PlayerGui")local f=Instance.new("ScreenGui")f.Name="ATG_AntiAFK"f.ResetOnSpawn=false;f.Parent=e or game.CoreGui;local g=Instance.new("Frame")g.Name="Main"g.Size=UDim2.new(0,320,0,130)g.Position=UDim2.new(0.35,0,0.38,0)g.AnchorPoint=Vector2.new(0.5,0.5)g.BackgroundColor3=Color3.fromRGB(45,45,45)g.BorderSizePixel=0;g.Visible=true;g.Parent=f;local h=Instance.new("UICorner")h.CornerRadius=UDim.new(0,10)h.Parent=g;local i=Instance.new("TextLabel")i.Name="Title"i.Parent=g;i.Size=UDim2.new(1,0,0,24)i.Position=UDim2.new(0,0,0,0)i.BackgroundColor3=Color3.fromRGB(35,35,35)i.BorderSizePixel=0;i.Font=Enum.Font.GothamBold;i.Text="ATG Anti-AFK"i.TextColor3=Color3.fromRGB(255,255,255)i.TextSize=16;i.TextScaled=true;local j=Instance.new("TextLabel")j.Parent=g;j.Size=UDim2.new(1,0,0,18)j.Position=UDim2.new(0,0,1,-20)j.BackgroundColor3=Color3.fromRGB(35,35,35)j.BorderSizePixel=0;j.Font=Enum.Font.Gotham;j.Text="Made by ATGFAIL"j.TextColor3=Color3.fromRGB(200,200,200)j.TextSize=14;j.TextScaled=true;local k=Instance.new("TextButton")k.Parent=g;k.Name="Activate"k.Size=UDim2.new(0.94,0,0,64)k.Position=UDim2.new(0.03,0,0.18,0)k.BackgroundColor3=Color3.fromRGB(50,50,50)k.BorderSizePixel=0;k.Font=Enum.Font.GothamBold;k.Text="Activate"k.TextSize=24;k.TextColor3=Color3.fromRGB(0,255,127)k.AutoButtonColor=false;local l=Instance.new("UICorner")l.CornerRadius=UDim.new(0,8)l.Parent=k;local m=nil;local n=false;local o=false;local p={}local function q(r)if r then table.insert(p,r)end end;local function s()if n then return end;n=true;if m and m.Connected then m:Disconnect()end;if d then m=d.Idled:Connect(function()pcall(function()b:Button2Down(Vector2.new(0,0),workspace.CurrentCamera and workspace.CurrentCamera.CFrame or CFrame.new())task.wait(1)b:Button2Up(Vector2.new(0,0),workspace.CurrentCamera and workspace.CurrentCamera.CFrame or CFrame.new())end)end)q(m)end;k.Text="Deactivate"k.TextColor3=Color3.fromRGB(255,100,100)k.BackgroundColor3=Color3.fromRGB(70,30,30)end;local function t()if not n then return end;n=false;if m and m.Connected then m:Disconnect()end;m=nil;k.Text="Activate"k.TextColor3=Color3.fromRGB(0,255,127)k.BackgroundColor3=Color3.fromRGB(50,50,50)end;local u=k.MouseButton1Click:Connect(function()if o then return end;o=true;task.spawn(function()task.wait(0.12)o=false end)if n then t()else s()end end)q(u)do local v=false;local w=Vector2.new(0,0)local x=g.Position;i.InputBegan:Connect(function(y)if y.UserInputType==Enum.UserInputType.MouseButton1 then v=true;w=y.Position;x=g.Position end end)c.InputChanged:Connect(function(y)if v and y.UserInputType==Enum.UserInputType.MouseMovement then local z=y.Position-w;g.Position=UDim2.new(x.X.Scale,x.X.Offset+z.X,x.Y.Scale,x.Y.Offset+z.Y)end end)i.InputEnded:Connect(function(y)if y.UserInputType==Enum.UserInputType.MouseButton1 then v=false end end)end;local function A()for B,r in ipairs(p)do if r and r.Connected then r:Disconnect()end end;p={}if f and f.Parent then f:Destroy()end end;if syn and syn.on_close then syn.on_close(A)end