im trying to make a script where it creates a motor6d when the tool is equipped, but im not sure how to make it attach to the UpperTorso as a Part0.
local tool = script.Parent
local Char = game.Character
tool.Equipped:Connect(function()
local Motor6d = Instance.new("Motor6D",Char.UpperTorso)
Motor6d.Name = "GunMotor6D"
Motor6d.Part0 = Char.UpperTorso
Motor6d.Part1 = tool.Handle
end)
tool.Unequipped:Connect(function()
if Char.UpperTorso:FindFirstChild("GunMotor6D") then
Char.UpperTorso.GunMotor6D:Destroy()
end
end)

2 comments
thank you!
no problem! :)