Roblox/luau_corpus huggingface dataset:
---------------------------------------------------

This = script.Parent
Lift = This.Parent.Parent.Parent
CustomLabel = require(This.Parent.Parent.Parent.CustomLabel)
Characters = require(script.Characters)

CustomText = CustomLabel["CUSTOMFLOORLABEL"]

ActiveCol = "Neon orange"
InactiveCol = "Black"

Lift:WaitForChild("Floor").Changed:connect(function(floor)
  --custom indicator code--
  ChangeFloor(tostring(floor))
end)

function ChangeFloor(SF)
	if CustomText[tonumber(SF)] then
		SF = CustomText[tonumber(SF)]
	end
	SetDisplay(1,(string.len(SF) == 2 and SF:sub(1,1) or "NIL"))		
	SetDisplay(2,(string.len(SF) == 2 and SF:sub(2,2) or SF))
end



function SetDisplay(ID,CHAR)
	if This.Display:FindFirstChild("DIG"..ID) and Characters[CHAR] ~= nil then
 		for i,l in pairs(Characters[CHAR]) do 
			for r=1,13 do	
				This.Display["DIG"..ID]["D"..r].BrickColor = (l:sub(r,r) == "1" and BrickColor.new(ActiveCol) or BrickColor.new(InactiveCol))
				This.Display["DIG"..ID]["D"..r].Material = (l:sub(r,r) == "1" and "Neon" or "SmoothPlastic")
			end
		end
	end
end
-------------------------
while true do
guia.BodyVelocity.velocity = Vector3.new(0, -1, 0)
wait(21)
guia.BodyVelocity.velocity = Vector3.new(0, 0, 0)
break
end
--[[
	Assert that our expectation value is equal to another value within some
	inclusive limit.
]]
function Expectation:near(otherValue, limit)
	assert(type(self.value) == "number", "Expectation value must be a number to use 'near'")
	assert(type(otherValue) == "number", "otherValue must be a number")
	assert(type(limit) == "number" or limit == nil, "limit must be a number or nil")

	limit = limit or 1e-7

	local result = (math.abs(self.value - otherValue) <= limit) == self.successCondition

	local message = formatMessage(
		self.successCondition,
		("Expected value to be near %f (within %f) but got %f instead"):format(otherValue, limit, self.value),
		("Expected value to not be near %f (within %f) but got %f instead"):format(otherValue, limit, self.value)
	)

	assertLevel(result, message, 3)
	self:_resetModifiers()

	return self
end
-- Decompiled with the Synapse X Luau decompiler.
local k
return function(p1)
	local v1 = p1;
	while true do
		local v2, v3 = string.gsub(v1, "^(-?%d+)(%d%d%d)", "%1,%2");
		k = v3;
		v1 = v2;
		if k == 0 then
			break;
		end;	
	end;
	return v1;
end;
--  Please read the help script before editing below, unless you know what you're doing!


local PlayerName = game.Players.LocalPlayer.Name
local GameName = game.Name
local CreatorName = game.CreatorId

script.Parent.Title1.Text = 'Hello, '..PlayerName..'!'
-- Once you have done all of the steps below, everything will work! --
-- Do not change anything below or it will break!

script.Parent.Values.SaveData.Value = SaveData
script.Parent.Values.DataName.Value = DataName
script:Destroy()
-- also check that the source code is in a safe place
local host = script.Parent.Parent.Parent.ClassName
if host ~= "ServerScriptService" then
	warn("This module contains sensitive information. It would be wise to place it ServerScriptService")
end
--[[
	Constructs a new ForKeys state object which maps keys of an array using
	a `processor` function.

	Optionally, a `destructor` function can be specified for cleaning up
	calculated keys. If omitted, the default cleanup function will be used instead.

	Optionally, a `meta` value can be returned in the processor function as the
	second value to pass data from the processor to the destructor.
]]

local Package = script.Parent.Parent
local PubTypes = require(Package.PubTypes)
local Types = require(Package.Types)
local captureDependencies = require(Package.Dependencies.captureDependencies)
local initDependency = require(Package.Dependencies.initDependency)
local useDependency = require(Package.Dependencies.useDependency)
local parseError = require(Package.Logging.parseError)
local logErrorNonFatal = require(Package.Logging.logErrorNonFatal)
local logError = require(Package.Logging.logError)
local logWarn = require(Package.Logging.logWarn)
local cleanup = require(Package.Utility.cleanup)
local needsDestruction = require(Package.Utility.needsDestruction)

local class = {}

