Element/Entity Data Storage

Hey there,

I am originally coming from MTA, where I developed for a few servers in lua. At MTA we had access to a function called ‘setElementData’. This function was very useful in order to save data in an easy way and to use different data for an element in different resources. Here’s the link to MTA’s wiki:

It also allows us to store data which can be transferred to a client without the need to trigger an event to transfer it over. Therefore it might as well be an efficiency improvement.

Let me know what you think. I think this would be a huge improvement for FiveM.

Fun fact: these actually work using event serialization internally in MTA.

It’s somewhere on the to-do list already, however only at a later stage of OneSync API development as event serialization is not really efficient for network duplication, so the intent is rather to support Garry’s Mod-style entity bit fields in addition to ‘arbitrary event serialization’ as some sort of ‘backpack data node’ to be sent along with regular clone sync.


:open_mouth: https://wiki.garrysmod.com/page/Networking_Entities