Pinkstack/roblox-luau-corpus-text huggingface dataset:
--


tool.Equipped:connect(function()
	equipped = true
	owner = game:GetService("Players"):GetPlayerFromCharacter(tool.Parent)
	character = owner.Character
	local rightarm = Instance.new("Weld", character.Torso)
	rightarm.Part0 = character.Torso
	rightarm.Part1 = character["Right Arm"]
	rightarm.C0 = CFrame.new(1.5,0,0)
	rightarm.Name = "RightArmWeldpunch"
	local leftarm = Instance.new("Weld", character.Torso)
	leftarm.Part0 = character.Torso
	leftarm.Part1 = character["Left Arm"]
	leftarm.C0 = CFrame.new(-1.5,0,0)
	leftarm.Name = "LeftArmWeldpunch"
	local head = Instance.new("Weld", character.Torso)
	head.Part0 = character.Torso
	head.Part1 = character.Head
	head.C0 = CFrame.new(0,1.5,0)
	head.Name = "HeadWeldpunch"
	local humanoidrootpart = Instance.new("Weld", character.HumanoidRootPart)
	humanoidrootpart.Part0 = character.HumanoidRootPart
	humanoidrootpart.Part1 = character.Torso
	humanoidrootpart.Name = "HumanoidRootPartWeldpunch"
	for i,v in pairs(script:GetChildren()) do
		if v.ClassName == "Sound" then
			v.Parent = character.HumanoidRootPart
		end
	end
	cananimate = true
	local savedchar = character
	local lasthp = character:findFirstChildOfClass("Humanoid").Health
	coroutine.wrap(function()
		local humhp = character:findFirstChildOfClass("Humanoid").Health
		while runservice.Stepped:wait() and equipped do
			if character:findFirstChildOfClass("Humanoid").Health < humhp then
				local thedamage = humhp - character:findFirstChildOfClass("Humanoid").Health
				character:findFirstChildOfClass("Humanoid").Health = character:findFirstChildOfClass("Humanoid").Health + thedamage/2.5
			end
			if cananimate then
				head.C0 = head.C0:lerp(CFrame.new(0,1.5,0),0.1)
				humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(),0.2)
				leftarm.C0 = leftarm.C0:lerp(CFrame.new(-0.8,0.15,-0.5) * CFrame.fromEulerAnglesXYZ(math.pi-(math.rad(20)),0,math.rad(15)) * CFrame.new(0,-0.5,0),0.2)
				rightarm.C0 = rightarm.C0:lerp(CFrame.new(0.8,0.15,-0.5) * CFrame.fromEulerAnglesXYZ(math.pi-(math.rad(20)),0,math.rad(-15)) * CFrame.new(0,-0.5,0),0.2)
			end
			humhp = character:findFirstChildOfClass("Humanoid").Health
		end
	end)()
end)
tool.Unequipped:connect(function()
	equipped = false
	instancewhitelist = {}
	mouseclick = false
	cananimate = false
	for i,v in pairs(character.HumanoidRootPart:GetChildren()) do
		if v.ClassName == "Sound" then
			v.Parent = script
		end
	end
	if character.Torso:findFirstChild("LeftArmWeldpunch") then
		character.Torso:findFirstChild("LeftArmWeldpunch"):destroy()
	end
	if character.Torso:findFirstChild("RightArmWeldpunch") then
		character.Torso:findFirstChild("RightArmWeldpunch"):destroy()
	end
	if character.Torso:findFirstChild("HeadWeldpunch") then
		character.Torso:findFirstChild("HeadWeldpunch"):destroy()
	end
	if character:findFirstChild("HumanoidRootPart") then
		if character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldpunch") then
			character.HumanoidRootPart:findFirstChild("HumanoidRootPartWeldpunch"):destroy()
		end
	end
end)
-- Displays a hint to the player that the GUI auto-hides.
-- 
-- ForbiddenJ



IsGuiDisplayed = script.Parent.IsDisplayed
IsHiddenByOtherGUI = script.Parent.IsHiddenByOtherGUI
SpawnNotification = game.ReplicatedStorage.ClientStorage.SpawnNotification
SmallHint = script.Parent.SmallHint

HasShownLargeHint = false

