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

How to make character's arms together like a straight jacket?


local ting = 0 --debouncer

function onTouched(hit)

	if ting == 0 then --debounce check
	ting = 1 --activate debounce
	local check = hit.Parent:FindFirstChild("Humanoid") --Find the human that touched the button

	if check ~= nil then --If a human is found, then

		local player = game.Players:GetPlayerFromCharacter(hit.Parent) --get player from touching human
			--Fix Arms
			local Torso = hit.Parent:FindFirstChild("Torso")
			local LA = hit.Parent:FindFirstChild("Left Arm")
			local RA = hit.Parent:FindFirstChild("Right Arm")
			local LShoulder = Torso:WaitForChild("Left Shoulder")
			local RShoulder = Torso:WaitForChild("Right Shoulder")
			
			
			
			end

script.Parent.Touched:connect(onTouched)

Where it says --fix arms, I would like it to make a character's arms be into a position as a person in a straight jacket.

6 comments

0

Use an animation

0

How?

0

Can I use something like a CFrame?

0

An animation would be the easiest way to do it.

1 answer

using animations is easier but you could also use CFrame to do this. You need to edit the motor6d joints of the player(joints are different between r6 and r15). the joints are basically welds and you can edit them using weld offsets(C1 and C0). This takes some time to tweak to get it to the position you want.

for example

local rightshoulder -- define this as the motor6d joints in the player
local CFrame = CFrame.new() -- position of arms relative to where they normally are
local Angles = CFrame.Angles.new(math.rad(0),math.rad(0),math.rad(0)) -- rotate arms in degrees
rightshoulder.C1 = rightshoulder.C1 * CFrame * Angles

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