a library to speed up the development of Fivem scripts and frameworks
fivem-ts - Documentation v0.7.5 • Docs
fivem-ts - Documentation v0.7.5 / Shared / Tick
Tick(
_target
,propertyKey
,descriptor
):void
A decorator that schedules a method to be executed every game tick.
The @Tick
decorator registers the decorated method to be executed on each game tick. This is particularly useful
where a method needs to be run continuously at every update cycle.
• _target: unknown
The prototype of the class.
• propertyKey: string
The name of the method being decorated.
• descriptor: PropertyDescriptor
The property descriptor for the method.
void
class GameLogic {
@Tick
public update() {
console.log('Updating game state...');
}
}
const game = new GameLogic();
// The `update` method will now be called on every game tick.