FAQ

Frequently Asked Questions about the GOD Laser System.

General Questions

What frameworks does this script support?

The script supports:

  • QBCore - Full support

  • ESX - Full support

  • Qbox - Full support

You can switch between frameworks by changing the J0.Core setting in shared/config.lua.

What inventory systems are supported?

The script supports:

  • OX-Inventory - Full support with custom item handlers

  • QB-Inventory - Full support with automatic item usage

Configure your inventory system in shared/config.lua using the J0.Inventory setting.

Is ox_lib required?

Yes, ox_lib is required. The script uses ox_lib for:

  • UI components (progress bars, context menus)

  • Callback system for data synchronization

  • Other utility functions

Make sure ox_lib is started before the laser system in your server.cfg.

Installation Questions

Where do I place the script files?

Place the script in your resources folder and ensure it's added to your server.cfg:

Do I need to create a database?

No, the script uses a JSON file (shared/database.json) for storage. The file is automatically created on first run. You don't need to set up a MySQL database.

How do I add the items to my inventory?

See the Items Setup Guide for detailed instructions for both OX-Inventory and QB-Inventory.

Configuration Questions

How do I change the shop location?

Edit shared/config.lua and modify the shop_coords value:

Use /tp command or a coordinate finder to get the exact coordinates.

How do I change the shop NPC model?

Edit shared/config.lua and modify the shop_ped value:

Can I customize item prices?

Yes, edit the items table in shared/config.lua:

How do I disable the cooldown?

Set cooldown_on_place to false in shared/config.lua:

Usage Questions

How do I place a laser?

  1. Use a laser_device or laser_devicepol item from your inventory

  2. Look at where you want the laser to start and press E

  3. Look at where you want the laser to end and press E again

  4. Press E for temporary or ENTER for permanent placement

See the Usage Guide for detailed instructions.

What's the difference between temporary and permanent lasers?

  • Temporary (press E): Laser is placed but removed on server restart

  • Permanent (press ENTER): Laser is saved to database and persists across restarts

How do I remove a laser?

Use the laser_remover item from your inventory. It will automatically remove the closest laser to your position.

Can I remove someone else's laser?

The script doesn't have built-in ownership checking for removal. The laser_remover removes the closest laser regardless of owner. You may want to add custom permission checks if needed.

How far away can I see lasers?

Lasers are rendered when you're within 50 units (meters) of the laser's start point. This is optimized for performance.

Technical Questions

How does the detection system work?

The script uses mathematical calculations to detect when a player's position intersects with the laser line. It checks:

  • Distance from player to laser line

  • Height tolerance (0.5 units)

  • Line width (0.1 units)

Why isn't my laser detecting players?

Common causes:

  1. Players aren't crossing at the correct height

  2. The laser line is too high or too low

  3. The detection sensitivity might need adjustment

  4. Check server console for any errors

Can I change the laser color?

Currently, laser colors are hardcoded to red [255, 0, 0, 255]. The color property exists in the database structure but isn't configurable through the UI yet.

How are lasers stored?

Lasers are stored in shared/database.json in JSON format. Each laser is associated with a player's license identifier and includes all laser properties.

What happens if I delete database.json?

All saved lasers will be lost. The file will be recreated on next server start, but all previously placed permanent lasers will be gone.

Police Laser Questions

What's the difference between regular and police lasers?

  • Regular Laser (laser_device): Only notifies the owner when triggered

  • Police Laser (laser_devicepol): Notifies the owner AND all on-duty police officers

Who can use police lasers?

Anyone can purchase and use laser_devicepol items. The script doesn't restrict usage by job. If you want job restrictions, you'll need to add custom checks.

How does the police notification work?

When a police laser is triggered, the script:

  1. Finds all players with police job (job.type == 'leo' for QBCore/Qbox, job.name == 'police' for ESX)

  2. Sends a notification to all on-duty officers

  3. Also notifies the laser owner

Troubleshooting

Script won't start

  1. Check that ox_lib is installed and started

  2. Verify framework is correctly set in shared/config.lua

  3. Check server console for error messages

  4. Ensure all dependencies are loaded

Items not working

  1. Verify items are added to your inventory system

  2. For OX-Inventory: Check that item handlers are in client.lua

  3. For QB-Inventory: Verify items are in items.lua

  4. Check that inventory images are in the correct folder

  5. Restart your inventory resource

Lasers not saving

  1. Check file permissions on shared/database.json

  2. Verify the resource has write access

  3. Check server console for save errors

  4. Ensure you're pressing ENTER (not E) for permanent placement

Notifications not working

  1. Verify the laser owner is online (for owner notifications)

  2. For police lasers: Check that officers are on-duty

  3. Check server console for notification errors

  4. Verify job names match your framework's job system

Performance issues

  1. Limit the number of active lasers

  2. Remove unused lasers regularly

  3. The script automatically optimizes rendering (50 unit distance)

  4. Check server console for any performance warnings

Support

Where can I get help?

  • Check the documentation for detailed guides

  • Review server console for error messages

  • Verify all configuration settings match your setup

  • Ensure all dependencies are properly installed

Common Error Messages

"Failed to get player identifier"

  • Framework connection issue

  • Check that your framework is running and configured correctly

"Could not find player license"

  • Player identification issue

  • Usually resolves on player reconnect

"Laser ID not found"

  • Database synchronization issue

  • Try restarting the resource


Still have questions? Review the other documentation sections or check your server console for specific error messages.

Last updated