Hey guys, I’ve always wanted to Roleplay as a police officer with a K9, unfortunately, I never found THE script that has no bugs, and is easy to use and for free ! So I decided to make my own script, and here it is !
(note that some functions were inspired by other scripts, but I tried to make it as much as possible as standalone as possible)
Usage :
To use the resource, download it, put the mth-K9 folder in your main resources folder.
Add start mth-K9 to your server.cfg
Then, once you’re in game, press O to toggle the menu.
Features :
STANDALONE : this means that you don’t need any dependencies to start this script on your server
Easy to use
Give your K9 a name
Multiple animations for your K9
Attack a target (you can choose between the K9 attacking the player in front of him, or the player you’re selecting)
The K9 can follow you, or stay in a specific place
I think the dogs animations may be too fast, you could also add entry and exit animations, for example, the dog is laying down sleeping, and when you stop that animation or click another animation, it plays an exit animation before cancelling or switching.
Here’s some that I used:
Small dog getting up from sitting down (pug, poodle, etc)
Can you add a job and jobgrade restriction to open the menu? That would be nice to add this menu to a police menu. Would it also be possible to make a version with ox_lib context menu? There are a lot of people who use this.
For the job check, you can easily add a check around line 190 to check the player’s job / duty !
I never really worked with ox_lib context menu but I’ll take a look, if you manage to do it, feel free to add a pull request
Unfortunately I can’t script but i develop a server based on ox_lib. This script has a lot of potential and since many people use ox_lib I thought it would be awesome and fit the serverstyle of many people. However, it is your script and I think you could get a lot more out of this script and possibly charge money for it.
depends on your framework :
You should have an export that either gets the player job or that checks if the player is a cop :
Let’s say your export exports.core:checkCop() returns true when the player is a cop then the code will be something like :
Keys.Register('O', 'O', 'Menu K9', function()
if exports.core:checkCop() then
openK9Menu()
else
ShowNotification("You are not a cop!")
end
end)