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
Is this a bug? Unfinished? Or am i doing something wrong? Is there some code or documentation i can look at to answer my question? (Sorry if this is the wrong place to post this, didn't want to post it on the devforum since its strictly related to nevermore.)
The problem i am having is that PlayerData:Load("Money", 500) in my case returns a table rather than the saved value in the DataStore or even the default value. If this is correct, how am i supposed to get the stored value?
localPlayers=game:GetService("Players")
localReplicatedStorage=game:GetService("ReplicatedStorage")
localDataStoreService=game:GetService("DataStoreService")
localServerStorage=game:GetService("ServerStorage")
localMarketplaceService=game:GetService("MarketplaceService")
localTeams=game:GetService("Teams")
localEngine=require(ReplicatedStorage:WaitForChild("Nevermore"))
localrequire=Engine.requirelocalDataStoreManager=require("PlayerDataStoreManager")
localDataStore=DataStoreService:GetDataStore("PlayerData")
localPlayerDataStore=DataStoreManager.new(DataStore, function(Player)
return"/" ..Player.UserId.."/"end)
localfunctionPlayerAdded(Player)
localPlayerData=PlayerDataStore:GetDataStore(Player)
-- These values are just instanced in a seperate script.localLeaderstats=Player:WaitForChild("leaderstats")
localMoney=Leaderstats:WaitForChild("Money")
Money.Value=PlayerData:Load("Money", 500) -- Won't add the saved value or the default value due to it returning a table.PlayerData:StoreOnValueChange("Money", Money)
endfori,vinpairs(Players:GetPlayers()) doPlayerAdded(v)
endPlayers.PlayerAdded:Connect(PlayerAdded)
The text was updated successfully, but these errors were encountered:
You’re using it wrong, sorry! It returns a promise!
I’m on mobile but will type out a better answer later.
You want to do this:
PlayerData:Load(“Money”, 500):Then(function(money)
Money.Value = money
PlagerData:StoreOnValueChanged(“Money”, Money) — Only store if we load properly
end):Catch(function(err) — handle
Is this a bug? Unfinished? Or am i doing something wrong? Is there some code or documentation i can look at to answer my question? (Sorry if this is the wrong place to post this, didn't want to post it on the devforum since its strictly related to nevermore.)
The problem i am having is that PlayerData:Load("Money", 500) in my case returns a table rather than the saved value in the DataStore or even the default value. If this is correct, how am i supposed to get the stored value?
The text was updated successfully, but these errors were encountered: