# Setup

## Configuration

Add the script to your server config.

Open the `config.lua`file and make any necessary adjustments.

Make sure to update the framework / script configuration section with the relevant scripts that you use.

Setup the SQL database with the `wp-animals.sql` file

{% hint style="info" %}
If you select any OX script (or script that uses ox), be sure to uncomment the `@ox_lib/init.lua` line in the fxmanifest.
{% endhint %}

## Framework Implementations

External script implementations are handled in the `framework.lua` file. This file provides the necessary functions and hooks to integrate with different frameworks and scripts.

Out of the box, the script includes implementations for:

<table><thead><tr><th width="159"></th><th width="77" data-type="checkbox">qb</th><th width="73" data-type="checkbox">qbx</th><th width="61" data-type="checkbox">esx</th><th width="50" data-type="checkbox">ox</th><th width="73" data-type="checkbox">none</th><th data-type="checkbox">PolyZone</th></tr></thead><tbody><tr><td><strong>Framework</strong></td><td>true</td><td>true</td><td>true</td><td>false</td><td>false</td><td>false</td></tr><tr><td><strong>Notify</strong></td><td>true</td><td>false</td><td>true</td><td>true</td><td>true</td><td>false</td></tr><tr><td><strong>Target</strong></td><td>true</td><td>false</td><td>false</td><td>true</td><td>false</td><td>false</td></tr><tr><td><strong>Inventory</strong></td><td>true</td><td>false</td><td>false</td><td>true</td><td>false</td><td>false</td></tr><tr><td><strong>Progressbar</strong></td><td>true</td><td>false</td><td>false</td><td>true</td><td>true</td><td>false</td></tr><tr><td><strong>Zone</strong></td><td>false</td><td>false</td><td>false</td><td>true</td><td>false</td><td>true</td></tr></tbody></table>

## Add Items to Inventory

Add the items to the item file in your inventory script.

Copy / paste all of the images from the `images/`folder into your inventory script.

<details>

<summary>QB Inventory Items</summary>

{% code fullWidth="false" %}

```lua
-- Animals
    westy = { name = "westy", label = "Westy", weight = 2000, type = "item", image = "westy.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "West Highland White Terrier"},
    pug = { name = "pug", label = "Pug", weight = 2000, type = "item", image = "pug.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Pug"},
    poodle = { name = "poodle", label = "Poodle", weight = 2000, type = "item", image = "poodle.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Poodle"},
    rottweiler = { name = "rottweiler", label = "Rottweiler", weight = 2000, type = "item", image = "rottweiler.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Rottweiler"},
    husky = { name = "husky", label = "Husky", weight = 2000, type = "item", image = "husky.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Husky"},
    retriever = { name = "retriever", label = "Retriever", weight = 2000, type = "item", image = "retriever.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Retriever"},
    shepherd = { name = "shepherd", label = "Shepherd", weight = 2000, type = "item", image = "shepherd.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Shepherd"},
    cat = { name = "cat", label = "Cat", weight = 2000, type = "item", image = "cat.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Cat"},
    chicken = { name = "chicken", label = "Chicken", weight = 2000, type = "item", image = "chicken.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Chicken"},
    cow = { name = "cow", label = "Cow", weight = 2000, type = "item", image = "cow.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Cow"},
    pig = { name = "pig", label = "Pig", weight = 2000, type = "item", image = "pig.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Pig"},
    rabbit = { name = "rabbit", label = "Rabbit", weight = 2000, type = "item", image = "rabbit.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Rabbit"},
    rat = { name = "rat", label = "Rat", weight = 2000, type = "item", image = "rat.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Rat"},
    coyote = { name = "coyote", label = "Coyote", weight = 2000, type = "item", image = "coyote.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Coyote"},
    mountainlion = { name = "mountainlion", label = "Mountain Lion", weight = 2000, type = "item", image = "mountainlion.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Mountain Lion"},
    panther = { name = "panther", label = "Panther", weight = 2000, type = "item", image = "panther.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Panther"},
    chimp = { name = "chimp", label = "Chimp", weight = 2000, type = "item", image = "chimp.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Chimp"},
    rhesusmonkey = { name = "rhesusmonkey", label = "Rhesus", weight = 2000, type = "item", image = "rhesusmonkey.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Rhesus Monkey"},
    deer = { name = "deer", label = "Deer", weight = 2000, type = "item", image = "deer.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Deer"},
    boar = { name = "boar", label = "Boar", weight = 2000, type = "item", image = "boar.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Boar"},z
    fish = { name = "fish", label = "Fish", weight = 500, type = "item", image = "fish.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Fish"},
    dolphin = { name = "dolphin", label = "Dolphin", weight = 500, type = "item", image = "dolphin.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Dolphin"},
    humpback = { name = "humpback", label = "Humpback", weight = 500, type = "item", image = "humpback.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Humpback"},
    killerwhale = { name = "killerwhale", label = "Killer Whale", weight = 500, type = "item", image = "killerwhale.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Killer Whale"},
    stingray = { name = "stingray", label = "Stingray", weight = 500, type = "item", image = "stingray.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Stingray"},
    hammerheadshark = { name = "hammerheadshark", label = "Hammerhead Shark", weight = 500, type = "item", image = "hammerheadshark.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Hammerhead Shark"},
    tigershark = { name = "tigershark", label = "Tiger Shark", weight = 500, type = "item", image = "tigershark.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Tiger Shark"},
    tennisball = { name = "tennisball", label = "Tennis ball", weight = 500, type = "item", image = "tennisball.png", unique = false, useable = true, shouldClose = true, combinable = nil, description = "A ball that can be thrown"},
    baseball = { name = "baseball", label = "Baseball", weight = 500, type = "item", image = "baseball.png", unique = false, useable = true, shouldClose = true, combinable = nil, description = "A ball that can be thrown"},
    frisbee = { name = "frisbee", label = "Frisbee", weight = 500, type = "item", image = "frisbee.png", unique = false, useable = true, shouldClose = true, combinable = nil, description = "A frisbee that can be thrown"},
```

