local intro_formspec =
   'formspec_version[6]'..
   'size[32,18]'..
   'no_prepend[]'..
   'bgcolor[#020201;both;#020201]'..
   'background[0,0;32,18;rob_opr_base_intro_screen.png]'..
   'style_type[textarea;font_size=*2;textcolor=#49adff]'..
   'textarea[2,12;28,6;;;Hello Agent, \n   You should know you are not the first peson to undertake this mission. '..
   'Sadly nobody has had complete success, some have even died. Not to worry though, I\'ll be with you every step of the way.\n '..
   'Sneaking in through the ducting has worked for many others, but nobody has been able to retrieve the package we need.]'..
   'button_exit[14,17;4,1;exit;Okay]'

minetest.register_on_joinplayer(function(player)
   local name = player:get_player_name()
   minetest.show_formspec(name, 'intro', intro_formspec)
end)

minetest.register_on_player_receive_fields(function(player, formname, fields)
   if formname == 'intro' then
      minetest.set_timeofday(0)
      local name = player:get_player_name()
      minetest.chat_send_player(name, (minetest.colorize('#49adff', '{There should be a vent nearby that you can remove and gain entrance.}')))
      minetest.after(30, function() minetest.chat_send_player(name, (minetest.colorize('#49adff', '{What do you mean you don\'t know what the package is. You were at briefing this morning right?}')))end)
      minetest.after(40, function() minetest.chat_send_player(name, (minetest.colorize('#49adff', '{Advanced Robotic technology. Specifically a battle bot. Well we think that is the guarded secret.}')))end)
      minetest.after(50, function() minetest.chat_send_player(name, (minetest.colorize('#49adff', '{If our intel is correct this facility is working on sophisticated robotics that would allow them to do all sorts of evil.}')))end)
      minetest.after(60, function() minetest.chat_send_player(name, (minetest.colorize('#49adff', '{We need you to get in, retrieve a unit and get out.}')))end)
   end
end)
