Title is pretty self explanatory, but I just want to know, would this work?
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 not data_.Ban.Moderator then data_.Ban.Moderator = player.Name end --do some setting data stuff
if not data_.Ban.BanReason then data_.Ban.BanReason = "N/A" end
data.Set(player, data_)
v:Kick("You were kicked from the game.\nModerator: "..data_.Ban.Moderator..".\n\nReason:\n"..data_.Ban.BanReason) --kick
else
local data_ = data.Get(player)
local result = {}
for i = 3, #args do
table.insert(result, args[i])
end
if not data_.Ban.Moderator then data_.Ban.Moderator = player.Name end --do some setting data stuff
if not data_.Ban.BanReason then data_.Ban.BanReason = table.concat(result, " ") end
data.Set(player, data_)
v:Kick("You were kicked from the game.\nModerator: "..data_.Ban.Moderator..".\n\nReason:\n"..data_.Ban.BanReason)
end
end
The data script is here.