NoTextForSpeech

anti kick

Feb 22nd, 2024
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.45 KB | None | 0 0
  1. --// Cache
  2.  
  3. local getgenv, getnamecallmethod, hookmetamethod, newcclosure, checkcaller, stringlower = getgenv, getnamecallmethod, hookmetamethod, newcclosure, checkcaller, string.lower
  4.  
  5. --// Loaded check
  6.  
  7. if getgenv().ED_AntiKick then
  8.     return
  9. end
  10.  
  11. --// Variables
  12.  
  13. local Players, StarterGui, OldNamecall = game:GetService("Players"), game:GetService("StarterGui")
  14.  
  15. --// Global Variables
  16.  
  17. getgenv().ED_AntiKick = {
  18.     Enabled = true, -- Set to false if you want to disable the Anti-Kick.
  19.     SendNotifications = true, -- Set to true if you want to get notified for every event
  20.     CheckCaller = false -- Set to true if you want to disable kicking by other executed scripts
  21. }
  22.  
  23. --// Main
  24.  
  25. OldNamecall = hookmetamethod(game, "__namecall", newcclosure(function(...)
  26.     if (getgenv().ED_AntiKick.CheckCaller and not checkcaller() or true) and stringlower(getnamecallmethod()) == "kick" and ED_AntiKick.Enabled then
  27.         if getgenv().ED_AntiKick.SendNotifications then
  28.             StarterGui:SetCore("SendNotification", {
  29.                 Title = "Exunys Developer",
  30.                 Text = "The script has successfully intercepted an attempted kick.",
  31.                 Icon = "rbxassetid://6238540373",
  32.                 Duration = 2,
  33.             })
  34.         end
  35.  
  36.         return nil
  37.     end
  38.  
  39.     return OldNamecall(...)
  40. end))
  41.  
  42. if getgenv().ED_AntiKick.SendNotifications then
  43.     StarterGui:SetCore("SendNotification", {
  44.         Title = "Exunys Developer",
  45.         Text = "Anti-Kick script loaded!",
  46.         Icon = "rbxassetid://6238537240",
  47.         Duration = 3,
  48.     })
  49. end
Add Comment
Please, Sign In to add comment