Overview
This prompt aims to guide developers in adapting a QBCore script for compatibility with the Macho framework. Programmers transitioning between these frameworks will benefit from clear instructions and a structured approach.
Prompt Overview
Purpose: This script adapts a blackmarket menu for compatibility with the Macho framework.
Audience: It is intended for developers familiar with Lua and the Macho framework.
Distinctive Feature: The script maintains the original logic while ensuring compatibility with Macho’s API.
Outcome: Users will be able to access the blackmarket menu seamlessly within the Macho framework environment.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Video Game Development
- Techniques: Decomposition
- Models: Claude 3.5 Sonnet, Gemini 2.0 Flash, GPT-4o, Llama 3.1 70B
- Estimated time: 5-10 minutes
- Skill level: Intermediate
Variables to Fill
- ['qb-core'] – 'qb Core'
Example Variables Block
- ['qb-core']: Example 'qb Core'
The Prompt
Adapt the provided QBCore script for opening the blackmarket menu to be compatible with the Macho framework.
Ensure that all core object calls, player data retrieval, callbacks, event triggers, NUI focus handling, and command registration use Macho framework conventions and API methods instead of QBCore’s.
**Specifically:**
– Replace `QBCore = exports[‘qb-core’]:GetCoreObject()`
– with the equivalent Macho core object retrieval.
– Use Macho’s functions to get player data
– instead of `QBCore.Functions.GetPlayerData()`.
– Adapt callback registrations
– to Macho’s style.
– Replace all `QBCore.Functions` calls
– with their Macho counterparts.
– Modify command registration
– to use Macho’s command system.
– Ensure NUI focus management and message sending
– align with Macho’s patterns.
– Preserve all functional logic, variables, and the menu construction
– as in the original script.
– Maintain comments and structure for clarity.
**# Steps**
1. Identify Macho’s core object access method
– and replace the `QBCore` initialization.
2. Find Macho’s method to retrieve player data
– and modify the callback accordingly.
3. Replace all QBCore function calls
– with corresponding Macho calls.
4. Change the event triggering and callback mechanism
– to Macho’s equivalents.
5. Update the command registration
– to use Macho’s API.
6. Retain the menu data structure, NUI message format,
– and protective timer logic unchanged.
7. Keep commented code and messages intact.
**# Output Format**
Provide the fully adapted Lua script as plain code, clearly formatted and ready to use within a Macho framework environment.
Screenshot Examples
How to Use This Prompt
- [MACHO_CORE]: Access Macho framework core object.
- [PLAYER_DATA]: Retrieve player data using Macho.
- [CALLBACK_REGISTRATION]: Register callbacks with Macho style.
- [MACHO_FUNCTIONS]: Replace QBCore functions with Macho.
- [EVENT_TRIGGERING]: Adapt event triggers to Macho’s methods.
- [COMMAND_REGISTRATION]: Use Macho’s command registration API.
- [NUI_FOCUS]: Manage NUI focus with Macho patterns.
- [MENU_STRUCTURE]: Keep menu data and logic unchanged.
Tips for Best Results
- Core Object Retrieval: Use `Macho = exports[‘macho-core’]:GetCoreObject()` to access the core object.
- Player Data Access: Replace `QBCore.Functions.GetPlayerData()` with `Macho.Functions.GetPlayerData()` for player information.
- Callback Registration: Adapt callback registrations to Macho’s style using `Macho.RegisterCallback()` instead of QBCore’s method.
- Command Registration: Use `Macho.Commands.Add()` to register commands, ensuring compatibility with Macho’s command system.
FAQ
- How do I retrieve the core object in Macho framework?
Use `Macho = exports['macho-core']:GetCoreObject()` to access the core object. - What function retrieves player data in Macho?
Use `Macho.Functions.GetPlayerData()` to get the current player's data. - How do I register a command in Macho?
Use `Macho.Commands.Add('commandName', function(source, args) {…})` to register commands. - How do I manage NUI focus in Macho?
Use `SetNuiFocus(true, true)` to set NUI focus and manage messages accordingly.
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.


