1
0
EQ2Emu/docs/lua_functions/GetFollowTarget.md

20 lines
619 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### Function: GetFollowTarget(Spawn)
**Description:**
Retrieves the current follow target of a given NPC or pet. If the spawn is following someone, this returns the entity being followed.
**Parameters:**
- `spawn` (Spawn) Spawn object representing NPC (or players pet) that might be following a target.
**Returns:** Spawn The entity that Spawn is currently following, or nil if its not following anyone.
**Example:**
```lua
-- Example usage (check who an escort NPC is following)
local leader = GetFollowTarget(EscortNPC)
if leader == Player then
Say(EscortNPC, "I am right behind you!")
end
```