Jump to content

Replace elementData's system


Gordon_G

Recommended Posts

Hello, 

I've read the elementData were not secured, and very slow. So, we can replace it with table, but what could be the better ?

This ?

datas_ = {}

function setPlayerData(player,data,value)
  datas_[player][data] = value
end

Or this ?

datas_ = {}

function setPlayerData(player,data,value)
  datas_[data][player] = value
end

 

  • Like 1
Link to comment

I can say from personal experience that using element data the correct way doesn't make any noticeable lag. I use it whenever i need to sync small pieces of data with other players. I've also used it with onClientRender a few times and it works flawlessly. 

It's fine to use element data as long as you store small data in it, but if you want to store huge amounts of data then tables is the way to go. 

  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...