Grabbing objects by using welds?[Solved]
Asked by
5 years ago Edited 5 years ago
So I suck at math lmao or my knowledge of the roblox API is not large enough. I would like to know to grab item with a certain keybind.
Here's what I came up with :
01 | Character.GrabRightArm.Touched:Connect( function (hit) |
02 | if hit and RG = = true then |
04 | local Weld = Character.GrabRightArm:FindFirstChild( "Weld" ) |
05 | if Weld and Weld.Part 1 ~ = hit then |
07 | local Weld = Instance.new( "Weld" , Character.GrabRightArm) |
08 | Weld.Part 0 = Weld.Parent |
10 | Weld.C 0 = Weld.Part 0. CFrame |
11 | Weld.C 1 = Weld.Part 1. CFrame |
13 | elseif Weld = = nil then |
14 | local Weld = Instance.new( "Weld" , Character.GrabRightArm) |
15 | Weld.Part 0 = Weld.Parent |
17 | Weld.C 0 = Weld.Part 0. CFrame |
18 | Weld.C 1 = Weld.Part 1. CFrame |
This is the only part required because it's where the weld is being made.