• Auto Connect
    9 replies, posted
Can someone please write me a quick script that will allow a player when they join it reconnects them to another server?
[url]http://www.facepunch.com/threads/1157323[/url]
that code didnt work.
[QUOTE=ne0nz;34512128]that code didnt work.[/QUOTE] Make sure you use Bawbag's code, mine is wrong.
He didnt really have a code... if he does where is it?
[quote]wizardsbane posted: hook.Add("PlayerSpawn", "connect_elsewhere", function(ply) ply:ConCommand("connect SERVER_IP_HERE") end) This needs to be on the serverside, by the by. [/quote] [quote] Will throw an engine error. You need to tell the client from the server to run the command. Edited: hook.Add("InitPostEntity" , 0 , function() LocalPlayer():ConCommand("connect x") end ) [/quote]
[QUOTE=Keyword;34515403][/QUOTE] Yes, But i dont know where to place the code and how it should look..
Make a new file in lua/autorun in your server named redirect.lua In there put [lua] if ( CLIENT ) then hook.Add( "InitPostEntity", "doRedirect", function( ) local TO_IP = "8.8.8.8"; LocalPlayer():ConCommand( "connect " .. TO_IP ); end) else AddCSLuaFile( 'redirect.lua' ); end [/lua]
[QUOTE=zzaacckk;34525617]Make a new file in lua/autorun in your server named redirect.lua In there put [lua] if ( CLIENT ) then hook.Add( "InitPostEntity", "doRedirect", function( ) local TO_IP = "8.8.8.8"; LocalPlayer():ConCommand( "connect " .. TO_IP ); end) end [/lua][/QUOTE] This didn't work. I just tryed it.
My bad, try that.
Sorry, you need to Log In to post a reply to this thread.