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

Why doesnt this Motor6D tool script work?

so i want it to put your arm up. but its not??

script.Parent.Equipped:connect(function()
	if script.Parent.Parent:FindFirstChild("Humanoid") then
		local tool = script.Parent
		local char = tool.Parent
		char.Torso["Left Shoulder"].MaxVelocity = 1
		char.Torso["Left Shoulder"]:SetDesiredAngle(180)
	end
end)

1 answer

script.Parent.Equipped:connect(function()
    if script.Parent.Parent:FindFirstChild("Humanoid") then
        local tool = script.Parent
        local char = tool.Parent
	local LeftShoulder = char.Torso["Left Shoulder"]
        LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(math.rad(0),math.rad(0),math.rad(180)) -- Here we're using CFrame.Angles on the Motor6D's C0 to rotate the arm on the Z axis.
    end
end)

http://wiki.roblox.com/index.php?title=API:Class/JointInstance/C0 http://wiki.roblox.com/index.php?title=CFrame#Constructors

All the best.

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