Instance Logger (Universal Script/Open Source)
Key RequiredUniversal

Instance Logger (Universal Script/Open Source)

Universal Scriptl15042000l15042000 2K views 1.4K executesUpdated Sep 14, 2026
5.0/ 5(1 votes)
10100% Positive
Lua Script•168 lines (5570 chars)
-- Services
local Players = game:GetService("Players")
local CoreGui = game:GetService("CoreGui")

-- Variables
local player = Players.LocalPlayer
local mouse = player:GetMouse()
local selectedInstance = nil
local isSelecting = false
local connection = nil

-- UI Setup
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "InstanceLoggerUI"
ScreenGui.ResetOnSpawn = false
-- Fallback to PlayerGui if CoreGui is restricted
local success, err = pcall(function() ScreenGui.Parent = CoreGui end)
if not success then ScreenGui.Parent = player:WaitForChild("PlayerGui") end

local MainFrame = Instance.new("Frame")
MainFrame.Name = "MainFrame"
MainFrame.Parent = ScreenGui
MainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
MainFrame.Position = UDim2.new(1, -320, 1, -320)
MainFrame.Size = UDim2.new(0, 300, 0, 300)
MainFrame.Active = true
MainFrame.Draggable = true -- Allows dragging the UI around

local UICorner = Instance.new("UICorner")
UICorner.CornerRadius = UDim.new(0, 8)
UICorner.Parent = MainFrame

local TitleLabel = Instance.new("TextLabel")
TitleLabel.Parent = MainFrame
TitleLabel.BackgroundTransparency = 1
TitleLabel.Size = UDim2.new(1, 0, 0, 40)
TitleLabel.Font = Enum.Font.GothamBold
TitleLabel.Text = "  Instance Logger"
TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
TitleLabel.TextSize = 18
TitleLabel.TextXAlignment = Enum.TextXAlignment.Left

local ToggleButton = Instance.new("TextButton")
ToggleButton.Parent = MainFrame
ToggleButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
ToggleButton.Position = UDim2.new(1, -110, 0, 10)
ToggleButton.Size = UDim2.new(0, 100, 0, 25)
ToggleButton.Font = Enum.Font.GothamSemibold
ToggleButton.Text = "Mode: OFF"
ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
ToggleButton.TextSize = 14
local ToggleCorner = Instance.new("UICorner", ToggleButton)

local LogBox = Instance.new("TextBox")
LogBox.Parent = MainFrame
LogBox.BackgroundColor3 = Color3.fromRGB(15, 15, 15)
LogBox.Position = UDim2.new(0, 10, 0, 50)
LogBox.Size = UDim2.new(1, -20, 1, -100)
LogBox.Font = Enum.Font.Code
LogBox.Text = "Click 'Mode' to start selecting..."
LogBox.TextColor3 = Color3.fromRGB(200, 200, 200)
LogBox.TextSize = 12
LogBox.TextXAlignment = Enum.TextXAlignment.Left
LogBox.TextYAlignment = Enum.TextYAlignment.Top
LogBox.ClearTextOnFocus = false
LogBox.MultiLine = true
LogBox.TextWrapped = true
LogBox.TextEditable = false
local LogCorner = Instance.new("UICorner", LogBox)

local CopyButton = Instance.new("TextButton")
CopyButton.Parent = MainFrame
CopyButton.BackgroundColor3 = Color3.fromRGB(50, 150, 250)
CopyButton.Position = UDim2.new(0, 10, 1, -40)
CopyButton.Size = UDim2.new(1, -20, 0, 30)
CopyButton.Font = Enum.Font.GothamBold
CopyButton.Text = "Copy to Clipboard"
CopyButton.TextColor3 = Color3.fromRGB(255, 255, 255)
CopyButton.TextSize = 14
local CopyCorner = Instance.new("UICorner", CopyButton)

local HighlightBox = Instance.new("SelectionBox")
HighlightBox.Color3 = Color3.fromRGB(50, 150, 250)
HighlightBox.LineThickness = 0.05
HighlightBox.Parent = CoreGui

-- Utility Functions
local function getFullPath(instance)
    local path = instance.Name
    if string.match(path, "[^%w_]") then path = '["' .. path .. '"]' end
    
    local current = instance.Parent
    while current and current ~= game do
        local name = current.Name
        if string.match(name, "[^%w_]") then
            path = '["' .. name .. '"].' .. path
        else
            path = name .. "." .. path
        end
        current = current.Parent
    end
    return "game." .. path
end

local function generateLog(instance)
    local path = getFullPath(instance)
    local parentName = instance.Parent and instance.Parent.Name or "None"
    
    local logData = string.format(
        "Name: %s\n" ..
        "ClassName: %s\n" ..
        "Parent: %s\n" ..
        "Archivable: %s\n" ..
        "-----------------------\n" ..
        "Path:\n%s",
        instance.Name,
        instance.ClassName,
        parentName,
        tostring(instance.Archivable),
        path
    )
    return logData
end

-- Interactions
ToggleButton.MouseButton1Click:Connect(function()
    isSelecting = not isSelecting
    if isSelecting then
        ToggleButton.Text = "Mode: ON"
        ToggleButton.BackgroundColor3 = Color3.fromRGB(50, 200, 50)
        LogBox.Text = "Left-click on any part in the game to log it."
        
        connection = mouse.Button1Down:Connect(function()
            local target = mouse.Target
            if target then
                selectedInstance = target
                HighlightBox.Adornee = target
                LogBox.Text = generateLog(target)
            end
        end)
    else
        ToggleButton.Text = "Mode: OFF"
        ToggleButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
        HighlightBox.Adornee = nil
        if connection then
            connection:Disconnect()
            connection = nil
        end
    end
end)

CopyButton.MouseButton1Click:Connect(function()
    if selectedInstance and LogBox.Text ~= "" then
        -- setclipboard is a standard function in almost all executors
        if setclipboard then
            setclipboard(LogBox.Text)
            local oldText = CopyButton.Text
            CopyButton.Text = "Copied!"
            task.wait(1.5)
            CopyButton.Text = oldText
        else
            warn("Your executor does not support setclipboard()")
            CopyButton.Text = "Error: No Clipboard Func"
            task.wait(1.5)
            CopyButton.Text = "Copy to Clipboard"
        end
    end
end)

Features & Information

Instance registration script (if you can't find it, simply select the model, part, or instance and copy the path); using Dex is very useful for locating instances.
#op#usefull#universal

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts