[ESX] & [QBCORE] & [QBOX] Slaughter House Job Script

Showcase
SLAUGHTER JOB SCRIPT

Purchase
[QBCore & ESX & QBOX] - Slaughter job script

Features

  • Realistic Slaughtering Cycle: Simulates the entire process of animal slaughtering, starting with catching cows.
  • Interactive Slaughtering Process: Requires the player to slaughter the caught cow using a slaughter knife—your success improves as you gain experience, then proceed to wash it at an interactive washing station. The process continues with moving the carcass to the cutting machine. Washing ensures hygiene before cutting, adding realism to the gameplay.
  • Detailed Cow Processing: After washing, the player can further process the cow to obtain various parts like ribeye, sirloin, brisket, tenderloin, chuck, shank, kidneys, bone marrow, etc. This additional processing adds more depth and realism to the gameplay.
  • Value Addition through Grinding: The player can grind the cow meat to produce ground beef. This value-added product fetches a higher selling price in the market, creating opportunities for the player to maximize their income.
  • Flexible Selling Options: The script offers two selling options - a quick sell point for efficient but lower-priced selling, and a delivery option which requires more effort but yields higher selling prices.
  • Built-in Job Instructions: The script includes built-in instructions for the slaughter job, providing guidance to players and enhancing the role-play experience.
  • Advanced Delivery System: Implements a realistic method of product delivery, adding to the overall job experience.
  • Dynamic Pricing: The selling price of the beef products changes dynamically based on market conditions, offering a more engaging gameplay experience.
  • Protection Against Exploits: Advanced measures have been implemented to prevent script exploitation, ensuring fair gameplay.
  • Compatibility: Fully compatible with popular context menus and input menus, including Targets: qb-target, ox_target, qtarget, ContextMenus: qb-menu, ox_lib context menu, nh-context, and InputMenus: qb-input, ox_lib input menu, nh-keyboard.
  • Customizable: Every aspect of the script, including the catching rate, processing time, and product prices, can be customized through a config file, allowing for adaptability to various RP scenarios

Optimization
Full optimized.
0.00 ms

Code is accessible No
Subscription-based No
Lines (approximately) : ~3700
Requirements d3MBA-lib - Support most popular context menus (ox_lib, qb-menu, nh-context) - (ox_inputmenu, qb-input, nh-keyboard) (ox_target, qtarget, qb-target)
Support Yes

Other Resources

Config

Config.DebugPolyZone = false -- [true/false] - If you want to see polyzone borders, set it to 'true' (Config.DebugPolyZone = true) 

Config.KickReason = "[d3MBA-slaughterjob] | Protection!" -- Kick reason if player try to cheat.

Config.BlacklistZonesDebug = false -- true/flase | Default: false | If you set this to true, you will see the Blacklist Zones in the game (marker).
Config.BlacklistZones = { -- Blacklist zones where player can't catch cows. 
    {coords = vector3(972.8793, -2147.48, 29.966), radius = 130.0}, -- Slaughterhouse      
    -- Add more zones as needed
}

-- Particles synchronization   
Config.SyncParticlesWithAllPlayers = { -- If is false particles will see only the player who triggered it. 
    KillCow = true, -- [true/false] - If you want to sync particles with all players, set it to 'true'
    WashCow = true, -- [true/false] - If you want to sync particles with all players, set it to 'true'
    CutCow = true, -- [true/false] - If you want to sync particles with all players, set it to 'true'
    Grinder = true, -- [true/false] - If you want to sync particles with all players, set it to 'true'
}

Config.Blip = { -- Main blip configuration
    -- https://docs.fivem.net/docs/game-references/blips/
    Pos = vector3(953.2060, -2184.54, 30.551),
    Use = true, 
    Sprite = 141,
    Scale = 1.0,
    Color = 21,
    Label = "Slaughterhouse Raven", 
}

