> For the complete documentation index, see [llms.txt](https://hrscripts.gitbook.io/hrscripts-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hrscripts.gitbook.io/hrscripts-documentation/resources/hrlib/modules/radomvaluewithnorepetition/shared.md).

# Shared

## RandomValueWithNoRepetition

Function to generate a random value via given function that creates the value and the already occupied values

```lua
function HRLib.RandomValueWithNoRepetition(
    values: any[],
    createRandomValue: fun(): any
): any randomValue
```

Parameters description

* `values` - the occupied values
* `createRandomValue` - the function to trigger to get the value (must return value)

Return description

* `randomValue` - the random value, created by the createRandomValue function
