Welds not working

Im having some trouble here, I made some coaches for a train in my project and I’m using the RO Scale Advanced Weld Script by NWSpacek (Full credits go to him)

Anyway with that aside, I’m using his weld script to weld this complex model I made for this coach, but when I test out the game, the welds don’t work and the model breaks.

And another case is when I made a railroad crossing and I had welded it together using RigEdit (No questions please) but when i unanchored the model and tested it the model breaks apart.

What is happening, why arent the welds working?

Without seeing the plugins or scripts it will be difficult to help. Off the top of my head though a lot of these plugins or scripts require the model parts to be anchored and then the script or plugin will unachor it, so are all your parts anchored?

Heres the script

--MADE BY NWSPACEK

--[[ This weld script is cool!
	It will use the structure of models to weld. It treats each model as a separate moving body
	except if name a part "AHandle" and insert a BoolValue named "WeldToRoot" into it.
--]]

wait(1) --thanks PSG

local AvoidWelding = {--add models you want this script to not weld in here
	["Coupler"]=true
}

function weld(i,b)
	local weld1 = Instance.new("Weld") 
	weld1.Name = b.Name
	weld1.Part0 = i
	weld1.Part1 = b
	weld1.C1 = b.CFrame:inverse()*i.CFrame
	weld1.Parent = i
end

function welding(p,ph)
	p:MakeJoints()
	local handle = p:FindFirstChild("AHandle")
	if handle and ph and handle:FindFirstChild("WeldToRoot") then
		weld(handle,ph)
	end
	if not handle then
		for _,j in pairs (p:GetChildren()) do
			if j:IsA("BasePart") then
				handle = j
				break
			end
		end
	end
	if not handle then
		handle = ph
	end
	for _,j in pairs (p:GetChildren()) do
		if j:IsA("BasePart") then
			weld(handle,j)
		elseif j:IsA("Model") and not AvoidWelding[j.Name] then
			welding(j,handle)
		end
	end
end

function unanchoring(p)
	for _,j in pairs (p:GetChildren()) do
		if j:IsA("BasePart") then
			j.Anchored = false
		elseif j:IsA("Model") then
			unanchoring(j)
		end
	end
end

wait(1)
welding(script.Parent)
wait(0.5)
unanchoring(script.Parent)

Are you using any meshes or unions in your model because it looks like this handles only baseparts and models?

Okay so I found another script called “qPerfectionWeld” and that seems to work especially with the parts unanchored now to my second problem, the crossings

So, the crossings use normal welds in order to stay connected but when testing the game, they seem to break, would you like to see my hierarchy?

OH WAIT A SECOND, I AM SO DUMB

The model stays connected together, it justs falls on the ground without breaking. Nevermind, I think I just solved my own problem

1 Like