How to stop a player mid-air

I might just be stupid but i cant figure out what i should use to do this effectively.

What im trying to do is stop the player’s character while they are falling after a button is pressed.

Example: The player falls, they press [insert button], they stop as if they are frozen.

3 Likes

Replace HRP with a value that gets the HumanoidRootPart

function Freeze(HRP)
HRP.Velocity = Vector3.new(0,0,0)
print(HRP.Velocity)
end
-- Then you can call this later:
Freeze()

or you can just do:

function Freeze(HRP)
HRP.Anchored = true
wait(0.01)
HRP.Anchored = false
end
-- Then you can call this later:
Freeze()

Only do the second one if the first doesn’t work!

Other Infomation

Both work on Server Scripts! But only the second one will work on Local Scripts!
Make sure the second one if on a local script does not trigger any kind of anti-cheat.

Edit: Made it easier to use.

1 Like

I have a Question, did Script #1 or Script #2 work for you?

To note on this solution, the Velocity property is now deprecated and shouldn’t be used for new work. Use the AssemblyLinearVelocity property instead. :slight_smile:

2 Likes

i used solution 2, it was just what i was looking 4

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.