21 lines
1.0 KiB
Luau
21 lines
1.0 KiB
Luau
local D = game.ReplicatedStorage.OrnamentMachine.Decor
|
|
local out = {}
|
|
for _, m in D:GetChildren() do
|
|
local n, cls = 0, {}
|
|
for _, d in m:GetDescendants() do
|
|
if d:IsA("BasePart") then n += 1; cls[d.ClassName] = (cls[d.ClassName] or 0) + 1 end
|
|
end
|
|
local s = ""
|
|
for k, v in cls do s ..= k .. "=" .. v .. " " end
|
|
local piv = m:IsA("Model") and m:GetPivot().Position or Vector3.zero
|
|
local _, size = m:IsA("Model") and m:GetBoundingBox() or nil, m:IsA("Model") and select(2, m:GetBoundingBox()) or Vector3.zero
|
|
table.insert(out, string.format("%s [%s] parts=%d %s size=%.1f,%.1f,%.1f pivot=%.1f,%.1f,%.1f primary=%s attrs=%s tags=%s",
|
|
m.Name, m.ClassName, n, s, size.X, size.Y, size.Z, piv.X, piv.Y, piv.Z, tostring(m:IsA("Model") and m.PrimaryPart and m.PrimaryPart.Name),
|
|
game.HttpService:JSONEncode(m:GetAttributes()), table.concat(m:GetTags(), ",")))
|
|
end
|
|
local tr = D:FindFirstChild("ChristmasTrain")
|
|
if tr then
|
|
for _, c in tr:GetChildren() do table.insert(out, " train child: " .. c.Name .. " [" .. c.ClassName .. "]") end
|
|
end
|
|
return table.concat(out, "\n")
|