🗼 Signal Towers
Overview
The signal tower system simulates cell tower coverage and signal strength for the in-game phone. It determines the player's signal bars based on proximity to configured towers and updates the UI accordingly. The system also provides exports for other scripts to query or set signal strength.
How Signal Strength is Calculated
- Towers are defined in
Config.SignalTowers.Towersas a list of coordinates. - The system calculates the distance from the player to the nearest tower.
- Signal strength (bars) is determined by which range threshold the player is within:
Config.SignalTowers.Range[1](weakest, farthest)- ... up to
Config.SignalTowers.Range[4](strongest, closest)
- If the player is outside all tower ranges, the signal is set to 0.
Debugging
- If
Config.SignalTowers.Debugis enabled, blips are created for each tower and their signal ranges:- Main tower blip (icon)
- Colored radius blips for each signal level (red, yellow, blue, green)
- Useful for visualizing coverage during development.
Exports
The following exports are provided for use in other scripts:
Get Current Service Bars
lua
Get All Towers
lua
Force Signal Update
lua
Set Service Bars Manually
lua
Configuration Notes
- All towers and ranges are set in
Config.SignalTowers. - To enable/disable the system, set
Config.SignalTowers.Enabled. - To show debug blips, set
Config.SignalTowers.Debug = true.
Events
- The system triggers
yseries:client:phone:service-changedwhenever the signal bars change.
Troubleshooting
- If the signal is not updating, check that the config is loaded and the system is enabled.
- Use debug blips to verify tower placement and coverage.
For further customization, edit client/utils/signalTowers.lua and Config.SignalTowers as needed.