[Release] K9 Script [REMOVED]

ok where is the download link?

Scroll up to the top of this topic.

at the very top or what?

Yes. The original topic.

The Dog kills the owner as soon as it starts attacking the target. I tried with all the models and all of them killed me before the dog attacked and killed the targets. Also, is it possible to make it so the Rotweiler doesn’t bark so much before it attacks? As it takes like 30 seconds to actually chase someone. Thanks in advance!

The dog is still a GTA dog. That is built into their code. Nothing I can really do about that. Not sure how you managed to get the dog to attack you as I have tested with multiple people and have never seen that occur :smiley:.

I see. The dog doesn’t attack me but as soon as it gets close to the target, I imediatly die.

ooops :smiley:. That is my fault. I added some code in there to kill the other player when he got close (may have targeted the local player by accident lol)

Go into the Client.lua file and find this

if attacking then
                if IsPedAPlayer(GetPlayerPed(attacked_player)) then
                    local k9Coods = GetEntityCoords(spawned_ped, false)
                    local otherPedCoords = GetEntityCoords(GetPlayerPed(attacked_player), alive)
                    local distance = Vdist(k9Coods.x, k9Coods.y, k9Coods.z, otherPedCoords.x, otherPedCoords.y, otherPedCoords.z)
                    if distance < 5.0 then
                        Citizen.Trace("KILLING PLAYER")
                        TriggerServerEvent("K9:KillPlayerRequest", attacked_player)
                    end
                end
end

and remove it. If you don’t feel comfortable doing that give me a minute I will post the removal for it.

I just went ahead a pushed the fix for it. :smiley:

I am also getting this error: https://gyazo.com/2a39beab35223c652113e960ec51e86c

Thanks for the fix tho, I apreciate it!

EDIT: it spams this error non stop until the dog actually kills the civilian, while it is chasing it!

EDIT2: The previous fix fixed this, thanks in advance!

Yeah. I fixed that aswell when I fixed the death issue.

Ok I have a noob question, why wont the menu open?

K9Config = {}
K9Config = setmetatable(K9Config, {})

K9Config.OpenMenuIdentifierRestriction = false
K9Config.OpenMenuPedRestriction = true
K9Config.LicenseIdentifiers = {
	"license:c06fbf1faaf995c7b9e207ef77712971a3ed4dc3"
}
K9Config.SteamIdentifiers = {
	"steam:1100001081f9ab0"
}
K9Config.PedsList = {
	"s_m_y_sheriff_01"
}

What can the dog even do?

Ffs, is because people like you that many coders keep the code for themselves instead of sharing. Go and do a BASIC search either on the post or on the code!

You have ped restriction set to true. Are you that ped listed in the table.

He can attack, follow, and get in and out of vehicle. I am doing seerching and animations today.

1 Like

Yes, seems it was an issue with my control. I changed it from default and it didn’t want to work. its all good now. Thanks.

Oh what is the License thing about btw?

Cant wait for this to be more funchtinal…really hoping for VRP intergration :slight_smile:

Well there are 3 identifiers in fivem. License, steam, and ip. I use license keys because they show up for every player that is in fivem. Only way to change them is by getting a different game. Steam is only available if steam is started and can change per steam account you are logged into.

1 Like

The menu seems to open for random players when they join the server. The menu opens but its bugged all white and crazy. Only happens to a few people. They are not whitelisted to use it nor is the ped variable set to true. They should not have access to the menu and they don’t but when they join the server, the menu sometimes appears completely bugged.

EDIT2: Also, when you teleport yourself through any admin menu, the k9 menu doesn’t spawn or delete the dogs, it only opens the menu but it is now useless unless you manually restart the resource.

So your first statement. I don’t know how to fix that. All of my menus on FiveM have been doing that. Still looking for an answer.

The second statement what are you talking about teleporting away. I would like to know more of this issue!