Server Portal

So I saw in a server last night a Nether Portal that when clicked on took you to another owned server by the serverowner through what looked to be gametracker. I imagine it has to do with lua coding which is why I posted here, but what is it? And how do I make one for my server? I could really use it, im not even talking about something like a portal something as simple as an NPC or like a prop or something. Please help.

OnWhateverEvent if CLIENT then RunConsoleCommand(“connect”) end end

Replace with the ip of the server you want them to join.

I doubt RunConsoleCommand works,


(On RunConsoleCommand):The following commands are blocked:


–alot more but…

Why would they block those commands only on RunConsoleCommand? It would seem useless to keep :ConCommand and game.concommand abusable. I’m pretty sure connect isn’t blocked.

“connect” isn’t blocked, I don’t think _restart is blocked either

Player:ConCommand blocks commands with FCVAR_SERVER_CAN_EXECUTE it seems, only if you call it from the server (i.e. connect). RunConsoleCommand does not.

_restart was blocked for me when I tried to do it once.

_restart isn’t blocked on RunConsoleCommand on server or client

So I just type that into console looking at the ent I want to be the port…?

No, I put an example down bellow but that will change the server for the player when they die using a hook, you’ll probably want to change that though. Maybe having it so that when a player touches some entity it will change idk, whatever you want.

[lua]hook.Add(“PlayerDeath”, “changeServer”, function(ply)

Something I use on one of my servers.

local serverip = “” // Pirate Ship Wars
local serverip2 = “” // CARnage
local serverip3 = “” // BB
local serverip4 = “” // Zombie Survival
local serverip5 = “” // Underdone RPG

local chatcommand1 = “!psw”
local chatcommand2 = “!carnage”
local chatcommand3 = “!bb”
local chatcommand4 = “!zs”
local chatcommand5 = “!underdone”

hook.Add( “PlayerSay”, “plyChat”, function( ply, text, public )
text = string.lower(text)
if (text == chatcommand1) then
ply:SendLua(“LocalPlayer():ConCommand(‘connect “…serverip…”’)”)
if (text == chatcommand2) then
ply:SendLua(“LocalPlayer():ConCommand(‘connect “…serverip2…”’)”)
if (text == chatcommand3) then
ply:SendLua(“LocalPlayer():ConCommand(‘connect “…serverip3…”’)”)
if (text == chatcommand4) then
ply:SendLua(“LocalPlayer():ConCommand(‘connect “…serverip4…”’)”)
if (text == chatcommand5) then
ply:SendLua(“LocalPlayer():ConCommand(‘connect “…serverip5…”’)”)
Yes you can be an ass and do a “ulx cexec * say WHATEVER” and force everyone to join a different server. :slight_smile:

ply:ConCommand won’t work, use SendLua(“RunConsoleCommand(…)”)