setfpscap Synchronous
set_fps_cap
Request a frame-rate cap from the task scheduler. Save the current value first when your script only needs a temporary setting.
Luau
setfpscap(fps: number) -> ()Parameters
| Parameter | Type | Description |
|---|---|---|
fps | number | Requested frames per second. |
Returns
()No values.
Usage notes
Values that are non-finite, non-positive, or above 2000 are treated as 2000.
The cap is a scheduling target; actual rendering can be slower.
Example
Luau
local previous = getfpscap()
setfpscap(60)
print("Requested cap:", getfpscap())
if previous > 0 then setfpscap(previous) end