# BooleanSetting

A simple boolean setting.

### Remarks

Can only be created while initializing the script.

### Example

```ts
const alwaysAttack = new BooleanSetting("AlwaysAttack", "If the module will always attack regardles of player health.", false);
```

### Extends

* [`Setting`](https://scripting.breeze.rip/api/breeze/settings/setting)

### Constructors

#### Constructor

> **new BooleanSetting**(`holder`, `name`, `description`, `defaultValue`): `BooleanSetting`

**Parameters**

**holder**

`object`

Can either be 'script' or a subgroup.

**name**

`string`

The name of the setting.

**description**

`string`

The description of the setting.

**defaultValue**

`boolean`

The default value of the setting.

**Returns**

`BooleanSetting`

**Overrides**

`Setting.constructor`

### Methods

#### description()

> **description**(): `string`

**Returns**

`string`

The description of the setting.

**Inherited from**

[`Setting`](https://scripting.breeze.rip/api/breeze/settings/setting).[`description`](https://scripting.breeze.rip/api/breeze/setting#description)

***

#### getValue()

> **getValue**(): `boolean`

**Returns**

`boolean`

If the settings is toggled or not.

***

#### name()

> **name**(): `string`

**Returns**

`string`

The name of the setting.

**Inherited from**

[`Setting`](https://scripting.breeze.rip/api/breeze/settings/setting).[`name`](https://scripting.breeze.rip/api/breeze/setting#name)

***

#### setValue()

> **setValue**(`value`): `void`

**Parameters**

**value**

`boolean`

The value to set the setting to.

**Returns**

`void`

***

#### visible()

> **visible**(`visible`): `void`

You can use this to hide settings temporarily depending on the user config. The callback should return a boolean.

**Parameters**

**visible**

`Function`

The function to determine if the setting should be visible or not.

**Returns**

`void`

**Example**

```ts
const delay = new IntSetting("Delay", "The amount of ticks to wait in between attacks.", false);

delay.visible(() => {
	return someOtherSetting.getValue()
});
```

**Inherited from**

[`Setting`](https://scripting.breeze.rip/api/breeze/settings/setting).[`visible`](https://scripting.breeze.rip/api/breeze/setting#visible)
