Hello, so I’m trying to script a tool for a customer, (I rarely build, just making this item a tool). And it just doesn’t want to get welded. Every time I weld it, it just flips for some reason. Any help would be appreciated.
function weld(part1, part2)
local w = Instance.new("Weld")
w.Part0,w.Part1 = part1,part2
w.C0 = part2.CFrame:toObjectSpace(part1.CFrame):inverse()
w.Parent = part1
end
Just call it on the command line and send in part1 and part2
I usually always use Weld Constraints for tools, always works (without the needing to script it), for some reason this problem started occurring to be recently, is it something to do with my settings?
Wrote this code, works well now, appreciated: local weld = Instance.new("WeldConstraint", script.Parent) local h = script.Parent.Handle local p = script.Parent.Plate weld.Part0 = h weld.Part1 = p