Hello, I’m currently trying to make an anti-exploit and I’m trying to detect when an exploiter prints a message into the output. Using ScriptContext.Error, I can detect when a script errors and I can get the path of the script like this:
game:GetService("ScriptContext").Error:Connect(function(message, stackTrace, object)
print(stackTrace) -- Prints the path of the script that errored
end)
What I’m trying to do is similar to this but instead of getting the stack trace of an error, I want to get the stack trace of a print.
game:GetService("LogService").MessageOut:Connect(function(message)
print(message)
end)
This function above can get when a script prints a message but there is no parameter available to get the script that called the print function. I’m wondering if there is any way to find the script that called the print function. Thanks!