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 127.0.0.1”) end end

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

I doubt RunConsoleCommand works,

LocalPlayer():ConCommand(“connect 000.000.0.00”)

(On RunConsoleCommand):The following commands are blocked:

“con_enable”
“sv_cheats”,
“_restart”,
“exec”,
“condump”,
“connect”,

–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)
ply:ConCommand(“connect 192.168.1.1”)
end)[/lua]

Something I use on one of my servers.

[lua]
local serverip = “208.115.206.186:27016” // Pirate Ship Wars
local serverip2 = “208.115.206.186:27017” // CARnage
local serverip3 = “208.115.206.186:27019” // BB
local serverip4 = “208.115.206.186:27020” // Zombie Survival
local serverip5 = “208.115.206.186:27015” // 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…”’)”)
end
if (text == chatcommand2) then
ply:SendLua(“LocalPlayer():ConCommand(‘connect “…serverip2…”’)”)
end
if (text == chatcommand3) then
ply:SendLua(“LocalPlayer():ConCommand(‘connect “…serverip3…”’)”)
end
if (text == chatcommand4) then
ply:SendLua(“LocalPlayer():ConCommand(‘connect “…serverip4…”’)”)
end
if (text == chatcommand5) then
ply:SendLua(“LocalPlayer():ConCommand(‘connect “…serverip5…”’)”)
end
end)
[/lua]
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(…)”)