Animal hunting activity for any framework

Description

Players can go to NPC near forests, and get legal contracts to hunt down defined types of animals in selected area. When animal is killed there is a chance that you can get items from their remains like skin (every drop can be configured in config). When you decide you no longer want to hunt, you can go back to hunting shop and get reward for items you’ve collected.

Dependencies

Showcase

Framework

You can use this script with whatever framework you’re using. Just set up framework specific functions in assynu-animalhunting/bridge/custom/client.lua and server.lua. QB-Core is preconfigured.

Features

  • Hunter shop - option to buy hunting rifle, ammo, binoculars and hunting knife
  • Hunter shop - option to sell items dropped from animals
  • Animal drops with different quality based on weapon it was killed and other factors.
  • You need weapon license to hunt (or other license if you configure it)
  • Active location tracking (approximately)
  • Doesn’t affect performance of player and server
  • Option to have many hunting zones with different animals
  • You can configure nearly everything
  • All translations are editable, so event thou it’s in English by default, you can translate it to any language
  • If you get too close to animal, it will run away or attack you

Tebex

https://assynu.tebex.io/category/scripts

Config

return {
    Enabled = true,     -- enable/disable script
    DebugZones = false, -- debug mode
  
    WeaponRating = {    -- Chance for quality level (in procentages) you can get by using definied weapon (if weapon is not definied, you will alwayse get common quality)

        ['weapon_sniperrifle'] = {
            [1] = 30,   -- 30% for common quality
            [2] = 50,   -- 50% for rare quality
            [3] = 20    -- 20% for epic quality
        },
        ['weapon_knife'] = {
            [1] = 10, -- 10% for common quality
            [2] = 50, -- 50% for rare quality
            [3] = 40  -- 40% for epic quality
        },
    },

    HunterNPCs = {
        {
            Model = "cs_hunter",
            Coords = vector4(-1491.16, 4980.25, 63.36, 38.18),
            blip = {
                sprite = 463,
                color = 43,
                scale = 1.2,
                name = "Hunter",

            },
            Animals = {
                {
                    model = 'a_c_deer',
                    label = 'Deer',
                    aggresive = false,
                    drop = {
                        common = 'common_deer_skin',  -- Remember to add this item as it should be added in your framework
                        rare = 'rare_deer_skin', -- Remember to add this item as it should be added in your framework
                        epic = 'epic_deer_skin',  -- Remember to add this item as it should be added in your framework
                    }
                },
                {
                    model = 'a_c_mtlion',
                    label = 'Mountain Lion',
                    aggresive = true,
                    drop = {
                        common = 'common_lion_skin',  -- Remember to add this item as it should be added in your framework
                        rare = 'rare_lion_skin', -- Remember to add this item as it should be added in your framework
                        epic = 'epic_lion_skin'   -- Remember to add this item as it should be added in your framework
                    }
                },
            },
            HuntingZone = { -- https://overextended.dev/ox_lib/Modules/Zones/Shared
                Points = {
                    vec3(-1596.0, 4758.0, 78.0),
                    vec3(-1596.0, 4758.0, 78.0),
                    vec3(-1368.0, 4743.0, 78.0),
                    vec3(-1251.0, 4694.0, 78.0),
                    vec3(-1173.0, 4649.0, 78.0),
                    vec3(-986.0, 4553.0, 78.0),
                    vec3(-1099.0, 4276.0, 78.0),
                    vec3(-1293.0, 4262.0, 78.0),
                    vec3(-1356.0, 4117.0, 78.0),
                    vec3(-1424.0, 4225.0, 78.0),
                    vec3(-1602.0, 4205.0, 78.0),
                    vec3(-1710.0, 4239.0, 78.0),
                    vec3(-1933.0, 4445.0, 78.0),
                },
                Thickness = 264.0,
            }
        }
    },

    HuntingGearShop = {
        Model = "cs_russiandrunk",
        Coords = vector4(-319.81, 6085.58, 31.46, 333.68),
        blip = {
            sprite = 586,
            color = 24,
            scale = 0.8,
            name = "Hunting Shop",

        },

        BuyItems = {
            {
                label = "Hunting Rifle",
                name = "weapon_sniperrifle",
                icon = 'fa-solid fa-gun',
                image = '...',
                price = 1500,
                amount = 1,
                license = true,
                isWeapon = true

            },
            {
                label = "Hunting Rifle Ammo",
                name = "weapon_sniperrifle",
                icon = 'fa-solid fa-fire',
                image = '...',
                price = 600,
                amount = 6,
                ammunition = true,
                license = true,
                isWeapon = true

            },
            {
                label = "Hunting Knife",
                name = "weapon_knife",
                icon = 'fa-solid fa-highlighter',
                image = '...',
                price = 100,
                amount = 1,
                license = false,
                isWeapon = true
            },
        },

        SellItems = {
            {
                label = "Common Deer Skin",
                name = "common_deer_skin",
                price = 100,

            },
            {
                label = "Rare Deer Skin",
                name = "rare_deer_skin",
                price = 200,

            },
            {
                label = "Epic Deer Skin",
                name = "epic_deer_skin",
                price = 300,

            },
            {
                label = "Common Lion Skin",
                name = "common_lion_skin",
                price = 100,
            },
            {
                label = "Rare Lion Skin",
                name = "rare_lion_skin",
                price = 200,

            },
            {
                label = "Epic Lion Skin",
                name = "epic_lion_skin",
                price = 300,
            }
        }
    },
}
Code is accessible Partly
Subscription-based No
Requirements ox_lib, ox_target
Support Yes
1 Like

Very nice and interesting script, great job!

1 Like