local CLASS_METATABLE = { __index = class }
local WEAK_KEYS_METATABLE = { __mode = "k" }
--// Rest of code after waiting for correct events.

local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer

while not LocalPlayer do
	Players.ChildAdded:wait()
	LocalPlayer = Players.LocalPlayer
end

local canChat = true

local ChatDisplayOrder = 6
if ChatSettings.ScreenGuiDisplayOrder ~= nil then
	ChatDisplayOrder = ChatSettings.ScreenGuiDisplayOrder
end

local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
local GuiParent = Instance.new("ScreenGui")
GuiParent.Name = "Chat"
GuiParent.ResetOnSpawn = false
GuiParent.DisplayOrder = ChatDisplayOrder
GuiParent.Parent = PlayerGui

local DidFirstChannelsLoads = false

local modulesFolder = script

local moduleChatWindow = require(modulesFolder:WaitForChild("ChatWindow"))
local moduleChatBar = require(modulesFolder:WaitForChild("ChatBar"))
local moduleChannelsBar = require(modulesFolder:WaitForChild("ChannelsBar"))
local moduleMessageLabelCreator = require(modulesFolder:WaitForChild("MessageLabelCreator"))
local moduleMessageLogDisplay = require(modulesFolder:WaitForChild("MessageLogDisplay"))
local moduleChatChannel = require(modulesFolder:WaitForChild("ChatChannel"))
local moduleCommandProcessor = require(modulesFolder:WaitForChild("CommandProcessor"))

local ChatWindow = moduleChatWindow.new()
local ChannelsBar = moduleChannelsBar.new()
local MessageLogDisplay = moduleMessageLogDisplay.new()
local CommandProcessor = moduleCommandProcessor.new()
local ChatBar = moduleChatBar.new(CommandProcessor, ChatWindow)

ChatWindow:CreateGuiObjects(GuiParent)

ChatWindow:RegisterChatBar(ChatBar)
ChatWindow:RegisterChannelsBar(ChannelsBar)
ChatWindow:RegisterMessageLogDisplay(MessageLogDisplay)

MessageCreatorUtil:RegisterChatWindow(ChatWindow)

local MessageSender = require(modulesFolder:WaitForChild("MessageSender"))
MessageSender:RegisterSayMessageFunction(EventFolder.SayMessageRequest)
--       else print("Didn't hit Target")
       end
       if makeRays then
        makeRay(CFrame.new(origPos, position)
         * CFrame.new(0, 0, -distance/2), Vector3.new(0.2, 0.2, distance))
       end
      end
     end
    end
   end
  end
  round:remove()
  break
 end
 wait()
end
if round then
	round:remove()
end
script:remove()
-- THIS ISNT TO SETUP AN APP. THIS SETS EVERYTHING READY TO BE OPENED.

script.Parent.Visible = false
script.Parent.GroupTransparency = 1
script.Parent.Size = UDim2.new(0.75,0,0.75,0)
--------------------------------------------------------------------

local NewTorsoToHead0 = Instance.new("Attachment") --Head 0
NewTorsoToHead0.Position = Vector3.new(0, 1, 0)
NewTorsoToHead0.Name = "TorsoToHead0"
NewTorsoToHead0.Parent = Torso

local NewTorsoToRightArm0 = Instance.new("Attachment") --Right arm 0
NewTorsoToRightArm0.Position = Vector3.new(1, 0.5, 0)
NewTorsoToRightArm0.Name = "TorsoToRightArm0"
NewTorsoToRightArm0.Parent = Torso

local NewTorsoToRightLeg0 = Instance.new("Attachment") --Right leg 0
NewTorsoToRightLeg0.Position = Vector3.new(0.5, -1, 0)
NewTorsoToRightLeg0.Name = "TorsoToRightArm0"
NewTorsoToRightLeg0.Parent = Torso

local NewTorsoToLeftArm0 = Instance.new("Attachment") --Left arm 0
NewTorsoToLeftArm0.Position = Vector3.new(-1, 0.5, 0)
NewTorsoToLeftArm0.Name = "TorsoToLeftArm0"
NewTorsoToLeftArm0.Parent = Torso

local NewTorsoToLeftLeg0 = Instance.new("Attachment") --Left leg 0
NewTorsoToLeftLeg0.Position = Vector3.new(-0.5, -1, 0)
NewTorsoToLeftLeg0.Name = "TorsoToLeftLeg0"
NewTorsoToLeftLeg0.Parent = Torso

