GetAnimalState
What an animal is doing - hunting, fleeing or calm - and who it is about.
Syntax
Section titled “Syntax”GetAnimalState(id)| Parameter | Type | |
|---|---|---|
id |
number | the animal |
Returns
Section titled “Returns”string, number - "hunting" and its prey, "fleeing" and the player it runs from, or "calm" and nil; nil for anything but an animal
Example
Section titled “Example”local state, pid = GetAnimalState(wolf)if state == "hunting" then SendClientMessage(pid, COLOR_RED, "A wolf is on your trail!") endSee also
Section titled “See also”SetAnimalHostile · SetAnimalFlee · SetAnimalBehavior · the NPC actors group of the index
