From the reference libraryFiveM

clearTick

fivem-docs/docs/scripting-reference/runtimes/javascript/functions/clearTick.md

clearTick


title: clearTick

Removes a tick timer, stopping it from running. This is to be used in combination with a setTick id.

Syntax

clearTick(id);

Required arguments

  • id: The timer to be cleared.

Examples

This example creates a tick timer that prints a string to the console. We then clear it 5000ms after the server/client started.

const timer = setTick(() => {
  console.log("I'm running.");
});

setTimeout(() => {
  clearTick(timer);
  console.log('I stopped running.');
}, 5000);


title: clearTick

Removes a tick timer, stopping it from running. This is to be used in combination with a setTick id.

Syntax

clearTick(id);
Back to documentation