Get client FPS trough a script

Yeah I forgot 1/fps excuse me for that :slight_smile:

1 Like

It’s fine. It’s just less accurate than my method. It’s faster though, that’s for sure.

3 Likes

quite literally the opposite,i was making an antiexploit/ antisave.

Why would you necro the tread after TWO YEARS?

5 Likes

Before the second screenshot, you wrote “new VM”
What does “VM” mean??

I believe it means virtual machine, correct me if I am wrong though.

5 Likes

has been a while since this was written but can somone tell me how i would like take the number of FPS and lets say the player has less than 15 fps they get kicked out of the game (ik how to do the kicking part)

This isn’t a good idea. Often, when the game loads, the fps is very low as it starts rendering new things, loading in assets, and all that. Also, kicking someone for low FPS is not a good idea, since it literally reduces how many players you have.

If you REALLY need to though…

local LocalPlayer = game:GetService("Players").LocalPlayer
local RunService = game:GetService("RunService")
local FpsLabel = script.Parent
local TimeFunction = RunService:IsRunning() and time or os.clock

local LastIteration, Start
local FrameUpdateTable = {}

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

	FrameUpdateTable[1] = LastIteration
	local FPS = (math.floor(TimeFunction() - Start >= 1 and #FrameUpdateTable or #FrameUpdateTable / (TimeFunction() - Start)))
	FpsLabel.Text = tostring(FPS) .. " FPS"
	if FPS < 15 then
		LocalPlayer:Kick("Too low FPS!")
	end
end

Start = TimeFunction()
RunService.Heartbeat:Connect(HeartbeatUpdate)
1 Like

oh no no no thats not my intention you see Im building a small project and I want to use this as a fail safe so it doesnt mess up someones device that type of stuff it sounds kind of stupid

Ah, okay. But still keep in mind what I mentioned, loading in can reduce the FPS to below 15.

Also, please don’t necropost.

Im sorry but i dont really knoww what necroposting is haha im kinda new to this also the FPS thing wont be used in loading it will be used in areas in which the game has lots of particles etc

Simple

local count = 0

game:GetService('RunService').RenderStepped:Connect(function()
  count += 1
end)

while wait(1)
  textlabel.Text = count
  count = 0
end
6 Likes

Hello, I’m attempting to use this method but it when I test in an actual game it keeps saying my FPS is infinite.

local RunService = game:GetService("RunService")
local FpsLabel = PlayerProfile.FPS

local TimeFunction = RunService:IsRunning() and time or os.clock

local LastIteration, Start
local FrameUpdateTable = {}

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

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

Start = TimeFunction()
RunService.Heartbeat:Connect(HeartbeatUpdate)

Actually ignore this, I ended up resolving my issue because stupid me forgot to publish studio!

This is how pony does it internally

local Stats = game:GetService("Stats")
local FrameRateManager = Stats and Stats:FindFirstChild("FrameRateManager")
local RenderAverage = FrameRateManager and FrameRateManager:FindFirstChild("RenderAverage")


local function GetFramerate(): number
	return 1000 / RenderAverage:GetValue()
end

Did you know this is only accessible to plugins? Or have you decided to post yet another script some exploit uses? If so, this is a developer forum. No one here cares what code exploits use to get client FPS. If you forgot your V3rmillion password, then its not a reason to post such scripts here. Please be helpful/contributive to the discussion or not post at all.

So no, this this script won’t work unless you are using it from a plugin.

6 Likes

no it’s what PONY uses and Roblox uses, and there are ways to access them through local scripts

Afaik the only way to use this in a LocalScript is to use a script executor, which is not what @OP is looking for and is also against the Roblox ToU. I’ve looked up for what “Pony” is and it turns out to be an exploit written by you. CoreScripts, which is what Roblox use, have their own permissions. They can use almost any API the engine has.

5 Likes
function getFps()

return (1/game:GetService("RunService").RenderStepped:Wait())

end

--do anything u want
3 Likes