Fixed _ENV

This commit is contained in:
Cooldude2606
2018-10-26 13:42:08 +01:00
parent d287d33e05
commit 9f38f6a0f1
6 changed files with 8 additions and 16 deletions

View File

@@ -7,8 +7,7 @@ script.on_init(function(event)
name='afk-kick',
}:on_event('tick',function(self)
-- the _env should be auto loaded but it does not for some reason
local _ENV = _ENV or setmetatable({},{__index=_G})
_ENV.get_allowed_afk_time = self._env.get_allowed_afk_time
local _ENV = self._env.setmetatable({self=self,event=event},{__index=self._env})
if (game.tick%3600) ~= 0 then return end
for _,player in pairs(game.connected_players) do
local afk = #game.connected_players < 3 and 10 or get_allowed_afk_time(player)