{% endcode %}

</details>

<details>

<summary>OX Inventory Items</summary>

```lua
    ['westy'] = {
        label = 'Westy',
        weight = 2000,
        stack = false,
        close = true,
        description = 'West Highland White Terrier',
        client = {
            image = 'westy.png',
        }
    },
    ['pug'] = {
        label = 'Pug',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Pug',
        client = {
            image = 'pug.png',
        }
    },
    ['poodle'] = {
        label = 'Poodle',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Poodle',
        client = {
            image = 'poodle.png',
        }
    },
    ['rottweiler'] = {
        label = 'Rottweiler',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Rottweiler',
        client = {
            image = 'rottweiler.png',
        }
    },
    ['husky'] = {
        label = 'Husky',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Husky',
        client = {
            image = 'husky.png',
        }
    },
    ['retriever'] = {
        label = 'Retriever',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Retriever',
        client = {
            image = 'retriever.png',
        }
    },
    ['shepherd'] = {
        label = 'Shepherd',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Shepherd',
        client = {
            image = 'shepherd.png',
        }
    },
    ['cat'] = {
        label = 'Cat',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Cat',
        client = {
            image = 'cat.png',
        }
    },
    ['chicken'] = {
        label = 'Chicken',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Chicken',
        client = {
            image = 'chicken.png',
        }
    },
    ['cow'] = {
        label = 'Cow',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Cow',
        client = {
            image = 'cow.png',
        }
    },
    ['pig'] = {
        label = 'Pig',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Pig',
        client = {
            image = 'pig.png',
        }
    },
    ['rabbit'] = {
        label = 'Rabbit',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Rabbit',
        client = {
            image = 'rabbit.png',
        }
    },
    ['rat'] = {
        label = 'Rat',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Rat',
        client = {
            image = 'rat.png',
        }
    },
    ['coyote'] = {
        label = 'Coyote',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Coyote',
        client = {
            image = 'coyote.png',
        }
    },
    ['mountainlion'] = {
        label = 'Mountain Lion',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Mountain Lion',
        client = {
            image = 'mountainlion.png',
        }
    },
    ['panther'] = {
        label = 'Panther',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Panther',
        client = {
            image = 'panther.png',
        }
    },
    ['chimp'] = {
        label = 'Chimp',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Chimp',
        client = {
            image = 'chimp.png',
        }
    },
    ['rhesusmonkey'] = {
        label = 'Rhesus Monkey',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Rhesus Monkey',
        client = {
            image = 'rhesusmonkey.png',
        }
    },
    ['deer'] = {
        label = 'Deer',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Deer',
        client = {
            image = 'deer.png',
        }
    },
    ['boar'] = {
        label = 'Boar',
        weight = 2000,
        stack = false,
        close = true,
        description = 'Boar',
        client = {
            image = 'boar.png',
        }
    },
    ['fish'] = {
        label = 'Fish',
        weight = 500,
        stack = false,
        close = true,
        description = 'Fish',
        client = {
            image = 'fish.png',
        }
    },
    ['dolphin'] = {
        label = 'Dolphin',
        weight = 500,
        stack = false,
        close = true,
        description = 'Dolphin',
        client = {
            image = 'dolphin.png',
        }
    },
    ['humpback'] = {
        label = 'Humpback',
        weight = 500,
        stack = false,
        close = true,
        description = 'Humpback',
        client = {
            image = 'humpback.png',
        }
    },
    ['killerwhale'] = {
        label = 'Killer Whale',
        weight = 500,
        stack = false,
        close = true,
        description = 'Killer Whale',
        client = {
            image = 'killerwhale.png',
        }
    },
    ['stingray'] = {
        label = 'Stingray',
        weight = 500,
        stack = false,
        close = true,
        description = 'Stingray',
        client = {
            image = 'stingray.png',
        }
    },
    ['hammerheadshark'] = {
        label = 'Hammerhead Shark',
        weight = 500,
        stack = false,
        close = true,
        description = 'Hammerhead Shark',
        client = {
            image = 'hammerheadshark.png',
        }
    },
    ['tigershark'] = {
        label = 'Tiger Shark',
        weight = 500,
        stack = false,
        close = true,
        description = 'Tiger Shark',
        client = {
            image = 'tigershark.png',
        }
    },
    ['tennisball'] = {
        label = 'Tennis Ball',
        weight = 500,
        stack = true,
        close = true,
        description = 'A ball that can be thrown',
        client = {
            image = 'tennisball.png',
        }
    },
    ['baseball'] = {
        label = 'Baseball',
        weight = 500,
        stack = true,
        close = true,
        description = 'A ball that can be thrown',
        client = {
            image = 'baseball.png',
        }
    },
    ['frisbee'] = {
        label = 'Frisbee',
        weight = 500,
        stack = true,
        close = true,
        description = 'A frisbee that can be thrown',
        client = {
            image = 'frisbee.png',
        }
    },
```

