Please see my snippet below. This is not working, the arguments are not passing to the event. I am getting a nil for var2 and yes I know I can just send this straight to the ServerEvent however I was getting a nil there as well so I did it this way to troubleshoot. Does anyone know why my variables are not passing through qb-target? Local Multi is working the print above it is returning the correct value.
CreateThread(function()
for k, v in pairs(Config.PrimeJewelSales.locations) do
QBCore.Debug(v)
print("Line6:jeweler = "..k)
print("Line7:multiplier = "..v.multiplier)
local multi = v.multiplier
exports['qb-target']:AddBoxZone("JewellerySales"..k, vector3(v.coords.x, v.coords.y, v.coords.z), 1.2, 1.2, {
name = "JewellerySales"..k,
heading = v.coords.w,
debugPoly = true,
useZ = true,
}, {
options = {
{
type = "client",
event = 'qb-jewelry:client:sellprimejewels',
args = {var1 = k, var2 = multi },
icon = 'fas fa-gem',
label = 'Sell Jewelry',
}
},
distance = 1.5,
})
end
end)
RegisterNetEvent('qb-jewelry:client:sellprimejewels', function(jeweler,multiplier)
print("Command Received from interaction name ="..jeweler.." multiplier ="..multiplier)
TriggerServerEvent('qb-jewelry:server:sellPrime',jeweler,multiplier)
end)