Server portal

Can some one help please

I need to make it possible to teleport a player from one server to another if they have triggered a trigger I know it can be done because the PE servers have one it teleports you from the GMP server to the TF2TD servers.

So can some one please help I have been trying to work this out for nearly a month now and no luck :frowning:

Thats done with lua.

Or point_consolecommand if you know what you’re doing.

point_consolecommand > “connect IP.AD.DR.ESS:PORT”

I thought it was point_servercommand…?

I did this as a central station map once, the train to a server would come and take you into a dark tunnel where you would go through s trigger and a “Point_clientcommand” would shoot you over to that labeled server (labeled train platforms) of course if that server went down, then you would be fucked. i thought of putting buttons to press to make a “closed” sign and the trains would stop for that server, but i got lazy and slightly irritated with “'Thisguy463 has disconnected fromt he server” “somedude1234 has disconnected from the server” due to the people being shot to the dm and rp servers. sigh i wish our three servers were still up so we could do that. :crying:

[editline]12:19 AM[/editline]

Damn! i should have made it look like you were getting shot through internet cables, using folder trains!
That would have brought a new perspective to those servers xD, anyway. goodluck with your map! :fuckyou:

Yeah, if you want to get your server to try connecting to the other server, sure.



Thank you for the help guys. So I need a point_clientcommand?

well i tryed it but where do I put the command in the class info there is only one key and that is Name so do i need to make a new key e.g. Code?

ontrigger>CLientcommand01>command with a value of “Connect ###.###.#.###:Port

I can’t recall if the IP address goes in another manner but if it works than pimp the shit outa your map and have fun :smiley:

If it’s for gmod, look into getting a simple lua entity that allows you to change the server’s IP from a simple text file. It would mean that you don’t need to recompile the map every time you want to have a different server connected.

OK I can not get this to work this is what I am doing

  1. func_button>OnPressed>Server1 (point_clientcommand)>Command>Connect ###.###.###.###:####

2.trigger_multiple>OnTrigger>Server1 (point_clientcommand)> Command>Connect ###.###.###.###:####

I have tried 1 and 2 but can not get it to work can any one tell me how to make it work or has garry broken some thing else

but thank you for the help so far

a stupid question, but you don’t actually name the ip to ###?

LOL no i just dont want to put the ip address up there

I whipped up a trigger SENT that makes it a bit easier.
It’s a brush-based SENT that allows you to either set an IP directly, or set a text-file from which it reads the IP.
If you want a use a text-file you have to put it in the “data”-directory of gmod, and ONLY put the IP in there, nothing else!
Anyway, here’s what you can do/set/change:
[li]ip: The IP of the server the players should connect to.[/li] [li]textfile: If set, it will read the IP from the specified file. (Overwrites IP-keyvalue/SetIP-input)[/li][/ul]

[li]Start Disabled[1]: If checked, this trigger will start inactive. You can activate it by using the enable/toggle inputs[/li] [li]Admins Only[16]: If checked, only admins are allowed to use this trigger.[/li][/ul]

[li]Enable: Enables the entity.[/li] [li]Disable: Disables the entity.[/li] [li]Toggle: Toggles the disabled/enabled state of this entity[/li] [li]SetIP: Set the IP to which the players should connect to.[/li] [li]SetIPFile: Sets the Text File to read the IP from. (Overwrites IP-keyvalue/SetIP-input)[/li][/ul]

[li]OnStartTouch: Is fired when a player has touched the entity and begins reconnecting to the new server.[/li][/ul]

Download: FileSmelt
Wiki page: trigger_serverconnect
A forge game data file is included too, so you just have to add that in hammer and it will appear in the brush-based entity class drop-down menu.

This may be unhelpful but im not sure if the ports are needed, and two, are you using double quotes in your connect command? if not it will fail

[editline] 5:16 PM [/editline]

E.g. “Connect ###.###.#.###”

[editline] 12:13 AM [/editline]


You only have to add the port if it’s something else than 27015.

YAY it works thanks silverlan and thank you to every one else that helped

Better still, you’ve done my job for me and wiki’d it too!

Im working on a Map with the best servers, floors for grups (RP…)
But the server connecter gives crazy lua errors and does nothing D: