⬆️Exports

Check the instructions below.

GetPlayerColor Function

exports('GetPlayerColor', function(source)
    return Color[source]
end)

Usage

External resources or scripts can call the GetPlayerColor function to obtain the player's color using the exports syntax provided by FiveM.

Example usage in another script:

local playerColor = exports['gfx-pvpchat']:GetPlayerColor(source)

Return Value

  • The function returns the Color variable, which holds the player's color data.

  • The structure and content of the Color variable depend on how it is defined within your script. This could be a string (e.g., a hex color code), a table of RGB values, or any other format used in your application.

Note: Ensure that the Color variable is properly initialized and updated within your resource to provide valid data when this function is called.

Last updated