2025-05-28 21:48:33 -04:00
### Function: CanSeeInvis(Player, Target)
2025-05-04 14:34:15 -04:00
2025-05-28 21:48:33 -04:00
**Description:** Checks if the given NPC or player can see invisible entities. Some NPCs have see-invis or see-stealth abilities, which this would indicate.
2025-05-04 14:34:15 -04:00
2025-05-28 21:48:33 -04:00
**Parameters:**
2025-05-04 14:34:15 -04:00
2025-05-28 21:48:33 -04:00
`Player/Entity` : Spawn – The Player/Entity to check for see-invisibility capability.
`Target` : Spawn – The entity to check if Player can see them.
2025-05-04 14:34:15 -04:00
2025-05-28 21:48:33 -04:00
**Returns:** Boolean – true if this spawn can detect invisible targets; false if not.
2025-05-04 14:34:15 -04:00
2025-05-28 21:48:33 -04:00
**Example:**
2025-05-13 22:57:49 -04:00
2025-05-28 21:48:33 -04:00
```lua
2025-05-13 22:57:49 -04:00
-- Example usage (NPC will attack stealthed players only if it can see invis)
if IsPlayer(Target) or CanSeeInvis(NPC, Target) then
Attack(NPC, Target)
2025-05-28 21:48:33 -04:00
end
```