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 » Scripting Helpers
Home Search
 

Re: Trying to create a fake tool, can't figure something out.

Previous Thread :: Next Thread 
ExosXguy is not online. ExosXguy
Joined: 10 Oct 2010
Total Posts: 2239
08 Dec 2013 12:21 PM
So, I'm messing with fake tools, in other words making it appear the player has a tool when their backpack is empty. I've done this by welding a handle with a blade to the player's arm as shown below.
Weld1 = Instance.new('Weld',script.Parent['Right Arm'])
Weld1.Part0 = script.Parent['Right Arm']
Weld1.Part1 = script.Parent.Handle
Weld1.C0 = CFrame.new(0,-1,0)
Weld2 = Instance.new('Weld',script.Parent.Handle)
Weld2.Part0 = script.Parent.Handle
Weld2.Part1 = script.Parent.Blade
Weld2.C0 = script.Parent.Handle.CFrame:inverse()
Weld2.C1 = script.Parent.Blade.CFrame:inverse()
script.Parent.Handle.Anchored = false
script.Parent.Blade.Anchored = false

This works perfectly fine, the tool welds the the players arm as desired - I'm now trying to figure out how I can force the player's arm into a 90 degree angle, much like when you are holding a tool. I've got this so far:

Weld3 = Instance.new('Weld',script.Parent.HumanoidRootPart)
Weld3.Part0 = script.Parent.HumanoidRootPart
Weld3.Part1 = script.Parent['Right Arm']

I'm using a weld so it won't interfere with other anims and such, how would I angle this weld so the player's right arm is positioned correctly?
Report Abuse
ExosXguy is not online. ExosXguy
Joined: 10 Oct 2010
Total Posts: 2239
08 Dec 2013 12:22 PM
The tool welds to the player's arm as desired*
Report Abuse
ExosXguy is not online. ExosXguy
Joined: 10 Oct 2010
Total Posts: 2239
08 Dec 2013 12:44 PM
B[1]
Report Abuse
ExosXguy is not online. ExosXguy
Joined: 10 Oct 2010
Total Posts: 2239
08 Dec 2013 01:09 PM
B[2]
Report Abuse
ExosXguy is not online. ExosXguy
Joined: 10 Oct 2010
Total Posts: 2239
08 Dec 2013 01:27 PM
B[3]
Report Abuse
ExosXguy is not online. ExosXguy
Joined: 10 Oct 2010
Total Posts: 2239
08 Dec 2013 01:54 PM
B[4]
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
08 Dec 2013 01:56 PM
Make the Right Shoulder's Part1 = nil and create a weld with the Right Arm and the Torso with the Right Arm being Point1 and edit the C0 and C1 to match.
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
08 Dec 2013 01:57 PM
Dun forget to use CFrame.Angles with the C0 and C1 edited for the 90 degree angle.
Report Abuse
ExosXguy is not online. ExosXguy
Joined: 10 Oct 2010
Total Posts: 2239
08 Dec 2013 02:03 PM
What do you mean by 'making c0 and c1 match' ?
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
08 Dec 2013 02:05 PM
*to match


I mean you edit those (just C0 works, real tools use C0 and C1 for some odd reason) to what fits you fancy.


I'm guessing this is the C0 you want:
CFrame.new(1.5,0.5,0)*CFrame.Angles(0,math.rad(90),0)

Or something close to that.
Report Abuse
ExosXguy is not online. ExosXguy
Joined: 10 Oct 2010
Total Posts: 2239
08 Dec 2013 02:09 PM
Weld3 = Instance.new('Weld',script.Parent.HumanoidRootPart)
Weld3.Part0 = script.Parent.HumanoidRootPart
Weld3.Part1 = script.Parent['Right Arm']
Weld3.C0 = CFrame.new(1.5,0.5,0)*CFrame.Angles(0,math.rad(90),0)


This does weld my arm, but turns the arm into my body so the sword's impaling my waist rather than give me the same arm position as a tool.
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
08 Dec 2013 02:10 PM
I prolly did the rotation in the wrong direction... unless you mean it's the position of the arm.
Report Abuse
ExosXguy is not online. ExosXguy
Joined: 10 Oct 2010
Total Posts: 2239
08 Dec 2013 02:12 PM
My arm's slightly higher up than my torso, and rotated inwards so any tool held is pointing into my torso.
Report Abuse
ExosXguy is not online. ExosXguy
Joined: 10 Oct 2010
Total Posts: 2239
08 Dec 2013 03:34 PM
Well on the bright side, fixed that. Now I've made a basic arm up/down anim - it 'works' but doesn't rotate on the point I'd want it to - is there a way to rotate it by the end ('shoulder') than the centre? Looks a bit odd.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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