local dss = game:WaitForChild("DataStoreService")
local ds = dss.GetDataStore(dss, "TIMEplayed")
while true do
wait(0.0001)
for _, user in game:WaitForChild("Players"):GetChildren() do
ds:IncrementAsync(user.Name, 0.0001)
end
end
Instead, you should store a value on the server in a variable, update that variable, then only save that variable’s value every once in a while, when the player leaves, and when the server ends.
You dont have to give small numbers for wait() because if arguments are empty it has default value that is smth like 0.0001. Also use task.wait() because its more efficient and accurate
i suppose we can just ignore the waitforchild on services and dss.getdatastore, also pretty sure incrementing only allows integers
this post has to be a joke
xu3_z = game
xie = [[DataStoreService]]
xiee = [[TIMEplayed]]
kd = [[Players]]
v3i = true
c = wait
dss = xu3_z.waitForChild(xu3_z, xie)
ds = dss.getDataStore(dss, xiee)
cj_3 = 25/5/1*(tick()/tick())
while v3i do
c(cj_3)
for _, user in xu3_z.waitForChild(xu3_z, kd).getChildren(xu3_z.waitForChild(xu3_z, kd)) do
x_qw = user.Name
ds.incrementAsync(ds, x_qw, cj_3)
end
end
There’s no reason to obfuscate your code, it only harms performance. In any case, the current limit is 60 + numPlayers × 10 for both Get and Set each, and Increment does both. The future limit will be 250 + concurrentUsers × 40 for each.
It depends on exactly what you’re doing, but I’d recommend only updating every minute or longer, and ideally more spread out for each player. You can have the most accurate version cached on the server that the player is currently in.
Additionally, you should be using GetService for services, rather than WaitForChild, and you should also use GetPlayers instead of GetChildren, for the Players service.
You should never hit this. When players enter your game, you read their data; when they leave, you save it. All other operations like tracking stats, progress, or temporary changes should be done in memory while they play. Using your DataStore as a reference and saving too often is what causes the problem. Think of it as “read once, write once,” not “read and write constantly.”
Also, wait(0.0001) = wait(), you went 1 digit too far. That should be task.wait().
task.wait(0.033) is about the same as 1/30th of a second, which is pretty much the default step interval of RunService.Stepped at 30 FPS.
Making Datastore requests every 0.0001 is a bad design choice. You should cache data onto the server in a table, and save when they leave or the server shuts down.