//air walk remover, made by Kirb, reusable
//TY Kirb!

addHook("PlayerThink", function(player) //main hook //https://wiki.srb2.org/wiki/Lua/Hooks

if not(player.mo) then return end //do not execute the script if the player isn't in game, because it could produce errors (i don't think that there's a wiki page that explains this, after all it isn't that complex)

if not(P_IsObjectOnGround(player.mo)) //if the player isn't on ground.. //https://wiki.srb2.org/wiki/Lua/Functions
and player.mo.skin == "kamek"
and (player.mo.state == S_PLAY_WALK or player.mo.state == S_PLAY_RUN) //and he plays the walk or run animation.. //https://wiki.srb2.org/wiki/List_of_states
and not player.powers[pw_carry] //and not on a rollout ball --https://wiki.srb2.org/wiki/A_CustomPower
player.mo.state = S_PLAY_FALL //it plays the fall animation //https://wiki.srb2.org/wiki/List_of_states
end
end)