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

Welding ROBLOX weapons, parts scattered around the map? [closed]

Asked by 9 years ago

Hi SH,

I've made and scripted an AWP for a game I have in mind, but on usage, (mind you, it's fully welded) I see some parts are missing, and they're scattered around the baseplate. I don't know if it's a failure of my Weld Script, or anything.

This is my weld script:

function Weld(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" then
  Weld(script.Parent.Handle, A)
  A.Anchored = false
 else
  local C = A:GetChildren()
  for i=1, #C do
  Get(C[i])
  end
 end
end

function Finale()
 Get(script.Parent)
end

script.Parent.Equipped:connect(Finale)
script.Parent.Unequipped:connect(Finale)
Finale()

I don't know what I'm doing wrong. Help?

0
Make sure the Weapon is not Anchored and doesn;t collide. Mystdar 352 — 9y
0
The script actually welds colliding objects, so that is not the problem. broetchen 0 — 9y
0
With ROBLOX's release of Solid Modeling, especially now that the collision is better, it is usually preferable to make tools and such a single part until of welding multiple parts. Perci1 4988 — 9y

Locked by Perci1, Tkdriverx, Redbullusa, EzraNehemiah_TF2, and adark

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 9 years ago

This has been solved. I installed Ozzypig's welding plugin and it did the job just fine, now I have CFramed weapons.

Ad
Log in to vote
0
Answered by
Tkdriverx 514 Moderation Voter
9 years ago

Use solid modeling now, rather than using hundreds of parts. Your players will appreciate the lag reduction.