Hi, I have an issue with my data not being able to detect currency.
I am using ProfileService a DataManagement API made by loleris.
Problem:
Unable To Backup Data
if backupProfile ~= nil then
if not table.find(lockedData,player.Name) then
local function DataReadyForBackup()
local function Check(args)
local item = ""
for i = 1 ,#args do
item = item..'["'..args[i]..'"]'
print(profile.Data["Currency"]) --Prints out {["Coins"] = 0, ["Diamonds"] = 0}
if profile.Data[item] == nil then --Error Here! The Script should not be going through this check.. since item is == ["Currency"]
print(profile.Data)
print(item) --Prints out ["Currency"]
return false
end
end
print(true)
return true
end
local BackupCheck = {
{"Currency","Coins"},
{"Currency","Diamonds"},
}
for i,v in pairs(BackupCheck) do
if not Check(v) then
return false
end
end
return true
end
if profile.Data ~= nil then
if DataReadyForBackup() then
backupProfile.Data = profile.Data
print("Backup Data Updated.")
backupProfile:Release()
else
warn("Unable To Backup Data") --The game outputs this.
backupProfile:Release()
end
else
warn("Player Data Corrupted")
backupProfile:Release()
end
else
warn("Data is locked")
end
else
warn("Backup Profile Not Available")
end