Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

can you mass weld parts in Roblox Studio?

Asked by
BRAEGON -8
5 years ago

I am currently trying to make a survival game and have run into a seemingly impossible issue. I currently have hundreds of parts creating buildings that I have manually welded together. The problem is when I regenerate the map all the welds break and the game is unplayable. I want to know if there is a way to simply change the surface input of all of the surfaces on all of the bricks to welded. Can you use a for loop to call on all of the bricks and simply change the surface inputs? on the sides?

3 answers

Log in to vote
0
Answered by 5 years ago

Yes, but have you called :MakeJoints() on your regenerated map? That usually fixes such problems.

Roblox added a function GetDescendants to make what you ask for very simple:

for _, obj in pairs(workspace:GetDescendants) do -- or replace 'workspace' with  model/map/whatever
    if obj:IsA("BasePart") then -- can add other conditions too if desired
        -- can do whatever you like to 'obj'
    end
end
0
I tried that, I got a test and coded BRAEGON -8 — 5y
0
for i,v in pairs (#game.Workspace.Test:GetDescendants()) do if v:IsA("BasePart") then -- can add other conditions too if desired -- can do whatever you like to 'obj' v:MakeJoints() end end BRAEGON -8 — 5y
0
You added a "#" in the "pairs", but you only want to do that in a 'for' loop like "for i = 1, #ch do". If all you're going to do is call :MakeJoints(), you don't need to iterate over things - just call :MakeJoints on the model you're regenerating (after you've put it in the workspace, I think) chess123mate 5873 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

click and drag while holding click to bax a box around the parts you want to mass select then let go and it will select all the parts in that box

0
I need to do that with script, i need to regenerate the map and the welds every time i clone it from server storage BRAEGON -8 — 5y
Log in to vote
0
Answered by
BRAEGON -8
5 years ago

ok thanks, I have played with this off and on and perfected it at this point. Thank you for your answers!

Answer this question