✓ 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
local plr = game.Players.LocalPlayer
local weldHolder = plr.Characrer.Torso
function prayArms()
local leftArm = weldHolder["Left Shoulder"]
local rightArm = weldHolder["Right Shoulder"]
leftArm.C0 = CFrame.new(2,.5,0)
* CFrame.Angles(math.rad(45),math.rad(90),0)
rightArm.C0 = CFrame.new(-2,.5,0)
* CFrame.Angles(math.rad(-45),math.rad(90),0)
end
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
tool.Selected:connect(function(mouse)
mouse.Button1Down:connect(function()
prayArms()
end)
mouse.Button1Up:connect(function()
normalArms()
end)
end)
1 comment
Thanks! You Explained this Very well.