Remove __cfx_functionReference



I would like to make sure that this code works:

Ressource A:

Lib = {}
Name = "toto"

function AddFunction(name, callback)
  Lib [name] = callback

Resource B:

exports.lib:AddFunction('Get', function()

I would like to do that the function of the resource B is in the resource A. So I would like Name to be displayed.


Not possible. Resources are isolated, the only way to pass data is through events and refs.


How to make a clone then?




even with string.dump and load ?


nope, the bytecode loader is disabled as it’d allow sandbox breaches


How can I do to inject a functions into another ressource? Without using the “require”


I have this error, it has a link with the Reference?

Exemple code :

  exports.ft_players:AddPlayerMethod('GetCash', function(self)
    return + 0.0


You can include other resources in the __resource.lua. For example

server_script "@mysql-async/lib/MySQL.lua"

This will include the “MySQL.lua” of mysql-async into your resource. Take a look at mysql-async resource on how exactly it is done.