Advertisement
rrixh

malixious protektion

Sep 18th, 2023
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.92 KB | None | 0 0
  1. -- malixious protektion
  2. if not game:IsLoaded() then
  3.     game.IsLoaded:Wait()
  4. end
  5. if game:GetService("TextChatService").ChatVersion == Enum.ChatVersion.LegacyChatService then
  6.     chat = "legacy"
  7.     SMR = game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest
  8.     SMRP = SMR.Parent
  9.     ChatBar =
  10.         game:GetService("Players").LocalPlayer.PlayerGui.Chat.Frame.ChatBarParentFrame.Frame.BoxFrame.Frame.ChatBar
  11.     chatMain = game:GetService("Players").LocalPlayer.PlayerScripts.ChatScript.ChatMain
  12.     lastText = ""
  13.     function makeMessage(message)
  14.         msg = tostring(message)
  15.         game:GetService("StarterGui"):SetCore(
  16.             "ChatMakeSystemMessage",
  17.             {
  18.                 Text = msg,
  19.                 Color = Color3.fromRGB(255, 89, 98),
  20.                 Font = Enum.Font.GothamMedium,
  21.                 FontSize = 16
  22.             }
  23.         )
  24.     end
  25.     function makeWarn(message)
  26.         msg = tostring(message)
  27.         game:GetService("StarterGui"):SetCore(
  28.             "ChatMakeSystemMessage",
  29.             {
  30.                 Text = "[WARN]\n" .. msg,
  31.                 Color = Color3.fromHex("#fdfd96"),
  32.                 Font = Enum.Font.GothamMedium,
  33.                 FontSize = 16
  34.             }
  35.         )
  36.     end
  37.     function makeError(message)
  38.         msg = tostring(message)
  39.         game:GetService("StarterGui"):SetCore(
  40.             "ChatMakeSystemMessage",
  41.             {
  42.                 Text = "[ERROR]\n" .. msg,
  43.                 Color = Color3.fromRGB(125, 12, 23),
  44.                 Font = Enum.Font.GothamMedium,
  45.                 FontSize = 16
  46.             }
  47.         )
  48.     end
  49. else
  50.     chat = "tcs"
  51.     function makeMessage(msg)
  52.         msg = tostring(msg)
  53.         if game:GetService("TextChatService").TextChannels:FindFirstChild("RBXGeneral") then
  54.             game:GetService("TextChatService").TextChannels:FindFirstChild("RBXGeneral"):DisplaySystemMessage(msg)
  55.         end
  56.     end
  57.     function makeWarn(msg)
  58.         msg = tostring(msg)
  59.         if game:GetService("TextChatService").TextChannels:FindFirstChild("RBXGeneral") then
  60.             game:GetService("TextChatService").TextChannels:FindFirstChild("RBXGeneral"):DisplaySystemMessage(
  61.                 "[WARN] " .. msg
  62.             )
  63.         end
  64.     end
  65.     function makeError(msg)
  66.         makeMessage("[ERROR]\n" .. msg)
  67.     end
  68. end
  69. local function gcs()
  70.     if getcallingscript() ~= nil then
  71.         return getcallingscript():GetFullName()
  72.     else
  73.         return "Unknown script"
  74.     end
  75. end
  76. local r = true
  77. local ggv = getgenv
  78. ggv().Protectio = {
  79.     AllowSendAsync = false,
  80.     AllowHttpRequests = false,
  81.     AllowClientKick = false,
  82.     AllowReportAbuse = false,
  83.     AllowCaptureFocus = false,
  84.     AllowSayMessageRequest = false,
  85.     AllowLoadstrings = false
  86. }
  87. ggv().OnAttemptDeny = {
  88.     CopyURLs = false,
  89.     CopyReportAbuse = false
  90. }
  91.  
  92. local hook
  93. hook =
  94.     hookmetamethod(
  95.     game,
  96.     "__namecall",
  97.     function(Self, ...)
  98.         local args, method = {...}, getnamecallmethod()
  99.         if ggv().Protectio[1] == false and method == "SendAsync" and Self:IsA("TextChannel") then
  100.             return makeWarn(gcs() .. " tried to SendAsync with the message " .. args[1] .. " in channel " .. Self.Name)
  101.         end
  102.         if
  103.             ggv().Protectio[2] == false and method == "HttpGet" or
  104.                 method == "HttpGetAsync" and Self == game and not args[1]:find("https://scriptblox.com") and
  105.                     not args[1]:find("https://robloxscripts.net")
  106.          then
  107.             if ggv().OnAttemptDeny[2] == true then
  108.                 setclipboard(args[1])
  109.             end
  110.             return makeWarn(
  111.                 "\n! POSSIBLY DANGEROUS URL BLOCKED ! \n" ..
  112.                     gcs() ..
  113.                         " tried to use " .. method .. " with the URL " .. args[1] .. ", possibly used in loadstring"
  114.             )
  115.         end
  116.         if ggv().Protectio[3] == false and method == "Kick" and Self == game.Players.LocalPlayer then
  117.             return makeWarn(gcs() .. " tried to kick you, Protectio denied the attempt.")
  118.         end
  119.         if ggv().Protectio[4] == false and method == "ReportAbuse" and Self == game:GetService("Players") then
  120.             if ggv().OnAttemptDeny[3] == true then
  121.                 setclipboard(
  122.                     "-- Latest Report Abuse call info: \nCalling Script: " ..
  123.                         gcs() .. "\nReason: " .. args[1] .. "\nPlayer: " .. args[2] .. "\nNote: " .. args[3]
  124.                 )
  125.             end
  126.             return makeWarn(
  127.                 "-- Latest Report Abuse call info: \nCalling Script: " ..
  128.                     gcs() .. "\nReason: " .. args[1] .. "\nPlayer: " .. args[2] .. "\nNote: " .. args[3]
  129.             )
  130.         end
  131.         if
  132.             ggv().Protectio[5] == false and method == "CaptureFocus" and not getcallingscript() == chatMain and
  133.                 Self == ChatBar and
  134.                 chat == "legacy"
  135.          then
  136.             return makeWarn(gcs() .. " tried to CaptureFocus, Possible Force Chat attempt denied.")
  137.         elseif chat == "tcs" and method == "CaptureFocus" and ggv().Protectio[5] == false then
  138.             return makeWarn(gcs() .. " tried to call CaptureFocus, Attempt denied.")
  139.         end
  140.         if
  141.             chat == "legacy" and Self == SMR and method == "FireServer" and lastText ~= args[1] and
  142.                 getcallingscript() ~= chatMain
  143.          then
  144.             return makeWarn(gcs() .. " tried to call SayMessageRequest")
  145.         end
  146.         return hook(Self, ...)
  147.     end
  148. )
  149.  
  150. if ChatBar ~= nil then
  151.     ChatBar.Focused:Connect(
  152.         function()
  153.             repeat
  154.                 lastText = ChatBar.Text
  155.             until ChatBar.Text == ""
  156.         end
  157.     )
  158. end
  159. task.spawn(
  160.     function()
  161.         while task.wait(.9) do
  162.             if SMR ~= nil and SMRP ~= nil then
  163.                 SMR.Name = ""
  164.                 SMR.Name = SMR.Name .. tostring(math.random(1, 99999999)) .. "@(9$)"
  165.                 SMR.Parent = workspace
  166.                 task.wait(.3)
  167.                 SMR.Parent = SMRP
  168.             end
  169.         end
  170.     end
  171. )
  172.  
  173. hookfunction(
  174.     error,
  175.     newcclosure(
  176.         function(...)
  177.             if not stopped2 then
  178.                 local args = {...}
  179.                 for i, v in args do
  180.                     makeError = (v)
  181.                 end
  182.                 stopped2 = true
  183.                 for i, v in args do
  184.                     error(v)
  185.                 end
  186.                 stopped2 = false
  187.             end
  188.         end
  189.     )
  190. )
  191. hookfunction(
  192.     warn,
  193.     newcclosure(
  194.         function(...)
  195.             if not stopped3 then
  196.                 local args = {...}
  197.                 for i, v in args do
  198.                     makeWarn(v)
  199.                 end
  200.                 stopped3 = true
  201.                 for i, v in args do
  202.                     warn(v)
  203.                 end
  204.                 stopped3 = false
  205.             end
  206.         end
  207.     )
  208. )
  209.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement