# GuiInterface.setButtonCallback

Sets a button callback to be called when the button is pressed

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
guiInterface:setButtonCallback( buttonName, callback )
```

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

**Availability:** Client only

**Parameters:**

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