Jump to content
RAGE Multiplayer Community

How to create simple timer?


0xNull
 Share

Recommended Posts

  • 2 months later...
  • 1 month later...
let myTimer = null;
myTimer = setInterval(() => {
	// Spawn Vehicle
	clearInterval(myTimer);
	myTimer = null;
}, 3000);

This should work, after 3 seconds, it performs the function and clears the range (runs only once)

Edited by LeozinH1
Link to comment
Share on other sites

Am 19.5.2018 um 22:10 schrieb LeozinH1:
let myTimer = null;
myTimer = setInterval(() => {
	// Spawn Vehicle
	clearInterval(myTimer);
	myTimer = null;
}, 3000);

This should work, after 3 seconds, it performs the function and clears the range (runs only once)

No need for an interval, just use the timeout function

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...