Skip to content

Worn

Class ยท server and client scripts

Worn marks an accessory root currently worn by a character. Scripts add and remove it with Entity:Add and Entity:Remove, and inspect Asset through accessory.Worn.

Example

-- Server script.
for accessory in World.Query(Component.Worn) do
    local worn = accessory.Worn
    if worn then
        print(accessory.Name, worn.Asset)
    end
end

Asset

PropertyRead only
Asset: string

Asset is the asset id the API 54 AddAccessory spawned the accessory from. Every other way of wearing an accessory leaves it "0".

Default "0"