Jump to content

Replace elementData's system


Gordon_G

Recommended Posts

Posted

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
Posted

This is stupid to replace this with setElementData. You can easily make it secure by just adding simple anti cheat which has even example on the wiki.

  • Like 1
Posted

I don't think setElementData is an unreliable function, it's fine at least for me. Still, if you want to make your own system, you can use tables, since it's a strong point of Lua.

  • Like 1
Posted

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

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...