a rather odd problem with my script/running it in game.

so i set up a server to test out an addon i made, so i put cl_init in the servers lua/autorun/client, and the server in the lua/autorun/server. which seems to work, but when i load up the server and i join, i get a client error, that say this:

[ERROR] addons/interaction menu/lua/autorun/client/cl_init.lua:4: attempt to index local ‘frame’ (a nil value)

  1. unknown - addons/interaction menu/lua/autorun/client/cl_init.lua:4

which is not true, the dframe has been tied to frame. but heres the weird part.

so when i load it, gives me that error, and pressing tab + r (to bring up the menu) does not work. but, if i open the cl_init.lua file in the autorun/client folder, and save it while im in it it works just fine in game. i dont even have to edit it, it just poof works.

code:


local ply = LocalPlayer()

local frame = vgui.Create("DFrame")
frame:SetSize(160,500)
frame:SetVisible(true)
frame:SetTitle( "Interaction Menu" )
frame:SetDraggable( true )
frame:SetSizable( true )
frame:SetPos (ScrW, ScrH)
frame:ShowCloseButton( false )
frame.Paint = function(s , w , h)

	draw.RoundedBox(20,0,0,w , h,Color(0,0,255))
	draw.RoundedBox(20,2,2,w-4 , h-4,Color(0,128,255))

end

hook.Add( "Tick", "KeyDown_Test", function()
	if ( Entity( 1 ):KeyDown( IN_RELOAD ) ) and ( Entity( 1 ):KeyDown( IN_SCORE ) ) then
		frame:SetVisible( true )
	end
end )

local label = vgui.Create( "DLabel", panel )
label:SetPos( 5 , 20 )
label:SetText( "Actions" )
label:SetParent( frame )


local Action = vgui.Create( "DButton" )
Action:SetPos( 5, 40 )
Action:SetText( "Dance" )
Action:SetSize( 40, 20 )
Action:SetParent( frame )	
Action.DoClick = function()
	ply:ConCommand( "act dance" )
end

local Action = vgui.Create( "DButton" )
Action:SetPos( 50, 40 )
Action:SetText( "Muscle" )
Action:SetSize( 40, 20 )
Action:SetParent( frame )	
Action.DoClick = function()
	ply:ConCommand( "act muscle" )
end

local Action = vgui.Create( "DButton" )
Action:SetPos( 5, 70 )
Action:SetText( "Zombie" )
Action:SetSize( 40, 20 )
Action:SetParent( frame )	
Action.DoClick = function()
	ply:ConCommand( "act zombie" )
end

local Action = vgui.Create( "DButton" )
Action:SetPos( 50, 70 )
Action:SetText( "Fri Rie" )
Action:SetSize( 40, 20 )
Action:SetParent( frame )	
Action.DoClick = function()
	ply:ConCommand( "act pers" )
end

local Action = vgui.Create( "DButton" )
Action:SetPos( 5, 100 )
Action:SetText( "Point" )
Action:SetSize( 40, 20 )
Action:SetParent( frame )	
Action.DoClick = function()
	ply:ConCommand( "act forward" )
end

local Action = vgui.Create( "DButton" )
Action:SetPos( 50, 100 )
Action:SetText( "Salute" )
Action:SetSize( 40, 20 )
Action:SetParent( frame )	
Action.DoClick = function()
	ply:ConCommand( "act salute" )
end

local Action = vgui.Create( "DButton" )
Action:SetPos( 27, 130 )
Action:SetText( "no no" )
Action:SetSize( 40, 20 )
Action:SetParent( frame )	
Action.DoClick = function()
	ply:ConCommand( "act disagree" )
end

local label = vgui.Create( "DLabel", panel )
label:SetPos( 5 , 165 )
label:SetText( "WAC Spawner" )
label:SetSize( 200, 30 )
label:SetParent( frame )

local label = vgui.Create( "DLabel", panel )
label:SetPos( 5 , 180 )
label:SetText( "**COMING SOON!**" )
label:SetSize( 200, 30 )
label:SetParent( frame )

local SPAWNAH6J = vgui.Create( "DButton" )
SPAWNAH6J:SetPos( 5, 220 )
SPAWNAH6J:SetText( "AH6J LITTLE BIRD" )
SPAWNAH6J:SetSize( 140, 30 )
SPAWNAH6J:SetParent( frame )	
SPAWNAH6J.DoClick = function()
RunConsoleCommand( "say" , "I cant read!" )	
--	net.Start("SPAWNAH6J")
--	net.SendToServer()
end

local SPAWNAH1Z = vgui.Create( "DButton" )
SPAWNAH1Z:SetPos( 5, 260 )
SPAWNAH1Z:SetText( "AH1Z VIPER" )
SPAWNAH1Z:SetSize( 140, 30 )
SPAWNAH1Z:SetParent( frame )	
SPAWNAH1Z.DoClick = function()
RunConsoleCommand( "say" , "I cant read!" )	
net.Start("SPAWNAH1Z")
net.SendToServer()
end

