Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a 30 Frames Per Second Cap?

I'm trying to run this script but it doesn't do anything? Does it have to be a localscript?

Here's what I have so far:

local RunService = game:GetService("RunService")
while RunService.RenderStepped:Wait() do
	local t0 = tick()
	RunService.Heartbeat:Wait()
	debug.profilebegin("30 FPS Cap")
	repeat until (t0+0.0325) < tick()
	debug.profileend()
end

2 answers

Put this in a local script to cap the framerate to 30:

local RunService = game:GetService("RunService")

while RunService.RenderStepped:Wait() do
	local t0 = tick()
	RunService.Heartbeat:Wait()
	debug.profilebegin("30 FPS Cap")
	repeat until (t0+0.0325) < tick()
	debug.profileend()
end

2 comments

0

I think you had the same thing but just make sure it is in a LocalScript.

0

where do you put the local script

You can't control the Roblox's client frame rate in a script.

2 comments

0

Yes you can.

0

Clonetrooper's nostalgia zone is an example of allowing to via local script.

This discussion is preserved as it was. New answers, comments, and votes are closed.