Change PlayerSay to keybind?

how can i change [lua]AddCSLuaFile(“autorun/client/motd.lua”)

function MOTDMenuPopup(ply)
ply:ConCommand(“showmotdmenu”)
end

function ChatMOTDMenuPopup(ply, text)
local prefixs = {"!showmotd", “/showmotd”}
local command = string.Explode(" ", text)[1]
for _, v in pairs(prefixs) do
if string.lower(command) == v then
ply:ConCommand(“showmotdmenu”)
end
end
end

hook.Add(“PlayerSay”, “ChatMOTD”, ChatMOTDMenuPopup)[/lua] to make it ONLY open when f2 or f3 is pressed?

GM.ShowSpare1, GM.ShowSpare2

could you be more specific please?
What do i replace? or is that the local prefixes?

[lua]
function SchoolShow( ply )
ply:ConCommand( “SchoolMe” )
end
hook.Add(“ShowSpare1”, “School”, SchoolShow)
[/lua]

It is from the wiki.

so this? [lua]AddCSLuaFile(“autorun/client/motd.lua”)

function MOTDMenuPopup(ply)
ply:ConCommand(“gamemenu”)
end

function ChatMOTDMenuPopup(ply, text)
local prefixs = {"!showmenu", “/showmenu”}
local command = string.Explode(" ", text)[1]
for _, v in pairs(prefixs) do
if string.lower(command) == v then
ply:ConCommand(“gamemenu”)
end
end
end

hook.Add(“ShowSpare1”, “Menu”, MenuShow)[/lua]

Where did MenuShow come from?

[lua]
local function hook_ShowSpare1(player)
player:ConCommand(“gamemenu”);
end;

hook.Add(“ShowSpare1”, “showSpare1”, hook_ShowSpare1);
[/lua]

i don’t know… i just want to make it so f2 and f3 will open the menu

[editline]16th October 2011[/editline]

hello

I just gave you the code to do so.
You should learn some Lua first.

How do i make it close by pressing the button again

Save a bool ( per player ) to toggle when they press F1 or F2 (or whatever key) and then do an if-then in the keypress function.

Or make a bool for the menu since it is clientside anyways?

huh?