Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- malixious protektion
- if not game:IsLoaded() then
- game.IsLoaded:Wait()
- end
- if game:GetService("TextChatService").ChatVersion == Enum.ChatVersion.LegacyChatService then
- chat = "legacy"
- SMR = game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest
- SMRP = SMR.Parent
- ChatBar =
- game:GetService("Players").LocalPlayer.PlayerGui.Chat.Frame.ChatBarParentFrame.Frame.BoxFrame.Frame.ChatBar
- chatMain = game:GetService("Players").LocalPlayer.PlayerScripts.ChatScript.ChatMain
- lastText = ""
- function makeMessage(message)
- msg = tostring(message)
- game:GetService("StarterGui"):SetCore(
- "ChatMakeSystemMessage",
- {
- Text = msg,
- Color = Color3.fromRGB(255, 89, 98),
- Font = Enum.Font.GothamMedium,
- FontSize = 16
- }
- )
- end
- function makeWarn(message)
- msg = tostring(message)
- game:GetService("StarterGui"):SetCore(
- "ChatMakeSystemMessage",
- {
- Text = "[WARN]\n" .. msg,
- Color = Color3.fromHex("#fdfd96"),
- Font = Enum.Font.GothamMedium,
- FontSize = 16
- }
- )
- end
- function makeError(message)
- msg = tostring(message)
- game:GetService("StarterGui"):SetCore(
- "ChatMakeSystemMessage",
- {
- Text = "[ERROR]\n" .. msg,
- Color = Color3.fromRGB(125, 12, 23),
- Font = Enum.Font.GothamMedium,
- FontSize = 16
- }
- )
- end
- else
- chat = "tcs"
- function makeMessage(msg)
- msg = tostring(msg)
- if game:GetService("TextChatService").TextChannels:FindFirstChild("RBXGeneral") then
- game:GetService("TextChatService").TextChannels:FindFirstChild("RBXGeneral"):DisplaySystemMessage(msg)
- end
- end
- function makeWarn(msg)
- msg = tostring(msg)
- if game:GetService("TextChatService").TextChannels:FindFirstChild("RBXGeneral") then
- game:GetService("TextChatService").TextChannels:FindFirstChild("RBXGeneral"):DisplaySystemMessage(
- "[WARN] " .. msg
- )
- end
- end
- function makeError(msg)
- makeMessage("[ERROR]\n" .. msg)
- end
- end
- local function gcs()
- if getcallingscript() ~= nil then
- return getcallingscript():GetFullName()
- else
- return "Unknown script"
- end
- end
- local r = true
- local ggv = getgenv
- ggv().Protectio = {
- AllowSendAsync = false,
- AllowHttpRequests = false,
- AllowClientKick = false,
- AllowReportAbuse = false,
- AllowCaptureFocus = false,
- AllowSayMessageRequest = false,
- AllowLoadstrings = false
- }
- ggv().OnAttemptDeny = {
- CopyURLs = false,
- CopyReportAbuse = false
- }
- local hook
- hook =
- hookmetamethod(
- game,
- "__namecall",
- function(Self, ...)
- local args, method = {...}, getnamecallmethod()
- if ggv().Protectio[1] == false and method == "SendAsync" and Self:IsA("TextChannel") then
- return makeWarn(gcs() .. " tried to SendAsync with the message " .. args[1] .. " in channel " .. Self.Name)
- end
- if
- ggv().Protectio[2] == false and method == "HttpGet" or
- method == "HttpGetAsync" and Self == game and not args[1]:find("https://scriptblox.com") and
- not args[1]:find("https://robloxscripts.net")
- then
- if ggv().OnAttemptDeny[2] == true then
- setclipboard(args[1])
- end
- return makeWarn(
- "\n! POSSIBLY DANGEROUS URL BLOCKED ! \n" ..
- gcs() ..
- " tried to use " .. method .. " with the URL " .. args[1] .. ", possibly used in loadstring"
- )
- end
- if ggv().Protectio[3] == false and method == "Kick" and Self == game.Players.LocalPlayer then
- return makeWarn(gcs() .. " tried to kick you, Protectio denied the attempt.")
- end
- if ggv().Protectio[4] == false and method == "ReportAbuse" and Self == game:GetService("Players") then
- if ggv().OnAttemptDeny[3] == true then
- setclipboard(
- "-- Latest Report Abuse call info: \nCalling Script: " ..
- gcs() .. "\nReason: " .. args[1] .. "\nPlayer: " .. args[2] .. "\nNote: " .. args[3]
- )
- end
- return makeWarn(
- "-- Latest Report Abuse call info: \nCalling Script: " ..
- gcs() .. "\nReason: " .. args[1] .. "\nPlayer: " .. args[2] .. "\nNote: " .. args[3]
- )
- end
- if
- ggv().Protectio[5] == false and method == "CaptureFocus" and not getcallingscript() == chatMain and
- Self == ChatBar and
- chat == "legacy"
- then
- return makeWarn(gcs() .. " tried to CaptureFocus, Possible Force Chat attempt denied.")
- elseif chat == "tcs" and method == "CaptureFocus" and ggv().Protectio[5] == false then
- return makeWarn(gcs() .. " tried to call CaptureFocus, Attempt denied.")
- end
- if
- chat == "legacy" and Self == SMR and method == "FireServer" and lastText ~= args[1] and
- getcallingscript() ~= chatMain
- then
- return makeWarn(gcs() .. " tried to call SayMessageRequest")
- end
- return hook(Self, ...)
- end
- )
- if ChatBar ~= nil then
- ChatBar.Focused:Connect(
- function()
- repeat
- lastText = ChatBar.Text
- until ChatBar.Text == ""
- end
- )
- end
- task.spawn(
- function()
- while task.wait(.9) do
- if SMR ~= nil and SMRP ~= nil then
- SMR.Name = ""
- SMR.Name = SMR.Name .. tostring(math.random(1, 99999999)) .. "@(9$)"
- SMR.Parent = workspace
- task.wait(.3)
- SMR.Parent = SMRP
- end
- end
- end
- )
- hookfunction(
- error,
- newcclosure(
- function(...)
- if not stopped2 then
- local args = {...}
- for i, v in args do
- makeError = (v)
- end
- stopped2 = true
- for i, v in args do
- error(v)
- end
- stopped2 = false
- end
- end
- )
- )
- hookfunction(
- warn,
- newcclosure(
- function(...)
- if not stopped3 then
- local args = {...}
- for i, v in args do
- makeWarn(v)
- end
- stopped3 = true
- for i, v in args do
- warn(v)
- end
- stopped3 = false
- end
- end
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement