I am currently working on creating a medieval looking stockades-esque device that in theory should force a player to have their arms fitted through stocks above their head but I can't seem to get the orientation right. Is anyone able to help me fix this problem? Line 9 is the problem currently. Whenever I run this, no errors occur but the orientation doesn't change at all.

 function childAdded(child)

if game.Players:FindFirstChild(child.Name) ~= nil then

wait(1)

local character = child

local torso = child:findFirstChild("Torso")

local insertedpart = workspace.Union1

insertedpart.Name = "TorsoWeldingPart"

insertedpart.Orientation=Vector3.new(0, 179.78, -48.63)

insertedpart.CanCollide = false -- you can change this to whatever you want

insertedpart.CFrame = torso.CFrame * CFrame.new(0,-1,0) -- this is where you can set the position between the torso and the inserted part

local weld = Instance.new("Weld")

weld.Name = "TorsoWeld"

weld.Part0 = torso

weld.C0 = torso.CFrame

weld.Part1 = insertedpart

weld.C1 = insertedpart.CFrame

weld.Parent = insertedpart

insertedpart.Anchored = false

-- you can change the color and material of the part too if you wanted

end

end

  

game.Workspace.ChildAdded:connect(childAdded)