function Update()
	SmallHint.Visible = not IsGuiDisplayed.Value
	
	if not HasShownLargeHint and not IsGuiDisplayed.Value and not IsHiddenByOtherGUI.Value then
		HasShownLargeHint = true
		
		local notification =
			SpawnNotification:Invoke("Hover mouse to show panel.", nil, -1)
		SmallHint.ImageTransparency = 0
		notification.TextStrokeColor3 = Color3.new(0.7, 0.7, 0.7)
		
		local tween = game.TweenService:Create(
			SmallHint,
			TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, math.huge),
		{ImageTransparency = 0.85})
		tween.Parent = SmallHint
		tween:Play()
		local tween2 = game.TweenService:Create(
			notification,
			TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, math.huge),
			{TextStrokeColor3 = Color3.new(0, 0, 0)})
		tween2.Parent = notification
		tween2:Play()
		
		local hintCleanedUp = false
		local function cleanupHint()
			if not hintCleanedUp then
				if notification.Parent ~= nil then
					notification.LifetimeLeft.Value = 0
				end
				tween:Cancel()
				tween:Destroy()
				SmallHint.ImageTransparency = 0.85
				
				hintCleanedUp = true
			end
		end
		
		delay(10, cleanupHint)
		IsGuiDisplayed.Changed:Wait()
		cleanupHint()
	end
end

IsGuiDisplayed.Changed:Connect(Update)

Update()
-- ROBLOX TODO: add type constraint <EachCallback extends Global.TestCallback>


local function default<EachCallback>(cb_: GlobalCallback?, supportsDone_: boolean?)
	local supportsDone = if supportsDone_ ~= nil then supportsDone_ else true
	local cb = cb_ or unavailableFn
	return function(
		table_: Global_EachTable,
		...: any --[[ ROBLOX comment: Upstream type: <Global.TemplateData> (Array<unknown>) ]]
	)
		local taggedTemplateData = if select("#", ...) > 0 then { ... } else {}

		local function eachBind(title: string, test: Global_EachTestFn<EachCallback>, timeout: number?): ()
			local ok, result = pcall(function()
				local tests = if isArrayTable(taggedTemplateData)
					then buildArrayTests(title, table_)
					else buildTemplateTests(title, table_, taggedTemplateData)

				return Array.forEach(tests, function(row)
					-- ROBLOX FIXME Luau: supports done is known to be a boolean at this point
					return cb(row.title, applyArguments(supportsDone, row.arguments, test), timeout)
				end) :: any
			end)

			if not ok then
				local error_ = ErrorWithStack.new(result.message, eachBind)
				return cb(title, function()
					error(error_)
				end)
			end

			return result
		end
		return eachBind
	end
end
exports.default = default

function isArrayTable(data: Global_TemplateData)
	return #data == 0
end

function buildArrayTests(title: string, table_: Global_EachTable): EachTests
	validateArrayTable(table_)
	return convertArrayTable(title, table_ :: Global_ArrayTable)
end

function buildTemplateTests(title: string, table_: Global_EachTable, taggedTemplateData: Global_TemplateData): EachTests
	local headings = getHeadingKeys((table_ :: Array<string>)[1] :: string)
	validateTemplateTableArguments(headings, taggedTemplateData)
	return convertTemplateTable(title, headings, taggedTemplateData)
end

function getHeadingKeys(headings: string): Array<string>
	return String.split(extractValidTemplateHeadings(headings):gsub("%s+", ""), "|")
end
--Code--


local function PlayerTouched(Part)
	local Parent = Part.Parent
	if game.Players:GetPlayerFromCharacter(Parent) then
		Parent.Humanoid.Health = 1
		Parent.Humanoid.Walkspeed = 5
		wait(7.5)
		Parent.Humanoid.Walkspeed = 12
		wait(7.5)
		Parent.Humanoid.Walkspeed = 16
	end
end

