This is a mod that deletes the air walk, so when you go off a platform you play the fall animation, like that "outta here" Sonic Mania mod or (as i remember) like Sonic CD
it has explanations and links inside it, so you can change the mod as you like and learn how to use lua
here's the code
it has explanations and links inside it, so you can change the mod as you like and learn how to use lua
here's the code
//air walk remover, made by Kirb, reusable
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(player.mo.skin == "sonic") then return end //do not execute the script if the player isn't sonic, optional
if not(P_IsObjectOnGround(player.mo)) //if the player isn't on ground.. //https://wiki.srb2.org/wiki/Lua/Functions
and (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)
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(player.mo.skin == "sonic") then return end //do not execute the script if the player isn't sonic, optional
if not(P_IsObjectOnGround(player.mo)) //if the player isn't on ground.. //https://wiki.srb2.org/wiki/Lua/Functions
and (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)