# 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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
