Saving other values than leaderstats?
Asked by
4 years ago Edited 4 years ago
Should I be able to save values other than leaderstats? I have a boolean directly inside the player in Players. I also have leaderstats. My leaderstats save correctly, however my boolean doesn't save. I am using the same method on both, and it never gives off any errors. (I am using GetAsync and SetAsync)
01 | local datastore = game:GetService( "DataStoreService" ) |
02 | local ds = datastore:GetDataStore( "item" ) |
04 | game.Players.PlayerAdded:Connect( function (plr) |
06 | local item = Instance.new( "BoolValue" ,plr) |
07 | item.Name = "Sparkles" |
11 | local y 1 = pcall ( function () |
12 | d 1 = ds:GetAsync(plr.UserId.. "Sparkles-" ) |
20 | local y 1 = pcall ( function () |
21 | ds:SetAsync(plr.UserId.. "Sparkles-" ,plr.Sparkles.Value) |