Skip to content

Instantly share code, notes, and snippets.

@DuyNgao2306
Created May 1, 2026 16:48
Show Gist options
  • Select an option

  • Save DuyNgao2306/abc6979afba5ec68ca037bcbc85fed2e to your computer and use it in GitHub Desktop.

Select an option

Save DuyNgao2306/abc6979afba5ec68ca037bcbc85fed2e to your computer and use it in GitHub Desktop.
--// Services
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Stats = game:GetService("Stats")
local VirtualUser = game:GetService("VirtualUser")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
--// Anti AFK
player.Idled:Connect(function()
VirtualUser:CaptureController()
VirtualUser:ClickButton2(Vector2.new(0,0))
end)
--// GUI
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "PerformanceUI"
screenGui.ResetOnSpawn = false
screenGui.Parent = playerGui
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 220, 0, 60)
frame.Position = UDim2.new(0.5, -110, 0, 45)
frame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
frame.BackgroundTransparency = 0.2
frame.Parent = screenGui
-- Bo góc
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0, 12)
corner.Parent = frame
-- Viền nhẹ
local stroke = Instance.new("UIStroke")
stroke.Thickness = 1.5
stroke.Color = Color3.fromRGB(255,255,255)
stroke.Transparency = 0.7
stroke.Parent = frame
-- Text
local label = Instance.new("TextLabel")
label.Size = UDim2.new(1, 0, 1, 0)
label.BackgroundTransparency = 1
label.TextColor3 = Color3.fromRGB(255,255,255)
label.Font = Enum.Font.GothamBold
label.TextScaled = true
label.Parent = frame
--// FPS + Ping
local lastTime = tick()
RunService.RenderStepped:Connect(function()
local currentTime = tick()
local fps = math.floor(1 / (currentTime - lastTime))
lastTime = currentTime
-- Lấy ping
local ping = math.floor(Stats.Network.ServerStatsItem["Data Ping"]:GetValue())
-- Đổi màu theo FPS
local color = Color3.fromRGB(0,255,0) -- xanh
local status = "Smooth"
if fps < 30 then
color = Color3.fromRGB(255,0,0) -- đỏ
status = "Lag"
elseif fps < 50 then
color = Color3.fromRGB(255,255,0) -- vàng
status = "Normal"
end
label.TextColor3 = color
label.Text = "FPS: "..fps.." ("..status..")\nPing: "..ping.." ms\nBy: YourName"
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment