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:

1local RunService = game:GetService("RunService")
2while RunService.RenderStepped:Wait() do
3    local t0 = tick()
4    RunService.Heartbeat:Wait()
5    debug.profilebegin("30 FPS Cap")
6    repeat until (t0+0.0325) < tick()
7    debug.profileend()
8end

2 answers

Log in to vote
1
Answered by 6 years ago

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

1local RunService = game:GetService("RunService")
2 
3while RunService.RenderStepped:Wait() do
4    local t0 = tick()
5    RunService.Heartbeat:Wait()
6    debug.profilebegin("30 FPS Cap")
7    repeat until (t0+0.0325) < tick()
8    debug.profileend()
9end
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 — 6y

Answer this question