Price
UnknownA script by MajorFivePD
Price
UnknownMFPD-PoliceCompanion

NEW FEATURES & IMPROVEMENTS:
- Organized Squad Formation:
Companions now follow you in a structured V-shaped formation rather than clustering behind you. Up to 9 companions can line up in an organized squad, enhancing immersion and tactical appeal.
- Dynamic Movement Speed:
Your companions adjust their running speed to match yours. If you sprint, they run alongside you at a similar pace, ensuring they keep up seamlessly regardless of your movement.
- Enhanced /stay Command Behavior:
The/staycommand has been improved to check your configuration for animation preferences:
- If
Config.UseAnimis set totrue, companions will play a specified animation when standing still.- If
Config.UseAnimis set tofalse, they will remain stationary without playing the animation, respecting your configuration choice.- This allows you to customize whether companions use animations during a stay command.
- Framework Compatibility & Configuration:
- ESX/QBCore Integration:
Specify allowed jobs (e.g., police, sheriff) withinconfig.luato control who can spawn companions.- Standalone Mode:
Operates independently, offering full companion functionality without a framework.
Companion Spawning and Management:
Config.SpawnCommand = 'mfpd' -- Change to whatever you desire
Config.StopCompanion = 'stay' -- Change to whatever you desire
Config.DismissCommand = 'bye' -- Change to whatever you desire
If your ped dies, it will AUTOMATICALLY delete all of your companions, to avoid strange behaviors!
Use stay to toggle between stopping in formation and resuming follow behavior.
Enhanced Companion Behavior:
------------------------------------------------------
-- FORMATION OFFSETS EXPLANATION --
-- --
-- 1) x coordinate: --
-- • Negative (-) moves companions to the LEFT --
-- • Positive (+) moves companions to the RIGHT --
-- --
-- 2) y coordinate: --
-- • Negative (-) moves companions BEHIND you --
-- • Positive (+) moves companions IN FRONT --
-- --
-- 3) z coordinate: --
-- • Negative (-) places them BELOW your level --
-- • Positive (+) places them ABOVE your level --
-- --
-- Adjust these values to position your companions --
-- however you prefer. Below are just examples. --
------------------------------------------------------
Config.FormationOffsets = {
-- Companion #1: Slightly to the left of player
{ x = -2.0, y = 0.0, z = 0.0 },
-- Companion #2: Further left & behind
{ x = -3.0, y = -1.5, z = 0.0 },
-- Companion #3: Further left & in front
{ x = -3.0, y = 1.5, z = 0.0 },
-- Companion #4: Even more left & behind
{ x = -4.0, y = -3.0, z = 0.0 },
-- Companion #5: Even more left & in front
{ x = -4.0, y = 3.0, z = 0.0 },
-- Companion #6: Farther left & behind
{ x = -5.0, y = -4.5, z = 0.0 },
-- Companion #7: Farther left & in front
{ x = -5.0, y = 4.5, z = 0.0 },
-- Companion #8: Very far left & behind
{ x = -6.0, y = -6.0, z = 0.0 },
-- Companion #9: Very far left & in front
{ x = -6.0, y = 6.0, z = 0.0 },
-- Companion #10: Behind the player’s left
{ x = -2.5, y = -3.0, z = 0.0 }
}
Dynamic Movement:
They adjust their speed based on your movement, running when you run.
Combat Attributes:
Improved combat ensuring that companions will be able to communicate with each other and move together, taking cover or doing the appropriate action and engagement logic, including intelligent threat detection.
Config = {}
-- Choose the framework or Standalone mode
Config.Framework = 'Standalone' -- Options: 'ESX', 'QBCore', 'Standalone'
-- Resource Commands -- --
Config.SpawnCommand = 'mfpd' -- Change to whatever you desire
Config.StopCompanion = 'stay' -- Change to whatever you desire
Config.DismissCommand = 'bye' -- Change to whatever you desire
Config.ReactArea = 150.0 -- Set desired HOSTILE detection radius (in meters)
-- -- -- -- -- -- -- --
Config.UseAnim = false -- or false if you DO NOT want the animation below to play after /stay.
Config.Animation = { -- Default animations used to set both companions to Stay in place.
Dict = "amb@world_human_cop_idles@male@idle_b", -- Change animation dictionary here.
Name = "idle_e" -- Change animation name here.
}
-- Job/Role configuration for ESX.
Config.ESX = {
AllowedJobs = { -- You need to setup your job/roles here.
'police',
'sheriff'
}
}
-- Job/Role configuration for QBCore.
Config.QBCore = {
AllowedJobs = { -- You need to setup your job/roles here.
'police',
'sheriff'
}
}
Animation Control:
The stay command respects that you set in the config.lua respects the Config.UseAnim:
Vehicle Interactions:
Companions intelligently enter and exit vehicles with you based on your actions. No need to type any additional commmands.
Aiming/Flashlight Functionality:

Download and extract the “MFPD-PoliceCompanion” resource.
Place the resource folder into your server’s resources directory.
Add the following line to your server.cfg:
ensure MFPD-PoliceCompanion
Any support related questions, bugs/errors found, contact me via DM here on the Forum.
| Code is accessible | No - Only Config.lua |
|---|---|
| Subscription-based | No |
| ------------------------------------- | ---------------------------- |
| Lines (approximately) | 587+ |
| ------------------------------------- | ---------------------------- |
| Requirements | N/A |
| ------------------------------------- | ---------------------------- |
| Support | Yes |
| ------------------------------------- | ---------------------------- |
See what others are saying about this script.
Share your experience and help others.