|
| 24 Feb 2015 10:09 PM |
I'm trying to weld the player's arm to a part called "WeldPoint" or WP, which is in turn attached to the player's head. For some reason the WP, along with the head, is attached to and follows the arm, rather than the other way around. Does anyone know why this happens, and how I can fix it?
local WPtoHead = Instance.new("Weld") WPtoHead.Part0 = WP WPtoHead.Part1 = game.Players.LocalPlayer.Character:FindFirstChild("Head") WPtoHead.C0 = CFrame.new(0, 1, 0) WPtoHead.Parent = WP local weldarm = Instance.new("ManualWeld") weldarm.Name = "LArmWeld" weldarm.Part0 = game.Players.LocalPlayer.Character:FindFirstChild("WeldPoint") weldarm.Part1 = game.Players.LocalPlayer.Character:FindFirstChild("Left Arm") weldarm.Parent = script.Parent |
|
|
| Report Abuse |
|
|
|
| 24 Feb 2015 10:15 PM |
| Did you break the shoulder off before attempting to take the arm? Set shoulder C1 or C0 to nil |
|
|
| Report Abuse |
|
|
|
| 24 Feb 2015 10:25 PM |
| Ooooooh...thanks. I may have forgotten about that. |
|
|
| Report Abuse |
|
|
|
| 24 Feb 2015 11:44 PM |
This is suppose to run when the weapon is equipped:
local WPtoHead = Instance.new("Weld") WPtoHead.Part0 = WP WPtoHead.Part1 = game.Players.LocalPlayer.Character:FindFirstChild("Head") WPtoHead.C0 = CFrame.new(0, 1, 0) WPtoHead.Parent = WP local weldarm = Instance.new("ManualWeld") weldarm.Name = "LArmWeld" weldarm.Part1 = WP weldarm.Part0 = game.Players.LocalPlayer.Character:FindFirstChild("Left Arm") weldarm.Parent = script.Parent weldarm.C0 = CF(1,0.7,-0.2) * CFrame.Angles(RD(-90),RD(60),RD(-10)) local weldarm = Instance.new("ManualWeld") weldarm.Name = "RArmWeld" weldarm.Part1 = WP weldarm.Part0 = game.Players.LocalPlayer.Character:FindFirstChild("Right Arm") weldarm.Parent = script.Parent weldarm.C0 = CF(-1,0.8,-0.2) * CFrame.Angles(RD(-90),RD(0),RD(0))
It works, but I get a "maximum event re-entrancy depth exceeded" error whenever I equip it, and if I remove this part of the script, it functions perfectly. Any idea why this is happening?
|
|
|
| Report Abuse |
|
|
|
| 24 Feb 2015 11:46 PM |
| When I say it works perfectly, I mean it doesn't give me the error, but obviously it's not welded in that case. |
|
|
| Report Abuse |
|
|
|
| 25 Feb 2015 09:18 AM |
| here: http://www.roblox.com/Forum/ShowPost.aspx?PostID=63814022 |
|
|
| Report Abuse |
|
|
|
| 25 Feb 2015 02:03 PM |
Uh...so I got everything, but I have no clue how to reattach the arms when the weapon is unequipped. I tried to run this on unequip, but it gives me an "attempt to index nil value" error.
tool.Parent.Parent.Character:FindFirstChild("Left Shoulder").Part1 = tool.Parent.Parent.Character:FindFirstChild("Torso") tool.Parent.Parent.Character:FindFirstChild("Right Shoulder").Part1 = tool.Parent.Parent.Character:FindFirstChild("Torso") |
|
|
| Report Abuse |
|
|
|
| 27 Feb 2015 01:17 AM |
| Set the part1 and part0 to what they orignally were |
|
|
| Report Abuse |
|
|