I’ve already searched up “CorePackages” looking to see if anybody else has been having the same issues, and I found two different one’s. So keep in mind I’m posting this - not certain if this is a ROBLOX engine bug.
However, the one thing I find strange is that it refers to “Experience” nil when this occurs. I have just updated our Experience’s datastore due to a major bug in our remote event’s security that results in a lot of unwanted EXP for players who didn’t actually earn it.
The only thing I changed in datastore was the following:
local myDataStore = DataStoreService:GetDataStore("myDataStore")
to
local myDataStore = DataStoreService:GetDataStore("NewEXP")
I don’t believe I’ve had any issues with this before - or none that I had ever noticed. But this is the error I now get, followed by a bunch of CorePackages errors. This is the only thing that occurs in dev console when players are allegedly “lagging out.” Any help with this would be amazing!
All lines of code used for “Experience” leaderstat:
local ranktime = Instance.new("IntValue")
ranktime.Name = "Experience"
ranktime.Parent = leaderstat
–
local rt = plr.leaderstats["Experience"].Value
ranktime.Value = myDataStore:GetAsync(plr.userId.."EXP")
if jail:GetAsync(plr.userId.."PrisonTime")~= nil and jail:GetAsync(plr.userId.."PrisonTime") > 0 then
jailtime.Value = jail:GetAsync(plr.userId.."PrisonTime")
end
–
while wait(60*3) do
if cash then
cash.Value = cash.Value + 300
plr.PlayerGui.Notify.Paid.Enabled = true
wait (4)
plr.PlayerGui.Notify.Paid.Enabled = false
saves:SetAsync(plr.userId,game.ServerStorage.Data[plr.Name.."Cash"].Value)
print(plr.Name.." 's money saved!")
if plr:GetRankInGroup(4219097) >= 1 then
if ranktime then
ranktime.Value = ranktime.Value + 3
local rt = plr.leaderstats["Experience"].Value
myDataStore:SetAsync(plr.userId.."EXP", rt)
print(plr.Name.."'s experience saved!")
end
end
end
end
end)
–
local rt = plr.leaderstats["Experience"].Value
if rt > 0 then
myDataStore:SetAsync(plr.userId.."EXP", rt)
end
This is the error that appears:
Keep in mind all the code provided in this forum is within the same script I use as our main “module” (not a module script though)
This error appears to be lagging out a good chunk of my players, resulting in my player count being lower then usual. Any assistance is HIGHLY appreciated.