So the title might not make much sense but basically I have a table of code for data:
handler.leaderboards = {
['MostRolled'] = {
Part = leaderboards.MostRolls.Plane,
Datastore = dataStoreService:GetOrderedDataStore("MostRolled"),
ValuePrefix = "Rolls",
Path = "{plr}.leaderstats.Rolls.Value"
}
}
I want to call this table later and concatenate the player instance to the path value but I’m not sure how to do that without getting an error. Here is a snippet of where I’m using it.
local function saveAll(lbInfo)
local datastore:OrderedDataStore = lbInfo.Datastore
for _, plr in pairs(players:GetPlayers()) do
print(players[lbInfo.Path:gsub("{plr}", plr.Name)].Value)
task.wait(0.5)
end
end
I knew this wouldn’t work in the first place, but for the sake of an example I did it anyway.
Heres the error I get whenever I run this:
CaelmDev.leaderstats.Rolls.Value is not a valid member of Players "Players"
Hopefully I made it clear enough. If you can help me please do thanks.