</details>

## Configure Animals Sold

All animals defined in `Config.Animals`will be purchasable at the animal store.&#x20;

If there are specific animals you don't want sold, comment out or remove them from the table.

This is also the spot where you can add new animals (including custom models) to sell.

## Customize Animals

When purchasing an animal you can choose the name, color, collar (if applicable).

After purchasing you can customize the collar color through the menu. There is a full prop placement system that allows you to accessorize the animals with props. The animals can currently be customized with 5 different prop slots. Props can quickly and easily be adjusted / changed through the menu at any time.

Add additional props (including custom props) to the `Config.PropOptions` table.&#x20;

Recommend using [Plebmasters Forge](https://forge.plebmasters.de/objects) to find props to use.

{% hint style="success" %}
Be sure to hit the Save button when you are done making changes!
{% endhint %}

## Additional Notes

The `inInventory` field in the DB is used to indicate whether an animal is actively in a players inventory or is out in the world. The value must be 0 (false) for the animal to show in the pound. We also keep track of a server side list of all animals in the world, so if the animal is still out in the world it wont be visible in the pound either. Some rare edge cases (like game client cleaning up entities) could cause an animal to not show up in the pound, typically after a server restart they will show again. If not, the inInventory field can be manually set to 0 to make them show up in the pound again.

The attack action is behind `Config.EnableAttackAction`, enable at your own risk.&#x20;

*I recommend implementing server rules to guide players on its usage, as it can be easily used in ways that might adversely affect roleplay.*


---

# 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://waypoint-scripts.gitbook.io/waypoint-scripts/scripts/waypoint-animals/setup.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.
