LawMixer

sss

Aug 1st, 2021 (edited)
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.64 KB | None | 0 0
  1. service = nil
  2. server = nil
  3.  
  4. local HttpService = game:GetService("HttpService")
  5. local Settings = {
  6.     Webhook = "ur gayy"; -- Replace with your webhook link. (MAKE SURE YOU KEEP THE QUOTES)
  7.     RunForGuests = true; -- Set to true if you want guests (players without admin) commands to be logged.
  8.     Ignore = {}; -- Commands you want ignored. Example: {":fly", ":speed"}
  9. }
  10.  
  11. local function FindInArray(arr, obj)
  12.     for i = 1, #arr do
  13.         if arr[i] == obj then
  14.             return i
  15.         end
  16.     end
  17.     return nil
  18. end
  19.  
  20. -- Module
  21. return function()
  22.     service.Events.CommandRan:Connect(function(plr, data)
  23.         local msg = data.Message;
  24.         local cmd = data.Matched;
  25.         local args = data.Args;
  26.  
  27.         if FindInArray(Settings.Ignore, cmd:lower()) then
  28.             return
  29.         end
  30.  
  31.         local pLevel = data.PlayerData.Level
  32.         local Level = server.Admin.LevelToListName(pLevel)
  33.         local InformationToSend = {
  34.             ["content"] = "",
  35.             ["embeds"] = {{
  36.                 ["title"] = "**Logging Commands**",
  37.                 ["description"] = "This will log our give and take credits commands;" ,
  38.                 ["type"] = "rich",
  39.                 ["color"] = tonumber(0xefffff),
  40.                 ["fields"] = {
  41.                     {
  42.                         ["name"] = "Username & ID;",
  43.                         ["value"] = plr.Name .. " ; ".. plr.UserId,
  44.                         ["inline"] = false
  45.                     }, 
  46.                     {
  47.                         ["name"] = "Admin Level;",
  48.                         ["value"] = (Level or "Guest"),
  49.                         ["inline"] = false
  50.                     },
  51.                     {
  52.                         ["name"] = "Command;",
  53.                         ["value"] = msg,
  54.                         ["inline"] = false
  55.                     },
  56.                 }
  57.             }}
  58.         }
  59.        
  60.        
  61.         if Level or (not Level and Settings.RunForGuests) then
  62.             local NewData = HttpService:JSONEncode(InformationToSend)
  63.             HttpService:PostAsync(Settings.Webhook, NewData)
  64.         end
  65.     end)
  66. end
Add Comment
Please, Sign In to add comment