function onRunning(s)if s>.01 then playAnimation("\119\097\108\107",.1,Humanoid)pose="\082\117\110\110\105\110\103"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 onJumping()playAnimation("\106\117\109\112",.1,Humanoid)jumpAnimTime=jumpAnimDuration pose="\074\117\109\112\105\110\103"end local s=0 function move(d)local h=1 local F=1 local o=d-s s=d local A=0 local M=false if jumpAnimTime>0 then jumpAnimTime=jumpAnimTime-o end if M then local s=h*math.sin(d*F)RightShoulder:SetDesiredAngle(s+A)LeftShoulder:SetDesiredAngle(s-A)RightHip:SetDesiredAngle(-s)LeftHip:SetDesiredAngle(-s)end end
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------

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

function onDied()
	pose = "Dead"
end

function onJumping()
	playAnimation("jump", 0.1, Humanoid)
	jumpAnimTime = jumpAnimDuration
	pose = "Jumping"
end

local lastTick = 0

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

	local climbFudge = 0
	local setAngles = false

	if jumpAnimTime > 0 then
		jumpAnimTime = jumpAnimTime - deltaTime
	end

	if setAngles then
		local desiredAngle = amplitude * math.sin(time * frequency)

		RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
		LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
		RightHip:SetDesiredAngle(-desiredAngle)
		LeftHip:SetDesiredAngle(-desiredAngle)
	end
end
