What's new
Heapleak - Scripthub

Get the most out of HeapLeak by creating a free account! Once signed in, you’ll gain full access to restricted content, be able to share your own scripts, and participate in our member-only discussions.

fps counter made with chatgpt

Version / Update: v1.0.0
Download / Script Link
-- Script para exibir FPS sobre o personagem no Roblox Studio

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")

-- Criando o ScreenGui
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "FPSDisplay"
screenGui.Parent = player.PlayerGui

-- Criando o TextLabel
local fpsLabel = Instance.new("TextLabel")
fpsLabel.Size = UDim2.new(0, 100, 0, 50)
fpsLabel.Position = UDim2.new(0, 0, 0, 0)
fpsLabel.BackgroundTransparency = 1
fpsLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
fpsLabel.TextSize = 20
fpsLabel.Text = "FPS: 0"
fpsLabel.Parent = screenGui

-- Função para calcular FPS
local lastFrameTime = tick()
local frameCount = 0
local fps = 0

-- Atualiza o FPS a cada segundo
game:GetService("RunService").Heartbeat:Connect(function()
frameCount = frameCount + 1
local currentTime = tick()

if currentTime - lastFrameTime >= 1 then
fps = frameCount
fpsLabel.Text = "FPS: " .. tostring(fps)
frameCount = 0
lastFrameTime = currentTime
end
end)

-- Atualizar a posição do label para ficar sobre o personagem
game:GetService("RunService").Heartbeat:Connect(function()
if character and character:FindFirstChild("HumanoidRootPart") then
local screenPosition, onScreen = workspace.CurrentCamera:WorldToScreenPoint(humanoidRootPart.Position + Vector3.new(0, 3, 0))
if onScreen then
fpsLabel.Position = UDim2.new(0, screenPosition.X, 0, screenPosition.Y)
end
end
end)
[ View More ]
2cc52713-c9d5-4ffb-afac-89738c0a38e3.webp


if you are in "flex your fps" games the white small thing is your fps
 
Back
Top