Some Changes to maybe Fix Problem With Afk Kick

This commit is contained in:
Cooldude2606
2018-04-20 20:53:33 +01:00
parent ca5c2418b1
commit 07c6ea882f
2 changed files with 4 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ Discord: https://discord.gg/r6dC2uK
]]
--Please Only Edit Below This Line-----------------------------------------------------------
local function get_afk_time(player)
function _.get_afk_time(player)
local rank = Ranking.get_rank(player)
local count = #game.connected_players
local base = rank.base_afk_time or false
@@ -22,7 +22,7 @@ Event.register(-1,function(event)
}:on_event('tick',function(self)
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_afk_time(player)
local afk = #game.connected_players < 3 and 10 or _.get_afk_time(player)
if afk then
if player.afk_time > afk*3600 then game.kick_player(player,'AFK For Too Long ('..math.floor(afk)..' Minutes)') end
end