Config.Instructions = { 
    SetPedInvisable = true, -- [true/false] - If you want to set ped invisable during instructions set it to 'true' (Config.Instructions.SetPedInvisable = true)
    SetRentPedBlockingOtherEvents = true, -- [true/false] - If you want to set rent ped blocking other events, set it to 'true' (Config.Instructions.SetRentPedBlockingOtherEvents = true) 

    -- Link for ped models - https://docs.fivem.net/docs/game-references/ped-models/
    Peds = {
        {Model = "s_m_y_factory_01", Pos = vector4(969.4871, -2107.84, 30.476, 80.65)},
        {Model = "s_m_y_factory_01", Pos = vector4(960.8325, -2186.61, 29.525, 72.87)},
        {Model = "s_m_y_factory_01", Pos = vector4(992.8211, -2174.91, 28.976, 193.78)},
        {Model = "s_m_y_factory_01", Pos = vector4(990.6311, -2135.06, 29.217, 213.2)},
        {Model = "s_m_y_factory_01", Pos = vector4(995.8681, -2189.92, 28.978, 358.4)},
        {Model = "s_m_y_factory_01", Pos = vector4(986.1961, -2130.06, 29.492, 356.9)},
        {Model = "s_m_y_factory_01", Pos = vector4(965.4450, -2154.84, 28.474, 217.61)},
        {Model = "s_m_y_factory_01", Pos = vector4(991.5023, -2104.30, 29.475, 174.31)},
    },
}

Config.ChangeClothes = { 
    Use = true, -- [true/false] - If you want to use change clothes, set it to 'true' (Config.ChangeClothes.Use = true)
    CheckBeforeAnyInteraction = false,  -- [true/false] - If you want to check before any interaction, if player wearing job uniform set it to 'true' (Config.ChangeClothes.CheckBeforeAnyInteraction = true)

    -- This thing you should adjust to your server. Numbers for clothes you should find in your clothing shop!
    Uniforms = {
        Male = { 
            -- AJUST THIS FOR YOUR SERVER
            tshirt_1 = 23,  tshirt_2 = 0,
            torso_1 = 22,   torso_2 = 0,
            decals_1 = 0,   decals_2 = 0,
            arms = 85,
            pants_1 = 36,   pants_2 = 0,
            shoes_1 = 12,   shoes_2 = 3,
            chain_1 = 0,    chain_2 = 0,
            hat_1 = -1,     hat_2 = 0,
            ears_1 = -1,    ears_2 = 0,
            bproof_1 = 0,   bproof_2 = 0
        },  

        Female = {
            -- AJUST THIS FOR YOUR SERVER
            tshirt_1 = 23,  tshirt_2 = 0,
            torso_1 = 22,   torso_2 = 0,
            decals_1 = 0,   decals_2 = 0,
            arms = 85,
            pants_1 = 36,   pants_2 = 0,
            shoes_1 = 12,   shoes_2 = 3,
            chain_1 = 0,    chain_2 = 0,
            hat_1 = -1,     hat_2 = 0,
            ears_1 = -1,    ears_2 = 0,
            bproof_1 = 0,   bproof_2 = 0
        }
    },
}

Config.JobVehicle = {
    Ped = {
        Model = "s_m_y_factory_01", -- https://docs.fivem.net/docs/game-references/ped-models/
        Pos = vector4(961.3096, -2108.65, 30.970, 79.75),
    },

    
    Model = "mule3", 

    JobVehicleBlip = {
        Sprite = 477,
        Color = 2,
        Scale = 0.9,
        Label = "[Slaughterhouse Raven] - Job vehicle",
    },

    ReturnVehilclePos = vector3(951.9329, -2112.40, 30.551), -- return vehicle 

    ReturnVehicleMarker = { 
        Use = true, -- [true/false] - If you want to use marker, set it to 'true'
        Distance = 35.0, -- [float] - Distance to see marker 
        Type = 1, -- https://docs.fivem.net/docs/game-references/markers/
        Size = vector3(10.0, 10.0, 1.0),
        Color = {r = 255, g = 255, b = 255, a = 150},
    },

    ReturnVehicleBlip = {
        Sprite = 477,
        Color = 1,
        Scale = 0.9,
        Label = "[Slaughterhouse Raven] - Return vehicle",
    },
    

    SpawnPos = vector4(954.0662, -2106.07, 30.136, 90.76), -- vehicle spawn position

    SetPedIntoVehicle = true, -- if true, ped will be set into vehicle after spawning. 
    FullFuel = true, -- if true, vehicle will be spawned with full fuel. 

    Deposit = {
        Use = true, -- [true/false] - If you want to use deposit system, set it to 'true'
        Account = "cash", -- ("cash", "bank")
        Amount = 100, -- amount of money to deposit
    },

    SpawnPointCheck = { -- It will check spawn point. To prevent spawning vehicle on vehicle. 
        Use = true,
        Radius = 3.5 -- Default radius 3.5
    }, 
}

