mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 06:28:54 +00:00
new docs
This commit is contained in:
1 parent
3cebaf7fa5
commit
b5eba8423f
229 files changed
+6238
-10690
No files matched your search
@@ -0,0 +1,65 @@
|
||||
---
|
||||
title: Skill Check
|
||||
---
|
||||
|
||||
import { Tabs, Tab } from 'nextra-theme-docs';
|
||||
|
||||
### 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 `object`
|
||||
- Can set custom difficulty by sending a object instead of string
|
||||
- `{ areaSize: number, speedMultiplier: number }`
|
||||
- easy: `{ areaSize: 50, speedMultiplier: 1 }`
|
||||
- medium: `{ areaSize: 40, speedMultiplier: 1.5 }`
|
||||
- hard: `{ areaSize: 25, speedMultiplier: 1.75 }`
|
||||
- `areaSize` size of the area in degrees.
|
||||
- Sending an array will chain the checks together and return false if one fails and true if all succeed
|
||||
- inputs: `string[]`
|
||||
- Picks a random key from the inputs table to use on each skill check pass.
|
||||
|
||||
### 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>
|
||||
|
||||

|
||||
Reference in new issue
Block a user