Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Grabbing objects by using welds?[Solved]

Asked by
St_vnC 330 Moderation Voter
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 :

01Character.GrabRightArm.Touched:Connect(function(hit)
02    if hit and RG == true then
03    -- Checks for Welds
04        local Weld = Character.GrabRightArm:FindFirstChild("Weld")
05        if Weld and Weld.Part1 ~= hit then
06            Weld:Destroy()
07            local Weld = Instance.new("Weld", Character.GrabRightArm)
08            Weld.Part0 = Weld.Parent
09            Weld.Part1 = hit
10            Weld.C0 = Weld.Part0.CFrame
11            Weld.C1 = Weld.Part1.CFrame
12            hit.Massless = true
13        elseif Weld == nil then
14            local Weld = Instance.new("Weld", Character.GrabRightArm)
15            Weld.Part0 = Weld.Parent
View all 22 lines...

This is the only part required because it's where the weld is being made.

1
i wanna know this too but i suck also so can someone tell me when this is answered speedyfox66 237 — 5y
0
Hey, if you have solved this question, then please post the answer, that way you can help others with this problem too Lord_WitherAlt 206 — 5y

Answer this question