Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is it possible to get a specific value from every single players data storage ?

Asked by 3 years ago

So lets say that every single player has a variable in their data storage called cash is there a way to get every single players cash value and add them together into a new value? I need this because I want it to be harder to get cash depending on how much cash there is in total like in the whole game not just in the server

0
its possible but it's hard Xapelize 2658 — 3y
0
you could change their async data Xapelize 2658 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

You would need to loop through each player, and then add their value to an existing variable outside the loop scope. Simple rundown being:

local amount = 0

for i,v in next, Players:GetPlayers() do
    amount += v.Cash.Value
end
0
You clearly didn't read the post. I want every single players cash even if they are not in the game via their data storage red_ninjas07 0 — 3y
Ad

Answer this question