Skip to content

Commit

Permalink
Merge pull request #20 from xThrasherrr/main
Browse files Browse the repository at this point in the history
feat(weather): add state for individual player weather
  • Loading branch information
FjamZoo authored Oct 9, 2024
2 parents 313b8dd + 82c877a commit 3a38a1c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions client/weather.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,19 @@ CreateThread(function ()
setWeather(true)

playerState.syncWeather = true
playerState.playerWeather = 'EXTRASUNNY'
end)

AddStateBagChangeHandler('syncWeather', ('player:%s'):format(cache.serverId), function(_, _, value)
if not value then
SetTimeout(0, function()
resetWeatherParticles()
while not playerState.syncWeather do
local setWeather = playerState.playerWeather or 'EXTRASUNNY'
SetRainLevel(0.0)
SetWeatherTypePersist('EXTRASUNNY')
SetWeatherTypeNow('EXTRASUNNY')
SetWeatherTypeNowPersist('EXTRASUNNY')
SetWeatherTypePersist(setWeather)
SetWeatherTypeNow(setWeather)
SetWeatherTypeNowPersist(setWeather)
Wait(2500)
end
end)
Expand Down

0 comments on commit 3a38a1c

Please sign in to comment.