SetAttribute

This function allows you to set attributes to an instance.

Example Usage:

-- 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)

Parameters

instance: Instance

The instance you want the attribute to be assigned to.

attributeName: string

The name of the attribute.

attributeValue: any

The value type of the attribute.

debugging: bool

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

References

Last updated