I want to union all of the parts with the same Y axis and have a certain value (Weight) in a model, but i'm not sure how to do it
local Print = workspace.GameValues.MagicDebug
local roundDecimals = function(num, places)
--This Part Works (You don't need to see it and it's just a visual thing)
end
if Print then print(script.Parent.Name.."'s Union Function Begin") end
for i, part in pairs(script.Parent:GetChildren()) do
if part:WaitForChild("Weight") then
part.Name = roundDecimals(part.Position.Y, 2)
end
end
if Print then print(script.Parent.Name.."'s Union Function End") end
(It does name the parts their Y but it's more exact if I were to check their Y property)

4 comments
Would there be a way for me to union the parts with the same Y together? I also get an error on line 8 and 26 of your script saying
attempt to call a nil valueYou need to replace MODEL inside the parenthesis with wherever your model is located in the game. In your case it would probably be script.Parent
You need to replace MODEL inside the parenthesis with wherever your model is located in the game. In your case it would probably be script.Parent
You need to replace MODEL inside the parenthesis with wherever your model is located in the game. In your case it would probably be script.Parent