|
| 21 Jul 2016 06:52 PM |
I am trying to make a game that has swords in it. I already have a sword model built and I need a script that welds a built sword model on to the player's hand. It would help me if you could write comments inside the script that explain how each of the functions work or just explain to me how the script works. |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 21 Jul 2016 06:55 PM |
Putting the welded parts of the sword in a Tool, unanchoring them, then equipping the tool will automatically weld the part named "Handle" to the player's hand, and by virtue of the welds, everything else will follow
|
|
|
| Report Abuse |
|
|
|
| 21 Jul 2016 07:08 PM |
| I am sorry I wasn't specific in my first post. I'd like to know how to weld the sword on to the player's hand without a tool. Also, the weld scripts I am using work but the angle isn't how I like it. If you know how to fix this, please explain to me. thx :D |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 21 Jul 2016 07:12 PM |
Use the UserInputService to detect when a key 1 through 9 is pressed, and give them the corresponding tool by parenting the tool model to their Character, and then saying something like:
Sword = -- define your sword
w = Instance.new("ManualWeld") w.Parent = Sword.Handle w.Part0 = character["Right Arm"] w.Part1 = Sword.Handle w.C0 = CFrame.new(0,0,0)*CFrame.Angles(0,0,0) -- here is where you set your CFrame and Angles
|
|
|
| Report Abuse |
|
|