[error] vrp_showroom

i got this error when i starts my server

Error loading script server.lua in resource vrp_showroom: @vrp/lib/utils.lua:13: bad argument #1 to ‘load’ (function expected, got nil)
stack traceback:
[C]: in function ‘load’
@vrp/lib/utils.lua:13: in function ‘module’
server.lua:28: in main chunk

server.lua file is:

local Tunnel = module("vrp", "lib/Tunnel")
local Proxy = module("vrp", "lib/Proxy")

MySQL = module("vrp_mysql", "MySQL")

vRP = Proxy.getInterface("vRP")
vRPclient = Tunnel.getInterface("vRP","vRP_showroom") 
Gclient = Tunnel.getInterface("vRP_garages","vRP_showroom")

local cfg = module("vrp_showroom","cfg/config")   --LINE 28
local vehgarage = cfg.showgarage


-- vehicle db / garage and lscustoms compatibility
MySQL.createCommand("vRP/showroom_columns", [[
ALTER TABLE vrp_user_vehicles ADD veh_type varchar(255) NOT NULL DEFAULT 'default' ;
ALTER TABLE vrp_user_vehicles ADD vehicle_plate varchar(255) NOT NULL;
]])
--MySQL.query("vRP/showroom_columns")

MySQL.createCommand("vRP/add_custom_vehicle","INSERT IGNORE INTO vrp_user_vehicles(user_id,vehicle,vehicle_plate,veh_type) VALUES(@user_id,@vehicle,@vehicle_plate,@veh_type)")

-- SHOWROOM
RegisterServerEvent('veh_SR:CheckMoneyForVeh')
AddEventHandler('veh_SR:CheckMoneyForVeh', function(vehicle, price ,veh_type)
    local user_id = vRP.getUserId({source})
    local player = vRP.getUserSource({user_id})
    MySQL.query("vRP/get_vehicle", {user_id = user_id, vehicle = vehicle}, function(pvehicle, affected)
        if #pvehicle > 0 then
          vRPclient.notify(player,{"~r~You already own a car."})
        else
          for i=1, #vehgarage.vehicles do
            if vehgarage.vehicles[i].model == vehicle and vehgarage.vehicles[i].costs == price then
              if vRP.tryFullPayment({user_id,price}) then
                vRP.getUserIdentity({user_id, function(identity)
                      MySQL.query("vRP/add_custom_vehicle", {user_id = user_id, vehicle = vehicle, vehicle_plate = "P "..identity.registration, veh_type = veh_type})
                    end})

                TriggerClientEvent('veh_SR:CloseMenu', player, vehicle, veh_type)
                vRPclient.notify(player,{"Payed ~r~$ "..price.."."})
              else
                vRPclient.notify(player,{"~r~Insufficient funds."})
              end
            end
          end
        end
      end)
  end)

Which line 28 is: local cfg = module(“vrp_showroom”,“cfg/config”)

i downloaded the files here: https://github.com/KilobaiD/FiveM-Scripts/tree/master/vRP

Try adding this to the bottom

RegisterServerEvent(‘veh_SR:CheckMoneyForBasicVeh’)
AddEventHandler(‘veh_SR:CheckMoneyForBasicVeh’, function(user_id, vehicle, price ,veh_type)
local player = vRP.getUserSource({user_id})
MySQL.query(“vRP/get_vehicle”, {user_id = user_id, vehicle = vehicle}, function(pvehicle, affected)
if #pvehicle > 0 then
vRPclient.notify(player,{"~r~You allready own that."})
vRP.giveMoney({user_id,price})
else
vRPclient.notify(player,{“Paid ~r~”…price…"$."})
vRP.getUserIdentity({user_id, function(identity)
MySQL.query(“vRP/add_custom_vehicle”, {user_id = user_id, vehicle = vehicle, vehicle_plate = "P "…identity.registration, veh_type = veh_type})
end})
Gclient.spawnBoughtVehicle(player,{veh_type, vehicle})
end
end)
end)

This should be asked in the original topic.

Please ask for support in the original resource topic only. Do not start new topics about issues/questions regarding specific resources.

This way the forums won’t get cluttered with a ton of topics for small issues, which may or may not have already been solved or answered in the original topic.

That way everyone can find their answers and ask their questions in one place, so the original creators get notified of the question and everyone knows where to look for answers and where to support others with a specific resource.

:mascot:

Closed.