Universal Script 📌
1.9k Views
90 Executions
Key System

Roblox afk

Universal Script 📌
wxza3350
wxza3350First script
2 years ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Afk

Updates

  1. Script edited: Create script

View Raw
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local VirtualInputManager = game:GetService("VirtualInputManager")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")

-- GUI 設置
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = player:WaitForChild("PlayerGui")
screenGui.ResetOnSpawn = false

-- AFK 按鈕
local afkButton = Instance.new("TextButton")
afkButton.Parent = screenGui
afkButton.Size = UDim2.new(0.25, 0, 0.1, 0)
afkButton.Position = UDim2.new(0.4, 0, 0.8, 0)
afkButton.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
afkButton.Text = "AFK: OFF"
afkButton.TextScaled = true
afkButton.TextColor3 = Color3.fromRGB(255, 255, 255)

local uiCorner = Instance.new("UICorner")
uiCorner.CornerRadius = UDim.new(0.3, 0)
uiCorner.Parent = afkButton

local uiStroke = Instance.new("UIStroke")
uiStroke.Thickness = 3
uiStroke.Color = Color3.fromRGB(0, 0, 0)
uiStroke.Parent = afkButton

-- 拖動按鈕
local dragging, dragStart, startPos

afkButton.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        dragging = true
        dragStart = input.Position
        startPos = afkButton.Position
    end


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

More universal scripts

See all
Script hub
234
311
Bumped 9 minutes ago

Script hub

Blythe

Script hub
8.9k
55.1k
Bumped 58 minutes ago
Key System
Script hub
496
6.4k
Bumped 5 hours ago
Key System
Universal Script 📌
7.1k
104.7k
Bumped 6 hours ago
Script hub
503
2.1k
Bumped 7 hours ago
Key System
Universal Script 📌
204
172
Approved 10 hours ago
Universal Script 📌
306
2.5k
Approved 11 hours ago