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

How would I make a glue script?

Asked by
Zerio920 285 Moderation Voter
10 years ago

I'm trying to work with glue to make a rope. I edited a weld script so it would create glue rather than a weld, but this causes the bricks to fly off the map and go all over the place.

function weld()
    local parts,last = {}
    local function scan(parent)
        for _,v in pairs(parent:GetChildren()) do
            if (v:IsA("BasePart")) then
                if (last) then
                    local w = Instance.new("Glue")
                    w.Name = ("%s_Weld"):format(v.Name)
                    w.Part0,w.Part1 = last,v
                    w.C0 = last.CFrame:inverse()
                    w.C1 = v.CFrame:inverse()
                    w.Parent = last
                end
                last = v
                table.insert(parts,v)
            end
            scan(v)
        end
    end
    scan(script.Parent)
    wait(1)
    for _,v in pairs(parts) do
        v.Anchored = false
    end
end

weld()
script:Destroy()

So, obviously, glue and welds are way different. What would a glue script look like?

1 answer

Log in to vote
0
Answered by 10 years ago

You have to define the F points. For what I'm talking about, see this Wiki page and read the description. That should help you out.

0
I still don't quite understand it, can you give an example of an F point? Zerio920 285 — 10y
Ad

Answer this question