local SPAWNF86 = vgui.Create( "DButton" )
SPAWNF86:SetPos( 5, 300 )
SPAWNF86:SetText( "F86 SABRE" )
SPAWNF86:SetSize( 140, 30 )
SPAWNF86:SetParent( frame )	
SPAWNF86.DoClick = function()
RunConsoleCommand( "say" , "I cant read!" )	
net.Start("SPAWNF86")
net.SendToServer()
end

local SPAWN206B = vgui.Create( "DButton" )
SPAWN206B:SetPos( 5, 340 )
SPAWN206B:SetText( "206B AMPHIBIOUS" )
SPAWN206B:SetSize( 140, 30 )
SPAWN206B:SetParent( frame )
SPAWN206B.DoClick = function()
RunConsoleCommand( "say" , "I cant read!" )	
net.Start("SPAWN206B")
net.SendToServer()
end


local label = vgui.Create( "DLabel", panel )
label:SetPos( 5 , 380 )
label:SetText( "Commands" )
label:SetSize( 200, 50 )
label:SetParent( frame )

local GetTriggered = vgui.Create( "DButton" )
GetTriggered:SetPos( 5, 460 )
GetTriggered:SetText( "Get Triggered." )
GetTriggered:SetSize( 150, 30 )
GetTriggered:SetParent( frame )
GetTriggered.DoClick = function()
	net.Start("GetTriggered")
	net.SendToServer()
--	RunConsoleCommand( "say" , "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄" )
--	RunConsoleCommand( "say" , "░░░░█I█M█T█R█I█G█G█E█R█E█D██▄▄░░░░" )
--	RunConsoleCommand( "say" , "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀" )
end

local SayRandom = vgui.Create( "DButton" )
SayRandom:SetPos( 5, 420 )
SayRandom:SetText( "Say something random" )
SayRandom:SetSize( 150, 30 )
SayRandom:SetParent( frame )	
SayRandom.DoClick = function()
	net.Start("SayRandom")
	net.SendToServer()
	local Random = math.random( 1, 6 )
	if Random == 1 then
	RunConsoleCommand( "say" , "This server is gay af." )
	end
	if Random == 2 then
		RunConsoleCommand( "say" , "Oh yeah, Mr.Krabs." )
	end
	if Random == 3 then
		RunConsoleCommand( "say" , "(PM) i see you :)." )
	end
	if Random == 4 then
		RunConsoleCommand( "say" , "You fuckin squeaker ass potato lookin fuckin bitch ass little hoe" )
	end
	if Random == 5 then
		RunConsoleCommand( "say" , "All KKK, cum meet me at mid for a meeting." )
	end
	if Random == 6 then
		RunConsoleCommand( "say" , "https://bad-dragon.com" )
	end
end

local KYSFAJIT = vgui.Create( "DButton" )
KYSFAJIT:SetPos( 5, 500 )
KYSFAJIT:SetText( "KYS fajit" )
KYSFAJIT:SetSize( 150, 30 )
KYSFAJIT:SetParent( frame )	
KYSFAJIT.DoClick = function()
	net.Start("KYS")
	net.SendToServer()
end

local HidePanel = vgui.Create( "DButton" )
HidePanel:SetPos( 110, 20 )
HidePanel:SetText( "Hide" )
HidePanel:SetSize( 40, 100 )
HidePanel:SetParent( frame )	
HidePanel.DoClick = function()
	frame:Hide()
end

-- ==========SETTINGS==========

local settingsframe = vgui.Create("DFrame")
settingsframe:SetSize(160,500)
settingsframe:SetVisible( false )
settingsframe:SetTitle( "Settings Menu" )
settingsframe:ShowCloseButton( false )
settingsframe:SetDraggable( true )
settingsframe:SetPos (ScrW, ScrH)
settingsframe:MakePopup ( false )
settingsframe.Paint = function(s , w , h)

	draw.RoundedBox(20,0,0,w , h,Color(0,0,255))
	draw.RoundedBox(20,2,2,w-4 , h-4,Color(0,128,255))

end

local SettingsPanel = vgui.Create( "DButton" )
SettingsPanel:SetPos( 110, 140 )
SettingsPanel:SetText( "Settings" )
SettingsPanel:SetSize( 40, 40 )
SettingsPanel:SetParent( frame )
SettingsPanel.DoClick = function()
	settingsframe:Show()
	frame:Hide()
end

local ControlBoard = vgui.Create( "DButton" )
ControlBoard:SetPos( 20, 20 )
ControlBoard:SetText( "This bitch empty!" )
ControlBoard:SetSize( 100, 100 )
ControlBoard:SetParent( settingsframe )
ControlBoard.DoClick = function()
	settingsframe:Hide()
	frame:Show()
	RunConsoleCommand( "say" , "Idk who made this shit interaction menu, but something tells me its in alpha. And maybe it got coded in one night..." )
