> For the complete documentation index, see [llms.txt](https://next-script-tm.gitbook.io/next-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://next-script-tm.gitbook.io/next-scripts/free-resources/targeting/examples.md).

# Examples

## Ox Inventory Give Item Feature

Select the player with targeting when giving items

> At this [line](https://github.com/overextended/ox_inventory/blob/52d99285eef1dc7df31c084679db3fdf6b1c0150/client.lua#L1628) of *@ox\_inventory/client.lua* you can replace all the code of the callback with this

```lua
RegisterNUICallback('giveItem', function(data, cb)
    cb(1)
    TriggerEvent('ox_inventory:closeInventory')
    local id = exports.targeting:StartTargeting({})
    giveItemToTarget(id, data.slot, data.count)
end)
```

***
