This should work, if you put it in some serverside code. Please note, I’ve not proofread it, it may be full of errors:
local function Connect( ply, str, pub )
if (str == "!join ServerName" ) then
ply:ConCommand( "connect XX.XX.XXX.XXX:XXXXX" ) -- Replace Xs with IP.
hook.Add( "PlayerSay", "Connect to server 2", Connect )
Correction: That WILL work, I tested it. If you want it standalone, put it in lua/autorun/server in a lua file, should work. Replace the IP with the server’s and ServerName with the server’s name.