@rbxts/planck-flamecs-hooks
Version:
A @rbxts/planck plugin that provides support for @rbxts/flamecs hooks.
15 lines (14 loc) • 664 B
TypeScript
import type { Modding } from "@flamework/core";
/**
* Utility for easy time-based throttling.
*
* Accepts a duration and returns `true` if it has been that long since the last
* time this function returned `true`. Always returns `true` the first time.
*
* @param seconds - The number of seconds to throttle for.
* @param discriminator - An optional value to additionally key by.
* @param key - An automatically generated key to store the throttle state.
* @returns - Returns true every x seconds, otherwise false.
* @metadata macro
*/
export declare function useThrottle(seconds: number, discriminator?: unknown, key?: Modding.Caller<"uuid">): boolean;