forgottenserver/data/scripts/creaturescripts/player/world_light_time.lua
Ramon Bernardo 3877aa925c
Move world time and light to lua (#4583)
* Move world time and light to lua

* Some fix

* Remove duplicated checks and move return to last fn line

* Move world packet to lua
2023-12-10 10:34:26 -06:00

12 lines
309 B
Lua

local event = CreatureEvent("WorldTimeAndLight")
function event.onLogin(player)
local worldTime = Game.getWorldTime()
player:sendWorldTime(worldTime)
local worldLightColor, worldLightLevel = Game.getWorldLight()
player:sendWorldLight(worldLightColor, worldLightLevel)
return true
end
event:register()