local G=script.Parent local r=G:WaitForChild("\072\117\109\097\110\111\105\100")local t="\083\116\097\110\100\105\110\103"local q=(UserSettings()):GetService("\085\115\101\114\071\097\109\101\083\101\116\116\105\110\103\115")local y,f=pcall(function()return(UserSettings()):IsUserFeatureEnabled("\085\115\101\114\078\111\085\112\100\097\116\101\079\110\076\111\111\112")end)local k=y and f local z,N=pcall(function()return(UserSettings()):IsUserFeatureEnabled("\085\115\101\114\065\110\105\109\097\116\101\083\099\097\108\101\082\117\110")end)local s=z and N local U=script:FindFirstChild("\083\099\097\108\101\068\097\109\112\101\110\105\110\103\080\101\114\099\101\110\116")local P=2 local j=0 local L=0 local O={x=.0,y=.0}local d=.0001 local X=.2 local c=Vector3.new(.0,.0,.0)local e=0 local p=6.4 local S=12.8 local H=.1 local V=""local D=nil local l=nil local A=nil local m=1.0 local W={}local a={}local u={idle={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\054\054\054\054\054";weight=1},{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\054\054\057\053\049";weight=1};{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\054\054\051\056\056";weight=9}},walk={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\055\055\056\050\054";weight=10}},run={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\054\055\055\049\052",weight=10}},swim={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\056\052\056\057\055";weight=10}};swimidle={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\056\053\048\055\050",weight=10}},jump={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\054\053\048\048\048";weight=10}},fall={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\054\055\057\054\056",weight=10}};climb={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\054\053\054\052\052",weight=10}};sit={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\050\053\048\054\050\056\049\055\048\051",weight=10}};toolnone={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\054\056\051\055\053",weight=10}},toolslash={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\050\050\054\051\053\053\049\052",weight=10}},toollunge={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\050\050\054\051\056\055\054\055";weight=10}},wave={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\055\048\050\051\057",weight=10}},point={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\055\048\052\053\051",weight=10}},dance={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\055\049\048\049\057";weight=10},{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\055\049\057\053\053",weight=10},{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\055\050\049\048\052",weight=10}};dance2={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\055\054\048\052\051";weight=10},{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\055\054\055\050\048";weight=10};{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\055\054\056\055\057",weight=10}},dance3={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\055\055\050\054\056",weight=10},{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\055\055\052\053\049",weight=10};{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\055\055\054\050\051",weight=10}},laugh={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\055\048\056\049\056";weight=10}},cheer={{id="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\053\048\055\055\055\048\054\055\055";weight=10}}}local Z={}local K={}local C=Z


local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local pose = "Standing"

local UserGameSettings = UserSettings():GetService("UserGameSettings")

local userNoUpdateOnLoopSuccess, userNoUpdateOnLoopValue = pcall(function() return UserSettings():IsUserFeatureEnabled("UserNoUpdateOnLoop") end)
local userNoUpdateOnLoop = userNoUpdateOnLoopSuccess and userNoUpdateOnLoopValue

local userAnimateScaleRunSuccess, userAnimateScaleRunValue = pcall(function() return UserSettings():IsUserFeatureEnabled("UserAnimateScaleRun") end)
local userAnimateScaleRun = userAnimateScaleRunSuccess and userAnimateScaleRunValue

local AnimationSpeedDampeningObject = script:FindFirstChild("ScaleDampeningPercent")
local HumanoidHipHeight = 2

local humanoidSpeed = 0 -- speed most recently sent to us from onRunning()
local cachedRunningSpeed = 0 -- The most recent speed used to compute blends.  Tiny variations from cachedRunningSpeed will not cause animation updates.
local cachedLocalDirection = {x=0.0, y=0.0} -- unit 2D object space direction of motion
local smallButNotZero = 0.0001 -- We want weights to be small but not so small the animation stops
local runBlendtime = 0.2
local lastLookVector = Vector3.new(0.0, 0.0, 0.0) -- used to track whether rootPart orientation is changing.
local lastBlendTime = 0 -- The last time we blended velocities
local WALK_SPEED = 6.4
local RUN_SPEED = 12.8

local EMOTE_TRANSITION_TIME = 0.1

local currentAnim = ""
local currentAnimInstance = nil
local currentAnimTrack = nil
local currentAnimKeyframeHandler = nil
local currentAnimSpeed = 1.0

local PreloadedAnims = {}

local animTable = {}
local animNames = {
	idle = 	{
		{ id = "http://www.roblox.com/asset/?id=507766666", weight = 1 },
		{ id = "http://www.roblox.com/asset/?id=507766951", weight = 1 },
		{ id = "http://www.roblox.com/asset/?id=507766388", weight = 9 }
	},
	walk = 	{
		{ id = "http://www.roblox.com/asset/?id=507777826", weight = 10 }
	},
	run = 	{
		{ id = "http://www.roblox.com/asset/?id=507767714", weight = 10 }
	},

	swim = 	{
		{ id = "http://www.roblox.com/asset/?id=507784897", weight = 10 }
	},
	swimidle = 	{
		{ id = "http://www.roblox.com/asset/?id=507785072", weight = 10 }
	},
	jump = 	{
		{ id = "http://www.roblox.com/asset/?id=507765000", weight = 10 }
	},
	fall = 	{
		{ id = "http://www.roblox.com/asset/?id=507767968", weight = 10 }
	},
	climb = {
		{ id = "http://www.roblox.com/asset/?id=507765644", weight = 10 }
	},
	sit = 	{
		{ id = "http://www.roblox.com/asset/?id=2506281703", weight = 10 }
	},
	toolnone = {
		{ id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
	},
	toolslash = {
		{ id = "http://www.roblox.com/asset/?id=522635514", weight = 10 }
	},
	toollunge = {
		{ id = "http://www.roblox.com/asset/?id=522638767", weight = 10 }
	},
	wave = {
		{ id = "http://www.roblox.com/asset/?id=507770239", weight = 10 }
	},
	point = {
		{ id = "http://www.roblox.com/asset/?id=507770453", weight = 10 }
	},
	dance = {
		{ id = "http://www.roblox.com/asset/?id=507771019", weight = 10 },
		{ id = "http://www.roblox.com/asset/?id=507771955", weight = 10 },
		{ id = "http://www.roblox.com/asset/?id=507772104", weight = 10 }
	},
	dance2 = {
		{ id = "http://www.roblox.com/asset/?id=507776043", weight = 10 },
		{ id = "http://www.roblox.com/asset/?id=507776720", weight = 10 },
		{ id = "http://www.roblox.com/asset/?id=507776879", weight = 10 }
	},
	dance3 = {
		{ id = "http://www.roblox.com/asset/?id=507777268", weight = 10 },
		{ id = "http://www.roblox.com/asset/?id=507777451", weight = 10 },
		{ id = "http://www.roblox.com/asset/?id=507777623", weight = 10 }
	},
	laugh = {
		{ id = "http://www.roblox.com/asset/?id=507770818", weight = 10 }
	},
	cheer = {
		{ id = "http://www.roblox.com/asset/?id=507770677", weight = 10 }
	},
}


local strafingLocomotionMap = {}
local fallbackLocomotionMap = {}
local locomotionMap = strafingLocomotionMap