💻
NoVariety Documentation
  • Overview
  • ROBLOS Documentation
    • Terminal Language
    • Coding Language
  • ROBLOS Website Creator
    • AppInstaller Files
    • HTML Interpreter
    • CSS Interpreter
      • position
      • size
      • anchor-point
      • layout-order
      • text-scale
      • text-wrap
      • color
      • background-color
      • background-transparency
      • border-size
      • border-color
      • rotation
      • visible
      • content
    • LUAScript
      • download
        • commit
      • Player
      • DOM
        • Document
          • title
          • setTitle
          • getTitle
          • addEventListener
          • removeEventListener
          • dispatchEvent
          • createNode
          • querySelector
          • getElementById
          • cloneNode
        • Elements
          • getElementById
          • getElementsById
          • querySelector
          • querySelectorAll
          • appendChild
          • insertBefore
          • removeChild
          • insertAttribute
          • removeAttribute
          • cloneNode
        • Window
          • Location
            • reload
            • to
            • teleport
          • localStorage
            • setKey
            • getKey
            • deleteKey
            • getKeys
          • alert
          • input
      • delay
      • setTimeout
      • setInterval
      • clearInterval
      • MarketPlace
        • promptGamepass
        • promptProductPurchase
        • promptPurchase
        • hasGamepass
        • hasAsset
        • purchaseSuccess
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. ROBLOS Website Creator
  2. LUAScript

setInterval

setInterval is just LUA native delay expect it runs infinitely every timeout

setInterval takes 2 arguments, the function and numeric timeout in seconds

setInterval returns the interval timeout ID, you can use this to stop the interval using clearInterval

local Age = 1
setInterval(function()
    Age = Age + 1
    print("You are " .. Age .. " years old")
end, 5) -- every 5 seconds this will print the current Age

PrevioussetTimeoutNextclearInterval

Last updated 1 year ago

Was this helpful?