I currently own two servers and I have tried adding a command so when I type It takes me from my TTT server to my death run and the other way round.
My current lua for this
function join_dr( ply )
ply:SendLua( 'RunConsoleCommand( "connect" ,"193.0.159.202:27465" )' )
end
hook.Add( "PlayerSay", "Commands", Commands )
function Commands( ply, text, public )
elseif( string.sub( text, 1, 4) == "!ttt" ) then
print("used !dr")
join_dr( ply )
end
end
Can anyone help me out? Because it works sometimes when i try it but it says something about this not being a correct ip but when i try and type it in manually to console it works.
function join_dr( ply )
ply:SendLua( 'RunConsoleCommand( "connect" ,"193.0.159.202:27465" )' )
end
hook.Add( "PlayerSay", "Commands", Commands )
function Commands( ply, text, public )
elseif( string.sub( text, 1, 4) == "!ttt" ) then --- This should be if not elseif
print("used !dr")
join_dr( ply )
end
end