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

Vector3 script not working?

Asked by 8 years ago
--I made A script that stretches my arm.But when i press e nothing happens I need the vector 3 y value to expand by 4 but its not working.
Char = game.Players.LocalPlayer
mouse = Char:GetMouse()

mouse.KeyDown:connect(function(key)
    key = key:lower()
    if key == "e" then
        RS = Char.Character.Torso["Right Shoulder"]
        RS.C0 = RS.C0 *CFrame.Angles(0,0,-32)
        RA = Char.Character["Right Arm"]
        RS = RA.Size
        RS = RS + Vector3.new(0,4,0)
    end
end)

2 answers

Log in to vote
0
Answered by 8 years ago

Instead of Using a Vector3 script

you can do a instance.new script and make your Right / Left Arm invisible

player = game.Players.LocalPlayer
char = player.Character
real = char.

Arm = instance.new("Part")
Arm.Parent =  char
Arm.Size = (0, 0, 0) --Should get the size of your arm and stretch it out
Arm.Rotation = (0, 0, 0)
Arm.Position = char:GetChildren("LeftArm").Position

It might be a fail :( idk

0
thanks renaldo that helped Clakker200 5 — 8y
0
no problem TRILLFLOWS 135 — 8y
Ad
Log in to vote
0
Answered by
StoIid 364 Moderation Voter
8 years ago

Your script is mainly not working because you are trying to change the size of a Motor6D which you cannot do. I have edited your code and got it to work a bit except the arm falls off when you try to change the size. I do not know why (probably because it's breaking the Motor6D which welds the parts together) but here you go.

Your Code Fixed

 Char = game.Players.LocalPlayer
mouse = Char:GetMouse()

mouse.KeyDown:connect(function(key)
    key = key:lower()
    if key == "e" then
    print('0')
        RS = Char.Character.Torso["Right Shoulder"]
        RS.C0 = RS.C0 *CFrame.Angles(0,0,-32)
        RA = Char.Character["Right Arm"]
        RA.Size = RA.Size
        RA = RA.Size + Vector3.new(0,4,0)
    end
end)

Study how characters work and try to fix that little problem if you really want to fix it. Or consider another method.

Hope this helped!

Answer this question