getClothesVariantCount
Shared
Counts how many textures a piece of clothing has for a ped's model.
int|false getClothesVariantCount(ped ped, string model)
Parameters
| Name | Type | Description |
|---|---|---|
| ped | ped | The ped or player whose model wears the piece. |
| model | string | The piece of clothing's model. |
Returns
The number of variants, which addPedClothes takes from 0 to that number minus 1, or false if the ped's model has no such piece.
Example
addCommandHandler("cor", function(player, command, model)
local count = getClothesVariantCount(player, model)
if count then
addPedClothes(player, model, math.random(0, count - 1))
end
end)