β›…Weather Widget

Allows server owners to dynamically control the weather temperature and icon displayed on phone widgets.

Features

  • Live Weather Updates: Temperature and weather icons can be updated in real-time

  • Server Owner Control: Complete control over weather data through exports

  • Automatic Sync: Weather data automatically syncs to all connected phones

  • Fallback System: Graceful fallback to default values if weather system is disabled

  • Force Update Option: Optional immediate sync to all clients

  • NOTE: The weather widget is available only for Humanoid(android) phones as of now.

Configuration

Enable/Disable Weather System

In config/config.misc.lua:

Config.Weather = {}
Config.Weather.Enabled = true                           -- Enable/disable live weather system
Config.Weather.DefaultTemperature = 21                  -- Default temperature in Celsius
Config.Weather.DefaultIcon = 'humanoid/utils/cloudy.png' -- Default weather icon path
Config.Weather.UpdateInterval = 60000                   -- Update interval in milliseconds (1 minute)

Server Exports

Basic Usage

All export functions accept an optional forceUpdate parameter. When set to true, the weather data will be immediately synchronized to all connected clients instead of waiting for the next update cycle.

Parameters:

  • forceUpdate (boolean, optional): If true, immediately syncs data to all clients

Set Temperature

Set Weather Icon

Set Multiple Values at Once

Get Current Weather Data

Advanced Examples

Integration with External Weather APIs

Weather Icons

Default Icons Available

  • humanoid/utils/cloudy.png - Cloudy weather

  • Add your own custom icons to the UI assets

Custom Weather Icons

  1. Add your weather icon files to ui/public/humanoid/utils/

  2. Reference them in the icon path: humanoid/utils/your-icon.png

Troubleshooting

Weather Not Updating

  1. Check if Config.Weather.Enabled is set to true

  2. Verify the weather system is loaded.

  3. Check for any error messages when calling exports

Icons Not Displaying

  1. Ensure icon paths are correct and files exist in ui/public/

  2. Check browser console for 404 errors on image requests

Performance Considerations

  • The default update interval is 60 seconds to balance real-time updates with performance

  • Consider longer intervals for production servers with many players

  • Weather data is cached and only sent when phones are open

Last updated