Skip to content

Skillchecks ​

Shiva provides a client-side Skillcheck global for triggering interactive skill check minigames rendered by the NUI host. Five types are available out of the box.

Skillcheck Types ​

TypeDescription
circleRotating arc — click when the indicator is inside the window
sequencePress a sequence of keys in order
lockpickPin tumbler — hold each pin at the right moment
hackGrid-based hacking puzzle
wiresCut the correct wire

Basic Usage ​

All skillcheck functions follow the same signature:

lua
Skillcheck.TYPE(opts, callback)

The callback receives true if the player succeeded, false if they failed.

lua
Skillcheck.circle({ difficulty = 'medium' }, function(success)
    if success then
        TriggerServerEvent('net:mymodule:fishCaught')
    else
        -- failed, play failure animation
    end
end)

Circle Skillcheck ​

lua
Skillcheck.circle({
    difficulty = 'easy',  -- 'easy' | 'medium' | 'hard'
    duration   = 3000,    -- ms before auto-fail (optional)
}, callback)

Sequence Skillcheck ​

lua
Skillcheck.sequence({
    keys   = { 'W', 'A', 'S', 'D' },  -- keys to press in order
    speed  = 'normal',                  -- 'slow' | 'normal' | 'fast'
}, callback)

Lockpick Skillcheck ​

lua
Skillcheck.lockpick({
    pins       = 4,        -- number of pins (1–6)
    difficulty = 'medium',
}, callback)

Hack Skillcheck ​

lua
Skillcheck.hack({
    gridSize   = 4,        -- 4x4 grid
    difficulty = 'hard',
    timeLimit  = 30000,    -- ms
}, callback)

Wires Skillcheck ​

lua
Skillcheck.wires({
    count     = 5,         -- number of wires
    correct   = 2,         -- how many to cut
    timeLimit = 20000,
}, callback)

Full Example — Fishing Cast ​

lua
local function startFishing()
    -- Show a circle skillcheck while casting
    Skillcheck.circle({ difficulty = 'easy', duration = 4000 }, function(success)
        if success then
            TriggerServerEvent('net:mymodule:fishCaught', { bonus = true })
            View.notify({ type = 'success', message = 'Nice cast!' })
        else
            View.notify({ type = 'error', message = 'The line snapped.' })
        end
    end)
end

Internals ​

All skillcheck types delegate to View.skillcheck(type, opts, cb), which sends a SendNUIMessage to the NUI host and listens for NUI:skillcheck:result. You don't need to interact with View directly.

API Reference ​

MethodDescription
Skillcheck.circle(opts, cb)Rotating arc skillcheck
Skillcheck.sequence(opts, cb)Key sequence skillcheck
Skillcheck.lockpick(opts, cb)Pin tumbler skillcheck
Skillcheck.hack(opts, cb)Grid hack skillcheck
Skillcheck.wires(opts, cb)Wire cutting skillcheck

Client-only

Skillcheck is a client-side global. It is not available in server scripts.

See Also ​

Released under the MIT License.