RageUI items are changing together

When changing gender:

it also changes “face”:

Here is my code

            RageUI.List('Gender', {
                { Name = "Male", Value = "mp_m_freemode_01" },
                { Name = "Female", Value = "mp_f_freemode_01" },
            }, index.list, description, {}, true, {
                onListChange = function(Index, Item)
                    index.list = Index;
                    Visual.Subtitle("onListChange", 100)
                    local ped = GetPlayerPed(PlayerId())
                    local skin = Item.Value
                    TriggerEvent("ChangeGender", skin)
                    SetPlayerModel(ped, model)
                    print("ped:", ped)
                    print("model:", model)
                    print("value:", Item.Value)
                end,
                onSelected = function(Index, Item)
                    Visual.Subtitle("onSelected", 100)
                end,
            })
            --

            RageUI.List('Face', {
                { Name = "1", Value = "1" },
                { Name = "2", Value = "2" },
            }, index.list, description, {}, true, {
                onListChange = function(Index, Item)
                    index.list = Index;
                    Visual.Subtitle("onListChange", 100)
                    local face = Item.Value
                    TriggerEvent("ChangeFace", face)
                    print("ped:", ped)
                    print("model:", model)
                    print("value:", Item.Value)
                end,
                onSelected = function(Index, Item)
                    Visual.Subtitle("onSelected", 100)
                end,
            })

I think it is something to do with naming the items but the RageUI docs aren’t working so I’m not sure which part is naming the item :confused:

1 Like

Both lists use index.list as third argument. and since you change index.list = Index for every list change, I think that might cause both lists to change at the same time.

Hello,

Did you solve the problem?

Yeah so like the above comment said, you have to change the Index.List to something else

1 Like

Hello,

Thank you for your reply :slight_smile:

I forgot to specify in a loop ^^