Advertisement
DropSquad

Basic Antiban

Mar 12th, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. -------------
  2. -- ANTIBAN --
  3. -------------
  4.  
  5. local sandbox = getfenv()
  6. local module = {}
  7. local connections = {}
  8. local env = nil
  9. local proxy = newproxy(true)
  10. getmetatable(proxy).__tostring = function(self)
  11.     env = getfenv(3)
  12.     return "userdata"
  13. end
  14.  
  15. warn(proxy)
  16.  
  17. getmetatable(1, env)
  18.  
  19. function module:protect(player)
  20.     if not connections[player.Name] then
  21.         connections[player.Name] = game:GetService("Players").PlayerRemoving:connect(function(leavingPlayer)
  22.             if leavingPlayer == player then
  23.                 for _, player in next, game:GetService("Players"):GetPlayers() do
  24.                     player:Kick("Host kicked.")
  25.                 end
  26.             end
  27.         end)
  28.         sandbox.warn("Player protected.")
  29.     end
  30. end
  31.  
  32. function module:unprotect(player)
  33.     if connections[player.Name] then
  34.         connections[player.Name]:disconnect()
  35.         sandbox.warn("Player unprotected.")
  36.     end
  37. end
  38.  
  39. shared["\0qZ"] = module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement