ULX Motd Button Problem

Hello, I am having some problems with my ULX MOTD I am tryin to add 2 buttons, I agree and one that says I Disagree, but the problem is that I can’t not see the “I agree” button when I go ingame and can only see the Disagree button, please help, thanks

[lua]ulx.motdmenu_exists = true

local isUrl
local url

function ulx.showMotdMenu()
local window = vgui.Create( “DFrame” )
if ScrW() > 640 then – Make it larger if we can.
window:SetSize( ScrW()*0.9, ScrH()*0.9 )
else
window:SetSize( 640, 480 )
end
window:Center()
window:SetTitle( “ULX MOTD” )
window:SetVisible( true )
window:MakePopup()

local html = vgui.Create( "HTML", window )

local button = vgui.Create( "DButton", window )
button:SetText( "I agree" )
button.DoClick = function() 
	window:Close()
	RunConsoleCommand("say", "I accept the server rules.") 
end
button:SetSize( 100, 40 )
button:SetPos( (window:GetWide() - button:GetWide()) / 3, window:GetTall() - button:GetTall() - 10 )

local button2 = vgui.Create( "DButton", window )
button:SetText( "I disagree" )
button.DoClick = function() 
	RunConsoleCommand( "disconnect" )
	RunConsoleCommand("say", "I do not accept these rules and will not be kicked.") 
end
html:SetSize( window:GetWide() - 20, window:GetTall() - button:GetTall() - 50 )
html:SetPos( 10, 30 )
if not isUrl then
	html:SetHTML( file.Read( "ulx/motd.txt" ) )
else
	html:OpenURL( url )
end

end

function ulx.rcvMotd( isUrl_, text )
isUrl = isUrl_
if not isUrl then
file.Write( “ulx/motd.txt”, text )
else
if text:find( “://”, 1, true ) then
url = text
else
url = “http://” … text
end
end
end
[/lua]

Excuse me as I am still learning really basic Lua and may be completely wrong, but I believe that you are overwriting the first button you defined with the information that was meant for the second button.


local button = vgui.Create( "DButton", window )
    button:SetText( "I agree" )
    button.DoClick = function()
        window:Close()
        RunConsoleCommand("say", "I accept the server rules.")
    end
    button:SetSize( 100, 40 )
    button:SetPos( (window:GetWide() - button:GetWide()) / 3, window:GetTall() - button:GetTall() - 10 )


local button2 = vgui.Create( "DButton", window )
    **button**:SetText( "I disagree" )
    **button**.DoClick = function()
        RunConsoleCommand( "disconnect" )
        RunConsoleCommand("say", "I do not accept these rules and will not be kicked.")
    end

I believe the solution to your problem would be to change all occurrences of “button” to “button2” from when button2 is defined and on.

EDIT: I was wrong, you’re right.

“I do not accept these rules and will not be kicked.” ?