Meliodas0_0

Mod detector

Mar 5th, 2020
44
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local players = game:GetService("Players")
  2. ---------------SETTINGS
  3. local toCheck = {348902,1,0000}--Add the UserId's of the people you want to check for
  4. local canLeave = true --If you want to auto leave the game then change this to true
  5. local canKick = true--If you have a anti client kick executed set this to false
  6. local notificationsEnabled = true -- set to false if the game can detect notifications
  7. local kickmessage = "" --The message you want when you're kicked. canKick must be true
  8. -----------------
  9. function check(player)
  10.     for i,v in pairs(toCheck) do
  11.         if tostring(v) == tostring(player.UserId)then
  12.             return true
  13.         end
  14.     end
  15.     return false
  16. end
  17. function notify(title,text,duritation)
  18.     game:GetService("StarterGui"):SetCore("SendNotification",{
  19.         Title = title;
  20.         Text = text;
  21.         Duritation = duritation;
  22.     })
  23. end
  24. function crash(o)
  25.     if o then
  26.         if kickMessage=="" then
  27.         players.LocalPlayer:Kick("A player in your toCheck table is currently in this game")
  28.         else
  29.             players.LocalPlayer:kick(kickMessage)
  30.         end
  31.     else
  32.         pcall(function() players.LocalPlayer.Character:BreakJoints() end)--kills you
  33.         wait(1)
  34.         pcall(function()
  35.             local part = Instance.new("Part")
  36.             local d = part.TouchEnded:Connect(print)
  37.             part.DescendantRemoving:Connect(function()
  38.             d:Disconnect()
  39.             end)
  40.             part:Destroy()
  41.         end)--this should close your game instantly
  42.         while true do print('k') end--if all else fails this will freeze your game
  43.     end
  44. end
  45.  
  46. for i,v in pairs(players:GetPlayers())do--I told you.
  47.     if check(v) and canLeave then
  48.         crash(canKick)
  49.     elseif check(v) then
  50.         if notificationsEnabled then
  51.             notify("WARNING",v.Name.." is in game and is on your detection list",5)
  52.         end
  53.     end
  54. end
  55.  
  56. players.PlayerAdded:Connect(function(player)--I told you x2.
  57.     if check(player) and canLeave then
  58.         crash(canKick)
  59.     elseif check(player) then
  60.         if notificationsEnabled then
  61.             notify("WARNING",player.Name.." has joined as is on your detection list",5)
  62.         end
  63.     end
  64. end)
  65.  
  66. if notificationsEnabled then
  67.     notify("Welcone","Welcome,"..players.LocalPlayer.Name,5)
  68.     notify("REMEMBER","Remember to configure your settings at the top of the script!",5)
  69. end
  70.  
  71. if notificationsEnabled==false and canLeave == false and canKick == false then
  72.     print("The fuck are you executing this script for?")
  73. end
RAW Paste Data