HEX
HexscriptsClassicMenu API

Exports

This section lists all client-side and server-side exports in this script. Exports can be called from other scripts to interact with this script functionality.

Note

If you need additional exports for your implementation, please open a ticket on our Discord server.

Client Exports

rageOpen

Open a menu.

exports['hex_menu_api']:rageOpen(namespace, name, data, submit, cancel, change, close)

Prop

Type

Data Object

Prop

Type

Element Object

Prop

Type

Prop

Type

Example Usage

RegisterCommand('testHexUI', function()
    exports['hex_menu_api']:rageCloseAll()

    local elements = {}
    local checkboxChecked = false
    local listValue = 0

    elements[#elements + 1] = { title = 'Button', value = 'example_button_value', type = 'button', description = 'Button Description' }
    elements[#elements + 1] = { title = 'Button Go', value = 'example_button_go_value', type = 'buttongo', description = 'Button GO Description' }
    elements[#elements + 1] = { title = 'Checkbox', value = 'example_checkbox_value', checked = checkboxChecked, type = 'checkbox', description = 'Checkbox Description' }
    elements[#elements + 1] = { title = 'List', value = 'example_list_value', list = { 'Option 1', 'Option 2', 'Option 3' }, valueList = listValue, type = 'list', description = 'List Description' }
    elements[#elements + 1] = { title = 'Seperator', type = 'seperator' }

    exports['hex_menu_api']:rageOpen(GetCurrentResourceName(), 'rageui_main', {
        header = 'https://cdn.resync.me/attachments/scripts/hex_ui_header.png',
        title = 'Example Menu Title',
        elements = elements,
        align = 'left' -- left, right, top-left, top-right, bottom-left, bottom-right
        -- customAlign = {
        --     top = '20vh',
        --     left = '20vh'
        -- },

    }, function(data, menu)
        if data.current.value == 'example_button_go_value' then
            print('Button Go Pressed')
        elseif data.current.value == 'example_button_value' then
            print('Button Pressed')
        elseif data.current.value == 'example_checkbox_value' then
            checkboxChecked = not checkboxChecked

            print('Checkbox Value: ' .. tostring(checkboxChecked))
        elseif data.current.value == 'example_list_value' then
            listValue = data.current.valueList

            print('List Value: ' .. tostring(listValue))
        end
    end, function(data, menu)
        menu.close()
    end)
end)

getRageOpened

Get specified menu if opened.

local menu = exports['hex_menu_api']:getRageOpened(namespace, name)

Prop

Type

rageCloseMenu

Closes a specified menu.

local success = exports['hex_menu_api']:rageCloseMenu(namespace, name)

Prop

Type

rageCloseAll

Closes all open menus.

exports['hex_menu_api']:rageCloseAll()

getElementByValue

Get an element by its value.

local element = exports['hex_menu_api']:getElementByValue(elements, value)

Prop

Type

Server Exports

No server exports are available at the moment.