Entity sending to a server

I have been trying ot make so when you touch this entity it sends you to another server. But its not working yes the ip works.
It put up like im connecting to a server but still it just stays at connecting. I have tryied other ips too.

[lua]
function ENT:Touch( hitEnt )
if ( hitEnt:IsValid() and hitEnt:IsPlayer() ) then
hitEnt:SendLua(“LocalPlayer():ConCommand(‘connect 69.162.67.19:27015’)”)
end
end
[/lua]

First of all… Why dont you make it ENT:Use() instead…

Cause its going to be a portal.

i never used this but hitent seems to return the player, so does [lua]function ENT:Touch( hitEnt )
if ( hitEnt:IsValid() and hitEnt:IsPlayer() ) then
hitEnt:ConCommand(“connect 69.162.67.19:27015”)
end
end[/lua]
work?

No it doesn’t.

Try **[G.RunConsoleCommand

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=G.RunConsoleCommand)**. Player.ConCommand is depreciated clientside.

Isn’t ‘connect’ one of the blocked commands?

Nope still its being stupid.

[lua]function ENT:StartTouch( hitEnt )
if ( hitEnt:IsValid() and hitEnt:IsPlayer() ) then
hitEnt:SendLua(“LocalPlayer():ConCommand([[connect 69.162.67.19:27015]])”)
end
end[/lua]

Use this.