--// Loadstring logger V1.5
local originalLoadstring = loadstring
getgenv().LoadstringLogs = {}
local function safeNotify(title, text, duration)
local success, err = pcall(function()
game.StarterGui:SetCore("SendNotification", {
Title = title,
Text = text,
Duration = duration or 5
})
end)
if not success then
warn("[Notification Error]: "..tostring(err))
end
end
local function ensureDirectory()
if not isfolder("ShashlikEx") then
makefolder("ShashlikEx")
end
end
local function clearOldLogs()
ensureDirectory()
if isfile("ShashlikEx/copycode.txt") then
delfile("ShashlikEx/copycode.txt")
end
end
local function writeToFile(content)
ensureDirectory()
local success, err = pcall(function()
if not isfile("ShashlikEx/copycode.txt") then
writefile("ShashlikEx/copycode.txt", "-- Loadstring Logs --\n\n")
end
local timestamp = os.date("%Y-%m-%d %H:%M:%S")
local fileContent = readfile("ShashlikEx/copycode.txt")
local newContent = string.format("\n-- [%s] --\n%s\n", timestamp, content)
writefile("ShashlikEx/copycode.txt", fileContent .. newContent)
end)
if not success then
warn("[File Error]: Failed to write to file: "..tostring(err))
end
end
clearOldLogs()
getgenv().loadstring = function(code, ...)
table.insert(getgenv().LoadstringLogs, code)
writeToFile(code)
safeNotify("[Loadstring logger]", "A new loadstring has been logged.")
return originalLoadstring(code, ...)
end
getgenv().load = getgenv().loadstring