Config.CatchingCows = {
    TakeOutOrReturnTrolleyTime = 2, -- Time to take out or return trolley (in seconds)


}

Config.KillStation = {
    DefaultShots = 3, -- Default shots to kill cow, ⚠️⚠️IF IS ExperienceSystem.Use = false⚠️⚠️

    ExperienceSystem = {
        Use = true, -- [true/false] - If you want to use experience system, set it to 'true'

        -- Experience system - (⚠️chances for catching chicken you can change in client-customize.lua file (client/client-customize.lua))
        IncreaseExperience = {
            Min = 1, -- [Min] - Minimum experience to increase
            Max = 3  -- [Max] - Maximum experience to increase
        },

        ExperienceTable = { 
            -- [Experience] = {min shots, max shots}
            [0] = {3, 7},  -- 0 XP = min and max shots to kill the cow
            [25] = {3, 6}, 
            [75] = {3, 5}, 
            [95] = {2, 4}, 
            [120] = {2, 3},
            [150] = {1, 2},
            [170] = {1, 1},
            --You can add more XP and chances here, like [200] = {1, 1}
        }, 
    }, 

}

Config.WashSink = {
    WashingTime = 15, -- Time to wash cow (in seconds)
    
}

Config.CutCow = { 


    -- ⚠️DISABLED FOR NOW, WILL BE FIXED IN THE NEXT SCRIPT UPDATE!⚠️
    -- ⚠️DISABLED FOR NOW, WILL BE FIXED IN THE NEXT SCRIPT UPDATE!⚠️
    -- SoundEffect = { -- Sound effect configuration
    --     Use = true, -- [true/false] - If you want to use sound effect, set it to 'true'
    --     Volume = 0.6, -- [float] - Volume of sound effect
    -- },


}

Config.CutCowHalf = {
    CuttingSpeed = 0.07, -- Cutting speed (default 0.07) sliding object speed, RECOMMENDED TO LEAVE IT ON 0.07, BECAUSE OF SOUND EFFECTS!!!

    SoundEffect = { -- Sound effect configuration
        Use = true, -- [true/false] - If you want to use sound effect, set it to 'true'
        Volume = 0.4, -- [float] - Volume of sound effect
    },

    Items = { 
        -- [ITEM_NAME] = AMOUNT or {MinAmount = MIN, MaxAmount = MAX}
        [Config.Items.Ribeye] = 2,   
        [Config.Items.Sirloin] = 2,  
        [Config.Items.Brisket] = 1,  
        [Config.Items.Tenderloin] = 1, 
        [Config.Items.Chuck] = 4, 
        [Config.Items.Shank] = 2, 
        [Config.Items.Kidneys] = 1, 
        [Config.Items.BoneMarrow] = {MinAmount = 2, MaxAmount = 4}, 
    },
}

Config.Grinder = {
    GrindingMeatTime = 15, -- Time to grind meat (in seconds)

    MachineZones = { 
        vector3(975.6870, -2120.37, 31.393), 
        vector3(976.2154, -2115.17, 31.389),
        -- You can add more vectors here.
    },


    GrinderMenu = {
        ["500"] = { -- 1000 = 1000 grams of gound meat 
            [Config.Items.Head] = 1,
            [Config.Items.Ribeye] = 1,
            [Config.Items.Sirloin] = 2,
            [Config.Items.Brisket] = 1,
            [Config.Items.Tenderloin] = 1,
            [Config.Items.Chuck] = 2,
            [Config.Items.Shank] = 1,
            [Config.Items.Kidneys] = 4,
            [Config.Items.BoneMarrow] = 2,
        }, 

        ["1000"] = { 
            [Config.Items.Head] = 2,
            [Config.Items.Ribeye] = 2,
            [Config.Items.Sirloin] = 4,
            [Config.Items.Brisket] = 2,
            [Config.Items.Tenderloin] = 2,
            [Config.Items.Chuck] = 4,
            [Config.Items.Shank] = 2,
            [Config.Items.Kidneys] = 8,
            [Config.Items.BoneMarrow] = 4,
        },

        ["2000"] = { 
            [Config.Items.Head] = 4,
            [Config.Items.Ribeye] = 4,
            [Config.Items.Sirloin] = 8,
            [Config.Items.Brisket] = 4,
            [Config.Items.Tenderloin] = 4,
            [Config.Items.Chuck] = 8,
            [Config.Items.Shank] = 4,
            [Config.Items.Kidneys] = 16,
            [Config.Items.BoneMarrow] = 8,
        }   
    }
        -- You can add more if you want. 
}



