Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is this "Unequipped" connect not working??

When I equip the tool a sword welds to your right arm but when its unequipped it doesnt weld to the back of my torso it just disappears.Why?

player = script.Parent.Parent.Parent
c = player.Character
Sword = script.Parent.Sword
bin = script.Parent
function eq()
w1 = Instance.new("Weld", c)
w1.Part0 = w1.Parent["Right Arm"]
w1.Part1 = Sword
w1.C1 = CFrame.fromEulerAnglesXYZ(1.55,0,0) *CFrame.new(0,1.2,2.9)
end

function uew()
w1.Part0 = w1.Parent["Torso"]
w1.Part1 = Sword
w1.C1 = CFrame.fromEulerAnglesXYZ(1.55,0,0) *CFrame.new(0,1.2,2.9)
end

bin.Equipped:connect(eq)

bin.Unequipped:connect(uew)

1 answer

✓ Accepted answer

This is due to the fact that the model of the sword is located inside the tool, when the tool is unequipped the tool is moved to the players backpack. When it is equipped it is inside the player. This is only an idea and may not work however try setting the sword model's parent to the players character, (variable player) when the sword is unequipped.

This discussion is preserved as it was. New answers, comments, and votes are closed.