Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- service = nil
- server = nil
- local HttpService = game:GetService("HttpService")
- local Settings = {
- Webhook = "ur gayy"; -- Replace with your webhook link. (MAKE SURE YOU KEEP THE QUOTES)
- RunForGuests = true; -- Set to true if you want guests (players without admin) commands to be logged.
- Ignore = {}; -- Commands you want ignored. Example: {":fly", ":speed"}
- }
- local function FindInArray(arr, obj)
- for i = 1, #arr do
- if arr[i] == obj then
- return i
- end
- end
- return nil
- end
- -- Module
- return function()
- service.Events.CommandRan:Connect(function(plr, data)
- local msg = data.Message;
- local cmd = data.Matched;
- local args = data.Args;
- if FindInArray(Settings.Ignore, cmd:lower()) then
- return
- end
- local pLevel = data.PlayerData.Level
- local Level = server.Admin.LevelToListName(pLevel)
- local InformationToSend = {
- ["content"] = "",
- ["embeds"] = {{
- ["title"] = "**Logging Commands**",
- ["description"] = "This will log our give and take credits commands;" ,
- ["type"] = "rich",
- ["color"] = tonumber(0xefffff),
- ["fields"] = {
- {
- ["name"] = "Username & ID;",
- ["value"] = plr.Name .. " ; ".. plr.UserId,
- ["inline"] = false
- },
- {
- ["name"] = "Admin Level;",
- ["value"] = (Level or "Guest"),
- ["inline"] = false
- },
- {
- ["name"] = "Command;",
- ["value"] = msg,
- ["inline"] = false
- },
- }
- }}
- }
- if Level or (not Level and Settings.RunForGuests) then
- local NewData = HttpService:JSONEncode(InformationToSend)
- HttpService:PostAsync(Settings.Webhook, NewData)
- end
- end)
- end
Add Comment
Please, Sign In to add comment