• Join a server via a command?
    5 replies, posted
I was thinking about doing this,Does anyone have a script where for example i am playing on 127.0.0.2 and i wanted to join 127.0.0.1 i could do this via a command like !join_ttt or something like that? [editline]11th June 2013[/editline] Thinking about something like this but with a chat command? hook.Add( "PlayerInitialSpawn", "<span class="highlight">Command</span> on <span class="highlight">Join</span>", function( ply ) ply:ConCommand( "my_command" ) end )
First of all use lua tag "[lua.][/lua]"
[lua]hook.Add("PlayerSay", "Join Commands", function(player, text, bTeam) if (text == "!join_ttt") then player:ConCommand("connect IP:PORT"); return; -- You can remove this return, this is just to prevent the chat showing "!join_ttt" end; end);[/lua]
IIRC, you can do it clientside using LocalPlayer():ConCommand()
[QUOTE=BoowmanTech;40994646]First of all use lua tag "[lua.][/lua]"[/QUOTE] Second of all use [noparse][noparse][/noparse][/noparse] around [noparse][lua][/lua][/noparse]
Third of all cry when editing any post that uses the lua tags :(
Sorry, you need to Log In to post a reply to this thread.