Skip to content

GetAnimalState

What an animal is doing - hunting, fleeing or calm - and who it is about.

GetAnimalState(id)
Parameter Type
id number the animal

string, number - "hunting" and its prey, "fleeing" and the player it runs from, or "calm" and nil; nil for anything but an animal

local state, pid = GetAnimalState(wolf)
if state == "hunting" then SendClientMessage(pid, COLOR_RED, "A wolf is on your trail!") end

SetAnimalHostile · SetAnimalFlee · SetAnimalBehavior · the NPC actors group of the index