> For the complete documentation index, see [llms.txt](https://lualab.gitbook.io/lualab-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lualab.gitbook.io/lualab-docs/lualab-scripts/lualab-waterfill.md).

# LuaLab-WaterFill

### Dependencies

* QBCore Framework
* qb-core
* qb-target
* qb-inventory

### Installation

#### 1. Add Items to `qb-core/shared/items.lua`

```lua
['metal_bottle'] = {
name = 'metal_bottle',
label = 'Water Bottle',
weight = 500,
type = 'item',
image = 'metal_bottle.png',
unique = true,
useable = true,
shouldClose = true,
combinable = nil,
description = 'Water bottle (10 uses)'
},
['metal_bottle2'] = {
name = 'metal_bottle2',
label = 'Large Water Bottle',
weight = 750,
type = 'item',
image = 'metal_bottle2.png',
unique = true,
useable = true,
shouldClose = true,
combinable = nil,
description = 'Large water bottle (Unlimited uses)'
}

```

#### 2. Add Images

Copy the following images to `qb-inventory/html/images/`:

* metal\_bottle.png
* metal\_bottle2.png

#### 3. Add to qb-inventory/html/js/app.js

Add this to your FormatItemInfo function:

```javascript
if (item.name == "metal_bottle") {
    return `Filled: ${item.info.waterAmount || 0}% | Uses: ${item.info.uses || 0}/10`;
} else if (item.name == "metal_bottle2") {
    return `Filled: ${item.info.waterAmount || 0}%`;
}
```

### Configuration

You can modify the following in `config.lua`:

* Notification messages
* Bottle settings (capacity, uses, drink amount)
* Water dispenser props
* Animation settings
* Prop settings
* UI settings

### Usage

1. Get a water bottle (`/giveitem metal_bottle 1` or `/giveitem metal_bottle2 1`)
2. Find a water dispenser
3. Use qb-target to interact with the dispenser
4. Select your bottle and fill amount
5. Use the bottle from your inventory to drink

### Credits

Created by LuaLab

### License

This project is licensed under the MIT License - see the LICENSE file for details
