So I'm trying to do something that'll save player names into a table for licenses, not really relevant but some description to help
local module = {}
local DataStoreService = game:GetService("DataStoreService")
local LicenseStore = DataStoreService:GetDataStore("LicenseStore")
module.Licenses = {}
module.AddLicense = function(Player,AddOrRemove)
if AddOrRemove then
module.Licenses[Player.Name] = 1
elseif not AddOrRemove then
module.Licenses[Player.Name] = nil
end
LicenseStore:SetAsync("Licenses",LicenseStore)
end
module.CheckLicense = function(Player)
if module.Licenses[Player.Name] then
--Give license permissions
end
end
This is my code, I'm not entirely sure if I'm saving that correctly, how would I set the table to the saved data as well? Not really familiar with Datastores I generally try and avoid them most of the time. |