Shopping Cart
FiveM script 11abac85b780a6bfb422bb414511bacab31e72a7

OneSync / SERVER/CLIENT-SIDE Data Sharing – Modding Tutorials


FiveM Modding Tutorial


  • Set data to any entity or object
  • Share the data with server / client

How to use it (Lua)


--[[ set state mode to 'open' so client-side can share to server]]
local player = Entity(GetPlayerPed(source))
 – get Entity object from Entity id
player.state.anyKeyHere = anyValueHere
 – set any key and value to Entity state
 – return the 'anyKeyHere' set


local player = Entity(PlayerPedId())
--[[ same as server get Entity object from Entity id ]]
 – return the previus value set from server
player.state:set('anyKeyHere', anyValueHere, true – [[ bool | share with server? ]])
 – set any key and value to Entity state from client

Tested with other players. Yes, data is shared with all the players on the net

This is something like Decorators but an advanced Decor.
So that means, when you set data to an Entity and then a new player connect to the server, that data isnโ€™t shared. The data itโ€™s only shared with the currently net players, not new players.


Original source:

Leave a Reply
FiveM ESX Scripts

The best scripts and maps

Best support

Problems? We are there to help!

Wide range of products

We have a wide range of products

100% Secure Checkout