Help❓ Binding My Menu Help Me :(

Posts 1–7 of 7 · Page 1 of 1
❓ Binding My Menu Help Me :(
Hello .. this is a really skiddy thing to ask but could anyone help me with giving me some code that could open my menu when I press the insert key, please? and I know how to make derma menu's and stuff like that, but I made my own menu with a bit of code that I thought would work but I must be doing something wrong? please help


This isn't my menu, just a some random frame I pasted in from something else (can't remember) so you could get a better idea on how you could make the menu pop up when I press the insert key
Code:
local function RandomMenu()
Frame = vgui.Create("DFrame")
Frame:SetSize( 280 , 270 )
Frame:SetPos( ScrW() / 2 - Frame:GetWide() / 2 , ScrH() / 2 - Frame:GetTall() / 2  )
Frame:SetTitle("Shit Menu")
Frame:SetVisible( true )
Frame:ShowCloseButton( true )
Frame.Paint = function()
        draw****undedBox( 8, 0, 0, Frame:GetWide(), Frame:GetTall(), Color( 0,0,0,110 ) )
end
Frame:MakePopup()
end
concommand.Add("+RandomMenu", RandomMenu)

function Fail()
	if input.IsKeyDown ( KEY_INSERT ) then
		RunConsoleCommand("+RandomMenu")
	end	
end
hook.Add("Think", "fail", Fail)
asdasdasdasdasd
my menu leak?!?!??!?!?
Why make a console command when you have a designated key to open the menu ;-;
Code:
local function RandomMenu()
if LocalPlayer():KeyDown(KEY_INSERT) then
local Frame = vgui.Create("DFrame")
Frame:SetSize( 280 , 270 )
Frame:SetPos( ScrW() / 2 - Frame:GetWide() / 2 , ScrH() / 2 - Frame:GetTall() / 2  )
Frame:SetTitle("Shit Menu")
Frame:SetVisible( true )
Frame:ShowCloseButton( true )
Frame.Paint = function()
        draw****undedBox( 8, 0, 0, Frame:GetWide(), Frame:GetTall(), Color( 0,0,0,110 ) )
	end

Frame:MakePopup()
end end

hook.Add("Think",  tostring(math.random(666,12938122)), RandomMenu)
Quote Originally Posted by max1612 View Post
Code:
local function RandomMenu()
if LocalPlayer():KeyDown(KEY_INSERT) then
local Frame = vgui.Create("DFrame")
Frame:SetSize( 280 , 270 )
Frame:SetPos( ScrW() / 2 - Frame:GetWide() / 2 , ScrH() / 2 - Frame:GetTall() / 2  )
Frame:SetTitle("Shit Menu")
Frame:SetVisible( true )
Frame:ShowCloseButton( true )
Frame.Paint = function()
        draw****undedBox( 8, 0, 0, Frame:GetWide(), Frame:GetTall(), Color( 0,0,0,110 ) )
	end

Frame:MakePopup()
end end

hook.Add("Think",  tostring(math.random(666,12938122)), RandomMenu)
Thanks, it pops up when i press insert but its a bit broken.. like over 60 of the menu pops up instead of one of it popping up.. could you please fix it
this is exactly what my fail did in the coding at the top.. but this one doesn't create errors when i try to close it
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us