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

How would you Grab A Players Arm Through A Hopper Bin?

Its for a tool my friend has asked me to make, Which involves Hopper Bins, And If anyone could tell me what kind of Math would be used in the Cframe's as well

like

arm.CFrame = CFrame.new( math.sin(5 * 6) )

Or something Like that, It would be much appreciated!

EDIT

I Forgot to mention it is for a prayer Tool Sorry.

1 answer

✓ Accepted answer

I would be careful, because what you're doing with a 'prayer' tool might be classified as religious discrimination.

What you're ttempting to do, rotate the arms into a 'Praying' position, requires you to edit the welds in both the player's arms. To edit the welds, we need to look at the C0 and C1 properties of the weld. The welds are placed in the Character's Torso, named Right Shoulder, and Left Shoulder.

So, to do this.. it would look something like this;

Made this off the top of my head, so most likely you're going to have to mess around with the CFrame values / Rotations

local tool = script.Parent --Define the hopperbin
local plr = game.Players.LocalPlayer
local weldHolder = plr.Characrer.Torso

--Praying arms
function prayArms()
	local leftArm = weldHolder["Left Shoulder"]
	local rightArm = weldHolder["Right Shoulder"]

	leftArm.C0 = CFrame.new(2,.5,0) --Offset from the Torso
				* CFrame.Angles(math.rad(45),math.rad(90),0) --Rotate it.
	
	rightArm.C0 = CFrame.new(-2,.5,0)
				* CFrame.Angles(math.rad(-45),math.rad(90),0)
end

--Normal Arms
function normalArms()
	local leftArm = weldHolder["Left Shoulder"]
	local rightArm = weldHolder["Right Shoulder"]
	
	leftArm.C0 = CFrame.new(2,.5,0)
	
	rightArm.C0 = CFrame.new(-2,.5,0)
end

--Connect the functions to your tool.
tool.Selected:connect(function(mouse)
	mouse.Button1Down:connect(function()
		prayArms()
	end)
	mouse.Button1Up:connect(function()
		normalArms()
	end)
end)
	

1 comment

0

Thanks! You Explained this Very well.

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