Kartik Scripts

Items

Kartik Properties uses a small number of inventory items. Only add the ones for the features you enable. This page gives ready-to-paste definitions for ox_inventory and qb-inventory.

ItemConfig keyUsed byEnabled by default
lockpickConfig.LockpickItemLockpicking a locked door✅ (item required to pick)
contract_paperConfig.ContractItem.itemSigned contract copies✅ Config.ContractItem.enabled = true
property_keyConfig.PhysicalKeys.itemOptional physical property keys❌ Config.PhysicalKeys.enabled = false
furnitureConfig.FurnitureShop.itemGeneric metadata-based furniture item❌ 'furniture'

lockpick is almost certainly already defined in your inventory. You only need to add items for features you turn on. Change any item name in shared/properties.lua / shared/contracts.lua.


1. ox_inventory

Add to ox_inventory/data/items.lua.

ox_inventory has no "register usable item" API, a usable item names a server export the inventory calls when the item is used. Kartik Properties provides a single dispatcher export: kartik-properties.useItem. Point every usable item below at it.

['contract_paper'] = {
    label = 'Contract',
    weight = 10,
    stack = false,
    close = true,
    description = 'A signed property agreement',
    server = {
        export = 'kartik-properties.useItem'
    }
},
['property_key'] = {
    label = 'Property Key',
    weight = 50,
    stack = false,
    close = true,
    description = 'A key to a property',
    server = {
        export = 'kartik-properties.useItem'
    }
},
['lockpick'] = {
    label = 'Lockpick',
    weight = 5,
    stack = true,
    close = true,
    description = 'Might open a lock'
},
-- generic furniture item for shop delivery & placement metadata:
['furniture'] = {
    label = 'Furniture Piece',
    weight = 5000,
    stack = true,
    close = true,
    description = 'A piece of furniture'
},

2. qb-inventory

Add to qb-core/shared/items.lua.

contract_paper = {
    name = 'contract_paper',
    label = 'Contract',
    weight = 10,
    type = 'item',
    image = 'contract_paper.png',
    unique = true,
    useable = true,
    shouldClose = true,
    description = 'A signed property agreement',
},
property_key = {
    name = 'property_key',
    label = 'Property Key',
    weight = 50,
    type = 'item',
    image = 'property_key.png',
    unique = true,
    useable = true,
    shouldClose = true,
    description = 'A key to a property',
},
-- lockpick is usually already defined; ensure it exists:
lockpick = {
    name = 'lockpick',
    label = 'Lockpick',
    weight = 5,
    type = 'item',
    image = 'lockpick.png',
    unique = false,
    useable = true,
    shouldClose = true,
    description = 'Might open a lock',
},
-- generic furniture item for shop delivery & placement metadata:
furniture = {
    name = 'furniture',
    label = 'Furniture Piece',
    weight = 5000,
    type = 'item',
    image = 'furniture.png',
    unique = true,
    useable = false,
    shouldClose = true,
    description = 'A piece of furniture',
},

For qb-inventory and codem-inventory, usable items are wired up internally by the resource, no export field is needed in the item definition (unlike ox_inventory). Just define the item with useable = true.


Item images

  • ox_inventory: drop PNGs in ox_inventory/web/images/.
  • qb-inventory: drop PNGs in qb-inventory/html/images/ (or your inventory's image folder), matching the image field.

In shared/properties.lua:

Config.PhysicalKeys = { enabled = false, item = 'property_key', requireDatabaseAccess = true }
Config.FurnitureDelivery = false
Config.LockpickItem = 'lockpick'
Config.LockpickCooldown = 300   -- seconds between pick attempts

Config.FurnitureShop = {
    pedModel = 's_m_m_postal_01',
    coords = vec4(1219.4161, -3201.7300, 5.5281, 179.4545),
    blip = { sprite = 618, color = 5, label = 'Furniture Warehouse' },
    vehicleModel = 'boxville',
    dockCoords = vec3(1197.2559, -3253.5615, 7.0952),
    dockBlip = { sprite = 50, color = 5, label = 'Furniture Pickup' },
    vehicleSpawnCoords = vec4(1193.3, -3251.5, 7.1, 90.0),
    item = 'furniture', -- Generic item name for metadata-based furniture
}

In shared/contracts.lua:

Config.ContractItem = {
    enabled = true,
    item = 'contract_paper',
    giveToDrafter = true,   -- the drafter also gets a copy
}

On this page