Skill Check
lib.skillCheck
Runs a skill check with the defined difficulty.
- Lua
- JS/TS
lib.skillCheck(difficulty, inputs)
import lib from '@overextended/ox_lib/client'
lib.skillCheck(difficulty, inputs)
- difficulty:
easy
ormedium
orhard
orobject
- 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.
- { areaSize:
- Sending an array will chain the checks together and return false if one fails and true if all succeed
- Can set custom difficulty by sending a object instead of string
- inputs:
string[]
- Picks a random key from the inputs table to use on each skill check pass.
Usage Example
- Lua
- JS/TS
local success = lib.skillCheck({'easy', 'easy', {areaSize = 60, speedMultiplier = 2}, 'hard'}, {'w', 'a', 's', 'd'})
import lib from '@overextended/ox_lib/client'
const success = await lib.skillCheck(['easy', 'easy', {areaSize: 60, speedMultiplier: 2}, 'hard'], ['w', 'a', 's', 'd'])