Instance motor6d wont parent/jointed to HRpart

when i equipping my tool, the instance joint motor6d wont work, it says couldnt find players character (im using normal script btw)

local tool = script.Parent
local playerModel = game.Players.LocalPlayer.Character.HumanoidRootPart

local function connection()
	local newJoint = Instance.new("Motor6D")
	print("m6 dibuat")
	newJoint.Parent = rootPart
	newJoint.Part0 = rootPart
	newJoint.Part1 = script.Parent.Model.Guitar
end

tool.Equipped:Connect(connection)

ive tried using primary character but still doesnt work, any input? how to fix this