• A chat command to connect to another server
    7 replies, posted
Hello! I am requesting a chat command that you can type in and it will send you to another server. Such as "!Server2" will send you to another server
[lua]hook.Add("PlayerSay", "Cmd", function(pl,text) if string.find(text, string.sub( "!Server2", 1) ) then pl:ConCommand( "connect IPADDRESSGOESHERE" ) return false end end)[/lua]
[QUOTE=Jova;23023034][lua]hook.Add("PlayerSay", "Cmd", function(pl,text) if string.find(text, string.sub( "!Server2", 1) ) then pl:ConCommand( "connect IPADDRESSGOESHERE" ) return false end end)[/lua][/QUOTE] 1) connect is blocked in ConCommand 2) return "" (an empty string) instead of returning false
return false does the same thing.
[QUOTE=Jova;23040362]return false does the same thing.[/QUOTE] Return an empty string or lots of things will fuck up
So what should I put?
[QUOTE=erie1555;23042075]So what should I put?[/QUOTE] [QUOTE=CombineGuru;23023828][b]return "" (an empty string)[/b] instead of returning false[/QUOTE] [code]hook.Add("PlayerSay", "Cmd", function(pl,text) if string.find(text, string.sub( "!Server2", 1) ) then pl:ConCommand( "connect IPADDRESSGOESHERE" ) return "" end end)[/code]
nvm
Sorry, you need to Log In to post a reply to this thread.