stefi51
|
  |
| Joined: 28 Feb 2010 |
| Total Posts: 1105 |
|
|
| 25 Oct 2012 06:11 PM |
function stick(x, y) ply = script.Parent.Parent.Parent.Character stick(ply.Torso,LolAModel.Seat) weld = Instance.new("Weld") weld.Part0 = x weld.Part1 = y local HitPos = x.Position local CJ = CFrame.new(HitPos) local C0 = x.CFrame:inverse() *CJ local C1 = y.CFrame:inverse() * CJ weld.C0 = C0 weld.C1 = C1 weld.Parent = x end
I need help with this weld function.. It needs to weld 2 parts together |
|
|
| Report Abuse |
|
|
|
| 25 Oct 2012 06:14 PM |
You called the function inside the function.
function stick(x, y) ply = script.Parent.Parent.Parent.Character weld = Instance.new("Weld") weld.Part0 = x weld.Part1 = y local HitPos = x.Position local CJ = CFrame.new(HitPos) local C0 = x.CFrame:inverse() *CJ local C1 = y.CFrame:inverse() * CJ weld.C0 = C0 weld.C1 = C1 weld.Parent = x end
stick(ply.Torso, Workspace.LolAModel.Seat) |
|
|
| Report Abuse |
|
|
stefi51
|
  |
| Joined: 28 Feb 2010 |
| Total Posts: 1105 |
|
|
| 25 Oct 2012 06:15 PM |
Expand..? How do the function variables work? |
|
|
| Report Abuse |
|
|
|
| 25 Oct 2012 06:16 PM |
function math(x, y) print(x + y) end
math(3, 4)
>7 |
|
|
| Report Abuse |
|
|
|
| 25 Oct 2012 06:16 PM |
It basically sets Variables to it.
So since it's
function stick(x,y)
end
You would call it with
stick(workspace.Part1,workspace.Part2)
So INSIDE The Function, it sets Variables up
x = workspace.Part1 y = workspace.Part2 |
|
|
| Report Abuse |
|
|