Hello, I need help finding how to reference the name of the scope from which i have loaded in data, for the purpose of keeping a log of it in console.
I have a Datastore named “PlayerData”, from which im loading data under the scope “Donations”. However, when using Datastore’s .name property i only get “PlayerData” as a result, when i want to get “Donations” instead
How could I achieve this in the simplest manner?
function DataService:LoadData(datastore:DataStore,player:Player)
local val
local s,rr = pcall(function()
val = datastore:GetAsync(player.UserId)
end)
if s then
if val ~= nil then
print(string.format('Loaded data [%s] [%s]',datastore.Name,player.Name))
return val
else
print(string.format('No saved data [%s] [%s]',datastore.Name,player.Name))
end
else
warn(tag('GetAsync Err'),string.format('[%s] [%s]',datastore.Name,player.Name))
warn(rr)
end
return nil,rr
end
The result:
TLDR; I wish it said [Donations] instead of [PlayerData].