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

How do I make a 30 Frames Per Second Cap?

Asked by 6 years ago

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

Log in to vote
1
Answered by 6 years ago

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
0
I think you had the same thing but just make sure it is in a LocalScript. Endergenius100 12 — 6y
0
where do you put the local script ads_bv 29 — 3y
Ad
Log in to vote
-1
Answered by
metryy 306 Moderation Voter
6 years ago

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

0
Yes you can. Endergenius100 12 — 6y
0
Clonetrooper's nostalgia zone is an example of allowing to via local script. ExtremeRisk 9 — 5y

Answer this question