Error: CPed::SetVariation: Invalid variation (slotId, drawblId, texId)
A script tried to put clothing on a character that does not have that item — usually saved outfit data from a different character model.
Do this first
Harmless on its own. If someone's outfit looks wrong, their saved appearance is from another model.
What it means
Something asked a ped to wear a clothing component or texture that does not exist for its model. The three numbers are the whole message:
• slotId — which component slot (0 face, 1 mask, 3 arms, 4 legs, 6 shoes, 8 undershirt, 11 top, and so on)
• drawblId — which drawable inside that slot
• texId — which texture variant of that drawable
The game refuses and leaves the ped in whatever it was wearing. Nothing crashes, so this fills the console rather than breaking anything — but a slot that silently does not apply is usually a wardrobe or an addon-ped problem worth fixing rather than muting.
What causes it
Ordered by how often it is the answer.
- 1
The drawable or texture does not exist for that model
Each ped model has a different count per slot. A number valid for
mp_m_freemode_01can be out of range for amp_f_freemode_01or an addon ped, and the numbers do not transfer between them. - 2
Clothing data saved for a different model
The player changed model (male to female, freemode to an addon ped) and old appearance data was applied to the new one. This is by far the most common version, and it fires several of these at once on spawn.
- 3
Addon clothing that is not streamed
The wardrobe menu lists a drawable the server does not actually stream, so the index exists in the config and not in the game.
- 4
The component applied before the model finished loading
Setting variations on a ped whose model was not fully loaded gives a ped with no variations to choose from yet.
- 5
Counting from the wrong base
GetNumberOfPedDrawableVariationsreturns a COUNT; valid drawables are 0 to count-1. Passing the count itself is off by one, and produces exactly this on the last slot every time.
How to tell which one is yours
Ask the game what is valid for that ped, right before the call:
local ped = PlayerPedId()
print(GetEntityModel(ped),
GetNumberOfPedDrawableVariations(ped, 11),
GetNumberOfPedTextureVariations(ped, 11, drawable))If the number you are setting is at or above what it reports, it is out of range for this model. If it fires in a burst on spawn, it is saved data from a different model.
Where to look
Whatever applies appearance: the clothing or skin resource, and the saved appearance row for that player.
How to fix it
Clamp against what the model actually has, and skip rather than force:
local function setComponent(ped, slot, drawable, texture)
local maxDrawable = GetNumberOfPedDrawableVariations(ped, slot)
if drawable >= maxDrawable then return end -- 0..max-1
local maxTexture = GetNumberOfPedTextureVariations(ped, slot, drawable)
if texture >= maxTexture then texture = 0 end
SetPedComponentVariation(ped, slot, drawable, texture, 0)
endAnd store the model alongside the appearance, so data from one ped is never applied to another:
if saved.model ~= GetEntityModel(ped) then
return applyDefaultAppearance(ped)
endStill stuck on your own code?
This page is what this error usually means. Paste your console into Server Fixer and it will rank everything in it and tell you what to do first, and if you would rather not touch it, ORBIE can repair the script and hand the resource back ready to drop in.
bug_reportOpen Server Fixer