function onSwimming(u)if u>1.0 then local u=10.0 playAnimation("\115\119\105\109",.4,Humanoid)pose="\083\119\105\109\109\105\110\103"else playAnimation("\115\119\105\109\105\100\108\101",.4,Humanoid)pose="\083\116\097\110\100\105\110\103"end end function animateTool()if toolAnim=="\078\111\110\101"then playToolAnimation("\116\111\111\108\110\111\110\101",toolTransitionTime,Humanoid,Enum.AnimationPriority.Idle)return end if toolAnim=="\083\108\097\115\104"then playToolAnimation("\116\111\111\108\115\108\097\115\104",0,Humanoid,Enum.AnimationPriority.Action)return end if toolAnim=="\076\117\110\103\101"then playToolAnimation("\116\111\111\108\108\117\110\103\101",0,Humanoid,Enum.AnimationPriority.Action)return end end function getToolAnim(u)for u,r in ipairs(u:GetChildren())do if r.Name=="\116\111\111\108\097\110\105\109"and r.className=="\083\116\114\105\110\103\086\097\108\117\101"then return r end end return nil end local u=0 function stepAnimate(r)local m=r-u u=r local S=0 local H=false if jumpAnimTime>0 then jumpAnimTime=jumpAnimTime-m end if pose=="\070\114\101\101\070\097\108\108"and jumpAnimTime<=0 then playAnimation("\102\097\108\108",fallTransitionTime,Humanoid)elseif pose=="\083\101\097\116\101\100"then playAnimation("\115\105\116",.5,Humanoid)return elseif pose=="\082\117\110\110\105\110\103"then playAnimation("\119\097\108\107",.2,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 onSwimming(speed)
	if speed > 1.00 then
		local scale = 10.0
		playAnimation("swim", 0.4, Humanoid)
		pose = "Swimming"
	else
		playAnimation("swimidle", 0.4, Humanoid)
		pose = "Standing"
	end
end

function animateTool()
	if toolAnim == "None" then
		playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
		return
	end

	if toolAnim == "Slash" then
		playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
		return
	end

	if toolAnim == "Lunge" then
		playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
		return
	end
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 stepAnimate(currentTime)
	local deltaTime = currentTime - lastTick
	lastTick = currentTime

	local climbFudge = 0
	local setAngles = false

	if jumpAnimTime > 0 then
		jumpAnimTime = jumpAnimTime - deltaTime
	end

	if pose == "FreeFall" and jumpAnimTime <= 0 then
		playAnimation("fall", fallTransitionTime, Humanoid)
	elseif pose == "Seated" then
		playAnimation("sit", 0.5, Humanoid)
		return
	elseif pose == "Running" then
		playAnimation("walk", 0.2, Humanoid)
	elseif
		pose == "Dead"
		or pose == "GettingUp"
		or pose == "FallingDown"
		or pose == "Seated"
		or pose == "PlatformStanding"
	then
		stopAllAnimations()
	end

	-- Tool Animation handling
end
