Options

Options

When creating a targetable option you must send an array of options with the following properties.

Option Parameters

  • label: string
  • name?: string
    • An identifier used when removing an option.
  • icon?: string
  • iconColor?: string
  • distance?: number
    • The max distance to display the option.
  • bones?: string or string[]
  • offset?: vector3
    • Offset the targetable area of an entity, relative to the model dimensions.
  • offsetAbsolute?: vector3
    • Offset the targetable area of an entity, relative to the entity's world coords.
  • offsetSize?: number
    • The radius of the targetable area for an entity offset.
  • groups?: string or string[] or table<string, number>
    • A group, array of groups, or pairs of groups-grades required to show the option.
    • Groups are framework dependent, and may refer to jobs, gangs, etc.
  • items?: string or string[] or table<string, number>
    • An item, array of items, or pairs of items-count required to show the option.
    • Items are framework dependent.
  • anyItem?: boolean
    • Only require a single item from the items table to exist.
  • canInteract?: function(entity, distance, coords, name, bone)
    • Options will always display if this is undefined.
  • menuName?: string
    • The option is only displayed when a menu has been set with openMenu.
  • openMenu?: string
    • Sets the current menu name, displaying only options for the menuName.
  • onSelect?: function(data)
  • export?: string
  • event?: string
  • serverEvent?: string
  • command?: string

Option Effects

When selecting an option it will trigger a single action, in order of priority:

  1. onSelect function
  2. export
  3. event
  4. server event
  5. command