> ## Documentation Index
> Fetch the complete documentation index at: https://gluals.arnux.net/llms.txt
> Use this file to discover all available pages before exploring further.

# @fresh_result

> Mark a method that returns a new value on every call.

> [!NOTE]
>
> This annotation is intended for complex cases and is primarily designed to be used by the built-in annotations.

## Overview

GLuaLS normally treats repeated calls of a method with no arguments, like `ent:GetOwner()`, as the same value. A check on one call applies to the next:

```lua theme={null}
if IsValid(self:GetOwner()) then
    self:GetOwner():GetAimVector() -- no warning
end
```

Some methods return a different value every time, such as `CNavArea:GetRandomPoint()`. `fresh_result` marks those, so a check on one call does not carry over to the next.

***

## Syntax

```lua theme={null}
---@return T
---@[fresh_result]
```

Put it after the `@return` line.

***

## Example

```lua theme={null}
---@return Vector
---@[fresh_result]
function CNavArea:GetRandomPoint() end
```

```lua theme={null}
local point = area:GetRandomPoint()
if point.z > 0 then
    -- area:GetRandomPoint() here is a new point, not `point`
end
```

Store the result in a local when you need the same value again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.