> For the complete documentation index, see [llms.txt](https://docs.menanak47.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.menanak47.com/multi-framework/ak47_multicharacter/weather-and-time.md).

# Weather & Time

To ensure the cinematic cameras, lighting, and skies look perfect during the character selection phase, **ak47\_multicharacter** forces the weather to `CLEAR` and time to `00:00` (Midnight) or whatever is set by your lighting config.

To prevent your server's time/weather sync script from fighting with the multicharacter screen (which causes screen flickering), you need to pause your sync script.

The script natively pauses `cd_easytime` and `qb-weathersync`. If you use something else (like `vSync` or a custom script), follow the steps below.

### Modifying `custom/client.lua`

Open `custom/client.lua` and locate the `Custom_StartTimeLoop()` and `Custom_StopTimeLoop()` functions.

#### 1. Pausing Sync (Start Time Loop)

Add an event trigger to pause your specific weather script.

```lua
function Custom_StartTimeLoop()
    if not timeLoop then
        timeLoop = true
        
        -- Default Integrations
        if GetResourceState('cd_easytime') == 'started' then
            TriggerEvent('cd_easytime:PauseSync', true, 1)
        else
            if GetResourceState('qb-weathersync') == 'started' then
                TriggerEvent('qb-weathersync:client:DisableSync')
            end
            
            -- ADD YOUR CUSTOM PAUSE EVENT HERE
            -- TriggerEvent('my_weathersync:pause', true)
            
            -- Built-in Override Loop
            CreateThread(function()
                while timeLoop do
                    Wait(1)
                    NetworkOverrideClockTime(1, 0, 0)
                    ClearOverrideWeather()
                    ClearWeatherTypePersist()
                    SetWeatherTypePersist('CLEAR')
                    SetWeatherTypeNow('CLEAR')
                    SetWeatherTypeNowPersist('CLEAR')
                end
            end)
        end
    end
end
```

#### 2. Resuming Sync (Stop Time Loop)

Add an event trigger to resume your weather script once the player has spawned into the world.

```lua
function Custom_StopTimeLoop()
    if timeLoop then
        timeLoop = false
        
        -- Default Integrations
        TriggerEvent('qb-weathersync:client:EnableSync')
        TriggerEvent('cd_easytime:PauseSync', false)
        
        -- ADD YOUR CUSTOM RESUME EVENT HERE
        -- TriggerEvent('my_weathersync:pause', false)
    end
end
```
