
1.9k Views
70 Executions
Key System
Does it work?
No reports yetNo reports yet. Tried it? Be the first to say.
Also noticed:
Description
Afk
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
0Log in to join the conversation. Login
No comments yet. Be the first!








