> For the complete documentation index, see [llms.txt](https://lua2.fatality.win/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lua2.fatality.win/api/instances/gui/control/valueparam.md). Agents can also search and read this documentation through its [MCP server](https://lua2.fatality.win/~gitbook/mcp).

# ValueParam

This type represents a value data used by some control types.

{% hint style="info" %}
Note, that this part: `<type>` is used to designate what exact type the instance of this type is holding. For example, when it says `ValueParam<bool>`, it means that `Get` will return a `bool` value, and `Set` will accept only the type `bool` as it's `val` parameter.
{% endhint %}

## Get <a href="#get" id="get"></a>

[<kbd><mark style="background-color:purple;">**Method**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Returns the value.

**Arguments**

None.

**Returns**

| Type     | Description |
| -------- | ----------- |
| `<type>` | Value.      |

Example

```lua
ctrl:GetValue():Get();
```

## GetDirect <a href="#get" id="get"></a>

[<kbd><mark style="background-color:purple;">**Method**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Returns the value disrgarding any active keybinds.

**Arguments**

None.

**Returns**

| Type     | Description |
| -------- | ----------- |
| `<type>` | Value.      |

Example

```lua
ctrl:GetValue():GetDirect();
```

## Set <a href="#set" id="set"></a>

[<kbd><mark style="background-color:purple;">**Method**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Sets the value.

{% hint style="info" %}
It is advised to use `SetValue` method of the control, if any.
{% endhint %}

Arguments

| Name  | Type     | Description |
| ----- | -------- | ----------- |
| `val` | `<type>` | Value.      |

**Returns**

Nothing.

**Example**

```lua
ctrl:GetValue():Set(123);
```

## GetHotkeyState <a href="#get-hotkey-state" id="get-hotkey-state"></a>

[<kbd><mark style="background-color:purple;">**Method**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Returns `true` if there's any active hotkeys.

**Arguments**

None.

**Returns**

| Type   | Description                     |
| ------ | ------------------------------- |
| `bool` | `true` if any hotkey is active. |

**Example**

```lua
if ctrl:GetValue():GetHotkeyState() then
    -- ...
end
```

## DisableHotkeys <a href="#disable-hotkeys" id="disable-hotkeys"></a>

[<kbd><mark style="background-color:purple;">**Method**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Disables all active hotkeys. This allows you to override the value.

**Arguments**

None.

**Returns**

Nothing.

**Example**

```lua
ctrl:GetValue():DisableHotkeys();
```

[^1]: This field is a method and must be invoked using a colon (:)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://lua2.fatality.win/api/instances/gui/control/valueparam.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