Config.InstantSell = { 
    Use = true, -- [true/false] - If you want to use instant sell system, set it to 'true' 

    Ped = {
        Model = "s_m_m_migrant_01", -- https://docs.fivem.net/docs/game-references/ped-models/
        Pos = vector4(952.2521, -2124.89, 30.446, 264.85),
    }, 

    Blip = { -- https://docs.fivem.net/docs/game-references/blips/
        Use = true, -- [true/false] - If you want to use blip, set it to 'true'
        Sprite = 514,
        Color = 5,
        Scale = 0.9,
        Label = "[Slaughterhouse Raven] - Sell point",
    },

    DynamicPrices = {
        Use = true, -- [true/false] - If you want to use dynamic prices, set it to 'true'
        PriceMinMultiplier = 0.7, -- Min price multiplier, 70% of original price
        PriceMaxMultiplier = 1.5, -- Max price multiplier, 150% of original price
    }, 

    Account = "cash", -- ("cash", "bank")

    SellMenu = {
        {ItemName = Config.Items.Head, Price = 200},
        {ItemName = Config.Items.GroundMeat, Price = 20},
        {ItemName = Config.Items.Ribeye, Price = 300},
        {ItemName = Config.Items.Sirloin, Price = 270},
        {ItemName = Config.Items.Brisket, Price = 320},
        {ItemName = Config.Items.Tenderloin, Price = 330},
        {ItemName = Config.Items.Chuck, Price = 150},
        {ItemName = Config.Items.Shank, Price = 240},
        {ItemName = Config.Items.Kidneys, Price = 90},
        {ItemName = Config.Items.BoneMarrow, Price = 45},
        -- You can add more items here.
    }
}

