# Common Errors

In this section, you will find answers to commonly encountered issues. Remember that most errors stem from incorrect configuration, lack of required resources, or insufficient modification.

Bear in mind that troubleshooting requires patience and precision. Try to carefully analyze the errors and systematically review possible solutions.

If the issue persists after verifying the configuration and available resources, please contact the support on the VMS Discord.

***

<details>

<summary>My LMB does not work when creating a house.</summary>

This usually means that an external resource is blocking the Left Mouse Button input.

To fix this, open your `config.lua`, find the option `Config.HousingCreatorControls` and try replacing `SELECT` with one of the alternative control indexes for the Left Mouse Button:

```lua
['SELECT'] = {controlIndex = 92},
['SELECT'] = {controlIndex = 106},
['SELECT'] = {controlIndex = 122},
['SELECT'] = {controlIndex = 135},
['SELECT'] = {controlIndex = 142},
['SELECT'] = {controlIndex = 223},
['SELECT'] = {controlIndex = 229},
['SELECT'] = {controlIndex = 237},
['SELECT'] = {controlIndex = 257},
['SELECT'] = {controlIndex = 329},
['SELECT'] = {controlIndex = 346},
```

</details>

<details>

<summary>K4MB1 Shells have a buggy starting position inside.</summary>

You need to remove the **qb-interior** resource, and download Starter Shells from the [**official K4MB1 website**](https://k4mb1maps.com/product/5015840)**.**

</details>

<details>

<summary>Rain/snow inside the shell for a while with qb-weathersync</summary>

Find the equivalents in your current **qb-weathersync/client/client.lua** and replace with the code below.

```lua
RegisterNetEvent('qb-weathersync:client:DisableSync', function()
    disable = true
end)
```

{% code expandable="true" %}

```lua
CreateThread(function()
    while true do
        if not disable then
            if lastWeather ~= CurrentWeather then
                lastWeather = CurrentWeather
                SetWeatherTypeOverTime(CurrentWeather, 15.0)
                Wait(15000)
            end
            Wait(100) -- Wait 0 seconds to prevent crashing.
            if not disable then
                SetArtificialLightsState(blackout)
                SetArtificialLightsStateAffectsVehicles(blackoutVehicle)
                ClearOverrideWeather()
                ClearWeatherTypePersist()
                SetWeatherTypePersist(lastWeather)
                SetWeatherTypeNow(lastWeather)
                SetWeatherTypeNowPersist(lastWeather)
                if lastWeather == 'XMAS' then
                    SetForceVehicleTrails(true)
                    SetForcePedFootstepsTracks(true)
                else
                    SetForceVehicleTrails(false)
                    SetForcePedFootstepsTracks(false)
                end
                if lastWeather == 'RAIN' then
                    SetRainLevel(0.3)
                elseif lastWeather == 'THUNDER' then
                    SetRainLevel(0.5)
                else
                    SetRainLevel(0.0)
                end
            end
        else
            Wait(1000)
        end
    end
end)
```

{% endcode %}

</details>

<details>

<summary>Rain/snow inside the shell for a while with qbx_weathersync</summary>

Find the equivalents in your current **qbx\_weathersync/client/client.lua** and replace with the code below.

```lua
RegisterNetEvent('qb-weathersync:client:DisableSync', function()
    disable = true
end)
```

{% code expandable="true" %}

```lua
CreateThread(function()
    while true do
        if not disable then
            if lastWeather ~= currentWeather then
                lastWeather = currentWeather
                SetWeatherTypeOverTime(currentWeather, 15.0)
                Wait(15000)
            end
            Wait(100) -- Wait 0 seconds to prevent crashing.
            if not disable then
                print(lastWeather)
                SetArtificialLightsState(blackout)
                SetArtificialLightsStateAffectsVehicles(blackoutVehicle)
                ClearOverrideWeather()
                ClearWeatherTypePersist()
                SetWeatherTypePersist(lastWeather)
                SetWeatherTypeNow(lastWeather)
                SetWeatherTypeNowPersist(lastWeather)
                if lastWeather == 'XMAS' then
                    SetForceVehicleTrails(true)
                    SetForcePedFootstepsTracks(true)
                else
                    SetForceVehicleTrails(false)
                    SetForcePedFootstepsTracks(false)
                end
                if lastWeather == 'RAIN' then
                    SetRainLevel(0.3)
                elseif lastWeather == 'THUNDER' then
                    SetRainLevel(0.5)
                else
                    SetRainLevel(0.0)
                end
            end
        else
            Wait(1000)
        end
    end
end)
```

{% endcode %}

</details>

<details>

<summary>No time sync inside the shell with vSync</summary>

By default, [vSync](https://github.com/DevTestingPizza/vSync) does not have the ability to stop and resume time or weather, but in the following file we have prepared such an option.

The marked lines of code have been added:

<pre class="language-lua" data-expandable="true"><code class="lang-lua">CurrentWeather = 'EXTRASUNNY'

<strong>local isWeatherSynced = true
</strong>local lastWeather = CurrentWeather
local baseTime = 0
local timeOffset = 0
local timer = 0
local freezeTime = false
local blackout = false

<strong>RegisterNetEvent('vSync:toggle')
</strong><strong>AddEventHandler('vSync:toggle', function(toggle)
</strong><strong>    isWeatherSynced = toggle
</strong><strong>end)
</strong>
RegisterNetEvent('vSync:updateWeather')
AddEventHandler('vSync:updateWeather', function(NewWeather, newblackout)
    CurrentWeather = NewWeather
    blackout = newblackout
end)

Citizen.CreateThread(function()
    while true do
<strong>        if isWeatherSynced then
</strong>            if lastWeather ~= CurrentWeather then
                lastWeather = CurrentWeather
                SetWeatherTypeOverTime(CurrentWeather, 15.0)
                Citizen.Wait(15000)
            end
            Citizen.Wait(100) -- Wait 0 seconds to prevent crashing.
            SetBlackout(blackout)
            ClearOverrideWeather()
            ClearWeatherTypePersist()
            SetWeatherTypePersist(lastWeather)
            SetWeatherTypeNow(lastWeather)
            SetWeatherTypeNowPersist(lastWeather)
            if lastWeather == 'XMAS' then
                SetForceVehicleTrails(true)
                SetForcePedFootstepsTracks(true)
            else
                SetForceVehicleTrails(false)
                SetForcePedFootstepsTracks(false)
            end
<strong>        end
</strong><strong>        Citizen.Wait(100)
</strong>    end
end)

RegisterNetEvent('vSync:updateTime')
AddEventHandler('vSync:updateTime', function(base, offset, freeze)
    freezeTime = freeze
    timeOffset = offset
    baseTime = base
end)

Citizen.CreateThread(function()
    local hour = 0
    local minute = 0
    while true do
        Citizen.Wait(0)
<strong>        if isWeatherSynced then
</strong>            local newBaseTime = baseTime
            if GetGameTimer() - 500  > timer then
                newBaseTime = newBaseTime + 0.25
                timer = GetGameTimer()
            end
            if freezeTime then
                timeOffset = timeOffset + baseTime - newBaseTime			
            end
            baseTime = newBaseTime
            hour = math.floor(((baseTime+timeOffset)/60)%24)
            minute = math.floor((baseTime+timeOffset)%60)
            NetworkOverrideClockTime(hour, minute, 0)
<strong>        end
</strong>    end
end)

AddEventHandler('playerSpawned', function()
    TriggerServerEvent('vSync:requestSync')
end)

Citizen.CreateThread(function()
    TriggerEvent('chat:addSuggestion', '/weather', 'Change the weather.', {{ name="weatherType", help="Available types: extrasunny, clear, neutral, smog, foggy, overcast, clouds, clearing, rain, thunder, snow, blizzard, snowlight, xmas &#x26; halloween"}})
    TriggerEvent('chat:addSuggestion', '/time', 'Change the time.', {{ name="hours", help="A number between 0 - 23"}, { name="minutes", help="A number between 0 - 59"}})
    TriggerEvent('chat:addSuggestion', '/freezetime', 'Freeze / unfreeze time.')
    TriggerEvent('chat:addSuggestion', '/freezeweather', 'Enable/disable dynamic weather changes.')
    TriggerEvent('chat:addSuggestion', '/morning', 'Set the time to 09:00')
    TriggerEvent('chat:addSuggestion', '/noon', 'Set the time to 12:00')
    TriggerEvent('chat:addSuggestion', '/evening', 'Set the time to 18:00')
    TriggerEvent('chat:addSuggestion', '/night', 'Set the time to 23:00')
    TriggerEvent('chat:addSuggestion', '/blackout', 'Toggle blackout mode.')
end)

-- Display a notification above the minimap.
function ShowNotification(text, blink)
    if blink == nil then blink = false end
    SetNotificationTextEntry("STRING")
    AddTextComponentSubstringPlayerName(text)
    DrawNotification(blink, false)
end

RegisterNetEvent('vSync:notify')
AddEventHandler('vSync:notify', function(message, blink)
    ShowNotification(message, blink)
end)

</code></pre>

</details>
