I'm making a dataStore for my leaderstats, but the "chickenBux" part of the code shows up as "Value" in the leaderstats. Here's the code:
local DataStore = game:GetService("DataStoreService")
local ds1 = DataStore:GetDataStore("chickenEaten")
local ds2 = DataStore:GetDataStore("chickenBux")
game.Players.PlayerAdded:connect(function(player)
local leader = Instance.new("Folder", player)
leader.Name = "leaderstats"
local chickenEaten = Instance.new("IntValue", leader)
chickenEaten.Name = "Chicken"
chickenEaten.Value = ds1:GetAsync(player.UserId) or 0
ds1:SetAsync(player.UserId, chickenEaten.Value)
chickenEaten.Changed:connect(function()
print('Saving Data...')
ds2:SetAsync(player.UserId, chickenEaten.Value)
end)
--where I think the problem is
local chickenBux = Instance.new("IntValue", leader)
chickenBux.Name = "ChickenBux"
chickenBux.Value = ds2:GetAsync(player.UserId) or 0
ds2:SetAsync(player.UserId, chickenBux.Value)
chickenBux.Changed:connect(function()
print('Saving Data...')
ds2:SetAsync(player.UserId, chickenBux.Value)
end)
end)
game.Players.PlayerRemoving:connect(function(player)
ds1:SetAsync(player.UserId, player.leaderstats.Chicken.Value)
ds1:SetAsync(player.UserId, player.leaderstats.ChickenBux.Value)
end)
Thanks!

2 comments
Try using 1 data store
I just tried that & it didn't work. Probably a good idea, though