roblox antiafk script local TweenService = game:GetService("TweenService") local UserInputService = game:GetService("UserInputService") local Players = game:GetService("Players") local LocalPlayer = Players.LocalPlayer -- Create ScreenGui local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "CounterGui" ScreenGui.ResetOnSpawn = false ScreenGui.Parent = game:GetService("CoreGui") roblox antiafk script How to get it for free? roblox antiafk script local margin = 20 -- Function to create a styled frame like your Counter local function createStyledFrame(size, position, anchorPoint) local frame = Instance.new("Frame") frame.Size = size frame.Position = position frame.AnchorPoint = anchorPoint frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255) frame.BackgroundTransparency = 0.3 roblox antiafk script How to get it for free? roblox antiafk script frame.BorderSizePixel = 0 local gradient = Instance.new("UIGradient", frame) gradient.Color = ColorSequence.new{ ColorSequenceKeypoint.new(0, Color3.fromRGB(74, 74, 74)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0)) } local corner = Instance.new("UICorner", frame) corner.CornerRadius = UDim.new(1, 8) roblox antiafk script How to use it? roblox antiafk script local shadow = Instance.new("ImageLabel", frame) shadow.Name = "Shadow" shadow.BackgroundTransparency = 1 shadow.Position = UDim2.new(-0.32, 0, -0.92, 0) shadow.Size = UDim2.new(1.6, 0, 3.1, 0) shadow.ZIndex = -1 shadow.Image = "rbxassetid://9637602897" shadow.ImageColor3 = Color3.fromRGB(0,0,0) shadow.ImageTransparency = 0.7 roblox antiafk script PasteShr roblox antiafk script return frame end -- Positions for animation local onScreenPos = UDim2.new(1, -margin, 1, -margin) local offScreenPos = UDim2.new(1, 140, 1, -margin) -- Main Counter UI local Counter = createStyledFrame(UDim2.new(0, 140, 0, 52), offScreenPos, Vector2.new(1,1)) roblox antiafk script How to dowload it? roblox antiafk script Counter.Name = "Counter" Counter.Parent = ScreenGui Counter.Visible = true -- Timer TextLabel local TextLabel = Instance.new("TextLabel") TextLabel.Parent = Counter TextLabel.Size = UDim2.new(0, 63, 0, 23) TextLabel.Position = UDim2.new(0.065, 0, 0.26, 0) TextLabel.BackgroundTransparency = 1 roblox antiafk script PasteShr roblox antiafk script TextLabel.Text = "00:00:00" TextLabel.Font = Enum.Font.FredokaOne TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255) TextLabel.TextScaled = true TextLabel.TextWrapped = true TextLabel.BorderSizePixel = 0 -- Icon ImageLabel local ImageLabel = Instance.new("ImageLabel") ImageLabel.Parent = Counter roblox antiafk script How to get it? roblox antiafk script ImageLabel.Position = UDim2.new(0.59, 1, 0.10, 3) ImageLabel.Size = UDim2.new(0, 40, 0, 33) ImageLabel.BackgroundTransparency = 1 ImageLabel.Image = "rbxassetid://1083501283" -- your icon ImageLabel.BorderSizePixel = 0 -- Maintain aspect ratio for icon local UIAspectRatioConstraint = Instance.new("UIAspectRatioConstraint") UIAspectRatioConstraint.Parent = Counter UIAspectRatioConstraint.AspectRatio = 2.635 roblox antiafk script How to get it? roblox antiafk script -- Timer update logic spawn(function() local i = 0 while true do wait(1) i += 1 local h = math.floor(i / 3600) local m = math.floor((i % 3600) / 60) local s = i % 60 roblox antiafk script How to get it for free? roblox antiafk script TextLabel.Text = string.format("%02d:%02d:%02d", h, m, s) end end) -- Anti-AFK local vu = game:GetService("VirtualUser") LocalPlayer.Idled:Connect(function() vu:CaptureController() vu:ClickButton2(Vector2.new()) end) roblox antiafk script How to use it? roblox antiafk script -- Tween info for sliding local slideTweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out) -- Function to slide in/out Counter UI local function toggleCounter(visible) if visible then Counter.Visible = true local tween = TweenService:Create(Counter, slideTweenInfo, {Position = onScreenPos}) tween:Play() roblox antiafk script How to get it for free? roblox antiafk script else local tween = TweenService:Create(Counter, slideTweenInfo, {Position = offScreenPos}) tween:Play() tween.Completed:Connect(function() Counter.Visible = false end) end end -- Initially slide in on start roblox antiafk script PasteShr roblox antiafk script toggleCounter(true) -- Toggle UI on Right Ctrl UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.RightControl then toggleCounter(not Counter.Visible) end end) roblox antiafk script How to dowload it? roblox antiafk script roblox antiafk script