Controlled Posted March 3, 2014 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.
TrapLord Studios™ Posted March 3, 2014 Posted March 3, 2014 use a database that stores the information and the other resource wousld just fetch from the db.
Controlled Posted March 3, 2014 Author Posted March 3, 2014 Using SQL queries would be waaaay worst. Much more laggy
myonlake Posted March 3, 2014 Posted March 3, 2014 Tables are the answer. However, keep in mind that these two are located in two different areas of the application.
Moderators Citizen Posted March 3, 2014 Moderators 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.
myonlake Posted March 3, 2014 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.
Controlled Posted March 3, 2014 Author Posted March 3, 2014 How could I use a Table to write a new Number Value but have it readable across resources?
Spajk Posted March 3, 2014 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.
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