
local t = 0.9
core.register_globalstep(function(dtime)
	if t < 1 then t = t + dtime; return else t = t - 1 end
    for i, player1 in ipairs(core.get_connected_players()) do
        local observers = player1:get_observers() or {}
        observers[player1:get_player_name()] = true
        for k, player2 in ipairs(core.get_connected_players()) do repeat
            if (player1 == player2) then break end
            if (vector.distance(player1:get_pos(), player2:get_pos()) > 250) then
                observers[player2:get_player_name()] = nil
            else
                observers[player2:get_player_name()] = true
            end
        until true end
        player1:set_observers(observers)
    end
end)
