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.

Syntax
Luau
setfpscap(fps: number) -> ()

Parameters

Function parameters
ParameterTypeDescription
fpsnumberRequested 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

Example
Luau
local previous = getfpscap()
setfpscap(60)
print("Requested cap:", getfpscap())
if previous > 0 then setfpscap(previous) end
Kawaii documentation