Making a ban function which is connected to a table but I don't know how to.
The Module Script
local banned = {} reason = "You have been banned from the game from a Developer" local datastore = game:GetService('DataStoreService'):GetDataStore('MHARebornBanList') --The DataStore local banlist = {}--Storing the Banlist function banned.AddBanlist(userid) table.insert(#banlist, userid) local key = "Banned-"..userid local getsave = datastore:GetAsync(key) if getsave then end end return banned
For your use, I think instead of saving a consistent table, you should save separate keys to a Banlist datastore.
You have to use the SetAsync
function to set the player's ID into a new key.
--Establish datastore local datastore = game:GetService("DataStoreService"):GetDataStore("BanList") local module = {}; --Declare module's environment function module.AddBanlist(userid) local data = datastore:GetAsync(tostring(userid)) if not data then --If they're not already there datastore:SetAsync(tostring(userid),true) --Add them end end --Usage module.AddBanlist(69913657);