Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to check if player is in the air?

Hi, I am making a fighting technique for a game, and I was wondering how I could make the fighting technique not run if the player is in the air. So, how would I make a condition like this?

I tried using the code

if character.Humanoid.FreeFalling then return end

but the player wouldn't be able to run the fighting technique at all with this condition

4 comments

0

I guess if the legs are not being touched then your in the air? Idk the most efficent this is just a basic one

0

If the axis is above the ground then the player is in the air

0

I made an edit to my question. Sorry guys.

0

I know this might sound like a lot of work (Not really) but maybe try using rays/ray casting to detect a part at their distance?

2 answers

I think there is an event called freefalling try something like this:

char.Humanoid.FreeFalling:connect(function()
	--code in here
end)

sorry if im wrong lol

1 comment

0

Yes, I have checked the API, and there is in fact a "FreeFalling" event.

This discussion is preserved as it was. New answers, comments, and votes are closed.