Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game:GetService("Players").LocalPlayer
- local key = plr.UserId
- -- Mude aqui
- --[[ exemplo
- local ondeGuis = {game.StarterGui, game.ReplicatedStorage}
- Ele ira checar se é um gui ou esta dentro de um gui,
- então nao tem problema onde colocar.
- ele vai validar com o propio id do usuario, se
- aquele novo gui colocado no PlayerGui, não for validado
- com o usuario (como o de exploits) , o usuario leva kick.
- ]]
- local ondeGuis = {}
- -- Coloque a script no "StarterPlayerScripts"
- local permitidos = {"BubbleChat" .. " " .. key, "Chat" .. " " .. key}
- function kick(quem)
- quem:Kick("You was Kicked from this game For Hacking.")
- end
- function securanca(key,onde)
- for i,v in pairs(onde:GetDescendants()) do
- table.insert(permitidos,v.Name .. " " .. key)
- end
- end
- function check(quem,key)
- for i=1,#permitidos do
- local estaPermitido = permitidos[i] == quem.Name .. " " .. key
- if estaPermitido then
- return true
- end
- end
- end
- function permitir()
- securanca(key,plr.PlayerGui:FindFirstChild("BubbleChat"))
- securanca(key,plr.PlayerGui:FindFirstChild("Chat"))
- for i=1,#ondeGuis do
- securanca(key,ondeGuis[i])
- end
- end
- local plrnome = plr.Name
- game.Workspace:WaitForChild(plrnome)
- wait(2)
- permitir()
- plr.PlayerGui.DescendantAdded:connect(function(des)
- if plr.Character then
- local ok = check(des,key)
- if not ok then
- kick(plr)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement