Overview
This prompt aims to guide developers in creating a Lua script for admin-exclusive item distribution using specific frameworks. Programmers and game developers working with ox_lib and QBCore will benefit from this structured approach.
Prompt Overview
Purpose: This script enables admins to grant items to players securely and efficiently.
Audience: Designed for server administrators using the QBCore framework and ox_lib UI components.
Distinctive Feature: It combines input dialogs and context menus for a streamlined item-giving process.
Outcome: Admins receive confirmation notifications after successfully delivering items to players.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Development Tools & DevOps, Productivity & Workflow
- Techniques: Output Constraints, Role/Persona Prompting, Structured Output
- Models: Claude 3.5 Sonnet, Gemini 2.0 Flash, GPT-4o, Llama 3.1 70B
- Estimated time: 5-10 minutes
- Skill level: Beginner
Variables to Fill
No inputs required — just copy and use the prompt.
Example Variables Block
No example values needed for this prompt.
The Prompt
Create a script using the **ox_lib** text UI framework that restricts access exclusively to admins.
The script should include the following features:
– An input dialog for the admin to enter a player’s ID.
– A context menu that appears after entering the ID, allowing the admin to select an item to give to the specified player.
– A QBCore notification to confirm the action after the item is given.
### Requirements:
– Access to this script is limited to users with admin privileges.
– Utilize ox_lib’s input dialog for player ID entry.
– Present a context menu from ox_lib for item selection.
– Use QBCore’s notification system to confirm successful item delivery.
### Steps:
1. Verify that the user has admin rights before displaying the UI.
2. Display an input dialog for entering the player ID.
3. Once a valid player ID is entered, show a context menu with available items.
4. Execute the logic to give the item to the specified player upon selection.
5. Display a QBCore notification confirming that the item was given.
### Output Format:
Provide the complete, well-commented Lua script implementing the above features, ready for integration with **ox_lib** and **QBCore** frameworks.
### Notes:
– Ensure all UI interactions utilize ox_lib components for consistency.
– The admin check must be secure and appropriate for a QBCore environment.
– The notification should be clear and informative regarding the action taken.
Screenshot Examples
How to Use This Prompt
- Copy the prompt provided above.
- Paste the prompt into your coding environment.
- Adjust any specific details as needed for your project.
- Run the script to test its functionality.
- Ensure all dependencies are correctly installed and configured.
Tips for Best Results
- Check Admin Privileges: Ensure the user has admin rights before proceeding with the script.
- Input Dialog for Player ID: Use ox_lib’s input dialog to prompt the admin for the player’s ID.
- Context Menu for Item Selection: Display a context menu with a list of items available for the admin to give to the player.
- QBCore Notification: After successfully giving the item, use QBCore’s notification system to inform the admin of the action taken.
FAQ
- How can I restrict access to the script?
Check if the user has admin privileges before allowing access to the script. - What UI component should I use for player ID input?
Utilize the input dialog feature from the ox_lib framework for player ID entry. - How do I display a context menu for item selection?
After entering a valid player ID, show a context menu using ox_lib to select items. - How can I confirm item delivery to the player?
Use QBCore's notification system to inform the admin that the item was successfully given.
Compliance and Best Practices
- Best Practice: Review AI output for accuracy and relevance before use.
- Privacy: Avoid sharing personal, financial, or confidential data in prompts.
- Platform Policy: Your use of AI tools must comply with their terms and your local laws.
Revision History
- Version 1.0 (February 2026): Initial release.


