|
| 07 Sep 2016 08:51 PM |
| This welding script of 'mine' fails utterly to weld together a model, when before it worked fine. Before as in, before summer. function ################ -- Modified by me, found in a free model -- model = ############################### local function weld(x, y) local Weld = Instance.new("Weld") --Creates a weld-- Weld.Part0 = x Weld.Part1 = y local ################# local ## = ################## local ## # ################## ### local C1 = y.CFrame:inverse() ### ####### # ## Weld.C1 = C1 Weld.Parent = x Weld.Name = "Weld" --The name on the Weld-- end -- End of copied part -- for _, child in ipairs(model:GetChildren()) do print(child.Name) if child:IsA("BasePart") then local a = child local b; if b == nil then b = child end weld(a, b) print("Welded") local b = child end end end Pastebin, ######## |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2016 08:52 PM |
i am having same problem pls help
am i supposed to include hashes in script? |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2016 08:52 PM |
I'm not loving roblox's filter right now. Pastebin /Sanwf3er |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2016 09:10 PM |
| Do not include the number signs in the script. |
|
|
| Report Abuse |
|
|
| |
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 07 Sep 2016 10:38 PM |
function weldModel(model) -- Modified by me, found in a free model -- local descendants = {model} model:BreakJoints() local parts = {} for _, descendant in ipairs(descendants) do for _, child in ipairs(descendant:GetChildren()) do descendants[#descendants+1] = child parts[#parts+1]=child:IsA("BasePart") and child or nil end end print(#parts) local main = parts[1] for i = 2, #parts do local weld = Instance.new("Weld", main) weld.Part1 = parts[i] weld.C1 = weld.Part1.CFrame:inverse()*main.CFrame weld.Part0 = main end end weldModel(workspace["Pine Tree"]) |
|
|
| Report Abuse |
|
|