local function m(m)local o=m:WaitForChild("\072\117\109\097\110\111\105\100")local c=o.RootPart.Position local h=false o.StateChanged:Connect(function(n,p)if p==Enum.HumanoidStateType.Freefall then h=true c=o.RootPart.Position elseif n==Enum.HumanoidStateType.Freefall and p~=Enum.HumanoidStateType.Freefall then if h then h=false handlePlayerFalling(game.Players:GetPlayerFromCharacter(m),o.RootPart.Position,c)end end end)end
-- Function to handle player character added
local function onCharacterAdded(character)
	local humanoid = character:WaitForChild("Humanoid")
	local previousPosition = humanoid.RootPart.Position
	local isFalling = false

	-- Listen for character state changes
	humanoid.StateChanged:Connect(function(oldState, newState)
		if newState == Enum.HumanoidStateType.Freefall then
			isFalling = true
			previousPosition = humanoid.RootPart.Position
		elseif oldState == Enum.HumanoidStateType.Freefall and newState ~= Enum.HumanoidStateType.Freefall then
			if isFalling then
				isFalling = false
				handlePlayerFalling(
					game.Players:GetPlayerFromCharacter(character),
					humanoid.RootPart.Position,
					previousPosition
				)
			end
		end
	end)
end
