local SaveInterval = 60
local HttpService = game:GetService("HttpService")
local dataKey = game:GetService("DataStoreService"):GetDataStore("MainData28")
local functions = {}
local CurrentPlrDataSession = {}
local NewData = {
Gem1 = 0,
Chest1 = 0,
CoinsMulti = 1,
GemsMulti = 1,
MaxPetInventory = 25,
Pets = {},
Pickaxes = {}
}
functions.addToValue = function(plr,statName,valueToAdd)
CurrentPlrDataSession[tostring(plr.UserId)][statName] = CurrentPlrDataSession[plr][statName] + valueToAdd
end
functions.setValue = function(plr,statName,valueToSet)
CurrentPlrDataSession[tostring(plr.UserId)][statName] = valueToSet
end
--[[CurrentPlrDataSession.getValue = function(plr, statName)
return CurrentPlrDataSession[plr.UserId][statName]
end]]
functions.addDataEntry = function(plr,newKey,setValue)
CurrentPlrDataSession[tostring(plr.UserId)][newKey] = setValue
end
functions.addPetEntry = function(plr)
CurrentPlrDataSession[tostring(plr.UserId)].Pets[string.sub(HttpService:GenerateGUID(true), 2, 19)] = {Name = "Bunny",Exp = 0,Locked = false,Shiny = false,CoinMulti = 1.5,GemMulti = 1.5,Equipped = false}
print(plr.Name)
for i,v in pairs(CurrentPlrDataSession[tostring(plr.UserId)].Pets) do
print(i)
end
--CurrentPlrDataSession[plr]["Pets"][key] = data
end
When I add data with a key in a dictionary. And then try to get the data again from the same key it returns data from every key in the dictionary.
So when I press e to activate it from the 2nd player. It prints out only his data.
But when the 1st player activates it. It will print out the 1st players data as well as the 2nd players data. Shown in the picture… Which their data should be completely separate and not have any way of combining.

I have been at it for hours and can’t find a way to fix this. Wondering if anyone could help?