Script that identifies and handles the functions for my Datastores + leaderstats have randomly broke over the night.
I’ve looked into this - attempting on an older version of my game where I know the leaderstats + datastore had been working & now it won’t work? The only thing I can assume is that this is a ROBLOX update?
Beginning of script:
local data = Instance.new("Folder",game.ServerStorage)
data.Name = "Data"
local saves = game:GetService("DataStoreService"):GetDataStore("BXMKIIII")
local jail = game:GetService("DataStoreService"):GetDataStore("jailstuff")
local DataStoreService = game:GetService("DataStoreService")
local myDataStore = DataStoreService:GetDataStore("NewEXP")
game.Players.PlayerAdded:connect(function(plr)
repeat wait() until plr
local leaderstat = Instance.new("Model")
leaderstat.Name = "leaderstats"
leaderstat.Parent = plr
local ranktime = Instance.new("IntValue")
ranktime.Name = "Experience"
ranktime.Parent = leaderstat
local jailtime = Instance.new("IntValue")
jailtime.Name = "Prison Time"
jailtime.Parent = leaderstat
local fines = Instance.new("IntValue")
fines.Name = "fine"
fines.Parent = plr
local cash = Instance.new("IntValue", data)
cash.Name = plr.Name.."Cash"
local money = Instance.new("IntValue", data)
money.Name = "money"
money.Parent = plr
local rt = plr.leaderstats["Experience"].Value
Where the error occurs:
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
Error Image:
As I’ve said - I haven’t made any changes to this script in weeks. There should be no reason that this is happening - I’ve tried adjusting caps on userid and everything. I’m not sure if ROBLOX pushed out a new update for GetAsync or if the GetAsync featue may be glitching out right now.
Summary:
- Script broke randomly without any updates being done to it.
- The script does not have any relative scripts that could affect it if they were updated.
- The “error” message does not display a cause for this error
- I’ve double checked the spelling and more multiple times.
- I do not have any other scripters or developers in general. So there is no way this was updated without me knowing.
Any feedback, help, or shedding any light on this situation in general is BEYOND appreciated.