> For the complete documentation index, see [llms.txt](https://synilla.gitbook.io/essentials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://synilla.gitbook.io/essentials/reference/functions/general/setattribute.md).

# SetAttribute

**Example Usage:**

{% tabs %}
{% tab title="Script" %}

```lua
-- Getting ReplicatedStorage and Workspace service
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local workspace = game:GetService("Workspace")

-- Referencing Essentials
local Essentials = require(ReplicatedStorage.Essentials)

-- Referencing the instance you want to set the attribute to
local damagePart = workspace.DamagePart

-- Setting the attribute and it's value
Essentials.SetAttribute(damagePart, "Damage", 50, true)
```

{% endtab %}

{% tab title="Output" %}

```
Essentials: Successfully set damagePart's attribute name to Damage and the attribute value to 50
```

{% endtab %}
{% endtabs %}

### Parameters

#### instance: [Instance](https://create.roblox.com/docs/reference/engine/datatypes/Instance)

The instance you want the attribute to be assigned to.

#### attributeName: [string](https://create.roblox.com/docs/luau/strings)

The name of the attribute.

#### attributeValue: [any](https://create.roblox.com/docs/studio/instance-attributes#supported-types)

The value type of the attribute.

#### debugging: [bool](https://create.roblox.com/docs/luau/booleans)

Sends an output log to your output window and developer console.

### References

#### [Instance Attributes](https://create.roblox.com/docs/studio/instance-attributes)
