> For the complete documentation index, see [llms.txt](https://xeavin.gitbook.io/ff12-lua-loader/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xeavin.gitbook.io/ff12-lua-loader/events/functions/wait-flag.md).

# Wait Flag

### Signatures

```csharp
bool waitFlag(string name)
bool waitFlag(string name, u64 duration)
```

### Description

Waits until a flag is created by any script.

Returns `true` if the flag was created or `false` once the wait time is exceeded.

### Arguments

#### Name

The name of the flag to await.

#### Duration

The time to wait in milliseconds.

Is optional and set to `5000` by default.
