Black Screen on Start

Are you facing a problem with a black screen on startup while working on your system? If yes, then don't worry, we have a solution for you. This issue usually occurs due to a problem in the fuel system in the /client/functions.lua file.

However, we cannot provide a universal solution for every system, as every fuel system is different. Therefore, we suggest you either connect your own fuel system or remove the existing one.

To remove the fuel system, follow the steps mentioned below:

Original code:

function SetVehicle(vehicle)
    -- Setup here your vehicle keys, fuel etc..
    
    if Config.Framework == "QBCore" then
        exports['LegacyFuel']:SetFuel(vehicle, 100.0)
        TriggerEvent("vehiclekeys:client:SetOwner", Core.Functions.GetPlate(vehicle))
    elseif Config.Framework == "ESX" then
    
    else
    
    end
end

Modified code:

function SetVehicle(vehicle)

    -- Setup here your vehicle keys, fuel etc..

    if Config.Framework == "QBCore" then
        TriggerEvent("vehiclekeys:client:SetOwner", Core.Functions.GetPlate(vehicle))
    elseif Config.Framework == "ESX" then

    else

    end
end

By following these steps, you can remove the fuel system and solve the black screen issue on startup.

Last updated