generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Parts welding incorrectly

Previous Thread :: Next Thread 
pinballboy7 is not online. pinballboy7
Joined: 12 Mar 2009
Total Posts: 1485
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
lego555444 is not online. lego555444
Joined: 21 Sep 2008
Total Posts: 1383
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
pinballboy7 is not online. pinballboy7
Joined: 12 Mar 2009
Total Posts: 1485
24 Feb 2015 10:25 PM
Ooooooh...thanks. I may have forgotten about that.
Report Abuse
pinballboy7 is not online. pinballboy7
Joined: 12 Mar 2009
Total Posts: 1485
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
pinballboy7 is not online. pinballboy7
Joined: 12 Mar 2009
Total Posts: 1485
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
lego555444 is not online. lego555444
Joined: 21 Sep 2008
Total Posts: 1383
25 Feb 2015 09:18 AM
here: http://www.roblox.com/Forum/ShowPost.aspx?PostID=63814022
Report Abuse
pinballboy7 is not online. pinballboy7
Joined: 12 Mar 2009
Total Posts: 1485
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
lego555444 is not online. lego555444
Joined: 21 Sep 2008
Total Posts: 1383
27 Feb 2015 01:17 AM
Set the part1 and part0 to what they orignally were
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image