so I'm having issues saving bans and such using a datastore I was wondering if anyone could help me I'm kinda stuck at the end
local DataStore = game:GetService("DataStoreService"):GetDataStore("BannedList")
local bans = {""}
local admins = {"admin"}
local victim
function tableContains(t, value)
for _, v in pairs(t) do
if v == value then
return true
end
end
return false
end
function findPlayer(name)
for _, player in ipairs(game.Players:GetPlayers()) do
if player.Name:lower() == name:lower() then
return player
end
end
end
game:GetService("Players").PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg:sub(1, 4) == "ban/" and tableContains(admins, player.Name) then
victim = findPlayer(msg:sub(5))
if victim then
end
end
end)

2 comments
I'm just trying to save a table here nothing special
Then why didn't you say that in the question? The more detailed your explanation, the more detailed your answer.