Hello there! I have had multiple people tell me how I should :GetAsync()/SetAsync() Player data through the whole table and not key by key. To prevent throttle, yes, but I need a clear answer as to 'how' do I save/load data throughout the table. ( Because I am also experiencing data throttle using key-by-key method when player leaves. Which also causes my studio to crash.)
Module Script:
return {
PlayerData = { Coins = 0, Diamonds = 0, Experience = 0, Kills = 0, Level = 0, EXPneeded = 0 }
}
Saving-Data Script:
local Datastore = game:GetService("DataStoreService"):GetDataStore("PlayerDataV1");
local DataModule = require(game.ReplicatedStorage.PlayerData)
game.Players.PlayerAdded:Connect(function(plr)
Datastore:GetAsync(plr.UserId,DataModule.PlayerData)
end)
game.Players.PlayerRemoving:Connect(function(plr)
Datastore:SetAsync(plr.UserId,DataModule.PlayerData) -- the 'Coins = 0' when value changed not Setting when player leaves.
end)
(Extra Info if needed)
• The 'Coins = 0' when the value is changed, doesn't set when player leaves. So something is wrong with SetAsync.

2 comments
A) Its a module script. Which means its not in each individual player B) It is just return and nothing is connecting to the script? Also its easier to assign stats to each player individually.
Also note that if you use api access on studio theres a slight chance your studio might crash.