# GuiInterface.setOnOpenCallback

Sets a callback to be called when the gui is opened

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
guiInterface:setOnOpenCallback( callback )
```

[Open the full Game reference](../Game-Script-Environment/Userdata/GuiInterface.md#setonopencallback)

**Availability:** Client only

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `gui` | [GuiInterface](../Game-Script-Environment/Userdata/GuiInterface.md) | The Gui interface |
| `callback` | string | Function to be called when gui is opened |
