Advertisement
Gabkiu1

Anti Exploit

May 21st, 2018
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. local plr = game:GetService("Players").LocalPlayer
  2. local key = plr.UserId
  3.  
  4.  
  5. -- Mude aqui
  6.  
  7. --[[ exemplo
  8. local ondeGuis = {game.StarterGui, game.ReplicatedStorage}
  9.  
  10. Ele ira checar se é um gui ou esta dentro de um gui,
  11. então nao tem problema onde colocar.
  12. ele vai validar com o propio id do usuario, se
  13. aquele novo gui colocado no PlayerGui, não for validado
  14. com o usuario (como o de exploits) , o usuario leva kick.
  15. ]]
  16. local ondeGuis = {}
  17.  
  18.  
  19. -- Coloque a script no "StarterPlayerScripts"
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32. local permitidos = {"BubbleChat" .. " " .. key, "Chat" .. " " .. key}
  33.  
  34. function kick(quem)
  35. quem:Kick("You was Kicked from this game For Hacking.")
  36. end
  37.  
  38.  
  39.  
  40.  
  41. function securanca(key,onde)
  42. for i,v in pairs(onde:GetDescendants()) do
  43. table.insert(permitidos,v.Name .. " " .. key)
  44. end
  45. end
  46.  
  47.  
  48.  
  49.  
  50. function check(quem,key)
  51. for i=1,#permitidos do
  52. local estaPermitido = permitidos[i] == quem.Name .. " " .. key
  53.  
  54. if estaPermitido then
  55. return true
  56. end
  57. end
  58. end
  59.  
  60.  
  61. function permitir()
  62. securanca(key,plr.PlayerGui:FindFirstChild("BubbleChat"))
  63. securanca(key,plr.PlayerGui:FindFirstChild("Chat"))
  64. for i=1,#ondeGuis do
  65. securanca(key,ondeGuis[i])
  66. end
  67. end
  68.  
  69. local plrnome = plr.Name
  70. game.Workspace:WaitForChild(plrnome)
  71. wait(2)
  72. permitir()
  73.  
  74. plr.PlayerGui.DescendantAdded:connect(function(des)
  75. if plr.Character then
  76. local ok = check(des,key)
  77. if not ok then
  78. kick(plr)
  79. end
  80. end
  81. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement