Getting Started

How to install MenuV

  1. Download the latest stable release of MenuV and place it in your resource folder.

  2. Add @menuv/menuv.lua in your fxmanifest.lua

--- EXAMPLE: fxmanifest.lua

fx_version 'adamant'
game 'gta5'

client_scripts {
    '@menuv/menuv.lua',
    'example.lua'
}

dependencies {
    'menuv'
}

Creating a basic menu

You can create a menu by using the MenuV class. This class provides 5 functions: CreateMenu, GetMenu, OpenMenu, CloseMenu and CloseAll.

CreateMenu has 8 parameters: Title, Subtitle, Position, Red, Green, Blue, Icon and Size.

MenuV:CreateMenu(title: string, subtitle: string, position: string, r: number, g: number, b: number, icon: string, size: string)

Example

local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0)

Now you can start adding options to your menu by using the following functions: AddButton, AddCheckbox, AddSlider, AddRange and AddConfirm.

local button = menu:AddButton({ icon = '😃', label = 'Simple Button', value = 'YEA', description = 'Simple Button Description' })

local checkbox = menu:AddCheckbox({ icon = '😃', label = 'Simple Checkbox', value = false, description = 'Simple Checkbox Description' })

local slider = menu:AddCheckbox({ icon = '😃', label = 'Simple Slider', value = 1, description = 'Simple Slider Description', values = {
    { label = 'Option #1', value = 1 },
    { label = 'Option #2', value = 2 },
    { label = 'Option #3', value = 3 }
}})

local range = menu:AddRange({ icon = '😃', label = 'Simple Range', value = 0, description = 'Simple Range Description', min = 0, max = 10 })

local checkbox = menu:AddConfirm({ icon = '😃', label = 'Simple Confirm', value = false, description = 'Simple Confirm Description' })

local menu_button = menu:AddButton({ icon = '😃', label = 'Simple Menu Button', value = menu, description = 'Simple Menu Button Description' })

You can bind events by adding the name of events in the table while creating the item or after the item has been created and using the On function.

--- Bind event on item create function
local button = menu:AddButton({ icon = '😃', label = 'Simple Button', value = 'YEA', description = 'Simple Button Description', select = function(btn)
    print('YOU PRESSED THE BUTTON WITH VALUE ' .. btn.Value)
end})

--- Bind event after item has been created
local button = menu:AddButton({ icon = '😃', label = 'Simple Button', value = 'YEA', description = 'Simple Button Description' })

--- When user pressed `ENTER` on the button
button:On('select', function(btn)
    print('YOU PRESSED THE BUTTON WITH VALUE ' .. btn.Value)
end)

Last updated