Tablefy
Tablefy is a simple module that converts an entire object tree into a table.
This module is really simple and I don’t plan on updating it, I don’t even know if people will use it, but I just want to but it out there for y’all. Probably won’t update unless something breaks, I really like one of your ideas, or I want to add something.
Ways to get the Module
Requiring the Module
local Tablefy = require(6802183519)
From an Object
Tablefy.rbxm (975 Bytes)
local Tablefy = require(location_of_Tablefy)
-- for example
local Tablefy = require(workspace.Tablefy)
From the Source
Source
local runService = game:GetService("RunService")
local function treeToTable(obj)
local success,err = pcall(function()
local tree = {["Object"] = obj}
end)
if success then
local tree = {["Object"] = obj}
for i,a in pairs(obj:GetChildren()) do
success,err = pcall(function()
tree[a.Name] = {["Object"] = a}
end)
if success then
if #a:GetChildren() > 0 then
local additionalTree = treeToTable(a)
tree[a.Name] = {["Object"] = a}
for i,b in pairs(additionalTree) do
if typeof(b) ~= "Instance" then
tree[a.Name][b["Object"].Name] = b
end
runService.Heartbeat:Wait()
end
end
end
runService.Heartbeat:Wait()
end
print("Scanned " .. tostring(obj))
return tree
else
return {}
end
end
return treeToTable
Usage
Extremely simple:
local Tablefy = require(6802183519)
Tablefy(workspace)
Which in my game would spit out the following:
lots of stuff
{
["Base"] = {
["Object"] = Base
},
["Baseplate"] = {
["Object"] = Baseplate
},
["Camera"] = {
["Object"] = Camera
},
["Horse Lift"] = {
["Base"] = {
["Object"] = Base,
["Part"] = {
["Object"] = Part
},
["Union"] = {
["Object"] = Union
}
},
["Control"] = {
["Object"] = Control
},
["Lever"] = {
["ClickDetector"] = {
["Object"] = ClickDetector
},
["Object"] = Lever
},
["Lever2"] = {
["ClickDetector"] = {
["Object"] = ClickDetector
},
["Object"] = Lever2
},
["Lift"] = {
["Object"] = Lift,
["Rope1"] = {
["Object"] = Rope1
},
["Rope2"] = {
["Object"] = Rope2
},
["Union"] = {
["Object"] = Union
},
["UpperAnchor1"] = {
["Object"] = UpperAnchor1
},
["UpperAnchor2"] = {
["Object"] = UpperAnchor2
}
},
["Object"] = Horse Lift,
["RemoteEvent"] = {
["Object"] = RemoteEvent
}
},
["KronosEvolved - Initalizer"] = {
["Object"] = KronosEvolved - Initalizer,
["Settings"] = {
["Object"] = Settings
},
["Startup"] = {
["Object"] = Startup
}
},
["Model"] = {
["Object"] = Model,
["Part"] = {
["Object"] = Part
}
},
["Object"] = Workspace,
["SpawnLocation"] = {
["Decal"] = {
["Object"] = Decal
},
["Object"] = SpawnLocation
},
["Speedboat"] = {
["Main"] = {
["Floating"] = {
["Object"] = Floating
},
["Object"] = Main,
["Source"] = {
["Object"] = Source,
["VehicleSeat"] = {
["Object"] = VehicleSeat
},
["Welds"] = {
["Meshes/Speed-boat_Cube"] = {
["Object"] = Meshes/Speed-boat_Cube
},
["Meshes/Speed-boat_Cube.001"] = {
["Object"] = Meshes/Speed-boat_Cube.001
},
["Meshes/Speed-boat_Cube.002"] = {
["Object"] = Meshes/Speed-boat_Cube.002
},
["Object"] = Welds,
["Part"] = {
["Object"] = Part
},
["Source"] = {
["Object"] = Source
},
["SteeringWheel"] = {
["Object"] = SteeringWheel
}
}
}
},
["Model"] = {
["Meshes/Speed-boat_Cube"] = {
["Object"] = Meshes/Speed-boat_Cube
},
["Meshes/Speed-boat_Cube.001"] = {
["Object"] = Meshes/Speed-boat_Cube.001
},
["Meshes/Speed-boat_Cube.002"] = {
["Object"] = Meshes/Speed-boat_Cube.002
},
["Object"] = Model,
["Part"] = {
["Object"] = Part
}
},
["Object"] = Speedboat,
["PassengerSeats"] = {
["Object"] = PassengerSeats
},
["SteeringWheel"] = {
["Object"] = SteeringWheel
}
},
["Terrain"] = {
["Object"] = Terrain
}
}
Updates
Versions
1.1
- Added support for core objects, if it does come across an unreadable object, it skips over it.
Short Poll:
- Interesting and useful
- Interesting but not useful
- Not interesting but useful
- Not interesting and not useful
0 voters