InteractOptions

All exports that need InteractOptions can use these data

InteractOptions

  • header: string

  • actions: table

    • text: string

    • action: function

    • canInteract?: function

  • range: number

Example with addGlobalObject export:

local modelHash = `prop_conc_blocks01b`
exports.fivecore_interact:addGlobalObject(modelHash, {
    header = 'Trash',
    actions = {
        {
            text = 'Option 1',
            action = function()
                print('Option 1 clicked!')
            end
        },
        {
            text = 'Option 2 disabled',
            action = function()
                print('Option 2 clicked!')
            end,
            canInteract = function ()
                return false
            end
        }
    },
    range = 2.0
})

Last updated