An advanced Pet System for FiveM servers. this script allows players to buy, care for (feed/water), and interact with their pets. It also features a fully functional K9 unit system for Police officers (Drug Sniffing & Attacking).
- Dual Framework: Built-in support for QBCore, Qbox and ESX.
- Target System: Supports both
ox_targetandqb-target. - Multi-Language (Locale): Supports English (
en) and Indonesian (id). - Needs System: Pets have hunger, thirst, and health that deplete over time.
- Healing & Revive System: Players can use medkits to heal their pets, or revivers if the pet dies.
- K9 Exclusive Actions: Contraband (illegal items) checking and target attacking for K9 Police units.
- Low Resmon: Highly optimized script utilizing modern target systems and efficient event management.
Ensure the following resources are installed and running on your server:
oxmysql(Required for the database)ox_lib(Required for UI Menus, Notifications, Progressbars)- UI Menu & Input System:
lation_ui,ox_lib, orqb-menu - Framework:
qb-coreOResxORqbox - Target:
ox_targetORqb-target
- Download or move the
ap_petfolder into your server'sresourcesdirectory. - Run the
ap_pet.sqlfile in your server's database. This will create theplayer_petstable. - Add the required items to your framework (Guide below).
- Ensure you have the item icons in your inventory's image folder (
ox_inventory/web/imagesorqb-inventory/html/img). - Add
ensure ap_petto yourserver.cfg. Make sure it is placed AFTERox_libandoxmysql. - Configure the script to your liking in the
config.luafile (Language, Prices, Target System, etc.).
You MUST register the following items in your core framework/inventory for the Feeding and Healing systems to work:
Open your qb-core/shared/items.lua (or ox_inventory/data/items.lua if using ox) and add the following items:
-- AP Pet Items
['pet_medkit'] = {['name'] = 'pet_medkit', ['label'] = 'Pet Medkit', ['weight'] = 500, ['type'] = 'item', ['image'] = 'pet_medkit.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A first aid kit to heal an injured pet.'},
['pet_revive'] = {['name'] = 'pet_revive', ['label'] = 'Pet Revive', ['weight'] = 200, ['type'] = 'item', ['image'] = 'pet_revive.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'An adrenaline syringe to revive a dead pet.'},
['pet_food'] = {['name'] = 'pet_food', ['label'] = 'Pet Food', ['weight'] = 200, ['type'] = 'item', ['image'] = 'pet_food.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Some tasty food for your pet.'},
['pet_water'] = {['name'] = 'pet_water', ['label'] = 'Pet Water', ['weight'] = 200, ['type'] = 'item', ['image'] = 'pet_water.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A bowl of water for your pet.'},- Use the
/petcommand to open the Main Pet Menu. - Buy a pet first via the "Pet Shop" menu.
- K9 Police officers can get K9 pets for free.
- Dead pets will be marked with a "☠️ (Dead)" tag. Click on their name to either revive them or discard them permanently.
When a K9 dog sniffs another player, the script checks the target's inventory for illegal items.
The list of illegal items can be edited in config.lua under the Config.ContrabandItems table:
Config.ContrabandItems = {
'weed', 'weed_pooch', 'coke', 'coke_pooch', 'meth', 'meth_pooch',
'kq_meth_low', 'kq_meth_mid', 'kq_meth_high',
'kq_weed_joint_og_kush', 'kq_weed_joint_purple_haze', 'kq_weed_joint_white_widow', 'kq_weed_joint_blue_dream'
}Add or remove illegal item names based on your server's items!
You can add other dog/cat ped models (e.g., custom Husky mod, Pug, etc.) by registering them in the Config.AvailablePets table in config.lua.
['rottweiler'] = { model = 'a_c_rottweiler', name = 'Rottweiler', price = 5000, type = 'civilian', canSit = true },



