mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
* refactor: Add h1 headers to all pages missing it * refactor: missed example h3 * change hooks example heading to bold text --------- Co-authored-by: Luke <[email protected]>
63 lines
1.5 KiB
Plaintext
63 lines
1.5 KiB
Plaintext
---
|
|
title: Skill Check
|
|
---
|
|
|
|
import { Tabs, Tab } from 'nextra-theme-docs';
|
|
|
|
# Skill Check
|
|
|
|
## lib.skillCheck
|
|
|
|
Runs a skill check with the defined difficulty.
|
|
|
|
<Tabs items={["Lua", "JS"]}>
|
|
<Tab>
|
|
```lua
|
|
lib.skillCheck(difficulty, inputs)
|
|
```
|
|
</Tab>
|
|
<Tab>
|
|
```ts
|
|
import lib from '@overextended/ox_lib/client';
|
|
|
|
lib.skillCheck(difficulty, inputs);
|
|
```
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
- difficulty: `'easy'` or `'medium'` or `'hard'` or `table`
|
|
- Preset difficulties:
|
|
- 'easy' - `{ areaSize: 50, speedMultiplier: 1 }`
|
|
- 'medium' - `{ areaSize: 40, speedMultiplier: 1.5 }`
|
|
- 'hard' - `{ areaSize: 25, speedMultiplier: 1.75 }`
|
|
- Custom difficulties can be set by sending an object instead of one of the preset strings above
|
|
- areaSize: `number`
|
|
- Size of the success area in degrees
|
|
- speedMultiplier: `number`
|
|
- Multiplier for the speed of the indicator
|
|
- inputs?: `string[]`
|
|
- A random key will be picked from the inputs table for each skill check
|
|
- If no inputs are defined the key is defaulted to `e`
|
|
|
|
## Usage Example
|
|
|
|
<Tabs items={["Lua", "JS"]}>
|
|
<Tab>
|
|
```lua
|
|
local success = lib.skillCheck({'easy', 'easy', {areaSize = 60, speedMultiplier = 2}, 'hard'}, {'w', 'a', 's', 'd'})
|
|
```
|
|
</Tab>
|
|
<Tab>
|
|
```ts
|
|
import lib from '@overextended/ox_lib/client';
|
|
|
|
const success = await lib.skillCheck(
|
|
['easy', 'easy', { areaSize: 60, speedMultiplier: 2 }, 'hard'],
|
|
['w', 'a', 's', 'd']
|
|
);
|
|
```
|
|
</Tab>
|
|
</Tabs>
|
|
|
|

|