Putting on and taking off clothes

I try to find out if he is wearing a vest and if so, to take it off and if not, to put on a specific one
However, it doesn’t quite work

                    local playerPed = GetPlayerPed(-1)

                    if IsPedComponentVariationValid(playerPed, 9, 6, 0) then
                        print("Valid component variation")
                        ClearPedProp(playerPed, 9)
                    else
                        print("Invalid component variation")
                        SetPedComponentVariation(playerPed, 9, 6, 0, 0)
                    end

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.