# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lualab.gitbook.io/lualab-docs/lualab-scripts/lualab-waterfill.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