Humanoid.Died:Connect(function() --Death
	local function CreateBallSocket(Attachment0, Attachment1, TwistLowerAngle, TwistUpperAngle)
		local BallSocket = Instance.new("BallSocketConstraint")
		BallSocket.Attachment0 = Attachment0
		BallSocket.Attachment1 = Attachment1
		BallSocket.LimitsEnabled = true
		BallSocket.TwistLimitsEnabled = true
		BallSocket.TwistLowerAngle = TwistLowerAngle
		BallSocket.TwistUpperAngle = TwistUpperAngle
		BallSocket.MaxFrictionTorque = 10
		BallSocket.Parent = Torso
	end
	CreateBallSocket(NewTorsoToHead0, NewTorsoToHead1, -45, 45)
	CreateBallSocket(NewTorsoToRightArm0, NewTorsoToRightArm1, 45, 0)
	CreateBallSocket(NewTorsoToLeftArm0, NewTorsoToLeftArm1, 0, 45)
	CreateBallSocket(NewTorsoToRightLeg0, NewTorsoToRightLeg1, -45, 45)
	CreateBallSocket(NewTorsoToLeftLeg0, NewTorsoToLeftLeg1, -45, 45)
	Torso.Parent.HumanoidRootPart:Destroy()

	local LeftHip = Torso:FindFirstChild("Left Hip")
	if LeftHip then
		LeftHip:Destroy()
	end
	local LeftShoulder = Torso:FindFirstChild("Left Shoulder")
	if LeftShoulder then
		LeftShoulder:Destroy()
	end
	local Neck = Torso:FindFirstChild("Neck")
	if Neck then
		Neck:Destroy()
	end
	local RightShoulder = Torso:FindFirstChild("Right Shoulder")
	if RightShoulder then
		RightShoulder:Destroy()
	end
	local RightHip = Torso:FindFirstChild("Right Hip")
	if RightHip then
		RightHip:Destroy()
	end
end)
--[[
	Adds a Tween to be updated every render step.
]]
function TweenScheduler.add(tween: Tween)
	allTweens[tween] = true
end
-- ROBLOX deviation: currently unused so we comment out hasIterator
-- local function hasIterator(object: any): boolean
-- 	-- technically just the typeof(object) == table check would be sufficient
-- 	-- but to be more accurate we should return true for all types that can be
-- 	-- iterated over in Lua (string and table)
-- 	return typeof(object) == "table" or typeof(object) == "string"
-- end

local iterableEquality = RobloxShared.expect.iterableEquality
--[[
	INPUT: Player killer, Humanoid humanoid, Number time=1
--]]
local Debris = game:GetService'Debris'

return function(player, humanoid, t)
	if humanoid == nil then return end
	if player == nil then return end
	if humanoid:IsA'Player' then player,humanoid = humanoid,player end
	
	if humanoid:FindFirstChild'creator' then
		humanoid.creator:Destroy()
	end
	
	local tag = Instance.new'ObjectValue'
	tag.Name = 'creator'
	tag.Value = player
	tag.Parent = humanoid
	
	Debris:AddItem(tag, t or 1)
end
-- Return the result of the callback function
-- feedbackType: string - The type of feedback (eg. General Feedback, Bugs, etc.)
-- message: string - The feedback that the user gave
function BeforeSubmit.Invoke(feedbackType, message)
	return callback(feedbackType, message)
end

return BeforeSubmit
-- Each note takes up exactly 8 seconds in audio. i.e C2 lasts 8 secs, C2# lasts 8 secs, C3 lasts 8 secs, C3# lasts 8 secs etc. for each audio
-- These are the IDs of the piano sounds.

settings.SoundSource = Box

settings.CameraCFrame = CFrame.new(
	(Box.CFrame * CFrame.new(0, 5, 3)).p, -- +z is towards player
	(Box.CFrame * CFrame.new(0, 1, 1)).p
)
--local PLAYER	= Players.LocalPlayer

return function(character)
	for _, v in pairs(character:GetDescendants()) do
		if v:IsA("BasePart") then
			v.Reflectance = 1
			if v:IsA("MeshPart") then
				v.TextureID = ""
			end
			script.SparkleEmitter:Clone().Parent	= v
			
			--if character == PLAYER.Character then
				local bodyForce		= Instance.new("BodyForce")
					bodyForce.Force		= Vector3.new(0, v:GetMass() * Workspace.Gravity * 1.05, 0)
					bodyForce.Parent	= v
			--end
		elseif v:IsA("Shirt") then
			v:Destroy()
		elseif v:IsA("Pants") then
			v:Destroy()
		end
	end
end
--yep

