Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I rotate Welds in a loop?

Asked by 7 years ago

So, i'm kinda new to Welds. and I want to make a script that Rotate a fake arm. So when a Player presses a key, it Rotates the Player's Character's Arm up and then goes back down. So can someone explain how rotating and moving welds works? Thanks

1 answer

Log in to vote
1
Answered by
Astilev 30
7 years ago
Edited 7 years ago

The Roblox Character is connected by a bunch of welds, which keep together the limbs to the torso. The weld for the left arm would be found as such

Player = game.Players.LocalPlayer
Char = Player:FindFirstChild('Character')
T = Char:FindFirstChild('Torso')
RS = T['Right Shoulder']
LS = T['Left Shoulder']

for i = 1,20 do
    RS.C0 = RS.C0*CFrame.Angles(0,0,math.rad(9/2))
    LS.C0 = LS.C0*CFrame.Angles(0,0,-math.rad(9/2))
    wait()
end

That block of code would rotate both arms forward 90 degrees. This works in a similar fashion for both legs.

0
That rotates the arm in the worng direction... MRbraveDragon 374 — 7y
0
Just change the values in .Angles Astilev 30 — 7y
Ad

Answer this question