Server Jumper

hello
i am working on a server jumper. this is my first script and im not very good with lua.

http://screencloud.net//img/screenshots/745c5dcba98e69a03f78528ae96b5b60.png

i have made a menu that popps up when people type !server in chat, the menu poppes up with buttons, each button has a server name and when you klick on it, it will connect you to the server.
i am using this command


local b = vgui.Create("DButton",DFrame1) 
		b:SetPos( 20, 90 )
		b:SetSize(160,25)
		b:SetText("slender 2")
		b.DoClick = function()
			RunConsoleCommand("connect","91.121.222.159:35000")
			if IsValid(bg) then
				bg:Close()
			end
		end

when i klick the button, it tries to connect to the server(the loading screen comes up and it says connecting to server on the bottom right)
then i get this in console
Bad server address (“91.121.222.159:34000”)

can anyone help me fix this?

You would use

[lua]LocalPlayer():ConCommand(“connect 91.121.222.159:35000”)[/lua]

thank you

Is it possible that I can see the rest of the code for this I am working on something like this and dont know how to make it work ?

[editline]9th September 2013[/editline]

my server jumper is now complete

http://screencloud.net//img/screenshots/b371032da092b7a147af3ee78ba71a95.png

[editline]9th September 2013[/editline]

add me on steam

I added you

I’m quite certain that connect is blocked by source.
Unless Player:ConCommand() isn’t blocked by RunConsoleCommand()'s limitations.
In which case I’ve been wasting time with webpage workarounds this whole time.

i used


LocalPlayer():ConCommand("connect 91.121.222.159:35000")

and it worked fine

SON OF A