I have this script in the workspace:
script:WaitForChild("SaveTableValues").OnServerEvent:connect(function(player) local datastore = game:GetService("DataStoreService"):GetDataStore("BannedPlayers") for i = 1, #BannedPeople do datastore:SetAsync(BannedPeople[i],BannedPeople[i]) print(BannedPeople[i].." successfully saved!") end end) script:WaitForChild("LoadTableValues").OnServerEvent:connect(function(player) local datastore = game:GetService("DataStoreService"):GetDataStore("BannedPlayers") for i = 1, #BannedPeople do table.insert(BannedPeople,datastore:GetAsync(BannedPeople[i])) print(BannedPeople[i].." successfully loaded!") end end)
Everytime I leave it won't load when I call the LoadTableValues
Event for some reason.. But the save Event works.
Can someone help?