Brick.Touched:connect(PlayerTouched)
--		print("Wha " .. pose)


		stopAllAnimations()
		amplitude = 0.1
		frequency = 1
		setAngles = true
	end

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

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

	-- Tool Animation handling
	local tool = getTool()
	if tool then
	
		animStringValueObject = getToolAnim(tool)

		if animStringValueObject then
			toolAnim = animStringValueObject.Value
			-- message recieved, delete StringValue
			animStringValueObject.Parent = nil
			toolAnimTime = time + .3
		end

		if time > toolAnimTime then
			toolAnimTime = 0
			toolAnim = "None"
		end

		animateTool()		
	else
		stopToolAnimations()
		toolAnim = "None"
		toolAnimTime = 0
	end
end
--[[Steering]]


Tune.SteerInner		= 49		-- Inner wheel steering angle (in degrees)
Tune.SteerOuter		= 50		-- Outer wheel steering angle (in degrees)
Tune.SteerSpeed		= .02		-- Steering increment per tick (in degrees)
Tune.ReturnSpeed	= .1		-- Steering increment per tick (in degrees)
Tune.SteerDecay		= 150		-- Speed of gradient cutoff (in SPS)
Tune.MinSteer		= 10		-- Minimum steering at max steer decay (in percent)
Tune.MSteerExp		= 1			-- Mouse steering exponential degree
	
	--Steer Gyro Tuning
	Tune.SteerD			= 1000		-- Steering Dampening
	Tune.SteerMaxTorque	= 50000		-- Steering Force
	Tune.SteerP			= 100000	-- Steering Aggressiveness
--== Init/config ==--


local car = script.Parent.Car.Value
local inputService = game:GetService("UserInputService")

local sts = script.Start

script:WaitForChild("Start")

local delayToStartEngine = 2.8 														-- The script will wait this many seconds to turn the car on
local delayToStopStartupSound = 0.1												-- The script will wait this many seconds after starting the car before stopping your ignition sound

local primaryKey 	= Enum.KeyCode.LeftShift												-- Which key on your keyboard will start your car?
local modifierKey	= Enum.KeyCode.K									-- I recommend using Right Shift - no conflicts with default AC6 keybinds, and most people never use it anyways
																							-- You could probably get away with Right Control as well
--[=[
	@tag Component Class
	@return Promise<ComponentInstance>

	Resolves a promise once the component instance is present on a given
	Roblox instance.

	An optional `timeout` can be provided to reject the promise if it
	takes more than `timeout` seconds to resolve. If no timeout is
	supplied, `timeout` defaults to 60 seconds.

	```lua
	local MyComponent = require(somewhere.MyComponent)

	MyComponent:WaitForInstance(workspace.SomeInstance):andThen(function(myComponentInstance)
		-- Do something with the component class
	end)
	```
]=]


function Component:WaitForInstance(instance: Instance, timeout: number?)
	local componentInstance = self:FromInstance(instance)
	if componentInstance then
		return Promise.resolve(componentInstance)
	end
	return Promise.fromEvent(self.Started, function(c)
		local match = c.Instance == instance
		if match then
			componentInstance = c
		end
		return match
	end):andThen(function()
		return componentInstance
	end):timeout(if type(timeout) == "number" then timeout else DEFAULT_TIMEOUT)
end
--[[
	Creates a new promise that receives the result of this promise.

	The given callbacks are invoked depending on that result.
]]


function Promise.prototype:_andThen(traceback, successHandler, failureHandler)
	self._unhandledRejection = false

	-- Create a new promise to follow this part of the chain
	return Promise._new(traceback, function(resolve, reject)
		-- Our default callbacks just pass values onto the next promise.
		-- This lets success and failure cascade correctly!

		local successCallback = resolve
		if successHandler then
			successCallback = createAdvancer(
				traceback,
				successHandler,
				resolve,
				reject
			)
		end

		local failureCallback = reject
		if failureHandler then
			failureCallback = createAdvancer(
				traceback,
				failureHandler,
				resolve,
				reject
			)
		end

		if self._status == Promise.Status.Started then
			-- If we haven't resolved yet, put ourselves into the queue
			table.insert(self._queuedResolve, successCallback)
			table.insert(self._queuedReject, failureCallback)
		elseif self._status == Promise.Status.Resolved then
			-- This promise has already resolved! Trigger success immediately.
			successCallback(unpack(self._values, 1, self._valuesLength))
		elseif self._status == Promise.Status.Rejected then
			-- This promise died a terrible death! Trigger failure immediately.
			failureCallback(unpack(self._values, 1, self._valuesLength))
		elseif self._status == Promise.Status.Cancelled then
			-- We don't want to call the success handler or the failure handler,
			-- we just reject this promise outright.
			reject(Error.new({
				error = "Promise is cancelled",
				kind = Error.Kind.AlreadyCancelled,
				context = "Promise created at\n\n" .. traceback,
			}))
		end
	end, self)
