Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 960 Bytes

qb-keyminigame.md

File metadata and controls

38 lines (28 loc) · 960 Bytes
description
Simon says press this key

⌨ qb-keyminigame

Introduction

  • This is a JavaScript mini game that prompts players to press certain keys within a set amount of time and returns how many times they messed up

Preview

Configuration

{% hint style="success" %} This resource requires no configuration and has no dependencies {% endhint %}

Usage example

local function minigameResults(faults) -- callback function with fault amount
    if faults == 0 then
        print('Player finished game with 0 faults!')
    elseif faults == 1 then
        print('Player finished game with 1 faults!')
    elseif faults == 2 then
        print('Player finished game with 2 faults!')
    end
end

RegisterCommand('keyminigame', function()
    TriggerEvent('qb-keyminigame:show') -- displays game UI on screen
    TriggerEvent('qb-keyminigame:start', minigameResults) -- starts game
end)