local function o(o)local W=o:WaitForChild("\072\117\109\097\110\111\105\100")local x=W.RootPart.Position local t=false W.StateChanged:Connect(function(k,h)if h==Enum.HumanoidStateType.Freefall then t=true x=W.RootPart.Position elseif k==Enum.HumanoidStateType.Freefall and h~=Enum.HumanoidStateType.Freefall then if t then t=false handlePlayerFalling(game.Players:GetPlayerFromCharacter(o),W.RootPart.Position,x)end end end)end

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
