Redirect

Is it possible now to be able to redirect a user from one server to another server using the IP Address. I have tried some of the scripts are available currently but they don’t seem to work.

This script should redirect everyone to a Garry’s Mod Tower server. Modify the player object to change who gets redirected.

Essentially what you want to do is write a script that sends a lua function to the player to run a console command that connects you to a server based off the first argument



ServerIP = "join.gmtower.org"
for _, ply in pairs(player.GetAll()) do
    ply:SendLua( string.format( "LocalPlayer():ConCommand( \"connect %s\" )", ServerIP )
end