# 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](/websitecreator/luascript/clearinterval.md)

```lua
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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.novarietygames.com/websitecreator/luascript/setinterval.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