end

function Promise.prototype:andThen(successHandler, failureHandler)
	assert(
		successHandler == nil or type(successHandler) == "function" or successHandler.__call ~= nil,
		string.format(ERROR_NON_FUNCTION, "Promise:andThen")
	)
	assert(
		failureHandler == nil or type(failureHandler) == "function" or failureHandler.__call ~= nil,
		string.format(ERROR_NON_FUNCTION, "Promise:andThen")
	)

	return self:_andThen(debug.traceback(nil, 2), successHandler, failureHandler)
end
--[[Weight and CG]]


	Tune.Weight			= 2500		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		3.5		,
	 --[[Length]]		14		}
	Tune.WeightDist		= 50		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .8		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .1		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- Rear Wheel Density
	Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
	Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]
	
	Tune.AxleSize		= 2			-- Size of structural members (larger = more stable/carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members
--[[
	Pops a node off of the navigation stack.
]]


function TestSession:popNode()
	assert(#self.nodeStack > 0, "Tried to pop from an empty node stack!")
	table.remove(self.nodeStack, #self.nodeStack)
	table.remove(self.contextStack, #self.contextStack)
	table.remove(self.expectationContextStack, #self.expectationContextStack)
end
-- Connection class


local Connection = {}
Connection.__index = Connection

function Connection.new(signal, fn)
	return setmetatable({
		_connected = true,
		_signal = signal,
		_fn = fn,
		_next = false,
	}, Connection)
end

function Connection:Disconnect()
	self._connected = false

	-- Unhook the node, but DON'T clear it. That way any fire calls that are
	-- currently sitting on this node will be able to iterate forwards off of
	-- it, but any subsequent fire calls will not hit it, and it will be GCed
	-- when no more fire calls are sitting on it.
	if self._signal._handlerListHead == self then
		self._signal._handlerListHead = self._next
	else
		local prev = self._signal._handlerListHead
		while prev and prev._next ~= self do
			prev = prev._next
		end
		if prev then
			prev._next = self._next
		end
	end
end
------------------------------------------------------------------------
--
-- * used in multiple locations
------------------------------------------------------------------------


function luaK:dischargevars(fs, e)
  local k = e.k
  if k == "VLOCAL" then
    e.k = "VNONRELOC"
  elseif k == "VUPVAL" then
    e.info = self:codeABC(fs, "OP_GETUPVAL", 0, e.info, 0)
    e.k = "VRELOCABLE"
  elseif k == "VGLOBAL" then
    e.info = self:codeABx(fs, "OP_GETGLOBAL", 0, e.info)
    e.k = "VRELOCABLE"
  elseif k == "VINDEXED" then
    self:freereg(fs, e.aux)
    self:freereg(fs, e.info)
    e.info = self:codeABC(fs, "OP_GETTABLE", 0, e.info, e.aux)
    e.k = "VRELOCABLE"
  elseif k == "VVARARG" or k == "VCALL" then
    self:setoneret(fs, e)
  else
    -- there is one value available (somewhere)
  end
end
--health.Changed:connect(function()
--root.Velocity = Vector3.new(0,5000,0)
--end)



local anims = {}
local lastAttack= tick()

local target,targetType

local lastLock = tick()

local fleshDamage = 25
local structureDamage = 20

local path = nil


for _,animObject in next,animations do
anims[animObject.Name] = hum:LoadAnimation(animObject)
end

function Attack(thing,dmg)
if tick()-lastAttack > 2 then
hum:MoveTo(root.Position)
lastAttack = tick()
anims.AntWalk:Stop()
anims.AntMelee:Play()

if thing.ClassName == "Player" then
root.FleshHit:Play()
ant:SetPrimaryPartCFrame(CFrame.new(root.Position,Vector3.new(target.Character.PrimaryPart.Position.X,root.Position.Y,target.Character.PrimaryPart.Position.Z)))

elseif thing.ClassName == "Model" then
root.StructureHit:Play()
end

rep.Events.NPCAttack:Fire(thing,dmg) 
end
end


function Move(point)
hum:MoveTo(point)
if not anims.AntWalk.IsPlaying then
anims.AntWalk:Play()
end
end

function ScanForPoint()
local newPoint
local rayDir = Vector3.new(math.random(-100,100)/100,0,math.random(-100,100)/100)
local ray = Ray.new(root.Position,rayDir*math.random(10,50),ant)
local part,pos = workspace:FindPartOnRay(ray)
Move(pos)
enRoute = true
end
--[[
	Create a new TestPlan from a list of specification functions.

	These functions should call a combination of `describe` and `it` (and their
	variants), which will be turned into a test plan to be executed.

	Parameters:
		- modulesList - list of tables describing test modules {
			method, -- specification function described above
			path, -- array of parent entires, first element is the leaf that owns `method`
			pathStringForSorting -- a string representation of `path`, used for sorting of the test plan
		}
		- testNamePattern - Only tests matching this Lua pattern string will run. Pass empty or nil to run all tests
		- extraEnvironment - Lua table holding additional functions and variables to be injected into the specification
							function during execution
]]


function TestPlanner.createPlan(modulesList, testNamePattern, extraEnvironment)
	local plan = TestPlan.new(testNamePattern, extraEnvironment)

	table.sort(modulesList, function(a, b)
		return a.pathStringForSorting < b.pathStringForSorting
	end)

	for _, module in ipairs(modulesList) do
		plan:addRoot(module.path, module.method)
	end

	return plan
end

return TestPlanner
-- -- -- -- -- -- --
--DIRECTION SCROLL--
-- -- -- -- -- -- --



This.Parent.Parent.Parent.Parent.Parent:WaitForChild("Direction").Changed:connect(function(val)
    if val == 1 then
			SetDisplay(1,"U0")
    elseif val == -1 then
			SetDisplay(1,"D0")
	else
		SetDisplay(1,"NIL")
    end
end)
--


FakeTorso.Size = Torso.Size
FakeHumanoidRootPart.Size = HumanoidRootPart.Size
FakeTorso.CFrame = FakeHumanoidRootPart.CFrame
RootHipClone = RootHipJoint:Clone()
RootHipClone.Parent = FakeHumanoidRootPart
RootHipClone.Part0 = FakeHumanoidRootPart
RootHipClone.Part1 = FakeTorso
-- << VARIABLES >>


local topBar = main.gui.CustomTopBar
local coreToHide = {"Chat", "PlayerList"}
local originalCoreStates = {};
local cmdBar = main.gui.CmdBar
local currentProps = {}
local originalTopBarTransparency = 0.5
local originalTopBarVisibility = true
local mainProps
mainProps = {
	maxSuggestions = 5;
	mainParent = cmdBar;
	textBox = cmdBar.SearchFrame.TextBox;
	rframe = cmdBar.ResultsFrame;
	suggestionPos = 1;
	suggestionDisplayed = 0;
	forceExecute = false;
	highlightColor = Color3.fromRGB(50,50,50);
	otherColor = Color3.fromRGB(80,80,80);
	suggestionLabels = {};
	currentBarCommand = nil;
}
--Set up equipping and unequipping the tool.


Tool.Equipped:Connect(function()
	if not Equipped then
		Equipped = true
		
		CurrentCharacter = Tool.Parent
		CurrentPlayer = game.Players:GetPlayerFromCharacter(CurrentCharacter)
		EquipSound:Play()
		
		--Create the left hand rocket.
		local LeftGripAttachment = CurrentCharacter:FindFirstChild("LeftGripAttachment",true)
		if LeftGripAttachment then
			CurrentHandRocket = RocketCreator:CreateRocket(false)
			CurrentHandRocket.Name = "HandRocket"
			CurrentHandRocket.Transparency  = 1
			CurrentHandRocket.Parent = Tool
			
			local Weld = Instance.new("Weld")
			Weld.Part0 = LeftGripAttachment.Parent
			Weld.Part1 = CurrentHandRocket
			Weld.C0 = LeftGripAttachment.CFrame
			Weld.C1 = CFrame.Angles(0,math.pi,0)
			Weld.Parent = CurrentHandRocket
		end
		
		RocketBuffer:SetCurrentPlayer(CurrentPlayer)
	end
end)

Tool.Unequipped:Connect(function()
	if Equipped then
		Equipped = false
		
		CurrentCharacter = nil
		CurrentPlayer = nil
		EquipSound:Stop()
		if CurrentHandRocket then CurrentHandRocket:Destroy() end
		RocketBuffer:SetCurrentPlayer()
	end
end)
-- http://www.ryanjuckett.com/programming/damped-springs/



local EPSILON = 0.0001;

local exp = math.exp;
local cos = math.cos;
local sin = math.sin;
local sqrt = math.sqrt;

local spring = {};
local spring_mt = {__index = spring};

function spring.new(p0, v0, target, angularFrequency, dampingRatio)
	local self = {};
	self.p = p0;
	self.v = v0;
	self.target = target;
	self.angularFrequency = angularFrequency or 10;
	self.dampingRatio = dampingRatio or 1;
	return setmetatable(self, spring_mt);
end

function spring:update(dt)
	local aF = self.angularFrequency;
	local dR =  self.dampingRatio;
	
	if (aF < EPSILON) then return; end;
	if (dR < 0) then dR = 0; end;
	
	local epos = self.target;
	local dpos = self.p - epos;
	local dvel = self.v;
	
	if (dR > 1 + EPSILON) then
		local za = -aF * dR;
		local zb = aF * sqrt(dR*dR - 1);
		local z1 = za - zb;
		local z2 = za + zb;
		local expTerm1 = exp(z1 * dt);
		local expTerm2 = exp(z2 * dt);
		
		local c1 = (dvel - dpos*z2)/(-2*zb);
		local c2 = dpos - c1;
		self.p = epos + c1*expTerm1 + c2*expTerm2;
		self.v = c1*z1*expTerm1 + c2*z2*expTerm2;
	elseif (dR > 1 - EPSILON) then
		local expTerm = exp(-aF * dt);
		
		local c1 = dvel + aF*dpos;
		local c2 = dpos;
		local c3 = (c1*dt + c2)*expTerm;
		
		self.p = epos + c3;
		self.v = (c1*expTerm) - (c3*aF);
	else
		local omegaZeta = aF*dR;
		local alpha = aF*sqrt(1 - dR*dR);
		local expTerm = exp(-omegaZeta*dt);
		local cosTerm = cos(alpha*dt);
		local sinTerm = sin(alpha*dt);
		
		local c1 = dpos;
		local c2 = (dvel + omegaZeta*dpos) / alpha;
		self.p = epos + expTerm*(c1*cosTerm + c2*sinTerm);
		self.v = -expTerm*((c1*omegaZeta - c2*alpha)*cosTerm + (c1*alpha + c2*omegaZeta)*sinTerm);
	end
end

return spring;
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
-- STATE CHANGE HANDLERS



function onRunning(speed)
	local heightScale = if userAnimateScaleRun then getHeightScale() else 1
	
	local movedDuringEmote = currentlyPlayingEmote and Humanoid.MoveDirection == Vector3.new(0, 0, 0)
	local speedThreshold = movedDuringEmote and (Humanoid.WalkSpeed / heightScale) or 0.75
	if speed > speedThreshold * heightScale then
		local scale = 16.0
		playAnimation("walk", 0.2, Humanoid)
		setAnimationSpeed(speed / scale)
		pose = "Running"
	else
		if emoteNames[currentAnim] == nil and not currentlyPlayingEmote then
			playAnimation("idle", 0.2, Humanoid)
			pose = "Standing"
		end
	end
end

function onDied()
	pose = "Dead"
end

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

function onClimbing(speed)
	if userAnimateScaleRun then
		speed /= getHeightScale()
	end
	local scale = 5.0
	playAnimation("climb", 0.1, Humanoid)
	setAnimationSpeed(speed / scale)
	pose = "Climbing"
end

function onGettingUp()
	pose = "GettingUp"
end

function onFreeFall()
	if (jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, Humanoid)
	end
	pose = "FreeFall"
end

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	pose = "Seated"
end

function onPlatformStanding()
	pose = "PlatformStanding"
end