I made a ban system for an admin system that I’m making, and I’m looking for feedback.
You can use the code, but just leave credit.
Code
for _,v in pairs(GetPlayer(player, args)) do --get player
if not args[2] then return end
if not args[3] then
local data_ = data.get(player) --get data
if data_.Ban.Moderator == nil then data_.Ban.Moderator = player.Name end
if not data_.Ban.Reason then data_.Ban.Reason = "N/A" end
data_.Ban.Banned = true
data.set(player)
v:Kick("You were kicked from the game.\nModerator: "..data_.Ban.Moderator..".\n\nReason:\n"..data_.Ban.Reason)
else
local data_ = data.get(player)
local result = {}
for i = 3, #args do
table.insert(result, args[i])
end
if data_.Ban.Moderator == nil then data_.Ban.Moderator = player.Name end
if data_.Ban.Reason == "N/A" then data_.Ban.Reason = table.concat(result, " ") end
data_.Ban.Banned = true
data.set(player)
print(data_)
v:Kick("You were kicked from the game.\nModerator: "..data_.Ban.Moderator..".\n\nReason:\n"..data_.Ban.Reason)
end
end