Skip to content

[LooksCrafter] Items

Sh1zok edited this page Aug 7, 2026 · 2 revisions

In each handler, you can create slots into which clothing items will be placed. Here is an example of creating a handler, a slot and a list of items in it:

local looksAPI = require("your/path/to/LooksCrafter.lua")
looksAPI:newHandler(textures["assets.Skin"]):newSlot("Boots", 1, false, {
    goofyClownBoots = {
        texture = textures["assets.Boots.goofyClownBoots"]
    },
    whiteSneakers = {
        texture = texture["assets.Boots.whiteSneakers"]
    }
})

This is a very simple and basic example, in fact, each item may have more parameters, here is a description of them:

Name Type Description
texture Texture The texture that will be merged with the handler's base texture as a result of updateLook()
chromaKeyColor Vector4 A color that will remove pixels left by previous clothing layers before merging the current layer
modelParts table A model parts table that specifies which model parts will be shown or hidden when an item is equipped
onEquip function The function that will be executed when the item is equipped
unUnequip function The function that will be executed when the item is Unequipped

Tip

The onEquip() and onUnequip() functions has a handler object parameter

Example

local looksAPI = require("your/path/to/LooksCrafter.lua")

looksAPI:newHandler(textures["Skin"]):newSlot("TestItems", 1, false, {
    -- texture usage example
    Item1 = {
        texture = textures["assets.TestTexture"]
    },
    -- chromaKeyColor usage example
    Item2 = {
        texture = texture["assets.TestTexture"],
        chromaKeyColor = vec(0, 0.5, 1, 1) -- Red: 0, Green: 127, Blue: 255, Alpha: 255
    },
    -- modelParts usage example
    Item3 = {
        modelPart = {
            [models.model.root.Body] = false, -- `models.model.root.Body` will be hidden
            [models.model.root.Head.Earrings] = true -- `models.model.root.Head.Earrings` will be shown
        }
    },
    -- onEquip & onUnequip usage example
    Item4 = {
        onEquip = function(handler)
            print("Hello, World!") -- Will print "Hello, World!" in the chat on equip
            handler:setSlot("TestItems", false)
        end,
        onUnequip = function()
            print("Goodbye, World!") -- Will print "Goodbye, World!" in the chat on unequip
        end
    }
})

Clone this wiki locally