Fivecore
  • Fivecore - FiveM Scripts
  • Discord
  • General
    • Common issues
  • RESOURCES
    • Zombies
      • Installation
      • Usage
      • Functions
        • Server Functions
      • Events
        • Server Events
    • Looting
      • Installation
      • Setup
      • Events
        • Server Events
      • Functions
        • Client Functions
        • Server Functions
      • Loot editor
    • NPC Dialogs
      • Installation
      • Usage
      • Extras
    • Dynamic Guides
      • Installation
      • Usage
    • Interact
      • Installation
      • Usage
      • InteractOptions
      • Functions
        • Client
Powered by GitBook
On this page
  1. RESOURCES
  2. Interact

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
})
PreviousUsageNextFunctions

Last updated 6 months ago