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