LawMixer

sss

May 25th, 2021 (edited)
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. service = nil -- words cant explain how much i hate doing this
  2.  
  3. local HttpService = game:GetService("HttpService")
  4. local Settings = {
  5. Webhook = "-tT53gNTbY2q3s",
  6. RunForGuests = true,
  7. Ignore = {}
  8. }
  9.  
  10. local function GetLevel(plr)
  11. local level = _G.Adonis.GetLevel(plr)
  12.  
  13. if level > 0 then
  14. if level == 1 then
  15. return "Moderator"
  16. elseif level == 2 then
  17. return "Admin"
  18. elseif level == 3 then
  19. return "Owner"
  20. elseif level == 4 then
  21. return "Creator"
  22. elseif level == 5 then
  23. return "Place Owner"
  24. end
  25. end
  26. end
  27.  
  28. local function FindInArray(arr, obj)
  29. for i = 1, #arr do
  30. if arr[i] == obj then
  31. return i
  32. end
  33. end
  34. return nil
  35. end
  36.  
  37. local function Convert(playerArgs, cmdArgs)
  38. local tab = {}
  39. for i = 1, #cmdArgs do
  40. local arg1 = playerArgs[i]
  41. local argName = cmdArgs[i]
  42. tab[argName] = arg1
  43. end
  44. return tab
  45. end
  46. -- Module
  47. return function()
  48. service.Events.CommandRan:Connect(
  49. function(plr, data)
  50. local msg = data.Message
  51. local cmd = data.Matched
  52. local args = data.Args
  53.  
  54. if FindInArray(Settings.Ignore, cmd:lower()) then
  55. return
  56. end
  57.  
  58. local Level = GetLevel(plr)
  59. if Level or (not Level and Settings.RunForGuests) then
  60. HttpService:PostAsync(
  61. Settings.Webhook,
  62. HttpService:JSONEncode(
  63. {
  64. embeds = {
  65. {
  66. author = "Executor:" .. plr.Name,
  67. title = "Admin Level:" .. (Level or "Guest"),
  68. type = "rich",
  69. description = msg,
  70. color = 8376188
  71. }
  72. }
  73. }
  74. )
  75. )
  76. end
  77. end
  78. )
  79. end
  80.  
Add Comment
Please, Sign In to add comment