Skip to content

Client Exports ​


Exports ​

exports['fs_placeables']:additem(item, data)

Makes an item placeable at runtime without editing config.lua. On the client it adds the item to the placement menu and adds the pickup target to its models.

Call it on both sides

The client and server each keep their own item list. Call additem with the same data on the client (menu and target) and the server (prop model). See Server Exports.

If the item is already in Config.Items, the call does nothing.

Arguments ​

ParameterTypeRequiredDescription
itemstringYesThe item's spawn name
datatableYes[amount] = model, same format as Config.Items

Example ​

lua
exports['fs_placeables']:additem('repairkit', {
    [1] = `prop_tool_box_04`
})

Events ​

TriggerEvent('fs_placeables:placeitemhook', item, count)

Starts placement of count of item without the menu. Use it from a usable item, an ox_inventory item button, a radial menu, etc.

The server checks the player has enough before the preview opens. The item is only taken when the prop is placed.

Arguments ​

ParameterTypeRequiredDescription
itemstringYesItem name in Config.Items (or money / black_money / markedbills)
countnumberNoAmount to place. Defaults to 1. Use an amount from Config.Items, otherwise the [1] model or Config.defaultprop is used

Example ​

lua
-- client side
TriggerEvent('fs_placeables:placeitemhook', 'money', 10000)

-- from a server script
TriggerClientEvent('fs_placeables:placeitemhook', source, 'repairkit', 1)

For an ox_inventory button example, see Place Money Using ox_inventory.

FWB Studio documentation.