function onRunning(U)if U>.01 then playAnimation("\114\117\110",.1,Humanoid)pose="\082\117\110\110\105\110\103"setAnimationSpeed(1.5)else playAnimation("\105\100\108\101",.1,Humanoid)pose="\083\116\097\110\100\105\110\103"end end function onDied()pose="\068\101\097\100"end function onClimbing(U)playAnimation("\105\100\108\101",.1,Humanoid)pose="\067\108\105\109\098\105\110\103"end function onGettingUp()pose="\071\101\116\116\105\110\103\085\112"end function onFreeFall()playAnimation("\105\100\108\101",.1,Humanoid)pose="\070\114\101\101\070\097\108\108"end function onFallingDown()pose="\070\097\108\108\105\110\103\068\111\119\110"end function onSeated()pose="\083\101\097\116\101\100"end function onPlatformStanding()pose="\080\108\097\116\102\111\114\109\083\116\097\110\100\105\110\103"end function onSwimming(U)if U>0 then pose="\082\117\110\110\105\110\103"else pose="\083\116\097\110\100\105\110\103"end end function getTool()for U,A in ipairs(Figure:GetChildren())do if A.className=="\084\111\111\108"then return A end end return nil end function getToolAnim(U)for U,A in ipairs(U:GetChildren())do if A.Name=="\116\111\111\108\097\110\105\109"and A.className=="\083\116\114\105\110\103\086\097\108\117\101"then return A end end return nil end local U=0 function move(A)local O=0 local p=0 local C=A-U U=A local I=0 local c=false if pose=="\070\114\101\101\070\097\108\108"then playAnimation("\105\100\108\101",.1,Humanoid)elseif pose=="\083\101\097\116\101\100"then playAnimation("\115\105\116",.1,Humanoid)return elseif pose=="\082\117\110\110\105\110\103"then playAnimation("\114\117\110",.1,Humanoid)elseif pose=="\068\101\097\100"or pose=="\071\101\116\116\105\110\103\085\112"or pose=="\070\097\108\108\105\110\103\068\111\119\110"or pose=="\083\101\097\116\101\100"or pose=="\080\108\097\116\102\111\114\109\083\116\097\110\100\105\110\103"then stopAllAnimations()end end



function onRunning(speed)
	if speed>0.01 then
		playAnimation("run", 0.1, Humanoid)
		pose = "Running"
		setAnimationSpeed(1.5)
	else
		playAnimation("idle", 0.1, Humanoid)
		pose = "Standing"
	end
end

function onDied()
	pose = "Dead"
end

function onClimbing(speed)
	playAnimation("idle", 0.1, Humanoid)
	pose = "Climbing"
end

function onGettingUp()
	pose = "GettingUp"
end

function onFreeFall()
	playAnimation("idle", 0.1, Humanoid)
	pose = "FreeFall"
end

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	pose = "Seated"
end

function onPlatformStanding()
	pose = "PlatformStanding"
end

function onSwimming(speed)
	if speed>0 then
		pose = "Running"
	else
		pose = "Standing"
	end
end

function getTool()	
	for _, kid in ipairs(Figure:GetChildren()) do
		if kid.className == "Tool" then return kid end
	end
	return nil
end

function getToolAnim(tool)
	for _, c in ipairs(tool:GetChildren()) do
		if c.Name == "toolanim" and c.className == "StringValue" then
			return c
		end
	end
	return nil
end

local lastTick = 0

function move(time)
	local amplitude = 0
	local frequency = 0
  	local deltaTime = time - lastTick
  	lastTick = time

	local climbFudge = 0
	local setAngles = false

	if (pose == "FreeFall") then
		playAnimation("idle", 0.1, Humanoid)
	elseif (pose == "Seated") then
		playAnimation("sit", 0.1, Humanoid)
		return
	elseif (pose == "Running") then
		playAnimation("run", 0.1, Humanoid)
	elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
		stopAllAnimations()
	end

end
