Gordon_G Posted April 15, 2017 Share Posted April 15, 2017 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 1 Link to comment
NeXuS™ Posted April 15, 2017 Share Posted April 15, 2017 It's easier to remove data with the first method (especially, if the player disconnects). 1 Link to comment
Gordon_G Posted April 15, 2017 Author Share Posted April 15, 2017 Oh yes, it is, I did not noticed it, thanks ! Link to comment
Fist Posted April 15, 2017 Share Posted April 15, 2017 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. 1 Link to comment
DNL291 Posted April 15, 2017 Share Posted April 15, 2017 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. 1 Link to comment
Gordon_G Posted April 15, 2017 Author Share Posted April 15, 2017 I do not do that to patch a security prob. Juste to reduce lag because I use a lot datas Link to comment
koragg Posted April 16, 2017 Share Posted April 16, 2017 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. 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now