I have a data store table that has a list of jobs and players that have the job, I can add to it fine as seen below
local jobEmployeeStore = DataStoreService:GetDataStore("JobEmployees")
local jobEmployeeData = jobEmployeeStore:GetAsync("jobs_key")
table.insert(jobEmployeeData[job], player.Name)
local Success, errorMessage = pcall(function()
jobEmployeeStore:SetAsync("jobs_key", jobEmployeeData)
end)
if not Success then
print(errorMessage)
end
But when I :GetAsync again and try to iterate through the table, I get this
local jobEmployeeStore = DataStoreService:GetDataStore("JobEmployees")
local jobEmployeeData = jobEmployeeStore:GetAsync("jobs_key")
for i,v in pairs(jobEmployeeData[job]) do
print(i)
end
The second script function is to remove the player from the table, but I can’t even get it to iterate through the table in order to then table.remove the player name. How can I solve this?