⛅ 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:
lua
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
lua
Set Weather Icon
lua
Set Multiple Values at Once
lua
Get Current Weather Data
lua
Advanced Examples
Integration with External Weather APIs
lua
Weather Icons
Default Icons Available
humanoid/utils/cloudy.png- Cloudy weather- Add your own custom icons to the UI assets
Custom Weather Icons
- Add your weather icon files to
ui/public/humanoid/utils/ - Reference them in the icon path:
humanoid/utils/your-icon.png
Troubleshooting
Weather Not Updating
- Check if
Config.Weather.Enabledis set totrue - Verify the weather system is loaded.
- Check for any error messages when calling exports
Icons Not Displaying
- Ensure icon paths are correct and files exist in
ui/public/ - 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