end

because the script is ran too early; try creating your elements in an InitPostEntity hook

just in case, heres the server code.


util.AddNetworkString("KYS" )
util.AddNetworkString("SPAWNAH6J" )
util.AddNetworkString("SPAWNAH1Z" )
util.AddNetworkString("SPAWNF86" )
util.AddNetworkString("SPAWN206B" )
util.AddNetworkString("GetTriggered" )
util.AddNetworkString("SayRandom" )
util.AddNetworkString("RESPAWN" )

function PlayerDisconnected( ply )
	 PrintMessage( HUD_PRINTTALK, ply:Name().. " has givin up on life and left." )
end

function PlayerConnect( name, ip )
	PrintMessage( HUD_PRINTTALK, name .. " joined." )
	print( name .. " connected." )
	print( ip .. " connected." )
	if name == ( "darpeyface" ) then
		PrintMessage( HUD_PRINTTALK, "O SHIT IS DAT BOI." )
		print( name .. " connected." )
	end
	if name == ( "[APR]JonLePotatoPhone" ) then
		PrintMessage( HUD_PRINTTALK, "The Potato Messiah Has Entered" )
		print( name .. " connected." )
	end
end

net.Receive("KYS",function(len, ply)

	print ("Suicide gun givin to", Entity( 1 ):GetName() )
	ply:Give( "weapon_suicidegun" )
	RunConsoleCommand( "say" , "Well, this is pretty homosexual. Fuck this." )
	
end)

net.Receive("SPAWNAH6J",function(len, ply)

	print ("AH6J Spawned by", Entity( 1 ):GetName() )
	ply:Give( "wac_hc_littlebird_ah6" )
	
end)

net.Receive("SPAWNAH1Z",function(len, ply)

	print ("AH1Z Spawned by", Entity( 1 ):GetName() )
	ply:Give( "wac_hc_ah1z_viper" )
	
end)

net.Receive("SPAWNF86",function(len, ply)

	print ("F86 Spawned by", Entity( 1 ):GetName())
	ply:Give( "wac_pl_f86" )
	
end)

net.Receive("SPAWN206B",function(len, ply)

--	local heli = wac_hc_206b_amphib
	print ("206B Spawned by", Entity( 1 ):GetName() )
	ply:Give( "wac_hc_206b_amphib" )
--	heli:SetBodygroup( 1, 1 )
	
end)
net.Receive("GetTriggered",function(len, ply)

	print ( Entity( 1 ):GetName(), "was triggered." )
	PrintMessage( 3, Entity( 1 ):GetName() )
	PrintMessage( 3, "█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█" )
	PrintMessage( 3, "█░░░░▄▄█I█M█T█R█I█G█G█E█R█E█D██▄▄░░░░█" )
	PrintMessage( 3, "█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█" )
	
end)

net.Receive("SayRandom",function(len, ply)

	print ("this message is random btw, dont get pissey. Sent by:", Entity( 1 ):GetName() )
	
end)

[editline]26th August 2016[/editline]

could you elaborate on creating elements in that hook? like would i do a function at the top? i just started coding, but i used the code blue tutorials, which helped a lot.

[editline]26th August 2016[/editline]

what would i put in this (from the wiki)


function GM:InitPostEntity()
	print( "All Entities have initialized" )
end

[editline]26th August 2016[/editline]

i just joined, idk how to post without editing my post lol

[editline]26th August 2016[/editline]

well, i did this


