How to Change the Black Money Name

In our scripts, black money is typically referred to as markedbills. However, some users may prefer to use different names like black_money or dirtymoney. You can customize the name of black money by modifying specific functions in your script files. This guide will help you identify where and how to make these changes based on whether you're using older or newer script versions.

Changing Black Money Name in Older Scripts

For older scripts, the black money name is managed through the server.lua file.

Steps to Modify:

  • Locate the server.lua File:

    • Access your server files via FTP or your file manager.

    • Navigate to the directory where your older script’s server-side files are located.

  • Open server.lua:

    • Use a text editor to open the server.lua file.

  • Find the Black Money Function:

    • Search for the variable related to black money, typically named something like markedbills.

Example (For QBCore):

local info = {
    worth = count
}
player.Functions.AddItem('markedbills', 1, false, info)
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items['markedbills'], "add") 

Modify the Function:

  • Change the markedbills to your desired name such as black_money or dirtymoney.

Updated Example:

When you change it to black_money or dirtymoney, you must delete the remaining codes except the code below.

player.Functions.AddItem('black_money', count)

Save and Restart:

  • Save your changes and restart your server to apply the new black money name.

Changing Black Money Name in Newer Scripts

In newer scripts, the black money name is handled by the editable_server.lua file through the addBlackMoney function.

Steps to Modify:

  • Locate the editable_server.lua File:

    • Access your server files via FTP or your file manager.

    • Navigate to the directory where your newer script’s server-side files are located.

  • Open editable_server.lua:

    • Use a text editor to open the editable_server.lua file.

  • Find the addBlackMoney Function:

    • Search for the addBlackMoney function in the file.

Example (For QBCore):

self.addBlackMoney = function(amount)
    local info = {
        worth = amount,
    }
    Player.Functions.AddItem('markedbills', 1, false, info)
    TriggerClientEvent('inventory:client:ItemBox', playerId, QBCore.Shared.Items['markedbills'], 'add')
end

Modify the Function:

  • Update the markedbills to the desired name like black_money or dirtymoney.

Updated Example:

When you change it to black_money or dirtymoney, you must delete the remaining codes except the code below.

self.addBlackMoney = function(amount)
    Player.Functions.AddItem('black_money', amount)
end

Save and Restart:

  • Save your changes and restart your server to apply the new black money name.

Verifying Changes

  • Test the Functionality:

    • After making changes, verify that black money transactions are properly reflected in the new name.

  • Check Consistency:

    • Ensure that the new name is consistently used across all relevant scripts and functions.

Troubleshooting

  • Name Not Updating: Double-check that you’ve modified all relevant occurrences of the old name in the script.

  • Errors in Console: Review any error messages to diagnose issues with the function changes.

Additional Tips

  • Backup Your Files: Always create a backup of your original files before making changes.

  • Consistency Across Scripts: Ensure that the new black money name is used consistently across all scripts and configurations.

Last updated