delayFrames Function #

Description: Pauses the execution of the script for a specified number of game frames. This can be useful for synchronizing actions with the game's frame updates or creating timed sequences.

Usage:

delayFrames(frames)

Parameters:

  • frames (number): The number of game frames to wait. Must be a positive integer.

Returns:

  • None

Example:

-- Wait for 30 frames before executing the next action
delayFrames(30)

Details:

  • This function introduces a delay in the script execution, allowing for timed actions that depend on specific game events or animations.
  • Ensure that the frames parameter is set to a reasonable value to avoid excessive delays that may affect the script's performance.