# Sleeping in Roblox Lua

#### You:
how to sleep in roblox executor lua

#### ChatGPT:
In Roblox Lua (Luau), the usual way to "sleep" or pause execution is:

```lua
task.wait(seconds)
```

Example:

```lua
print("Start")

task.wait(2) -- wait 2 seconds

print("2 seconds later")
```

You can also use:

```lua
wait(2)
```

but `wait()` is considered older and `task.wait()` is preferred because it's more accurate and doesn't throttle execution. ([Creator Hub](https://create.roblox.com/docs/reference/engine/libraries/task?utm_source=chatgpt.com), [Creator Hub](https://create.roblox.com/docs/scripting/scheduler?utm_source=chatgpt.com))

### Inside a loop

```lua
while true do
    print("Hello")
    task.wait(1) -- pause 1 second each iteration
end
```

### If you're using a Roblox executor

Most executors support:

```lua
task.wait(1)
```

or sometimes:

```lua
wait(1)
```

Some executors additionally provide a custom:

```lua
sleep(1000) -- milliseconds
```

but that is executor-specific and not part of standard Roblox Luau. If you tell me which executor you're using (Solara, Xeno, Swift, etc.), I can tell you the exact syntax it supports.
