Have i used variables correctly my script?


local servername = enterservernamehere
local server1 = entergamemodehere
local server1ip = enterserveriphere

-- Do not edit below this line.

local DrawServerJoiner = vgui.Create( "DFrame" )
Frame:SetTitle( servername .. "Server Changer!" )
Frame:SetSize( 300, 300 )
Frame:Center()
Frame:MakePopup()
Frame.Paint = function( self, w, h ) 
	draw.RoundedBox( 0, 0, 0, w, h, Color( 231, 76, 60, 150 ) ) 
end

local Button = vgui.Create( "DButton", Frame )
Button:SetText( "Join our" .. server1 )
Button:SetTextColor( Color( 255, 255, 255 ) )
Button:SetPos( 100, 100 )
Button:SetSize( 100, 30 )
Button.Paint = function( self, w, h )
	draw.RoundedBox( 0, 0, 0, w, h, Color( 41, 128, 185, 250 ) ) -- Draw a blue button
end
Button.DoClick = function()
    Msg( .. v:Nick() .. "Changing server now!" )
	coroutine.wait(3)
	JoinServer( .. server1ip ..)
end

This is my code, will this work or not? im running it on the client.

Run it, if it shows errors, then it doesn’t work.


JoinServer( .. server1ip ..)

Not sure what are you trying to do here, but looks fancy.

[lua]local DrawServerJoiner = vgui.Create( “DFrame” )
Frame:SetTitle( servername … “Server Changer!” )[/lua]

if you actually try running your script it’ll tell you the errors :slight_smile: such as 1 big obvious thing is that Frame is undefined, you probably meant DrawServerJoiner

JoinServer isn’t available in the client state.