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 6767 are treated as 6767.

The cap is a scheduling target; actual rendering can be slower.

When the FPS unlocker is enabled in Environment settings, Kawaii applies its saved value on each join and teleport and whenever that value changes, so a script cap lasts until then. With the unlocker off, Kawaii does not reapply a saved value.

Example

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