How would I get this tool to stay together? I pick up the tool (which has 3 parts, welded together) and then when I unequip and then equip it again it falls apart and only the handle remains? Is it something wrong with the script?
Weld Script -
local base = script.Parent -- Tool handle, the script is inside the tool handle local part = script.Parent.Wrapper -- Part of tool, child of the handle local weld = Instance.new("Weld", game.JointsService) weld.Part0 = base weld.Part1 = part weld.C0 = CFrame.new(0,0,0) -- All the parts are located within 0.3 studs of each other so this would work, right? It works without me unequipping.. weld.C1 = CFrame.new(0,0,0)
local base = script.Parent.TeaLiquid -- Another part of tool, child of the handle local part = script.Parent.Wrapper local weld = Instance.new("Weld", game.JointsService) weld.Part0 = base weld.Part1 = part weld.C0 = CFrame.new(0,0,0) weld.C1 = CFrame.new(0,0,0)
http://imgur.com/fEAIdx4
You need to create the welds whenever you equip the tool. Let me know if this does not work, please specify more clearly if this was not the correct answer, tell us where in the script the welds are made!
--YOU PROBABLY WANT TO USE A LOCAL SCRIPT!!! Tool = script.Parent -- Look at the script, and trace how many parents until you get to the tool object, be sure to change this value accordingly Tool.Equipped:connect(function() --put welding stuff here end) -- THIS WORKS AS WELL function OnEquip() --weld stuff here end Tool.Equipped:connect(OnEquip)
This is how you would do it: Add the welds into the handle, use the Equipped event and MakeJoints.
script.Parent.Equipped:connect(function() script.Parent.Handle:MakeJoints() end)
Hope it helps!