Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make an "all in one" framerate/stats GUI?

Asked by 3 years ago

To elaborate, a GUI that displays the players framerate, ping, server location, and the game version. I would like to make something very similar that's seen in something like Typical Colors 2, as seen here. I currently have a basic framerate counter, but I do not know how to make this all one script, with one TextLabel. This is my current GUI for displaying framerate-

local FpsLabel = script.Parent
local Heartbeat = game:GetService("RunService").Heartbeat

local LastIteration, Start
local FrameUpdateTable = { }

local function HeartbeatUpdate()
    LastIteration = tick()
    for Index = #FrameUpdateTable, 1, -1 do
        FrameUpdateTable[Index + 1] = (FrameUpdateTable[Index] >= LastIteration - 1) and FrameUpdateTable[Index] or nil
    end

    FrameUpdateTable[1] = LastIteration
    local CurrentFPS = (tick() - Start >= 1 and #FrameUpdateTable) or (#FrameUpdateTable / (tick() - Start))
    CurrentFPS = math.floor(CurrentFPS )
    FpsLabel.Text = "" .. CurrentFPS .. " FPS"
end

Start = tick()
Heartbeat:Connect(HeartbeatUpdate)

1 answer

Log in to vote
-1
Answered by 3 years ago

I am sure these people can help you, they are teaching and helping people with Roblox Lua for free. I personally love it, and it helped me with a lot of errors: https://discord.gg/MPnhU2aCSb

0
:0 User#37681 0 — 3y
Ad

Answer this question