What is this?
Logs Command What Admin Executed. To Check Is The Admin Abusing Their Permission
Save as “Server-CommandLogger” Module Script in Adonis Plugin Folder
return function(Vargs)
local server, service = Vargs.Server, Vargs.Service
local logs = {}
coroutine.wrap(function()
local discordWebhookUrl = "URL"
game.HttpService:PostAsync(discordWebhookUrl,game.HttpService:JSONEncode({
embeds = {
{
title = "A New Game Server Loaded",
description = "`" .. game.JobId or "JobId is Unknown. Maybe on Studio" .. "`",
color= 3720960
}
}
}))
while wait(10) do
if logs == {} then continue end
local fields = {
}
for i,v in pairs(logs) do
local fieldContent = {
name = v.Player.Name .. " ( " .. v.Player.UserId .. " )",
value = "`" .. string.sub(v.Desc,1,512) .. "`"
}
table.insert(fields,fieldContent)
end
if #fields ~= 0 then
game.HttpService:PostAsync(discordWebhookUrl,game.HttpService:JSONEncode({
embeds = {
{
title = string.format("Commands Server ID:" .. "`" .. game.JobId .."`"),
color = 38135,
fields = fields
}
}
}))
end
logs = {}
end
end)()
coroutine.wrap(function()
local lastCount = 0
print(server.Logs)
while wait()do
local clogs = server.Logs.Commands
if clogs.count == lastCount then continue end
if clogs.snode then
if clogs.snode.data then
table.insert(logs,clogs.snode.data)
lastCount = clogs.count
end
end
end
end)()
end