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

Tool Weld script not working (anymore), any help?

Asked by 8 years ago

Hi there. I seem to be having some trouble with this script for welding parts in a tool...

for _,v in pairs(script.Parent:GetChildren()) do
local weld = Instance.new("Weld", game.Workspace)
weld.Part0 = script.Parent.Handle
weld.Part1 = script.Parent.Grip
weld.C0 = CFrame.new(0,0,-0.5)
end

The funny thing is, this used to work. I added some other parts to the script to weld, and then this error started popping up in output:

07:45:12.385 - Workspace.Tool.Weld:4: bad argument #3 to 'Part1' (Object expected, got CFrame) 07:45:12.386 - Script 'Workspace.Tool.Weld', Line 4

Even after I removed all of the other welds from the script, this error still occurs. I'm not very good at scripting, so the answer is probably staring me right in the face, but I would appreciate any help.

1 answer

Log in to vote
0
Answered by 8 years ago

Actually, I answered my own question. All I had to do was change the part "Grip" to be named something else. Thanks in advance to anyone that was going to help.

Ad

Answer this question