function lobby.press_button(pos, node, clicker)
   local name = clicker:get_player_name()
   local player_attributes = clicker:get_meta()
   local voting = player_attributes:get_string('voting')
   local mode = player_attributes:get_string('mode')
   local map_id = lobby.game[name]
   if voting == 'false' then
      if map_id ~= 'lobby' and mode == 'player' then
         local game_data = lobby.savedata.data[map_id]
         local game_pos = game_data['level_pos']
         local survivors = lobby.players_on_level(map_id)
         lobby.votes[map_id] = 0
         for _, player in pairs(minetest.get_connected_players()) do
            local rname  = player:get_player_name()
            local player_attributes = player:get_meta()
            if lobby.game[rname] == map_id then
               lobby.voted[rname] = false
               player:set_physics_override({speed=0})
               player_attributes:set_string('voting', 'true')
               minetest.chat_send_player(rname, minetest.colorize('#FF0000', name..' called an emergency meeting!'))
               minetest.show_formspec(rname, 'lobby:voting', lobby.voting_formspec(survivors))
               player:set_pos({x=game_pos.x+(math.random(-3,3)),y=game_pos.y,z=game_pos.z+(math.random(-3,3))})
            end
         end
      end
   else
      minetest.chat_send_player(name, 'Sorry, you can\'t do that now.')
   end
end

minetest.register_node('lobby:emergency_button', {
   description = 'Emergency Button',
   drawtype = 'mesh',
   mesh = 'lobby_button.obj',
   tiles = {'lobby_button_frame.png', 'lobby_button_button.png'},
   use_texture_alpha = 'clip',
   groups = {breakable=1},
   paramtype = 'light',
   paramtype2 = 'facedir',
   selection_box = {
      type = 'fixed',
      fixed = {-.5, -.5, -.5, .5, -.3, .5},
   },
   collision_box = {
      type = 'fixed',
      fixed = {-.5, -.5, -.5, .5, -.3, .5},
   },
   on_place = minetest.rotate_and_place,
   on_rightclick = lobby.press_button,
   on_punch = lobby.press_button,
})