function InitPostEntity()
	local ply = LocalPlayer()

	local frame = vgui.Create("DFrame")
	frame:SetSize(160,500)
	frame:SetVisible(true)
	frame:SetTitle( "Interaction Menu" )
	frame:SetDraggable( true )
	frame:SetSizable( true )
	frame:SetPos (ScrW, ScrH)
	frame:ShowCloseButton( false )
	frame.Paint = function(s , w , h)

		draw.RoundedBox(20,0,0,w , h,Color(0,0,255))
		draw.RoundedBox(20,2,2,w-4 , h-4,Color(0,128,255))

	end

	hook.Add( "Tick", "KeyDown_Test", function()
		if ( Entity( 1 ):KeyDown( IN_RELOAD ) ) and ( Entity( 1 ):KeyDown( IN_SCORE ) ) then
			frame:SetVisible( true )
		end
	end )

	local label = vgui.Create( "DLabel", panel )
	label:SetPos( 5 , 20 )
	label:SetText( "Actions" )
	label:SetParent( frame )


	local Action = vgui.Create( "DButton" )
	Action:SetPos( 5, 40 )
	Action:SetText( "Dance" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act dance" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 50, 40 )
	Action:SetText( "Muscle" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act muscle" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 5, 70 )
	Action:SetText( "Zombie" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act zombie" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 50, 70 )
	Action:SetText( "Fri Rie" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act pers" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 5, 100 )
	Action:SetText( "Point" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act forward" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 50, 100 )
	Action:SetText( "Salute" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act salute" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 27, 130 )
	Action:SetText( "no no" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act disagree" )
	end

	local label = vgui.Create( "DLabel", panel )
	label:SetPos( 5 , 165 )
	label:SetText( "WAC Spawner" )
	label:SetSize( 200, 30 )
	label:SetParent( frame )

	local label = vgui.Create( "DLabel", panel )
	label:SetPos( 5 , 180 )
	label:SetText( "**COMING SOON!**" )
	label:SetSize( 200, 30 )
	label:SetParent( frame )

	local SPAWNAH6J = vgui.Create( "DButton" )
	SPAWNAH6J:SetPos( 5, 220 )
	SPAWNAH6J:SetText( "AH6J LITTLE BIRD" )
	SPAWNAH6J:SetSize( 140, 30 )
	SPAWNAH6J:SetParent( frame )	
	SPAWNAH6J.DoClick = function()
	RunConsoleCommand( "say" , "I cant read!" )	
	--	net.Start("SPAWNAH6J")
	--	net.SendToServer()
	end

	local SPAWNAH1Z = vgui.Create( "DButton" )
	SPAWNAH1Z:SetPos( 5, 260 )
	SPAWNAH1Z:SetText( "AH1Z VIPER" )
	SPAWNAH1Z:SetSize( 140, 30 )
	SPAWNAH1Z:SetParent( frame )	
	SPAWNAH1Z.DoClick = function()
	RunConsoleCommand( "say" , "I cant read!" )	
	net.Start("SPAWNAH1Z")
	net.SendToServer()
	end

	local SPAWNF86 = vgui.Create( "DButton" )
	SPAWNF86:SetPos( 5, 300 )
	SPAWNF86:SetText( "F86 SABRE" )
	SPAWNF86:SetSize( 140, 30 )
	SPAWNF86:SetParent( frame )	
	SPAWNF86.DoClick = function()
	RunConsoleCommand( "say" , "I cant read!" )	
	net.Start("SPAWNF86")
	net.SendToServer()
	end

	local SPAWN206B = vgui.Create( "DButton" )
	SPAWN206B:SetPos( 5, 340 )
	SPAWN206B:SetText( "206B AMPHIBIOUS" )
	SPAWN206B:SetSize( 140, 30 )
	SPAWN206B:SetParent( frame )
	SPAWN206B.DoClick = function()
	RunConsoleCommand( "say" , "I cant read!" )	
	net.Start("SPAWN206B")
	net.SendToServer()
	end


	local label = vgui.Create( "DLabel", panel )
	label:SetPos( 5 , 380 )
	label:SetText( "Commands" )
	label:SetSize( 200, 50 )
	label:SetParent( frame )

	local GetTriggered = vgui.Create( "DButton" )
	GetTriggered:SetPos( 5, 460 )
	GetTriggered:SetText( "Get Triggered." )
	GetTriggered:SetSize( 150, 30 )
	GetTriggered:SetParent( frame )
	GetTriggered.DoClick = function()
		net.Start("GetTriggered")
		net.SendToServer()
	--  RunConsoleCommand( "say" , "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄" )
	--  RunConsoleCommand( "say" , "░░░░█I█M█T█R█I█G█G█E█R█E█D██▄▄░░░░" )
	--	RunConsoleCommand( "say" , "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀" )
	end

	local SayRandom = vgui.Create( "DButton" )
	SayRandom:SetPos( 5, 420 )
	SayRandom:SetText( "Say something random" )
	SayRandom:SetSize( 150, 30 )
	SayRandom:SetParent( frame )	
	SayRandom.DoClick = function()
		net.Start("SayRandom")
		net.SendToServer()
		local Random = math.random( 1, 6 )
		if Random == 1 then
		RunConsoleCommand( "say" , "This server is gay af." )
		end
		if Random == 2 then
			RunConsoleCommand( "say" , "Oh yeah, Mr.Krabs." )
		end
		if Random == 3 then
			RunConsoleCommand( "say" , "(PM) i see you :)." )
		end
		if Random == 4 then
			RunConsoleCommand( "say" , "You fuckin squeaker ass potato lookin fuckin bitch ass little hoe" )
		end
		if Random == 5 then
			RunConsoleCommand( "say" , "All KKK, cum meet me at mid for a meeting." )
		end
		if Random == 6 then
			RunConsoleCommand( "say" , "https://bad-dragon.com" )
		end
	end

	local KYSFAJIT = vgui.Create( "DButton" )
	KYSFAJIT:SetPos( 5, 500 )
	KYSFAJIT:SetText( "KYS fajit" )
	KYSFAJIT:SetSize( 150, 30 )
	KYSFAJIT:SetParent( frame )	
	KYSFAJIT.DoClick = function()
		net.Start("KYS")
		net.SendToServer()
	end

	local HidePanel = vgui.Create( "DButton" )
	HidePanel:SetPos( 110, 20 )
	HidePanel:SetText( "Hide" )
	HidePanel:SetSize( 40, 100 )
	HidePanel:SetParent( frame )	
	HidePanel.DoClick = function()
	frame:Hide()
	end

	-- ==========SETTINGS==========

		local settingsframe = vgui.Create("DFrame")
	settingsframe:SetSize(160,500)
	settingsframe:SetVisible( false )
	settingsframe:SetTitle( "Settings Menu" )
	settingsframe:ShowCloseButton( false )
	settingsframe:SetDraggable( true )
	settingsframe:SetPos (ScrW, ScrH)
	settingsframe:MakePopup ( false )
	settingsframe.Paint = function(s , w , h)

		draw.RoundedBox(20,0,0,w , h,Color(0,0,255))
		draw.RoundedBox(20,2,2,w-4 , h-4,Color(0,128,255))

	end

	local SettingsPanel = vgui.Create( "DButton" )
	SettingsPanel:SetPos( 110, 140 )
	SettingsPanel:SetText( "Settings" )
	SettingsPanel:SetSize( 40, 40 )
	SettingsPanel:SetParent( frame )
	SettingsPanel.DoClick = function()
		settingsframe:Show()
		frame:Hide()
	end

	local ControlBoard = vgui.Create( "DButton" )
	ControlBoard:SetPos( 20, 20 )
	ControlBoard:SetText( "This bitch empty!" )
	ControlBoard:SetSize( 100, 100 )
	ControlBoard:SetParent( settingsframe )
	ControlBoard.DoClick = function()
		settingsframe:Hide()
		frame:Show()
		RunConsoleCommand( "say" , "Idk who made this shit interaction menu, but something tells me its in alpha. And maybe it got coded in one night..." )
	end
end

and spent like 10 minutes on it, and now it wont load whenever i save. no errors though.

you need to elaborate on what you mean by elements. i dont get none of your cool coding words yet.

[lua]hook.Add(“InitPostEntity”, “You can type anything you want here as long as it’s unique to your addon”, function()
local ply = LocalPlayer()
local frame = vgui.Create(“DFrame”)

end )[/lua]

its working, suddenly starts working. thanks everyone :slight_smile:

[editline]26th August 2016[/editline]

oh yeah the amount of times that ive gone looking for a solution via google and the guy just ends the thread without a solution:


hook.Add("InitPostEntity", "BECUH I GOT HIGH BRUH", function()
	local WAC count = 0
	local ply = LocalPlayer()
	local frame = vgui.Create("DFrame")
	frame:SetSize(160,500)
	frame:SetVisible(true)
	frame:SetTitle( "Interaction Menu" )
	frame:SetDraggable( true )
	frame:SetSizable( true )
	frame:SetPos (ScrW, ScrH)
	frame:ShowCloseButton( false )
	frame.Paint = function(s , w , h)

		draw.RoundedBox(20,0,0,w , h,Color(0,0,255))
		draw.RoundedBox(20,2,2,w-4 , h-4,Color(0,128,255))

	end

	hook.Add( "Tick", "KeyDown_Test", function()
		if ( Entity( 1 ):KeyDown( IN_RELOAD ) ) and ( Entity( 1 ):KeyDown( IN_SCORE ) ) then
			frame:SetVisible( true )
		end
	end )

	local label = vgui.Create( "DLabel", panel )
	label:SetPos( 5 , 20 )
	label:SetText( "Actions" )
	label:SetParent( frame )


	local Action = vgui.Create( "DButton" )
	Action:SetPos( 5, 40 )
	Action:SetText( "Dance" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act dance" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 50, 40 )
	Action:SetText( "Muscle" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act muscle" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 5, 70 )
	Action:SetText( "Zombie" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act zombie" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 50, 70 )
	Action:SetText( "Fri Rie" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act pers" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 5, 100 )
	Action:SetText( "Point" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act forward" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 50, 100 )
	Action:SetText( "Salute" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act salute" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 27, 130 )
	Action:SetText( "no no" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act disagree" )
	end

	local label = vgui.Create( "DLabel", panel )
	label:SetPos( 5 , 165 )
	label:SetText( "WAC Spawner" )
	label:SetSize( 200, 30 )
	label:SetParent( frame )

	local label = vgui.Create( "DLabel", panel )
	label:SetPos( 5 , 180 )
	label:SetText( "**COMING SOON!**" )
	label:SetSize( 200, 30 )
	label:SetParent( frame )

	local SPAWNAH6J = vgui.Create( "DButton" )
	SPAWNAH6J:SetPos( 5, 220 )
	SPAWNAH6J:SetText( "AH6J LITTLE BIRD" )
	SPAWNAH6J:SetSize( 140, 30 )
	SPAWNAH6J:SetParent( frame )	
	SPAWNAH6J.DoClick = function()
	RunConsoleCommand( "say" , "I cant read!" )	
		net.Start("SPAWNAH6J")
		net.SendToServer()
	end

	local SPAWNAH1Z = vgui.Create( "DButton" )
	SPAWNAH1Z:SetPos( 5, 260 )
	SPAWNAH1Z:SetText( "AH1Z VIPER" )
	SPAWNAH1Z:SetSize( 140, 30 )
	SPAWNAH1Z:SetParent( frame )	
	SPAWNAH1Z.DoClick = function()
	RunConsoleCommand( "say" , "I cant read!" )	
	net.Start("SPAWNAH1Z")
	net.SendToServer()
	end

	local SPAWNF86 = vgui.Create( "DButton" )
	SPAWNF86:SetPos( 5, 300 )
	SPAWNF86:SetText( "F86 SABRE" )
	SPAWNF86:SetSize( 140, 30 )
	SPAWNF86:SetParent( frame )	
	SPAWNF86.DoClick = function()
	RunConsoleCommand( "say" , "I cant read!" )	
	net.Start("SPAWNF86")
	net.SendToServer()
	end

	local SPAWN206B = vgui.Create( "DButton" )
	SPAWN206B:SetPos( 5, 340 )
	SPAWN206B:SetText( "206B AMPHIBIOUS" )
	SPAWN206B:SetSize( 140, 30 )
	SPAWN206B:SetParent( frame )
	SPAWN206B.DoClick = function()
	RunConsoleCommand( "say" , "I cant read!" )	
	net.Start("SPAWN206B")
	net.SendToServer()
	end


	local label = vgui.Create( "DLabel", panel )
	label:SetPos( 5 , 380 )
	label:SetText( "Commands" )
	label:SetSize( 200, 50 )
	label:SetParent( frame )

	local GetTriggered = vgui.Create( "DButton" )
	GetTriggered:SetPos( 5, 460 )
	GetTriggered:SetText( "Get Triggered." )
	GetTriggered:SetSize( 150, 30 )
	GetTriggered:SetParent( frame )
	GetTriggered.DoClick = function()
		net.Start("GetTriggered")
		net.SendToServer()
	--  RunConsoleCommand( "say" , "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄" )
	--  RunConsoleCommand( "say" , "░░░░█I█M█T█R█I█G█G█E█R█E█D██▄▄░░░░" )
	--	RunConsoleCommand( "say" , "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀" )
	end

	local SayRandom = vgui.Create( "DButton" )
	SayRandom:SetPos( 5, 420 )
	SayRandom:SetText( "Say something random" )
	SayRandom:SetSize( 150, 30 )
	SayRandom:SetParent( frame )	
	SayRandom.DoClick = function()
		net.Start("SayRandom")
		net.SendToServer()
		local Random = math.random( 1, 6 )
		if Random == 1 then
		RunConsoleCommand( "say" , "This server is gay af." )
		end
		if Random == 2 then
			RunConsoleCommand( "say" , "Oh yeah, Mr.Krabs." )
		end
		if Random == 3 then
			RunConsoleCommand( "say" , "(PM) i see you :)." )
		end
		if Random == 4 then
			RunConsoleCommand( "say" , "You fuckin squeaker ass potato lookin fuckin bitch ass little hoe" )
		end
		if Random == 5 then
			RunConsoleCommand( "say" , "All KKK, cum meet me at mid for a meeting." )
		end
		if Random == 6 then
			RunConsoleCommand( "say" , "https://bad-dragon.com" )
		end
	end

	local KYSFAJIT = vgui.Create( "DButton" )
	KYSFAJIT:SetPos( 5, 500 )
	KYSFAJIT:SetText( "KYS fajit" )
	KYSFAJIT:SetSize( 150, 30 )
	KYSFAJIT:SetParent( frame )	
	KYSFAJIT.DoClick = function()
		net.Start("KYS")
		net.SendToServer()
	end

	local HidePanel = vgui.Create( "DButton" )
	HidePanel:SetPos( 110, 20 )
	HidePanel:SetText( "Hide" )
	HidePanel:SetSize( 40, 100 )
	HidePanel:SetParent( frame )	
	HidePanel.DoClick = function()
	frame:Hide()
	end

	-- ==========SETTINGS==========

		local settingsframe = vgui.Create("DFrame")
	settingsframe:SetSize(160,500)
	settingsframe:SetVisible( false )
	settingsframe:SetTitle( "Settings Menu" )
	settingsframe:ShowCloseButton( false )
	settingsframe:SetDraggable( true )
	settingsframe:SetPos (ScrW, ScrH)
	settingsframe:MakePopup ( false )
	settingsframe.Paint = function(s , w , h)

		draw.RoundedBox(20,0,0,w , h,Color(0,0,255))
		draw.RoundedBox(20,2,2,w-4 , h-4,Color(0,128,255))

	end

	local SettingsPanel = vgui.Create( "DButton" )
	SettingsPanel:SetPos( 110, 140 )
	SettingsPanel:SetText( "Settings" )
	SettingsPanel:SetSize( 40, 40 )
	SettingsPanel:SetParent( frame )
	SettingsPanel.DoClick = function()
		settingsframe:Show()
		frame:Hide()
	end

	local ControlBoard = vgui.Create( "DButton" )
	ControlBoard:SetPos( 20, 20 )
	ControlBoard:SetText( "This bitch empty!" )
	ControlBoard:SetSize( 100, 100 )
	ControlBoard:SetParent( settingsframe )
	ControlBoard.DoClick = function()
		settingsframe:Hide()
		frame:Show()
		RunConsoleCommand( "say" , "Idk who made this shit interaction menu, but something tells me its in alpha. And maybe it got coded in one night..." )
	end

end )

[editline]26th August 2016[/editline]

oh yeah the amount of times that ive gone looking for a solution via google and the guy just ends the thread without a solution:


hook.Add("InitPostEntity", "BECUH I GOT HIGH BRUH", function()
	local WAC count = 0
	local ply = LocalPlayer()
	local frame = vgui.Create("DFrame")
	frame:SetSize(160,500)
	frame:SetVisible(true)
	frame:SetTitle( "Interaction Menu" )
	frame:SetDraggable( true )
	frame:SetSizable( true )
	frame:SetPos (ScrW, ScrH)
	frame:ShowCloseButton( false )
	frame.Paint = function(s , w , h)

		draw.RoundedBox(20,0,0,w , h,Color(0,0,255))
		draw.RoundedBox(20,2,2,w-4 , h-4,Color(0,128,255))

	end

	hook.Add( "Tick", "KeyDown_Test", function()
		if ( Entity( 1 ):KeyDown( IN_RELOAD ) ) and ( Entity( 1 ):KeyDown( IN_SCORE ) ) then
			frame:SetVisible( true )
		end
	end )

	local label = vgui.Create( "DLabel", panel )
	label:SetPos( 5 , 20 )
	label:SetText( "Actions" )
	label:SetParent( frame )


	local Action = vgui.Create( "DButton" )
	Action:SetPos( 5, 40 )
	Action:SetText( "Dance" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act dance" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 50, 40 )
	Action:SetText( "Muscle" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act muscle" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 5, 70 )
	Action:SetText( "Zombie" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act zombie" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 50, 70 )
	Action:SetText( "Fri Rie" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act pers" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 5, 100 )
	Action:SetText( "Point" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act forward" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 50, 100 )
	Action:SetText( "Salute" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act salute" )
	end

	local Action = vgui.Create( "DButton" )
	Action:SetPos( 27, 130 )
	Action:SetText( "no no" )
	Action:SetSize( 40, 20 )
	Action:SetParent( frame )	
	Action.DoClick = function()
		ply:ConCommand( "act disagree" )
	end

	local label = vgui.Create( "DLabel", panel )
	label:SetPos( 5 , 165 )
	label:SetText( "WAC Spawner" )
	label:SetSize( 200, 30 )
	label:SetParent( frame )

	local label = vgui.Create( "DLabel", panel )
	label:SetPos( 5 , 180 )
	label:SetText( "**COMING SOON!**" )
	label:SetSize( 200, 30 )
	label:SetParent( frame )

	local SPAWNAH6J = vgui.Create( "DButton" )
	SPAWNAH6J:SetPos( 5, 220 )
	SPAWNAH6J:SetText( "AH6J LITTLE BIRD" )
	SPAWNAH6J:SetSize( 140, 30 )
	SPAWNAH6J:SetParent( frame )	
	SPAWNAH6J.DoClick = function()
	RunConsoleCommand( "say" , "I cant read!" )	
		net.Start("SPAWNAH6J")
		net.SendToServer()
	end

	local SPAWNAH1Z = vgui.Create( "DButton" )
	SPAWNAH1Z:SetPos( 5, 260 )
	SPAWNAH1Z:SetText( "AH1Z VIPER" )
	SPAWNAH1Z:SetSize( 140, 30 )
	SPAWNAH1Z:SetParent( frame )	
	SPAWNAH1Z.DoClick = function()
	RunConsoleCommand( "say" , "I cant read!" )	
	net.Start("SPAWNAH1Z")
	net.SendToServer()
	end

	local SPAWNF86 = vgui.Create( "DButton" )
	SPAWNF86:SetPos( 5, 300 )
	SPAWNF86:SetText( "F86 SABRE" )
	SPAWNF86:SetSize( 140, 30 )
	SPAWNF86:SetParent( frame )	
	SPAWNF86.DoClick = function()
	RunConsoleCommand( "say" , "I cant read!" )	
	net.Start("SPAWNF86")
	net.SendToServer()
	end

	local SPAWN206B = vgui.Create( "DButton" )
	SPAWN206B:SetPos( 5, 340 )
	SPAWN206B:SetText( "206B AMPHIBIOUS" )
	SPAWN206B:SetSize( 140, 30 )
	SPAWN206B:SetParent( frame )
	SPAWN206B.DoClick = function()
	RunConsoleCommand( "say" , "I cant read!" )	
	net.Start("SPAWN206B")
	net.SendToServer()
	end


	local label = vgui.Create( "DLabel", panel )
	label:SetPos( 5 , 380 )
	label:SetText( "Commands" )
	label:SetSize( 200, 50 )
	label:SetParent( frame )

	local GetTriggered = vgui.Create( "DButton" )
	GetTriggered:SetPos( 5, 460 )
	GetTriggered:SetText( "Get Triggered." )
	GetTriggered:SetSize( 150, 30 )
	GetTriggered:SetParent( frame )
	GetTriggered.DoClick = function()
		net.Start("GetTriggered")
		net.SendToServer()
	--  RunConsoleCommand( "say" , "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄" )
	--  RunConsoleCommand( "say" , "░░░░█I█M█T█R█I█G█G█E█R█E█D██▄▄░░░░" )
	--	RunConsoleCommand( "say" , "▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀" )
	end

	local SayRandom = vgui.Create( "DButton" )
	SayRandom:SetPos( 5, 420 )
	SayRandom:SetText( "Say something random" )
	SayRandom:SetSize( 150, 30 )
	SayRandom:SetParent( frame )	
	SayRandom.DoClick = function()
		net.Start("SayRandom")
		net.SendToServer()
		local Random = math.random( 1, 6 )
		if Random == 1 then
		RunConsoleCommand( "say" , "This server is gay af." )
		end
		if Random == 2 then
			RunConsoleCommand( "say" , "Oh yeah, Mr.Krabs." )
		end
		if Random == 3 then
			RunConsoleCommand( "say" , "(PM) i see you :)." )
		end
		if Random == 4 then
			RunConsoleCommand( "say" , "You fuckin squeaker ass potato lookin fuckin bitch ass little hoe" )
		end
		if Random == 5 then
			RunConsoleCommand( "say" , "All KKK, cum meet me at mid for a meeting." )
		end
		if Random == 6 then
			RunConsoleCommand( "say" , "https://bad-dragon.com" )
		end
	end

	local KYSFAJIT = vgui.Create( "DButton" )
	KYSFAJIT:SetPos( 5, 500 )
	KYSFAJIT:SetText( "KYS fajit" )
	KYSFAJIT:SetSize( 150, 30 )
	KYSFAJIT:SetParent( frame )	
	KYSFAJIT.DoClick = function()
		net.Start("KYS")
		net.SendToServer()
	end

	local HidePanel = vgui.Create( "DButton" )
	HidePanel:SetPos( 110, 20 )
	HidePanel:SetText( "Hide" )
	HidePanel:SetSize( 40, 100 )
	HidePanel:SetParent( frame )	
	HidePanel.DoClick = function()
	frame:Hide()
	end

	-- ==========SETTINGS==========

		local settingsframe = vgui.Create("DFrame")
	settingsframe:SetSize(160,500)
	settingsframe:SetVisible( false )
	settingsframe:SetTitle( "Settings Menu" )
	settingsframe:ShowCloseButton( false )
	settingsframe:SetDraggable( true )
	settingsframe:SetPos (ScrW, ScrH)
	settingsframe:MakePopup ( false )
	settingsframe.Paint = function(s , w , h)

		draw.RoundedBox(20,0,0,w , h,Color(0,0,255))
		draw.RoundedBox(20,2,2,w-4 , h-4,Color(0,128,255))

	end

	local SettingsPanel = vgui.Create( "DButton" )
	SettingsPanel:SetPos( 110, 140 )
	SettingsPanel:SetText( "Settings" )
	SettingsPanel:SetSize( 40, 40 )
	SettingsPanel:SetParent( frame )
	SettingsPanel.DoClick = function()
		settingsframe:Show()
		frame:Hide()
	end

	local ControlBoard = vgui.Create( "DButton" )
	ControlBoard:SetPos( 20, 20 )
	ControlBoard:SetText( "This bitch empty!" )
	ControlBoard:SetSize( 100, 100 )
	ControlBoard:SetParent( settingsframe )
	ControlBoard.DoClick = function()
		settingsframe:Hide()
		frame:Show()
		RunConsoleCommand( "say" , "Idk who made this shit interaction menu, but something tells me its in alpha. And maybe it got coded in one night..." )
	end

end )