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

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

Asked by 6 years ago

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

Log in to vote
0
Answered by 6 years ago

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.

0
read the description carefully, welding script inside a local model (a thing that the server cannot see) Konethorix 197 — 6y
0
But you want to clone a room model? Or is it some type of gui? wilsonsilva007 373 — 6y
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 Konethorix 197 — 6y
Ad

Answer this question