SkillCheck, Hacking & Lockpicking
The B2Lib minigame system provides three interactive minigames: skillcheck (timing-based), lockpicking, and hacking. These systems are perfect for adding interactive elements to your gameplay mechanics.




skillcheck
Display a comprehensive timing-based circular skillcheck minigame with advanced difficulty scaling and customization options.
Parameters:
options(table, required): Comprehensive skillcheck configuration objectplayerId(number, server-side only): Player server ID to show skillcheck to
Configuration Options:
id(string, optional): Unique skillcheck identifier for tracking and management (default: auto-generated UUID)position(string, optional): Screen position ('center', 'top-left', 'top-right', 'bottom-left', 'bottom-right') (default: 'center')difficulty(string, optional): Difficulty preset ('easy', 'medium', 'hard', 'expert', 'custom') (default: 'medium')speed(number, optional): Indicator movement speed multiplier with precision control (default: 2.0)targetAngle(number, optional): Target zone position in degrees with randomization support (default: 90)targetSize(number, optional): Target zone size in degrees with adaptive scaling (default: 45)perfectSize(number, optional): Perfect zone size in degrees for bonus scoring (default: 15)indicatorSize(number, optional): Moving indicator size in degrees with visual clarity (default: 20)maxAttempts(number, optional): Maximum attempts allowed with progressive difficulty (default: 3)pattern(string, optional): Movement pattern ('continuous', 'bounce', 'accelerate', 'random') (default: 'continuous')direction(number, optional): Initial direction (1 for clockwise, -1 for counter-clockwise) (default: 1)key(string, optional): Primary interaction key with customizable bindings (default: 'Space')alternativeKeys(table, optional): Alternative key bindings for accessibilitytimeLimit(number, optional): Overall time limit in milliseconds (default: 30000)zones(table, optional): Multiple target zones for advanced skillchecksrandomizeTarget(boolean, optional): Randomize target position each attempt (default: false)progressiveSpeed(boolean, optional): Increase speed with each successful attempt (default: false)vibration(boolean, optional): Controller vibration feedback (default: true)soundProfile(string, optional): Audio profile ('default', 'mechanical', 'electronic', 'silent') (default: 'default')
Visual Customization:
size(string, optional): Circle diameter with responsive scaling (default: '200px')strokeWidth(number, optional): Ring thickness with visual clarity optimization (default: 8)centerSize(string, optional): Center button size with proportional scaling (default: '48px')textSize(string, optional): Text font size with readability optimization (default: '1rem')shadow(string, optional): Drop shadow intensity ('none', 'sm', 'md', 'lg', 'xl') (default: 'lg')targetOpacity(number, optional): Target zone opacity with accessibility compliance (default: 0.8)perfectOpacity(number, optional): Perfect zone opacity with visual distinction (default: 0.9)showAttempts(boolean, optional): Display attempts counter with progress indication (default: true)showTimer(boolean, optional): Display countdown timer with visual urgency (default: false)showProgress(boolean, optional): Display overall progress indicator (default: false)glowEffect(boolean, optional): Enable glow effects for enhanced visibility (default: true)colorScheme(table, optional): Custom color scheme with theme integrationanimations(table, optional): Custom animation settings and transitions
Returns: string|boolean - Skillcheck ID on success, false on failure
Controls:
Space (or configured key): Attempt to hit the target zone
Escape: Cancel skillcheck (if enabled)
Alternative Keys: Custom key bindings for accessibility
Example:
hideSkillcheck
Hide the currently active skillcheck minigame with optional cleanup and result handling.
Parameters:
options(table, optional): Hide operation configurationplayerId(number, server-side only): Player server ID to hide skillcheck for
Configuration Options:
reason(string, optional): Hide reason ('completed', 'cancelled', 'timeout', 'manual') (default: 'manual')animate(boolean, optional): Animate hide transition (default: true)cleanup(boolean, optional): Clean up event handlers and resources (default: true)triggerEvent(boolean, optional): Trigger skillcheck-closed event (default: true)
Returns: boolean - Success status indicating skillcheck hide completion
Example:
lockpicking
Display a comprehensive tension-based lockpicking minigame with realistic mechanics and advanced customization options.
Parameters:
options(table, required): Comprehensive lockpicking configuration objectplayerId(number, server-side only): Player server ID to show lockpicking to
Configuration Options:
id(string, optional): Unique lockpicking identifier for tracking and management (default: auto-generated UUID)name(string, optional): Lock name/description for context display (default: 'Lock')position(string, optional): Screen position with responsive placement (default: 'center')difficulty(string, optional): Difficulty preset ('easy', 'medium', 'hard', 'expert', 'custom') (default: 'medium')timeLimit(number, optional): Time limit in milliseconds with visual countdown (default: 60000)pins(table, optional): Custom pin configurations for advanced lockslockType(string, optional): Lock mechanism type ('standard', 'deadbolt', 'electronic', 'masterwork') (default: 'standard')tensionSensitivity(number, optional): Tension control sensitivity (0.1-2.0) (default: 1.0)breakChance(number, optional): Lockpick break probability on failure (0-1) (default: 0.1)sweetSpotSize(number, optional): Sweet spot size for successful picking (default: 15)rotationSpeed(number, optional): Lockpick rotation speed multiplier (default: 1.0)maxAttempts(number, optional): Maximum picking attempts before failure (default: 5)vibrationFeedback(boolean, optional): Controller vibration for tension feedback (default: true)audioFeedback(boolean, optional): Audio cues for picking feedback (default: true)visualFeedback(boolean, optional): Visual tension and feedback indicators (default: true)progressiveBreaking(boolean, optional): Progressive lockpick wear and breaking (default: true)realismMode(boolean, optional): Enhanced realism with complex mechanics (default: false)
Advanced Options:
customPins(table, optional): Detailed pin configuration arraylockpickQuality(string, optional): Lockpick quality affecting durability ('poor', 'standard', 'professional', 'masterwork') (default: 'standard')environmentalFactors(table, optional): Environmental effects on difficultyskillModifiers(table, optional): Player skill-based modificationsantiCheat(table, optional): Server-side validation and anti-cheat measures
Returns: string|boolean - Lockpicking ID on success, false on failure
Controls:
A/D Keys: Rotate lockpick left/right with precision control
W/S Keys: Apply tension up/down with feedback
Enter: Attempt to pick the lock at current position
Escape: Cancel lockpicking operation
Shift: Fine adjustment mode for precise control
Space: Reset lockpick position to center
Example:
hideLockpicking()
Hide the currently active lockpicking minigame.
Returns: boolean - Success status
Example:
hacking
Display a comprehensive sequence-based hacking minigame with terminal-style interface and advanced customization options.
Parameters:
options(table, required): Comprehensive hacking configuration objectplayerId(number, server-side only): Player server ID to show hacking to
Configuration Options:
id(string, optional): Unique hacking identifier for tracking and management (default: auto-generated UUID)name(string, optional): Terminal name/description for context display (default: 'Terminal')position(string, optional): Screen position with responsive placement (default: 'center')difficulty(string, optional): Difficulty preset ('easy', 'medium', 'hard', 'expert', 'custom') (default: 'medium')timeLimit(number, optional): Time limit in milliseconds with visual countdown (default: 30000)sequences(table, optional): Array of sequence configurations for multi-stage hackinghackType(string, optional): Hacking mechanism type ('sequence', 'matrix', 'cipher', 'network') (default: 'sequence')codeLength(number, optional): Individual code length for sequence generation (default: 2)sequenceCount(number, optional): Number of sequences to complete (default: 2)showTime(number, optional): Time to display each sequence in milliseconds (default: 2000)inputTime(number, optional): Time allowed for input after sequence display (default: 5000)caseSensitive(boolean, optional): Whether codes are case-sensitive (default: false)allowPartialInput(boolean, optional): Allow partial sequence input (default: true)progressiveSpeed(boolean, optional): Increase speed with each successful sequence (default: false)randomizeSequences(boolean, optional): Randomize sequence order and content (default: true)visualEffects(boolean, optional): Enable terminal-style visual effects (default: true)audioFeedback(boolean, optional): Audio cues for typing and feedback (default: true)accessLevel(string, optional): Required access level ('user', 'admin', 'root', 'system') (default: 'user')
Advanced Options:
customSequences(table, optional): Predefined sequence configurationsmatrixSize(table, optional): Matrix dimensions for matrix-type hackingnetworkNodes(table, optional): Network node configuration for network-type hackingencryptionLevel(string, optional): Encryption complexity ('basic', 'advanced', 'military') (default: 'basic')antiCheat(table, optional): Server-side validation and anti-cheat measuresskillModifiers(table, optional): Player skill-based modifications
Returns: string|boolean - Hacking ID on success, false on failure
Controls:
Alphanumeric Keys: Input sequence codes with real-time validation
Enter: Confirm sequence input and proceed to next stage
Backspace: Delete last character in current input
Escape: Cancel hacking operation (if enabled)
Tab: Switch between input fields in matrix mode
Arrow Keys: Navigate network nodes in network mode
Example:
hideHacking
Hide the currently active hacking minigame with optional cleanup and result handling.
Parameters:
options(table, optional): Hide operation configurationplayerId(number, server-side only): Player server ID to hide hacking for
Configuration Options:
reason(string, optional): Hide reason ('completed', 'cancelled', 'timeout', 'detected', 'manual') (default: 'manual')animate(boolean, optional): Animate hide transition with terminal effects (default: true)cleanup(boolean, optional): Clean up event handlers and resources (default: true)triggerEvent(boolean, optional): Trigger hacking-closed event (default: true)securityAlert(boolean, optional): Trigger security alert on forced closure (default: false)
Returns: boolean - Success status indicating hacking hide completion
Example:
Server-Side Usage
The Skillcheck module provides comprehensive server-side integration for centralized minigame management, player validation, and anti-cheat protection. Server-side functions enable administrators to control minigame access, validate results, and maintain game integrity across all connected players.
Server-Side Functions
All client-side skillcheck functions have corresponding server-side exports that take a playerId as the first parameter:
Server-Side Events
Handle minigame results and player actions on the server:
Anti-Cheat Integration
Implement comprehensive anti-cheat measures for minigame integrity:
Player Management
Manage player minigame access and restrictions:
Events
The Skillcheck module provides a comprehensive event system for handling minigame results, progress tracking, and integration with other game systems. Events are triggered both client-side and server-side for maximum flexibility and security.
Client-Side Events
b2lib:skillcheck-result
Triggered when skillcheck minigame completes with comprehensive result data.
b2lib:skillcheck-opened
Triggered when skillcheck minigame opens.
b2lib:skillcheck-closed
Triggered when skillcheck minigame closes.
b2lib:lockpicking-result
Triggered when lockpicking minigame completes with detailed result information.
b2lib:lockpicking-opened
Triggered when lockpicking minigame opens.
b2lib:hacking-result
Triggered when hacking minigame completes with comprehensive access information.
b2lib:hacking-opened
Triggered when hacking minigame opens.
Server-Side Events
b2lib:server:minigame-completed
Triggered on server when any minigame completes for centralized logging.
Configuration
The Skillcheck module provides extensive configuration options for customizing minigame behavior, difficulty scaling, visual appearance, and integration settings. Configuration is managed through multiple config sections for maximum flexibility and organization.
Core Minigame Configuration
Configure default minigame settings and behavior in Config.lua:
Visual Styling Configuration
Customize the appearance and animations of minigame interfaces:
Advanced Examples
Lockpicking System
Hacking System
Crafting System with Skillchecks
Best Practices
Follow these comprehensive guidelines to ensure optimal minigame implementation and user experience:
1. Context-Appropriate Minigame Selection
Choose minigame types that match the narrative and mechanical context of the action being performed.
2. Balanced Difficulty Progression
Implement progressive difficulty that scales with player skill and context importance.
3. Comprehensive Feedback Systems
Provide immediate, clear, and meaningful feedback for all minigame outcomes.
4. Graceful Failure Handling
Design failure consequences that encourage learning rather than punish experimentation.
5. Enhanced Audio-Visual Experience
Leverage sound effects and visual feedback to create immersive experiences.
6. Accessibility and Inclusivity
Provide options for players with different abilities and preferences.
7. Performance Optimization
Implement efficient resource management and cleanup procedures.
8. Server-Side Validation and Security
Always validate minigame results server-side to prevent cheating.
9. Integration with Game Systems
Design minigames to integrate seamlessly with existing game mechanics.
10. User Experience Consistency
Maintain consistent behavior and visual design across all minigame implementations.
Troubleshooting
Comprehensive troubleshooting guide for common minigame issues and their solutions:
Minigame Interface Issues
Minigame Not Displaying
Symptoms: Minigame function called but no interface appears on screen.
Diagnostic Steps:
Check B2Lib Initialization:
Verify No Conflicting UI:
Console Error Checking:
Position Validation:
Visual Rendering Problems
Symptoms: Minigame appears but with visual glitches or incorrect styling.
Solutions:
Reset Component Styles:
Check Theme Compatibility:
Clear Style Cache:
Input and Control Issues
Controls Not Responding
Symptoms: Minigame displays but key presses are not registered.
Diagnostic Steps:
NUI Focus Verification:
Key Binding Conflicts:
Resource Interference:
Inconsistent Input Timing
Symptoms: Input registration varies or feels delayed.
Solutions:
Frame Rate Optimization:
Input Debouncing:
Event System Issues
Events Not Triggering
Symptoms: Minigame completes but result events are not fired.
Diagnostic Steps:
Event Handler Registration:
Event Name Verification:
Handler Function Errors:
Duplicate Event Firing
Symptoms: Result events fire multiple times for single minigame completion.
Solutions:
Event Handler Cleanup:
Result ID Tracking:
Performance and Resource Issues
Frame Rate Drops During Minigames
Symptoms: Significant FPS reduction when minigames are active.
Solutions:
Resource Monitoring:
Optimization Settings:
Memory Leaks
Symptoms: Increasing memory usage over time with repeated minigame use.
Solutions:
Explicit Cleanup:
Resource Limits:
Anti-Cheat and Validation Issues
False Positive Cheat Detection
Symptoms: Legitimate players flagged for cheating.
Solutions:
Adjust Validation Thresholds:
Player Skill Consideration:
Validation Not Working
Symptoms: Cheaters not being detected or blocked.
Solutions:
Enable Comprehensive Logging:
Server-Side Enforcement:
Last updated