Skip to content

Example

Linus edited this page Jul 29, 2018 · 15 revisions

A simple panel you can open and close with a chat command.

@persist Frame:dframe

if(first()) {
    runOnChat(1)
    #add all players to the default list
    vguiDefaultPlayers(players())
    Frame = dframe(1)
    Frame:setSize(150,150)
    Frame:center()
    Frame:setVisible(0) #set invisible on create
    Frame:setDeleteOnClose(0) # only hides the panel when the close button is pressed
    Frame:makePopup()
    Frame:create()
}
if(chatClk()) {
    if(lastSaid()=="menu") {
        local Visible = Frame:isVisible(lastSpoke()) #get the current visible status for the player
        Frame:setVisible(!Visible) #inverse the status
        Frame:modify(array(lastSpoke())) #apply changes only to the player who executed the command
    }
}

Clone this wiki locally