Advertisement
Gabkiu1

Untitled

May 23rd, 2018
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. local plr = game:GetService("Players").LocalPlayer
  2. local key = plr.UserId
  3.  
  4.  
  5.  
  6. -- localScript
  7.  
  8. -- Put here places like "game.StarterGui" or "game.Workspace", where is every gui that you going to use.
  9.  
  10. local ondeGuis = {}
  11.  
  12. -- Put script at StarterPlayerScripts
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. local permitidos = {"BubbleChat" .. " " .. key, "Chat" .. " " .. key}
  30.  
  31. function kick(quem)
  32. quem:Kick("You was Kicked from this game For Hacking.")
  33. end
  34.  
  35.  
  36.  
  37.  
  38. function securanca(key,onde)
  39. for i,v in pairs(onde:GetDescendants()) do
  40. table.insert(permitidos,v.Name .. " " .. key)
  41. end
  42. end
  43.  
  44.  
  45.  
  46.  
  47. function check(quem,key)
  48. for i=1,#permitidos do
  49. local estaPermitido = permitidos[i] == quem.Name .. " " .. key
  50.  
  51. if estaPermitido then
  52. return true
  53. end
  54. end
  55. end
  56.  
  57.  
  58. function permitir()
  59. securanca(key,plr.PlayerGui:FindFirstChild("BubbleChat"))
  60. securanca(key,plr.PlayerGui:FindFirstChild("Chat"))
  61. for i=1,#ondeGuis do
  62. securanca(key,ondeGuis[i])
  63. end
  64. end
  65.  
  66. local plrnome = plr.Name
  67. game.Workspace:WaitForChild(plrnome)
  68. wait(2)
  69. permitir()
  70.  
  71. plr.PlayerGui.DescendantAdded:connect(function(des)
  72. if plr.Character then
  73. local ok = check(des,key)
  74. if not ok then
  75. kick(plr)
  76. end
  77. end
  78. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement