From 23b2bb8b872b231ecf1dbc10f7bbb921c91e3ef8 Mon Sep 17 00:00:00 2001 From: Luke Date: Sun, 16 Oct 2022 18:14:32 +0200 Subject: [PATCH 1/2] add skillcheck docs --- docs/ox_lib/Interface/Client/skillcheck.md | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 docs/ox_lib/Interface/Client/skillcheck.md diff --git a/docs/ox_lib/Interface/Client/skillcheck.md b/docs/ox_lib/Interface/Client/skillcheck.md new file mode 100644 index 00000000..c6872f95 --- /dev/null +++ b/docs/ox_lib/Interface/Client/skillcheck.md @@ -0,0 +1,51 @@ +--- +title: Skill Check +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +### lib.skillCheck + +Runs a skill check with the defined difficulty. + + + + +```lua +lib.skillCheck(difficulty) +``` + + + +```ts +import lib from '@overextended/ox_lib/client' + +lib.skillCheck(difficulty) +``` + + + +* difficulty: `easy` or `medium` or `hard` or `object` + * Can set custom difficulty by sending a object instead of string + * { areaSize: `number`, speedMultiplier: `number` } + * Sending an array will chain the checks together and return false if one fails and true if all succeed + +### Usage Example + + + + +```lua +local success = lib.skillCheck({'easy', 'easy', {areaSize = 250, speedMultiplier = 2}, 'hard'}) +``` + + + +```ts +import lib from '@overextended/ox_lib/client' + +const success = await lib.skillCheck(['easy', 'easy', {areaSize: 250, speedMultiplier: 2}, 'hard']) +``` + + From 90aa2b2d9767c54fbf521702aa603b005f4be4c4 Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 18 Oct 2022 18:17:42 +0200 Subject: [PATCH 2/2] update skill check information --- docs/ox_lib/Interface/Client/skillcheck.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/ox_lib/Interface/Client/skillcheck.md b/docs/ox_lib/Interface/Client/skillcheck.md index c6872f95..955b905c 100644 --- a/docs/ox_lib/Interface/Client/skillcheck.md +++ b/docs/ox_lib/Interface/Client/skillcheck.md @@ -29,6 +29,10 @@ lib.skillCheck(difficulty) * 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: 275, speedMultiplier: 1 } + * medium: { areaSize: 290, speedMultiplier: 1.5 } + * hard: { areaSize: 295, speedMultiplier: 1.75 } + * `areaSize` works inverse, so smaller value means bigger zone. * Sending an array will chain the checks together and return false if one fails and true if all succeed ### Usage Example @@ -49,3 +53,5 @@ const success = await lib.skillCheck(['easy', 'easy', {areaSize: 250, speedMulti ``` + +![Image](https://i.imgur.com/RWSWZ1I.png)