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

Making A Weld Script; Character Upside Down?

Asked by 7 years ago

So my NPC's right arm wont animate with the tool equipped. I've narrow the issue down to it being that the weld script I had been using was requiring the tool to be anchored; SO I went about making one for myself instead

local parts = {} 
local handle = script.Parent.Handle
local children = script.Parent:GetChildren()
for idx,child in ipairs(children) do
    if(child.ClassName == "Part")then
        table.insert(parts,idx,child)
    end
end
if parts ~= nil then
    for key,value in pairs(parts) do
        if(tostring(value) ~= "Handle") then
            key = Instance.new("ManualWeld",handle)
            key.Part0 = handle
            key.Part1 = value
        end
    end
--[[else 
    print("failure")]]
end

This Takes each of the parts in my Tool and welds them to the handle; And it works; but When I go to equip the tool on an npc or myself; the tool remains stationary and flips my character upside down?

1 answer

Log in to vote
0
Answered by 7 years ago

After you're done welding, you must have a loop set Anchored to false for each part of the tool.

0
Thank you! ReedGhost 2 — 7y
Ad

Answer this question