+ and - commands

So here is an example menu
[lua]
local PerpSpawnFrame = vgui.Create(“DFrame”)
PerpSpawnFrame:Center()
PerpSpawnFrame:SetSize(205,352)
PerpSpawnFrame:SetTitle(“asdfasdf”)
PerpSpawnFrame:MakePopup()
[/lua]

What would I need to do so that the button I bound it to makes the menu only appear while the button is held down?
I thought it was:
[lua]
function open()
PerpSpawnFrame:SetVisible( true )
end

function close()
PerpSpawnFrame:SetVisivle( false )
end

concommand.Add("+menu", open)
concommand.Add("-menu", close)
hook.Add(“Initialize”, “menu”, “PerpSpawnFrame”)
[/lua]
But that doesn’t seem to work, can anyone help?

you spelt Visible wrong

[editline]06:04AM[/editline]

SERIOUSLY DID YOU NOT NOTICE WHEN IT SAID attempt to call SetVisivle a nill value

Didnt you know people at fp cant read errors

:x

I wrote that on fp, I used that same code just I know it was spelled right I made the error when I was typing it in on facepunch.


hook.Add("Initialize", "menu", open)



lua_run_cl for i = 1, 10000000 do achievements.SpawnMenuOpen() end


For example

wut?

Ye what have that achievement “cheat” to do with the Topic?

Yeah what exactly is that lol