Tips & Tricks
This page provides practical advice, tips, and best practices for working with the heist system. Instead of repeating parameter documentation, we focus on the development workflow, common pitfalls, an
Development Workflow
Start Small, Expand Later
Tip: Begin with a minimal working heist and gradually add complexity.
First, create a heist with just one stage and a simple interaction
Test thoroughly before adding more stages
Add complexity one element at a time (NPCs, doors, rewards)
Test each addition before moving to the next
This approach helps isolate issues when they occur and makes troubleshooting much easier.
Debug and Development Mode
The system offers two special modes to help during development:
Debug Mode (debug = true
in config.lua):
Visualizes zones that are normally invisible
Shows interaction points, render zones, and other elements
Helps ensure everything is positioned correctly
Intended purely for testing and development
Development Mode (dev_mode = true
in config.lua):
Bypasses item requirements for interactions
Ignores police officer count requirements
Allows using interactions that require a bag even without one
Intended purely for testing and development
Important Note: Currently, to reset heists or apply configuration changes, you need to restart the script. There are no built-in commands for resetting heists dynamically.
Coordinate Gathering
When placing interaction points, use:
Use some tools to get your current position (x, y, z, heading)
For objects, stand directly in front of them
Note that interaction offsets may need adjustment - small tweaks of 0.1-0.2 units can make a difference
Common Pitfalls and Solutions
Interaction Placement
Problem: Players complain they can't interact with objects.
Solutions:
Make sure
distance
is appropriate (usually 1.0-1.5)Verify the
zone.pos
is correctly positionedCheck if your
ox_target
orqb_target
settings are correctAdjust the size/dimensions to match the object
Use the debug visualization to see if zones are positioned correctly
Stage Progression Issues
Problem: Players get stuck at a stage and can't progress.
Solutions:
Check if you've included
unlock_stage
in youron_complete
functionsVerify the stage_id parameter is correct
Ensure you haven't accidentally locked an interaction with
lock_interaction
Check if any prerequisites (like items) are too difficult to obtain
NPC Behavior Problems
Problem: NPCs aren't behaving as expected.
Solutions:
Double-check the
relationship
value (5 = hostile, 3 = neutral)Verify that
stage
is set correctly so NPCs spawn at the right timeCheck if
guards_friendly_with_police
matches your intentionFor patrol routes, ensure positions are navigable by NPCs, some maps or interiors don't have AI navigation points.
If NPCs are running away, check
always_fight
setting
Optimization Tips
Performance Considerations (WIP)
Limit NPC Count: Each NPC adds processing overhead. Use only as many as needed.
Laser Systems: Complex laser systems with many targets can be performance-intensive. Limit the number of laser points and keep them in a small area.
Gas Effects: Gas particles can impact performance. Use them sparingly and in strategic locations.
Location Selection
When choosing locations for heists, consider:
Server Population: Place heists in different areas of the map to avoid player congestion
Resource Usage: Avoid areas with many existing resources/scripts running
Interior Complexity: Complex interiors may already have performance impacts
MLO Compatibility: Ensure custom MLOs are stable and compatible with your server
Design Patterns and Techniques
Multi-Stage Design Pattern
A well-structured heist typically follows this pattern:
Entry Stage: Initial breach with alarm triggering (thermite, lockpick)
Security Bypass: Deal with security systems (hack, disable lasers)
Access Stage: Access the secured area (drill vault, torch door)
Loot Stage: Multiple interaction points for rewards
Escape Mechanics: Optional challenges for escaping
NPC Placement Strategy
Strategic NPC placement creates better gameplay:
Place guards at entry points for initial challenge
Position NPCs with
find_target = false
deeper in the heist to give players time to reactSet up "reinforcement" NPCs with higher stage values
Use varied weapons and skill levels for different NPCs
Consider setting some NPCs to patrol key areas
Reward Balancing
Balance risk vs. reward for a satisfying experience:
Distribute rewards through multiple stages to encourage completion
Use chance percentages (e.g.,
chance = 10
) for rare itemsPlace higher-value rewards behind more difficult challenges
Consider the total value of all possible rewards to avoid economic imbalance
Use
limit
in rewards to control maximum obtainable items
Troubleshooting
When Interactions Don't Work
If an interaction isn't triggering:
Check if you're in the correct render zone
Verify item requirements are met
Make sure the stage is properly unlocked
Check if distance is appropriate
Look for syntax errors in your configuration
Ensure target system settings are correct
Try with
debug = true
to see additional informationCheck the server console for errors
Debugging NPC Issues
If NPCs aren't spawning or behaving correctly:
Verify coordinates are valid (not inside objects)
Check if the stage value matches when you expect them to appear
Make sure relationship values are correct
For patrols, ensure the route is navigable
Check if weapons are valid hashes
Verify animations/scenarios are valid
Common Syntax Issues
Watch for these syntax mistakes:
Missing commas at the end of table entries
Incorrect nesting of tables
Missing closing brackets or parentheses
Using quotes around vector coordinates
Improper hash syntax (use backticks: `model_name`)
Case sensitivity in function names and parameters
Best Practices
Configuration Organization
Keep your configurations clean and maintainable:
Use consistent indentation (preferably tabs or 4 spaces)
Add comments to explain complex logic
Group related settings together
Use meaningful names for presets and identifiers
Keep deeply nested tables organized with proper indentation
Testing Process
Follow a methodical testing approach:
Test each interaction point individually
Verify stage progression works correctly
Test with different numbers of players
Check police response and alerts
Verify all rewards are obtainable
Test edge cases (player death, disconnects, server restarts)
Have others test your heist for an unbiased perspective
Resource Priority
Set appropriate resource start order:
Ensure frameworks load before the heist system
Target systems should load before heists
Any custom resources used by your heists should start first
Consider using
ensure
statements in your server.cfg
Last updated