Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make welding scripts inside a local part or model?

I want to clone a room which is local (can only be seen by the players) and there are some welding scripts inside them (normal scripts), but since global scripts doesn't work inside anything that is local, how do you weld them together? Here's my illustration game: THE GAME

Most of the things in the room aren't welded properly because of the global scripts inside them.

So how do you fix it?

1 answer

Simple welding script that works for me 100% of the time:

function Stick(x, y)
	local W = Instance.new("Weld")
	W.Part0 = x
	W.Part1 = y
	local CJ = CFrame.new(x.Position)
	local C0 = x.CFrame:inverse()*CJ
	local C1 = y.CFrame:inverse()*CJ
	W.C0 = C0
	W.C1 = C1
	W.Parent = x
end

function Get(A)
	if A.ClassName == ("Part") or A.ClassName == "UnionOperation" then
		Stick(script.Parent.Handle, A)
		A.Anchored = false
	else
		local C = A:GetChildren()
		for i=1, #C do
		Get(C[i])
		end
	end
end


Try it out.

3 comments

0

read the description carefully, welding script inside a local model (a thing that the server cannot see)

0

But you want to clone a room model? Or is it some type of gui?

0

Ive already figured out a way to do this, you gotta weld the room using a local script inside the player. And plus, everything in the room is also run by local scripts

This discussion is preserved as it was. New answers, comments, and votes are closed.