function module.weldTable(parts:{BasePart}, PrimaryPart:BasePart):{WeldConstraint} if…
- User
function module.weldTable(parts:{BasePart}, PrimaryPart:BasePart):{WeldConstraint} if not PrimaryPart then error('PrimaryPart is nil') end local welds = {} for i, part in parts do if part:IsA("BasePart") then local weld = Instance.new("WeldConstraint") weld.Part0 = part weld.Part1 = PrimaryPart or next(parts, i) weld.Parent = part table.insert(welds, weld) end end return welds end function module.weldModel(model:Model) return module.weldTable(model:GetDescendants(), model.PrimaryPart or model:FindFirstChildWhichIsA("BasePart", true)) end function module.SmartWeldToTerrain(part:BasePart|Model) module.AnchorModel(part, true) part:AddTag('ConnectedToTerrain') end --придумать норм название function module.aboba228(model :Instance, primaryPart :BasePart?) primaryPart = primaryPart or model.PrimaryPart or model:FindFirstChildWhichIsA("BasePart", true) local mainWeld = module.WeldToTerrain(primaryPart) for _, secondaryWeld in module.weldModel(model) do secondaryWeld.Parent = mainWeld end return mainWeld end придумай норм название для функции aboba228
- Assistant
For the function
aboba228, which is responsible for welding a model's parts relative to a primary part, a more descriptive name could beweldModelToTerrain. This name better communicates the function's purpose and behavior, which involves creating a main weld to the terrain and subsequently welding the model's parts. This makes the function more understandable and maintainable.