Redirect User On Join

I just bought a server and I’d like to make it where when the person joins my old server they are redirected to the new server. How would I go about doing this?


(User was banned for this post ("stop posting in all bold" - postal))

password the old server and put the new ip in its hostname

I am not that good with lua, but I think you could try this code:


hook.Add("PlayerConnect","Redirect",function(ply)
ply:ConCommand("connect 127.0.0.1:27017") --Put your server IP here
end)

Like I said above I am not that good with lua, I am only trying to help. That should go in autorun/client I think.

Personally I would not do that though. It might end up making people hate your server, because they get instantly redirected when they join. I feel you should tell your community whats going on and have them transfer over. You could also do what the person above me said do. Even putting a popup in game to tell them where to go would help.