Im getting this error SCRIPT ERROR: @cw-racingapp/server/main.lua:332: attempt to perform arithmetic on a nil value (field '?')
I have not changed anything to do with pay not sure why Im getting this error
local function giveSplit(src, racers, position, pot)
local total = 0
if (racers == 2 or racers == 1) and position == 1 then
total = pot
elseif racers == 3 and (position == 1 or position == 2) then
total = Config.Splits['three'][position] * pot
if UseDebug then print('Payout for ', position, total) end
elseif racers > 3 then
total = Config.Splits['more'][position] * pot
if UseDebug then print('Payout for ', position, total) end
else
if UseDebug then print('No one got a payout') end
end
if total > 0 then
if Config.Options.MoneyType == 'crypto' and Config.UseRenewedCrypto then
exports['qb-phone']:AddCrypto(src, Config.Options.cryptoType, math.floor(total))
TriggerClientEvent('cw-racingapp:client:notify', src,
Lang("participation_trophy_crypto") .. math.floor(total) .. ' ' .. Config.Options.cryptoType, 'success')
else
addMoney(src, Config.Options.MoneyType, math.floor(total))
end
end
end
Config.Splits = {
three = { [1] = 0.7, [2] = 0.3 }, -- If three racers
more = { [1] = 0.6, [2] = 0.3, [3] = 0.1 } -- If more than 3
}