Skip to Content
Cobalt

cobalt_addons

Consumables, player actions and vehicle features.

Armor

Server

The armor items' server export. On usingItem it refuses while the player's armour is already at item.server.armour; on usedItem it sets it, and marks a vest for /resetarmor when item.client.effect is vest.

exports.cobalt_addons:Armor(event, item, inventory)
ParameterTypeOptionalDescription
event'usingItem' | 'usedItem'No
itemtableNo
inventorytableNo
ReturnsDescription
false?
Example
local result = exports.cobalt_addons:Armor(
    'usingItem',
    { name = 'armor', server = { armour = 50 }, client = { effect = 'vest' } },
    { id = 'ABC12345', source = source }
)

Parachute

Server

The parachute item's server export; marks the parachute for /resetparachute until the server sees the player in freefall.

exports.cobalt_addons:Parachute(event, item, inventory)
ParameterTypeOptionalDescription
event'usingItem' | 'usedItem'No
itemtableNo
inventorytableNo
Example
exports.cobalt_addons:Parachute(
    'usingItem',
    { name = 'parachute' },
    { id = 'ABC12345', source = source }
)

Firework

Server

The firework items' server export. On usingItem it refuses while the player is on fireworks.cooldown or has no flat ground in front of them, and returns the spot their client picked; on usedItem it sets a firework box down there, runs the countdown for players nearby, launches it and removes the box.

exports.cobalt_addons:Firework(event, item, inventory, slot, spot)
ParameterTypeOptionalDescription
event'usingItem' | 'usedItem'No
itemtableNo
inventorytableNo
slottableNo
spottableYesthe value usingItem returned
ReturnsDescription
table | false?
Example
firework1 = {
    label = '2Brothers', weight = 500,
    client = { usetime = 3000, anim = { dict = 'anim@mp_fireworks', clip = 'place_firework_3_box' } },
    server = { export = 'cobalt_addons.Firework' },
},

ItemEffect

Client

Plays the effect named by item.client.effect (coke, crack, meth, ecstasy, oxy, vest or parachute) after the item is used.

exports.cobalt_addons:ItemEffect(event, item)
ParameterTypeOptionalDescription
event'usingItem' | 'usedItem'No
itemtableNo
Example
exports.cobalt_addons:ItemEffect('usingItem', { name = 'meth', client = { effect = 'meth' } })

Binoculars

Client

The binoculars item's client export; toggles the binocular view.

exports.cobalt_addons:Binoculars(event)
ParameterTypeOptionalDescription
event'usingItem' | 'usedItem'No
Example
exports.cobalt_addons:Binoculars('usingItem')

On this page