You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code snippet (not full code) I was using in my game:
localDataStore2=require(game.ServerStorage.DataStore2)
localDataStoreService=game:GetService("DataStoreService")
localtotalKillsODS=DataStoreService:GetOrderedDataStore("TotalKills")
DataStore2.Combine("CombatData", "totalKills")
localfunctionmakeStatsForPlayer(player)
localkillStore=DataStore2("totalKills", player)
localtotalKills=Instance.new("IntValue")
totalKills.Name=STAT_NAMES.Total_KillstotalKills.Value=killStore:Get(0)
totalKills.Parent=leaderstatskillStore:OnUpdate(function(updatedTotalKills)
totalKills.Value=updatedTotalKillsend)
killStore:AfterSave(function(combatData)
-- combatData is NOT "totalKills" value, It's entire store.localtotal=DataStore2("totalKills", player):Get() -- Hacky way of grabbing totalKills.end)
returnleaderstatsend
The text was updated successfully, but these errors were encountered:
ghost
changed the title
DataStore2 sends entire store to :AfterSave, and cannot yield in :AfterSave
DataStore2 sends entire store to :AfterSave
Mar 10, 2020
Code snippet (not full code) I was using in my game:
The text was updated successfully, but these errors were encountered: