I need help with making your character not air walk

Expert

huh--
I need help with help the with lua to make your custom character not air walk
 
Last edited:
I think they mean when walking off a ledge, instead of cycling through walk cycles, they want their character to enter their falling animation?
 
This isn't too complex in the grand scheme of things. Basically you will want to run a script inside the player thinker, which sets the player object's state to S_PLAY_FALL when three conditions are fulfilled:
  • Player character is correct skin
  • Player is in the air
  • Player is in running or walking states

//Comments provided.
Code:
addHook("PlayerThink", function(player)
	//Exit this script if player is not in game (can produce errors otherwise)
	if not(player.mo) then return end 	
	
	//Exit this script if player is the wrong skin
	if not(player.mo.skin == "sonic") then return end
	
	//Check if player is NOT on ground, and that their state is walking or running. Then set falling state.
	if not(P_IsObjectOnGround(player.mo)) 
	and (player.mo.state == S_PLAY_RUN or player.mo.state == S_PLAY_WALK)
		player.mo.state = S_PLAY_FALL
	end
end)
 
Last edited:
Thanks Cobalt BW Not only is your Music Great your REALLY GOOD at Coding and thanks for the battle mod i might include that in my character
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top