This is a script inside StarterCharacter, a normal script. I'm trying to print something but for some reason this script isn't working. Any ideas?
1 | local Humanoid = script.Parent:WaitForChild( "Humanoid" ) |
2 |
3 | Humanoid.StateChanged:Connect( function (PreviousState, NewState) |
4 | if NewState = = Enum.HumanoidStateType.FallingDown then |
5 | print ( "falling" ) |
6 | elseif NewState = = Enum.HumanoidStateType.Landed then |
7 | print ( "landed" ) |
8 | end |
9 | end |
01 | local Humanoid = script.Parent:WaitForChild( "Humanoid" ) |
02 | local RunService = game:GetService( "RunService" ) |
03 |
04 | RunService.Heartbeat:Connect( function () |
05 | if NewState = = Enum.HumanoidStateType.FallingDown then |
06 | print ( "falling" ) |
07 | elseif NewState = = Enum.HumanoidStateType.Landed then |
08 | print ( "landed" ) |
09 | end |
10 | end ) |
honestly i think this would work
but if it doesnt maybe you should check if the falling animation is playing instead
I’ve edited it now, try this:
Instead of FallingDown
do Freefall
, which make should Line 4
look like:
1 | if NewState = = Enum.HumanoidStateType.Freefall then |
Hopefully this works out for you :D