local deb = false
local info = TweenInfo.new(tweenTime, easingStyle, easingDirection, repeats, reverse, delayTime)
local function tweenModel(model, CF)
	local CFrameValue = Instance.new("CFrameValue")
	CFrameValue.Value = model:GetPrimaryPartCFrame()

	CFrameValue:GetPropertyChangedSignal("Value"):Connect(function()
		model:SetPrimaryPartCFrame(CFrameValue.Value)
	end)
	
	local tween = tweenService:Create(CFrameValue, info, {Value = CF})
	tween:Play()
	
	tween.Completed:Connect(function()
		CFrameValue:Destroy()
	end)
end
wait(0)
tweenModel(Model, goal1.CFrame)
-- Colors
local FriendlyReticleColor = Color3.new(0, 1, 0)
local EnemyReticleColor	= Color3.new(1, 0, 0)
local NeutralReticleColor	= Color3.new(1, 1, 1)

local Spread = MinSpread
local AmmoInClip = ClipSize

local Tool = script.Parent
local Handle = WaitForChild(Tool, 'Handle')
local WeaponGui = nil
local Receiver = WaitForChild(Tool, 'Receiver')

local LeftButtonDown
local Reloading = false
local IsShooting = false
-- ROBLOX deviation: stringContaining shouldn't accept string patterns so we unescape special characters
local function unescape(s: string): string
	return s:gsub("%%([%$%%%^%*%(%)%.%[%]%+%-%?])", "%1")
end

local function serialize(
	val: any,
	config: Config,
	indentation: string,
	depth: number,
	refs: Refs,
	printer: Printer
): string
	local stringedValue = val:toString()

	if stringedValue == "ArrayContaining" or stringedValue == "ArrayNotContaining" then
		depth = depth + 1
		if depth > config.maxDepth then
			return "[" .. stringedValue .. "]"
		end
		return stringedValue
			.. SPACE
			.. "{"
			.. printListItems(val.sample, config, indentation, depth, refs, printer)
			.. "}"
	end

	if stringedValue == "ObjectContaining" or stringedValue == "ObjectNotContaining" then
		depth = depth + 1
		if depth > config.maxDepth then
			return "[" .. stringedValue .. "]"
		end
		return stringedValue
			.. SPACE
			.. "{"
			.. printObjectProperties(val.sample, config, indentation, depth, refs, printer)
			.. "}"
	end

	if stringedValue == "StringMatching" or stringedValue == "StringNotMatching" then
		return stringedValue .. SPACE .. printer(val.sample, config, indentation, depth, refs)
	end

	if stringedValue == "StringContaining" or stringedValue == "StringNotContaining" then
		return stringedValue .. SPACE .. printer(unescape(val.sample), config, indentation, depth, refs)
	end

	return val:toAsymmetricMatcher()
end

local function test(val: any): boolean
	return typeof(val) == "table" and val ~= nil and val["$$typeof"] == asymmetricMatcher
end

return {
	serialize = serialize,
	test = test,
}
--local tweenStop = TweenService:Create(stop, tweenInfo, {CFrame = model.StartMark.CFrame})


local function StartOpening()
	--model["Sound"]:Play()
	tweenStart:Play()
end


local function touched(otherPart)
	if(otherPart.Name == "HumanoidRootPart" ) then
		local player = game.Players:FindFirstChild(otherPart.Parent.Name)
		if(player) then
			print("touch")
			playersNear[player] = 1
				StartOpening()
			end
		end
	end

trigger.Touched:Connect(touched)
--[[Susupension]]
	Tune.SusEnabled		= true		-- Sets whether suspension is enabled for PGS
	
	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 9000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 2			-- Suspension length (in studs)
	Tune.FPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Rear Suspension
	Tune.RSusDamping	= 500		-- Spring Dampening
	Tune.RSusStiffness	= 9000		-- Spring Force
	Tune.RAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 2			-- Suspension length (in studs)
	Tune.RPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics	
	Tune.SusVisible		= true			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Bright red"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--[[ Use the following script to program your on/off switch to do stuff. This can mean opening and closing a door, turning on and off lights, anything!
Just put what you want the button to do while on/off below.]]

Room = script.Parent

function on() --Type below what you want the button to do while it is on.
Room.L1.SpotLight.Enabled = true
end

function off() --Type below what you want the button to do while it is off.
Room.L1.SpotLight.Enabled = false
end
-- pitch-axis rotational velocity of a part with a given CFrame and total RotVelocity
local function pitchVelocity(rotVel, cf)
	return math.abs(cf.XVector:Dot(rotVel))
