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.
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.