local f={[Enum.HumanoidStateType.Running]=true,[Enum.HumanoidStateType.RunningNoPhysics]=true;[Enum.HumanoidStateType.Climbing]=true;[Enum.HumanoidStateType.Ragdoll]=true,[Enum.HumanoidStateType.FallingDown]=true;[Enum.HumanoidStateType.Flying]=true;[Enum.HumanoidStateType.GettingUp]=true;[Enum.HumanoidStateType.Dead]=true,[Enum.HumanoidStateType.None]=true;[Enum.HumanoidStateType.Physics]=true,[Enum.HumanoidStateType.Swimming]=true;[Enum.HumanoidStateType.Seated]=true,[Enum.HumanoidStateType.PlatformStanding]=true}local S repeat wait()until script.Parent.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")S=script.Parent.Parent local m=S:WaitForChild("\072\117\109\097\110\111\105\100")local x=S:WaitForChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")local s=require(script.Parent.Values)while true do local S=getHumanoidState(m)if f[S]and not s.DontUpdateYet then s.LastStandingPos=x.Position end task.wait()end
-- The states where the Last Standing Y Position variable will not be changed.
local States = {
	[Enum.HumanoidStateType.Running] = true,
	[Enum.HumanoidStateType.RunningNoPhysics] = true,
	[Enum.HumanoidStateType.Climbing] = true,
	[Enum.HumanoidStateType.Ragdoll] = true,
	[Enum.HumanoidStateType.FallingDown] = true,
	[Enum.HumanoidStateType.Flying] = true,
	[Enum.HumanoidStateType.GettingUp] = true,
	[Enum.HumanoidStateType.Dead] = true,
	[Enum.HumanoidStateType.None] = true,
	[Enum.HumanoidStateType.Physics] = true,
	[Enum.HumanoidStateType.Swimming] = true,
	[Enum.HumanoidStateType.Seated] = true,
	[Enum.HumanoidStateType.PlatformStanding] = true,
}

local Character

repeat
	wait()
until script.Parent.Parent:FindFirstChild("Humanoid")

Character = script.Parent.Parent

local Humanoid = Character:WaitForChild("Humanoid")
local HRP = Character:WaitForChild("HumanoidRootPart")
local Values = require(script.Parent.Values)

while true do
	local state = getHumanoidState(Humanoid)
	--print(state)
	if States[state] and not Values.DontUpdateYet then
		Values.LastStandingPos = HRP.Position
		--print(Values.LastStandingYPos)
	end
	task.wait()
end
