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

making a weld script with other parts in model, any help?

Asked by 5 years ago
game.ReplicatedStorage.RemoteEvent.Weld.OnServerEvent:Connect(function()
local Main = script.Parent
local Prim = Main:WaitForChild("Primary")
local other = Main:WaitForChild("Other")
for i,Child in pairs(Main:GetChildren()) do
    if Child:IsA("Part") then
        local Weld = Instance.new("Weld",Prim)
        Weld.Part1 = Child
        Weld.Part0 = Prim
        Weld.C0 = Prim.CFrame:inverse() * Child.CFrame
        end     
    end
end)

so i was tryna fix it but it didnt work anyhelp?

Answer this question