> For the complete documentation index, see [llms.txt](https://docs.vames-store.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vames-store.com/assets/vms_needs/compatibility/phones/lb-phone.md).

# lb-phone

{% hint style="info" %}
This replaces the built-in random temperature generation with the real ambient and feels-like temperatures provided by VMS Needs.
{% endhint %}

{% hint style="warning" %}
Only replace the highlighted code. Leave the rest of the callback unchanged.
{% endhint %}

***

#### 1. Open the file

Open the following file: **lb-phone/client/apps/default/weather.lua**

#### 2. Replace the Temperature Calculation

Find the following code:

```lua
local temperature = math.random(weatherData.temperature[1], weatherData.temperature[2])
weatherData.temperature = temperature

if windSpeed > 4 and temperature < 50 then
    -- calculation from https://www.weather.gov/media/epz/wxcalc/windChill.pdf
    local windSpeedMph = windSpeed * 2.236936
    local feelsLike = (35.74 + (0.6215 * temperature) - (35.75 * windSpeedMph ^ 0.16) + (0.4275 * temperature * windSpeedMph ^ 0.16))

    weatherData.feelsLike = math.min(math.floor(feelsLike), temperature)
end
```

Replace it with:

```lua
local worldTemp = exports['vms_needs']:GetServerTemperature('fahrenheit')
local feelsLike = exports['vms_needs']:GetServerFeelsLikeTemperature('fahrenheit')

weatherData.temperature = worldTemp
weatherData.feelsLike = feelsLike
```
