Hello everyone i am using data stores 2. My other data store that stores stats is working perfectly, its just this other one i made. I don’t see what could be wrong because i copied my previous scripts’ code and changed the names and values a bit so i cant see why this wouldn’t be saving unless im using 2 of the same data stores at the same time and its overriding in a way… I looked up this error but i cant seem to find any answers,
script:
local DataStores2 = require(1936396537)
local TweenService = game:GetService("TweenService")
local debris = game:GetService("Debris")
DataStores2.Combine("CSludgeHead","USludgeHead","RSludgeHead","PSludgeHead"
)
local function PlayerAdded(plr)
local dataCSludgeHead = DataStores2("CSludgeHead",plr)
local dataUSludgeHead = DataStores2("USludgeHead",plr)
local dataRSludgeHead = DataStores2("RSludgeHead",plr)
local dataPSludgeHead = DataStores2("PSludgeHead",plr)
-----------------------Values-------------------------------
local Inventory = Instance.new("Folder", plr)
Inventory.Name = "Inventory"
local Gear = Instance.new("Folder", Inventory)
Gear.Name = "Gear"
--Katana--
local Katana = Instance.new("IntValue", Gear)
Katana.Name = "Katana"
Katana.Value = 0
--SludgeHead
local CSludgeHead = Instance.new("IntValue", Gear)
CSludgeHead.Name = "CSludgeHead"
CSludgeHead.Value = 0
local USludgeHead = Instance.new("IntValue", Gear)
USludgeHead.Name = "USludgeHead"
USludgeHead.Value = 0
local RSludgeHead = Instance.new("IntValue", Gear)
RSludgeHead.Name = "RSludgeHead"
RSludgeHead.Value = 0
local PSludgeHead = Instance.new("IntValue", Gear)
PSludgeHead.Name = "PSludgeHead"
PSludgeHead.Value = 0
-------------------------LoadData------------------------
--SlugeHead
if dataCSludgeHead:Get() ~= nil then
CSludgeHead.Value = dataCSludgeHead:Get()
else
CSludgeHead.Value = 0
end
if dataUSludgeHead:Get() ~= nil then
USludgeHead.Value = dataUSludgeHead:Get()
else
USludgeHead.Value = 0
end
if dataRSludgeHead:Get() ~= nil then
RSludgeHead.Value = dataRSludgeHead:Get()
else
RSludgeHead.Value = 0
end
if dataPSludgeHead:Get() ~= nil then
PSludgeHead.Value = dataPSludgeHead:Get()
else
PSludgeHead.Value = 0
end
----------------------Save Data---------------------------
--SludeHead
CSludgeHead.Changed:Connect(function()
dataCSludgeHead:Set(CSludgeHead.Value)
print("CSludgeHead Has Been Changed")
end)
USludgeHead.Changed:Connect(function()
dataUSludgeHead:Set(USludgeHead.Value)
end)
RSludgeHead.Changed:Connect(function()
dataRSludgeHead:Set(RSludgeHead.Value)
end)
PSludgeHead.Changed:Connect(function()
dataPSludgeHead:Set(PSludgeHead.Value)
end)
end
-- fire for already joined players
for _,Player in pairs(game.Players:GetPlayers()) do
coroutine.wrap(function() PlayerAdded(Player) end)()
end
game.Players.PlayerAdded:connect(PlayerAdded)