Controlled Posted March 3, 2014 Share Posted March 3, 2014 Would it be laggy to setElementData every second? I need a way for a number to be updated every second and carried over to another resource, but be bound to a single person if that makes sense. Link to comment
TrapLord Studios™ Posted March 3, 2014 Share Posted March 3, 2014 use a database that stores the information and the other resource wousld just fetch from the db. Link to comment
Controlled Posted March 3, 2014 Author Share Posted March 3, 2014 Using SQL queries would be waaaay worst. Much more laggy Link to comment
TrapLord Studios™ Posted March 3, 2014 Share Posted March 3, 2014 Are you certain ? , maybe tables then? Link to comment
myonlake Posted March 3, 2014 Share Posted March 3, 2014 Tables are the answer. However, keep in mind that these two are located in two different areas of the application. Link to comment
Moderators Citizen Posted March 3, 2014 Moderators Share Posted March 3, 2014 Would it be laggy to setElementData every second? No it won't, element datas are really powerfull. By the way, if you want to store the current play time of the player, I would use only one setElementData that will store the result of getTickCount(). Then when you want to know how many seconds the player is in: local tick = getTickCount() local joinTick = getElementData(thePlayer, "joinTick") or 0 local secondsIn = (tick - joinTick) / 1000 Do as you would like. Link to comment
myonlake Posted March 3, 2014 Share Posted March 3, 2014 Would it be laggy to setElementData every second?No it won't, element datas are really powerfull. Indeed. The main reason for that is that element data isn't going thru the Lua VM, but the core, so it should be considered as a more native feature. Depends on the usage though, sometimes tables are far better than element data. Link to comment
Controlled Posted March 3, 2014 Author Share Posted March 3, 2014 How could I use a Table to write a new Number Value but have it readable across resources? Link to comment
WhoAmI Posted March 3, 2014 Share Posted March 3, 2014 In this case element data would be better. Link to comment
Spajk Posted March 3, 2014 Share Posted March 3, 2014 How could I use a Table to write a new Number Value but have it readable across resources? Using exported functions. 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