I'm wondering how I would even start to make a gui/menu to show fps or ping? What would I have to get to show the client's fps?
Making a GUI display FPS is relatively easy:
--Insert inside your TextLabel local Heartbeat = game:GetService("RunService").Heartbeat local tick = tick 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 Current = (tick() - Start >= 1 and #FrameUpdateTable) or (#FrameUpdateTable / (tick() - Start)) Current = Current - Current % 1 script.Parent.Text = "FPS: "..Current end Start = tick() Heartbeat:Connect(HeartbeatUpdate)
However since Ping is the latency between the server and the client, you'll need to use a Remote Function
on ReplicatedStorage
and use a Server-Side script in ServerScriptService
in order to interact with both the Client and the Server, so we'll use 2 scripts:
1.-
--TextLabel (LocalScript) local ServerReturn = game.ReplicatedStorage:WaitForChild("RemoteFunction") function GetLatency() local t = tick() ServerReturn:InvokeServer("ping") local latency = tick()-t return math.floor((latency / 2) * 1000) end while wait(1) do --add a wait so it doesn't crash the game script.Parent.Text = "Ping: "..GetLatency().."ms" end
2.-
--ServerScriptService (Script) game.ReplicatedStorage:WaitForChild("RemoteFunction").OnServerInvoke = function(player, oof) -- "oof" can be named however you want I think if oof == "ping" then return "received" end end
Hope it helps.