Skip to content

Attachment

Class ยท server and client scripts

Attachment marks either a socket on a character or the root of an accessory that snaps into a matching socket. Read and write it through entity.Attachment.

Example

-- Server script.
local socket = World.Spawn({
    Name = "HatSocket",
    Position = Vector3.new(0, 1, 0),
    Attachment = { Slot = "Hat", IsRoot = false },
})
local att = socket.Attachment
if att then
    print(att.Slot, att.IsRoot)
end

IsRoot

Property
IsRoot: boolean

IsRoot marks this entity as an accessory root; its descendants are placed relative to it. When false, Attachment marks a character socket.

Default false

Slot

Property
Slot: AccessorySlot

Slot is the socket an accessory attaches to: "Hat", "Hair", "Face", "Back", "LeftShoulder", "RightShoulder", "Waist", "Front" or "Neck".

Default "Hat"