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

How to lower torso position?

Asked by 9 years ago

I want to make a crouch/prone script, but do any of you know how to lower the torso?

0
The idea behind crouching is using robloxian legs. scottmike0 40 — 9y

1 answer

Log in to vote
1
Answered by
Scarious 243 Moderation Voter
9 years ago

In order to crouch, you will not change the Torso.Position, but rather the legs position and location. The easiest way to do this will be to create an animation. You also could do this with scripts, but it seems to be a waste of time when using an animation would be faster.

In order to learn how to create an animation, you should go to this roblox wiki page:

http://wiki.roblox.com/index.php?title=Animations

When making your animation, make sure it is a looping animation

After you have your crouch/prone animation finished, you should use this line of code in a LocalScript inside StarterGui:

01local setvalue = 0
02local CrouchanimationID = 0 -- Crouch Animation ID
03local ProneanimationID = 0 -- Prone Animation ID
04 
05game:GetService("UserInputService").InputBegan:connect(function(inputObject, gameProcessedEvent)
06    if inputObject.KeyCode == Enum.KeyCode.C then
07        if setvalue < 2 then
08            setvalue = setvalue + 1
09        else
10            setvalue = 0
11        end
12    end
13end)
14 
15while wait() do
View all 24 lines...

If this code does NOT work, please pm me on ROBLOX.

https://www.roblox.com/messages/compose?recipientId=18982229

This will Not work with a FilteringEnabled game! If you need the script to be FilteringEnabled, pm me!

~ Taryo

Ad

Answer this question