Qb-multicharacter not saving on selection but player data is on database

Error : peds not saving on selection even tho it is on database

What was the last thing that changed:

i added this in main.lua QBCore.Functions.CreateCallback(“qb-multicharacter:server:SetupNewCharacter”, function(source, cb)
local license = QBCore.Functions.GetIdentifier(source, ‘license’)
local plyChars = {}
MySQL.Async.fetchAll(‘SELECT * FROM players WHERE license = ?’, {license}, function(result)
for k, v in pairs(result) do
local resultSkins = MySQL.Sync.fetchAll(‘SELECT * FROM playerskins WHERE citizenid = ? AND active = ?’, {v.citizenid, 1})
if resultSkins[1] then
plyChars[k] = {resultSkins[1].model, resultSkins[1].skin, v.cid, json.decode(v.charinfo), v}
end
end
Wait(400)
cb(plyChars)
end)
end)

because it is showing this error:

SCRIPT ERROR in promise (unhandled rejection): Error: SCRIPT ERROR: @qb-multicharacter/server/main.lua:185: attempt to index a nil value (field ‘integer index’)



no error in f8

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