title: Waiting in GameMaker: Studio
body: <p>I composed a script in GML that is supposed to wait a few seconds before executing a script, but I tried it out, and it isn't working. Can someone help? And I don't want to use the wait/sleep function, since that delays everything in the room. Here my script is.</p>
  
  <pre><code>//Rename this script according to what you want to wait for
  //Here is how many seconds we want to wait.
  var seconds = 0;
  //We will multiply the amount of seconds by the room speed, and store it in a variable
  var waittime = seconds * room_speed;
  //Then, we will define a script for later
  var script = "Your Script here";
  //Then, we will add a question, and it will ask if the room speed is the same as the wait time
  if (room_speed == waittime or room_speed &gt; waittime) {
      //Then, if the amount of room speed is the same as the wait time, then execute the script
      script_execute(script);
  }
  else {
      //But if the amount of seconds is not equal, or greater than the wait time, then just add the fps to the wait time-
      waittime += fps;
  }
  </code></pre>