Kartik Scripts

getForcedComponents

Returns every component GTA forces alongside a garment, arms, undershirts, decals. These are the pieces the game itself considers mandatory for the garment to render correctly, as opposed to the merely suggested ones shown in the GOES WITH panel.


๐Ÿ’ก Syntax

local forced = exports['kartik-clothing']:getForcedComponents(componentId, drawable, texture)

๐Ÿ“ฅ Parameters

ParameterTypeOptionalDescription
componentIdnumberNoThe component the garment sits in, usually 11 for tops.
drawablenumberNoDrawable index of the garment.
texturenumberYesTexture index. Defaults to 0.

๐Ÿ“ค Returns

TypeDescription
table[]A list of { componentId, drawable, texture }. Empty when the garment forces nothing, or when the game has no record of it.

๐Ÿ’ป Example

local forced = exports['kartik-clothing']:getForcedComponents(11, 84)

for _, piece in ipairs(forced) do
    print(('component %d must be %d/%d'):format(piece.componentId, piece.drawable, piece.texture))
end

On this page