Config.Delivery = {
    -- DISABLED FOR NOW, WILL BE AVAILABLE IN THE NEXT SCRIPT UPDATE!
    -- AutoDeleteOrder = 5, -- Time to auto delete order if is it unpackaged or not delivered (IN DAYS)
    -- DISABLED FOR NOW, WILL BE AVAILABLE IN THE NEXT SCRIPT UPDATE!

    PedModels = {
        "s_m_m_migrant_01", -- https://docs.fivem.net/docs/game-references/ped-models/
    },

    Account = "cash", -- ("cash", "bank")

    WaitingTime = { -- Time to find order (in seconds)  
        Min = 30, -- [Min] - Minimum time to find order (delivery point) (in seconds)
        Max = 60, -- [Max] - Maximum time to find order (delivery point) (in seconds)
    },

    Blip = {
        Use = true, -- [true/false] - If you want to use blip, set it to 'true'
        Sprite = 514,
        Color = 47,
        Scale = 1.0,
        Label = "[Slaughter job] - Delivery point",
    },

    DeliveryPoints = { -- Delivery points
        vector4(1734.031, 6409.151, 35.000, 132.51),
        vector4(1655.135, 4874.198, 42.069, 275.72),
        vector4(1963.889, 3739.070, 32.351, 238.64),
        vector4(916.3735, 3576.821, 33.561, 264.65),
        vector4(-1177.91, -892.363, 13.754, 318.38), -- BurgerShoot
        vector4(78.53101, 274.6932, 110.21, 160.22), -- Up-n-Atom
        vector4(412.7020, -1905.91, 25.504, 43.76),
        vector4(195.5339, -1764.04, 29.361, 86.36),
        vector4(6.011523, -1602.32, 29.294, 46.91),
        vector4(23.65342, -1349.79, 29.326, 222.24),
        vector4(45.90279, -999.194, 29.347, 333.86),
        vector4(-708.427, -917.119, 19.214, 174.23),
        vector4(-1654.28, -1037.47, 13.152, 51.19),
        vector4(-1529.19, -908.699, 10.169, 153.18),
        -- You can add more delivery points here.
    }, 

    NumberOfItems = { -- Number of items per order 
        Min = 3, -- [Min] - Minimum number of items per order
        Max = 6, -- [Max] - Maximum number of items per order
    },

    DynamicPrices = {
        Use = true, -- [true/false] - If you want to use dynamic prices, set it to 'true'
        PriceMinMultiplier = 0.8, -- Min price multiplier, 80% of original price
        PriceMaxMultiplier = 1.7, -- Max price multiplier, 170% of original price
    }, 

    DistanceMultiplier = {
        Use = true, -- [true/false] - If you want to use distance multiplier, set it to 'true'
        PriceMultiplier = 0.1, -- Adittional earn for each meter - (distance between company and delivery point) default 0.1$ per meter
    },

    PackagingTime = 15, -- Time to pack items (in seconds) 

    DeliveryItems = { -- Items that can be delivered
        {ItemName = Config.Items.Head, Price = 200, Amount = {Min = 1, Max = 2}},
        {ItemName = Config.Items.GroundMeat, Price = 20, Amount = {Min = 100, Max = 750}},
        {ItemName = Config.Items.Ribeye, Price = 300, Amount = {Min = 2, Max = 4}},
        {ItemName = Config.Items.Sirloin, Price = 270, Amount = {Min = 1, Max = 3}},
        {ItemName = Config.Items.Brisket, Price = 320, Amount = {Min = 1, Max = 4}},
        {ItemName = Config.Items.Tenderloin, Price = 330, Amount = {Min = 2, Max = 4}},
        {ItemName = Config.Items.Chuck, Price = 150, Amount = {Min = 3, Max = 6}},
        {ItemName = Config.Items.Shank, Price = 240, Amount = {Min = 1, Max = 3}},
        {ItemName = Config.Items.Kidneys, Price = 90, Amount = {Min = 1, Max = 6}},
        {ItemName = Config.Items.BoneMarrow, Price = 45, Amount = {Min = 2, Max = 5}},
    }
}

function DrawText3D(coords, text, scale2)
    local camCoords = GetGameplayCamCoord()
    local dist = #(coords - camCoords)
    
    -- Experimental math to scale the text down
    local scale = 200 / (GetGameplayCamFov() * dist)

    -- Format the text
    SetTextScale(0.0, scale2 * scale)
    SetTextFont(1)
    SetTextDropshadow(0, 0, 0, 0, 255)
    SetTextEdge(2, 0, 0, 0, 150)
    SetTextOutline()
    SetTextDropShadow()
    SetTextCentre(true)

    -- Diplay the text
    BeginTextCommandDisplayText("STRING")
    AddTextComponentSubstringPlayerName(text)
    SetDrawOrigin(coords, 0)
    EndTextCommandDisplayText(0.0, 0.0)
    ClearDrawOrigin()
end


Items

Config.Items = {
    Rope = "slaughter_rope",
    SlaughterKnife = "slaughter_knife",

    Cow = "slaughter_cow",
    DeadCow = "slaughter_dead_cow",
    WashedDeadCow = "slaughter_washed_dead_cow",

    Head = "slaughter_cow_head",
    Half = "slaughter_cow_half",

    Ribeye = "slaughter_ribeye",
    Sirloin = "slaughter_sirloin",
    Brisket = "slaughter_brisket",
    Tenderloin = "slaughter_tenderloin",
    Chuck = "slaughter_chuck",
    Shank = "slaughter_shank",
    Kidneys = "slaughter_kidneys",
    BoneMarrow = "slaughter_bonemarrow",

    GroundMeat = "slaughter_ground_meat",

    Order = "slaughter_order",
} 
1 Like