How do i make character not move when midair

  1. What do you want to achieve? Keep it simple and clear!
    trying to make the character that when he is on midair he cant control his character but when he lands he can

tried my besst

human.StateChanged:Connect(function(e)
if e== Enum.HumanoidStateType.FreeFall then
human.PlatformStand = true
end
if e == Enum.HumanoidStateType.Landed then
human.PlatformStand = false
end
end)

Please format your code correctly, with indents.
What was the error? If it was the following, you made a simple spelling mistake. Please use the autocomplete feature and Output window when scripting, it makes your life much easier.

I fixed some of your formatting for you:

human.StateChanged:Connect(function(e)
	if e == Enum.HumanoidStateType.Freefall then
		human.PlatformStand = true
    elseif e == Enum.HumanoidStateType.Landed then
		human.PlatformStand = false
	end
end)

Do you want the character to stop moving even if they’re jumping on a level surface?
If so, do this:

human.StateChanged:Connect(function(e)
    ... 
	elseif e == Enum.HumanoidStateType.Jumping then
	    human.PlatformStand = true
    elseif ...
end)

Otherwise, add a delay and then check the state again.

human.StateChanged:Connect(function(e)
    ... 
	elseif e == Enum.HumanoidStateType.Jumping then
		task.wait(1)
		if human:GetState() == Enum.HumanoidStateType.Jumping then
			human.PlatformStand = true
		end
    elseif ...
end)

This is based of quick testing by printing what e is while jumping on a flat surface, and jumping off a tall wedge.

sorry i lost the old script, so i was lazy to redo it

nevermind, i used controllermanager (the new roblox controller) and set the air control to 0

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.