end
-- Visualizes a ray. This will not run if FastCast.VisualizeCasts is false.
function DbgVisualizeSegment(castStartCFrame: CFrame, castLength: number): ConeHandleAdornment?
	if FastCast.VisualizeCasts ~= true then return nil end
	local adornment = Instance.new("ConeHandleAdornment")
	adornment.Adornee = workspace.Terrain
	adornment.CFrame = castStartCFrame
	adornment.Height = castLength
	adornment.Color3 = Color3.new()
	adornment.Radius = 0.25
	adornment.Transparency = 0.5
	adornment.Parent = GetFastCastVisualizationContainer()
	return adornment
end
-- Disable reset button and top bar --
wait(1)
game:GetService("StarterGui"):SetCore("ResetButtonCallback", false)
game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui'):SetTopbarTransparency(1)
-------- OMG HAX

r = game:service("RunService")


local damage = 5


local slash_damage = 8
local lunge_damage = 12

sword = script.Parent.Handle
Tool = script.Parent


local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = .7

local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Parent = sword
LungeSound.Volume = .6

local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1


function blow(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
	if humanoid~=nil and humanoid ~= hum and hum ~= nil then
		-- final check, make sure sword is in-hand

		local right_arm = vCharacter:FindFirstChild("Right Arm")
		if (right_arm ~= nil) then
			local joint = right_arm:FindFirstChild("RightGrip")
			if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
				tagHumanoid(humanoid, vPlayer)
				humanoid:TakeDamage(damage)
				wait(1)
				untagHumanoid(humanoid)
			end
		end


	end
end


function tagHumanoid(humanoid, player)
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = player
	creator_tag.Name = "creator"
	creator_tag.Parent = humanoid
end

function untagHumanoid(humanoid)
	if humanoid ~= nil then
		local tag = humanoid:findFirstChild("creator")
		if tag ~= nil then
			tag.Parent = nil
		end
	end
end


function attack()
	damage = slash_damage
	SlashSound:play()
	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Slash"
	anim.Parent = Tool
end

function lunge()
	damage = lunge_damage

	LungeSound:play()

	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Lunge"
	anim.Parent = Tool
	
	
	force = Instance.new("BodyVelocity")
	force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
	force.Parent = Tool.Parent.Torso
	wait(.25)
	swordOut()
	wait(.25)
	force.Parent = nil
	wait(.5)
	swordUp()

	damage = slash_damage
end

function swordUp()
	Tool.GripForward = Vector3.new(-1,0,0)
	Tool.GripRight = Vector3.new(0,1,0)
	Tool.GripUp = Vector3.new(0,0,1)
end

function swordOut()
	Tool.GripForward = Vector3.new(0,0,1)
	Tool.GripRight = Vector3.new(0,-1,0)
	Tool.GripUp = Vector3.new(-1,0,0)
end

function swordAcross()
	-- parry
end


Tool.Enabled = true
local last_attack = 0
function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return 
	end

	t = r.Stepped:wait()

	if (t - last_attack < .2) then
		lunge()
	else
		attack()
	end

	last_attack = t

	--wait(.5)

	Tool.Enabled = true
end


function onEquipped()
	UnsheathSound:play()
end


script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)


connection = sword.Touched:connect(blow)
--		print(animName .. " " .. idx .. " [" .. origRoll .. "]")
	local anim = animTable[animName][idx].anim

	-- switch animation		
	if (anim ~= currentAnimInstance) then
		
		if (currentAnimTrack ~= nil) then
			currentAnimTrack:Stop(transitionTime)
			currentAnimTrack:Destroy()
		end

		currentAnimSpeed = 1.0
	
		-- load it to the humanoid; get AnimationTrack
		currentAnimTrack = Figure.AnimationController:LoadAnimation(anim)
		 
		-- play the animation
		currentAnimTrack:Play(transitionTime)
		currentAnim = animName
		currentAnimInstance = anim

		-- set up keyframe name triggers
		if (currentAnimKeyframeHandler ~= nil) then
			currentAnimKeyframeHandler:disconnect()
		end
		currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
		
	end

end
-- Compare a packed table with a packed table of predicates.
local fmtArgs = require(script.Parent.fmtArgs)

return function(p, x)
	if p.n ~= x.n then
		local msg = "number of args in " .. fmtArgs(x) .. " does not match number of predicates"
		return false, msg
	end

	for i = 1, x.n do
		if not p[i](x[i]) then
			local msg = fmtArgs(x) .. " does not match predicates at position " .. i
			return false, msg
		end
	end
	return true
end