Roblox/luau_corpus huggingface dataset:
--[[Susupension]]
	Tune.SusEnabled		= true		-- Sets whether suspension is enabled for PGS
	Tune.LegacySusEn	= true		-- Sets whether suspension is enabled for Legacy Physics (Same values may vary in tune)
	
	--Front Suspension
	Tune.FSusStiffness	= 25000		-- Spring Force
	Tune.FSusDamping	= 400		-- Spring Dampening
	Tune.FAntiRoll 		= 400		-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 1.9		-- Resting Suspension length (in studs)
	Tune.FPreCompress	= .1		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .4		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .2		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 75		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 2			-- 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.RSusStiffness	= 20000		-- Spring Force
	Tune.RSusDamping	= 400		-- Spring Dampening
	Tune.RAntiRoll 		= 400		-- Anti-Roll (Gyro Dampening)
	
	Tune.RSusLength		= 2.1		-- Resting Suspension length (in studs)
	Tune.RPreCompress	= .1		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .4		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .2		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
	
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 2			-- 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 (PGS ONLY)
	Tune.SusVisible		= true			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Bronze"		-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 8				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--[[
    Connects the events for UI state.

    Connects the events for item addition/removal in the given store.

    The `selector` is a function that takes the store's state as an argument and
	returns the items table from it.

    Returns a Rodux Signal class. This has the same API as RBXScriptSignal but
    lowercase. For example:

    ```lua
    local store = Rodux.Store.new(reducer)
    local conn = itemEvents.connect(store)

    conn:disconnect()
    ```
]]
function itemEvents.connect(store, selector: (table) -> itemInfo.State)
	return store.changed:connect(function(newState: table, oldState: table)
		local oldItemInfo = selector(oldState)
		local newItemInfo = selector(newState)
		if oldItemInfo == newItemInfo then
			return
		end

		for newId, newInfo in pairs(newItemInfo) do
			if not oldItemInfo[newId] then
				-- IDs are converted to number for consistency with the addItemAsync API
				itemEvents.itemAdded:Fire(tonumber(newId), newInfo)
			end
		end

		for oldId, _ in pairs(oldItemInfo) do
			if not newItemInfo[oldId] then
				itemEvents.itemRemoved:Fire(tonumber(oldId))
			end
		end
	end)
end

return itemEvents
-- при добавлении и удалении потомка 
sf.ChildAdded:Connect(UpdateSize)
sf.ChildRemoved:Connect(UpdateSize)
--// F key, Horn
uis.InputEnded:connect(function(input)
	if input.KeyCode==Enum.KeyCode.ButtonL3 or input.KeyCode==Enum.KeyCode.F then 
		script.Parent.Parent.Horn.TextTransparency = 0.8
		veh.Lightbar.middle.Airhorn:Stop()
		veh.Lightbar.middle.Wail.Volume = 1
		veh.Lightbar.middle.Yelp.Volume = 1
		veh.Lightbar.middle.Priority.Volume = 1
		script.Parent.Parent.MBOV.Visible = true
		script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
	end
end)

uis.InputBegan:connect(function(input)
	if input.Keycode==Enum.KeyCode.LeftBracket then 
		veh.Lightbar.middle.Beep:Play()
		veh.Lightbar.TakedownEvent:FireServer(true)
	end
end)

uis.InputBegan:connect(function(input)
	if input.KeyCode==Enum.KeyCode.J or input.KeyCode==Enum.KeyCode.DPadUp then 
		veh.Lightbar.middle.Beep:Play()
veh.Lightbar.RemoteEvent:FireServer(true)
    end
end)
--[=[
	Takes in an observable of brios and returns an observable of the inner values that will also output
	nil if there is no other value for the brio.

	@param emitOnDeathValue U
	@return (source: Observable<Brio<T> | T>) -> Observable<T | U>
]=]
function RxBrioUtils.emitOnDeath(emitOnDeathValue)
	return Rx.switchMap(RxBrioUtils.mapBrioToEmitOnDeathObservable(emitOnDeathValue));
end
--made by Bertox
--lul
local ts = game:GetService("TweenService")
local fadeDRL = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local fadeDRL2 = TweenInfo.new(4, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local goal = {}
local goal2 = {}
local F = {}
local car = script.Parent.Parent.Parent.Parent

 script.Parent.Parent.Parent.Parent.Electrics.Changed:connect(function()
	if script.Parent.Parent.Parent.Parent.Electrics.Value == true then
		drlFade(true)
	else
		drlFade(false)
	end
end)

function drlFade(bool)
		if bool then
			goal2.Transparency = 0.2
			local a = ts:Create(car.Body.DRLs.DRL, fadeDRL, goal2)
			a:Play()
		else
			goal2.Transparency = 1
			local a = ts:Create(car.Body.DRLs.DRL, fadeDRL, goal2)
			a:Play()	
		end
	end

F.drlFade = function(bool)
	drlFade(bool)
end
-------------------------------------------------------------------------

local function FlashRed(object)
	local origColor = object.BrickColor
	local redColor = BrickColor.new("Really red")
	local start = tick()
	local duration = 4
	spawn(function()
		while object and tick() - start < duration do
			object.BrickColor = origColor
			wait(0.13)
			if object then
				object.BrickColor = redColor
			end
			wait(0.13)
		end
	end)
end
--Balance Brick
local bal = Instance.new("Part",bike.Body)
bal.Anchored = true
bal.CanCollide = false
if _Tune.BalVisible or _Tune.Debug then bal.Transparency = .75 else bal.Transparency = 1 end
bal.Name = "bal"
bal.Position = (fWheel.CFrame.p+rWheel.CFrame.p)/2
bal.Orientation = fWheel.Orientation
bal.CFrame = bal.CFrame - (Vector3.new((rWheel.Size.Y-(rWheel.Size.Y-fWheel.Size.Y))/2,(rWheel.Size.Y-(rWheel.Size.Y-fWheel.Size.Y))/2,(rWheel.Size.Y-(rWheel.Size.Y-fWheel.Size.Y))/2)*bal.CFrame.upVector)
bal.Size = Vector3.new(.05,.05,.05)
--back motor

script.Parent.Wheels.boggieF.motb.HingeConstraint.AngularVelocity = speed
script.Parent.Wheels.boggieF.motb.HingeConstraint2.AngularVelocity = -speed
script.Parent.Wheels.boggieF.motb.HingeConstraint.MotorMaxTorque = RPM
script.Parent.Wheels.boggieF.motb.HingeConstraint2.MotorMaxTorque = RPM
--StarterPlayerScripts

local plr = game:GetService("Players").LocalPlayer
game:GetService("RunService").Heartbeat:Connect(function()
	plr.Character:WaitForChild("Humanoid").CameraOffset = Vector3.new(plr.Character:WaitForChild("Humanoid").CameraOffset.X,plr.Character:WaitForChild("Humanoid").CameraOffset.Y,  -1)--Edit Only The Last Number Value
end)
------------------------------------------

local mps = game:GetService("MarketplaceService")
local music = game.Workspace:WaitForChild("Sound")
local requester = workspace.Requester
--local bodyPosition = Instance.new("BodyPosition", car.Chassis)
--bodyPosition.MaxForce = Vector3.new()
--local bodyGyro = Instance.new("BodyGyro", car.Chassis)
--bodyGyro.MaxTorque = Vector3.new()

local function UpdateThruster(thruster)
	-- Raycasting
	local hit, position = Raycast.new(thruster.Position, thruster.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value) --game.Workspace:FindPartOnRay(ray, car)
	local thrusterHeight = (position - thruster.Position).magnitude
	
	-- Wheel
	local wheelWeld = thruster:FindFirstChild("WheelWeld")
	wheelWeld.C0 = CFrame.new(0, -math.min(thrusterHeight, stats.Height.Value * 0.8) + (wheelWeld.Part1.Size.Y / 2), 0)
	-- Wheel turning
	local offset = car.Chassis.CFrame:inverse() * thruster.CFrame
	local speed = car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity)
	if offset.Z < 0 then
		local direction = 1
		if speed.Z > 0 then
			direction = -1
		end
		wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(0, (car.Chassis.RotVelocity.Y / 2) * direction, 0)
	end
	
	-- Particles
	if hit and thruster.Velocity.magnitude >= 5 then
		wheelWeld.Part1.ParticleEmitter.Enabled = true
	else
		wheelWeld.Part1.ParticleEmitter.Enabled = false
	end
end

car.Event.OnServerEvent:Connect(function(Player)
	if Player and Player.Character then
		if (Player.Character.HumanoidRootPart.Position-car.DriveSeat.Position).magnitude <= car.Configurations.Range.Value then
			if not HasDriver then
				car.DriveSeat:Sit(Player.Character.Humanoid)
			end
		end
	end
end)

car.DriveSeat.Changed:connect(function(property)
	if property == "Occupant" then
		if car.DriveSeat.Occupant then
			car.EngineBlock.Running.Pitch = 1
			car.EngineBlock.Running:Play()
			local player = game.Players:GetPlayerFromCharacter(car.DriveSeat.Occupant.Parent)
			if player then
				HasDriver = true
				car.DriveSeat:SetNetworkOwner(player)
				local localCarScript = script.LocalCarScript:Clone()
				localCarScript.Parent = player.PlayerGui
				localCarScript.Car.Value = car
				localCarScript.Disabled = false
			end
		else
			HasDriver = false
			car.EngineBlock.Running:Stop()
		end
	end
end)
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.PieBomb -- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage

hitPart.Touched:Connect(function(hit)
	if debounce == true then
		if hit.Parent:FindFirstChild("Humanoid") then
			local plr = game.Players:FindFirstChild(hit.Parent.Name)
			if plr then
				debounce = false
				hitPart.BrickColor = BrickColor.new("Bright red")
				tool:Clone().Parent = plr.Backpack
				wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again
				debounce = true
				hitPart.BrickColor = BrickColor.new("Bright green")
			end
		end
	end
end)
--// B_arocena
local _C = {}

function _C.RemoveHat(hts)
	for i=1, #hts do 
	if (hts[i].className == "Accessory") or (hts[i].className == "Hat") then 
	hts[i]:remove() 
end
end
end



function _C.ShirtPant (Outfit,Player,CClass)
	if CClass.Current.Value < CClass.Max.Value then
	if Player.Class.Current_Class.Value == "None" then
	if Outfit.Shirt.Value ~= 0 then
		Player.Character:WaitForChild("Shirt"):destroy()
		game:GetService("InsertService"):LoadAsset(Outfit.Shirt.Value).Shirt.Parent = Player.Character	
	end
	if Outfit.Pant.Value ~= 0 then
		Player.Character:WaitForChild("Pants"):destroy()
		game:GetService("InsertService"):LoadAsset(Outfit.Pant.Value).Pants.Parent = Player.Character
	end
	end
	end
end



function _C.GiveHat (s,CSYS,Player,Outfit,CClass)
if CClass.Current.Value < CClass.Max.Value then
	if Player.Class.Current_Class.Value == "None" then
if s.Value ~= "" then	
local g = CSYS.HATS[s.Value]:clone()
		g.Parent = Player.Character
		local C = g:GetChildren()
		for i=1, #C do
			if C[i]:IsA("BasePart")  then
				local W = Instance.new("Weld")
				W.Part0 = g.Middle
				W.Part1 = C[i]
				local CJ = CFrame.new(g.Middle.Position)
				local C0 = g.Middle.CFrame:inverse()*CJ
				local C1 = C[i].CFrame:inverse()*CJ
				W.C0 = C0
				W.C1 = C1
				W.Parent = g.Middle
				g.Middle.Transparency = 1
			end
				local Y = Instance.new("Weld")
				local Result = (s.Value):match("BACKPACK")
				if Result == nil then
				Y.Part0 = Player.Character.Head
				else
				Y.Part0 = Player.Character.Torso
				end
				Y.Part1 = g.Middle
				Y.C0 = CFrame.new(0, 0, 0)
				Y.Parent = Y.Part0
		end

		local h = g:GetChildren()
		for i = 1, # h do
			h[i].Anchored = false
			h[i].CanCollide = false
		end
end
end
end
end

function _C.giveclass (CClass,Player,CLNAME,Tools,Gui)
	if CClass.Current.Value < CClass.Max.Value then
	if Player.Class.Current_Class.Value == "None" then
	Player.Class.Current_Class.Value = CLNAME
	CClass.Current.Value = CClass.Current.Value + 1
	for i = 1, #Tools do
    Tools[i]:Clone().Parent = Player.Backpack
end
Gui:Destroy()
end
end
end

return _C
--[[Status Vars]]

	local _IsOn = _Tune.AutoStart
	if _Tune.AutoStart then script.Parent.IsOn.Value=true end
	
	local _GSteerT=0
	local _GSteerC=0
	local _GThrot=0
	local _GThrotShift=1
	local _GBrake=0
	
	local _ClutchOn = true
	local _ClPressing = false
	local _RPM = 0
	local _HP = 0
	local _OutTorque = 0
	local _CGear = 0
	local _PGear = _CGear
	local _spLimit = 0
	
	local _TMode = _Tune.TransModes[1]
	
	local _MSteer = false
	local _SteerL = false
	local _SteerR = false
	local _PBrake = false
	local _TCS = _Tune.TCSEnabled
	local _TCSActive = false
	local _TCSAmt = 0
	local _ABS = _Tune.ABSEnabled
	local _ABSActive = false
	
	local FlipWait=tick()
	local FlipDB=false
	
	local _InControls = false
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
PainKillerQnt.Text 	= PainKiller.Value
BandageQnt.Text 	= Bandage.Value
EnergyShotQnt.Text 	= EnergyShot.Value
EpinephrineQnt.Text = Epinephrine.Value
MorphineQnt.Text 	= Morphine.Value
SplintQnt.Text 		= Splint.Value
TourniquetQnt.Text 	= Tourniquet.Value

PainKiller.Changed:Connect(function()
	PainKillerQnt.Text = PainKiller.Value
end)

Bandage.Changed:Connect(function()
	BandageQnt.Text = Bandage.Value
end)

Splint.Changed:Connect(function()
	SplintQnt.Text = Splint.Value
end)

Tourniquet.Changed:Connect(function()
	TourniquetQnt.Text = Tourniquet.Value
end)

EnergyShot.Changed:Connect(function()
	EnergyShotQnt.Text = EnergyShot.Value
end)

Epinephrine.Changed:Connect(function()
	EpinephrineQnt.Text = Epinephrine.Value
end)

Morphine.Changed:Connect(function()
	MorphineQnt.Text = Morphine.Value
end)

SacoDeSangue.Changed:Connect(function()
	SacoDeSangueQnt.Text = SacoDeSangue.Value
end)

Target.Changed:Connect(function(Valor)
	if Valor == nil then
		PTexto.Text =  player.Name
	else
		PTexto.Text =  Valor.Name
	end
end)
------------------------------------------------------------------------
--
-- * used in (lparser) luaY:closelistfield(), luaY:lastlistfield()
------------------------------------------------------------------------
function luaK:setlist(fs, base, nelems, tostore)
  local c = math.floor((nelems - 1)/luaP.LFIELDS_PER_FLUSH) + 1
  local b = (tostore == luaY.LUA_MULTRET) and 0 or tostore
  assert(tostore ~= 0)
  if c <= luaP.MAXARG_C then
    self:codeABC(fs, "OP_SETLIST", base, b, c)
  else
    self:codeABC(fs, "OP_SETLIST", base, b, 0)
    self:code(fs, luaP:CREATE_Inst(c), fs.ls.lastline)
  end
  fs.freereg = base + 1  -- free registers with list values
end

return function(a) luaY = a return luaK end
-- connect events
Enemy.Died:connect(onDied)
Enemy.Running:connect(onRunning)
Enemy.Jumping:connect(onJumping)
Enemy.Climbing:connect(onClimbing)
Enemy.GettingUp:connect(onGettingUp)
Enemy.FreeFalling:connect(onFreeFall)
Enemy.FallingDown:connect(onFallingDown)
Enemy.Seated:connect(onSeated)
Enemy.PlatformStanding:connect(onPlatformStanding)
Enemy.Swimming:connect(onSwimming)
--[[for x = 1, 50 do
s.Pitch = s.Pitch + 0.01
s:play()
wait(0.001)
end]]
for x = 50, 120 do
s:play()
wait(0.001)
end
for x = 50, 120 do
s.Pitch = s.Pitch - 0.0020
s:play()
wait(0.001)
end
wait()
end
--[[
	All configurations are located in the "Settings" Module script.
	Please don't edit this script unless you know what you're doing.
--]]

local Tycoons = {}

local RebirthSettings = require(script.Parent.SaveTrigger.Settings)
local Teams = game:GetService('Teams')
local Settings = require(script.Parent.Settings)
local BC = BrickColor

local playerMoney = game:GetService("ServerStorage"):FindFirstChild("PlayerMoney")
local PlayerStatManager = require(script.Parent:WaitForChild("PlayerStatManager"))

print("Running Core_Handler_New-----------")
if playerMoney == nil then
	print("playerMoney == nil ------------")
	local Storage = Instance.new('Folder', game.ServerStorage)
	Storage.Name = "PlayerMoney"
end

Instance.new('Model',workspace).Name = "PartStorage" --  parts dropped go in here to be killed >:)


function returnColorTaken(color)
	for i,v in pairs(Teams:GetChildren()) do
		if v:IsA('Team') then
			if v.TeamColor == color then
				return true
			end
		end
	end
	return false
end
-- main:
physicsService:CreateCollisionGroup("Characters")
physicsService:CollisionGroupSetCollidable("Characters", "Characters", false)

players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(handleCharacter)
end)

for i, v in pairs(game.ReplicatedStorage.Enemys:GetChildren()) do
	if v:IsA("Model") then
		handleNPcs(v)
	end
end

for i, v in pairs(game.ReplicatedStorage.Units:GetChildren()) do
	if v:IsA("Model") then
		handleNPcs(v)
	end
end
-- RCM Settings V

self.WeaponWeight		= 4 -- Weapon weight must be enabled in the Config module

self.ShellEjectionMod	= true

self.Holster			= true
self.HolsterPoint		= "Torso"
self.HolsterCFrame		= CFrame.new(0.65,0.1,-0.8) * CFrame.Angles(math.rad(-90),math.rad(15),math.rad(75))

self.FlashChance = 4 -- 0 = no muzzle flash, 10 = Always muzzle flash

self.ADSEnabled 		= { -- Ignore this setting if not using an ADS Mesh
	true, -- Enabled for primary sight
	false} -- Enabled for secondary sight (T)

self.ExplosiveAmmo		= false -- Enables explosive ammo
self.ExplosionRadius	= 70 -- Radius of explosion damage in studs
self.ExplosionType		= "Default" -- Which explosion effect is used from the HITFX Explosion folder
self.IsLauncher			= true -- For RPG style rocket launchers

self.EjectionOverride	= nil -- Don't touch unless you know what you're doing with Vector3s

return self
-- ~60 c/s
game["Run Service"].Stepped:connect(function()	
	--RPM
	RPM()
	
	--Update External Values
	_IsOn = script.Parent.IsOn.Value
	_InControls = script.Parent.ControlsOpen.Value
	script.Parent.Values.Gear.Value = _CGear
	script.Parent.Values.RPM.Value = _RPM
	script.Parent.Values.Horsepower.Value = _HP
	script.Parent.Values.Torque.Value = _HP * _Tune.EqPoint / _RPM
	script.Parent.Values.TransmissionMode.Value = _TMode
	script.Parent.Values.Throttle.Value = _GThrot
	script.Parent.Values.Brake.Value = _GBrake
	script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
	script.Parent.Values.SteerT.Value = _GSteerT
	script.Parent.Values.PBrake.Value = _PBrake
	script.Parent.Values.TCS.Value = _TCS
	script.Parent.Values.TCSActive.Value = _TCSActive
	script.Parent.Values.ABS.Value = _ABS
	script.Parent.Values.ABSActive.Value = _ABSActive
	script.Parent.Values.Velocity.Value = car.DriveSeat.Velocity
end)
--[=[
	Provides utility functions to work with attributes in Roblox
	@class AttributeUtils
]=]

local require = require(script.Parent.loader).load(script)

local RunService = game:GetService("RunService")

local Maid = require("Maid")

local AttributeUtils = {}
--[=[
	Binds the given update function to [RunService.Stepped]. See [StepUtils.bindToRenderStep] for details.


	:::tip
	Be sure to call the disconnect function when cleaning up, otherwise you may memory leak.
	:::

	@param update () -> boolean -- should return true while it needs to update
	@return (...) -> () -- Connect function
	@return () -> () -- Disconnect function
]=]
function StepUtils.bindToStepped(update)
	return StepUtils.bindToSignal(RunService.Stepped, update)
end
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
	
local toolAnimName = ""
local toolOldAnimTrack = nil
local toolAnimTrack = nil
local currentToolAnimKeyframeHandler = nil
	
function toolKeyFrameReachedFunc(frameName)
	if (frameName == "End") then
		--		print("Keyframe : ".. frameName)
		local repeatAnim = stopToolAnimations()
		playToolAnimation(repeatAnim, 0.0, Humanoid)
	end
end
	
	
function playToolAnimation(animName, transitionTime, humanoid)
	if (animName ~= toolAnimName) then		 
			
		if (toolAnimTrack ~= nil) then
			toolAnimTrack:Stop()
			toolAnimTrack:Destroy()
			transitionTime = 0
		end
			
		local roll = math.random(1, animTable[animName].totalWeight) 
		local origRoll = roll
		local idx = 1
		while (roll > animTable[animName][idx].weight) do
			roll = roll - animTable[animName][idx].weight
			idx = idx + 1
		end
		--		print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
		local anim = animTable[animName][idx].anim
			
		-- load it to the humanoid; get AnimationTrack
		toolOldAnimTrack = toolAnimTrack
		toolAnimTrack = humanoid:LoadAnimation(anim)
		 
		-- play the animation
		toolAnimTrack:Play(transitionTime)
		toolAnimName = animName
			
		currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
	end
end
	
function stopToolAnimations()
	local oldAnim = toolAnimName
		
	if (currentToolAnimKeyframeHandler ~= nil) then
		currentToolAnimKeyframeHandler:disconnect()
	end
		
	toolAnimName = ""
	if (toolAnimTrack ~= nil) then
		toolAnimTrack:Stop()
		toolAnimTrack:Destroy()
		toolAnimTrack = nil
	end
		
		
	return oldAnim
end
--[ Activation ]:

coroutine.resume(coroutine.create(function()
	while RunSrv.RenderStepped:wait() and Hum:GetState().Value~=15 do	--[ Adding wait() here is the same as adding wait() later. ]
		local CamCF = Cam.CoordinateFrame
		--local MsePos = Mouse.Origin.p	--[ Might do something with this in a future update... ]
		if ((IsR6 and Body["Torso"]) or Body["UpperTorso"])~=nil and Body["Head"]~=nil then	--[ Check for the Torso and Head... ]
			local TrsoLV = Trso.CFrame.lookVector
			local HdPos = Head.CFrame.p
			if ((IsR6 and Trso["Neck"]) or Head["Neck"])~=nil then	--[ Make sure the Neck still exists. ]
				if Cam.CameraSubject:IsDescendantOf(Body) or Cam.CameraSubject:IsDescendantOf(Plr) then
					local Dist = nil;
					local Diff = nil;
					if not MseGuide then	--[ If not tracking the Mouse then get the Camera. ]
						Dist = (Head.CFrame.p-CamCF.p).magnitude
						Diff = Head.CFrame.Y-CamCF.Y
						if not IsR6 then	--[ R6 and R15 Neck rotation C0s are different; R15: X axis inverted and Z is now the Y. ]
							Neck.C0 = OrgnC0*Ang((aSin(Diff/Dist)*Fctor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y, 0)
						else	--[ R15s actually have the properly oriented Neck CFrame. ]
							Neck.C0 = OrgnC0*Ang(-(aSin(Diff/Dist)*Fctor), 0, -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y)
						end
					else
						local _, Point = Wrks:FindPartOnRay(Ray.new(Head.CFrame.p, Mouse.Hit.lookVector), Wrks, false, true)
						Dist = (Head.CFrame.p-Point).magnitude
						Diff = Head.CFrame.Y-Point.Y
						if not IsR6 then
							Neck.C0 = OrgnC0*Ang(-(aTan(Diff/Dist)*Fctor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*Fctor, 0)
						else
							Neck.C0 = OrgnC0*Ang((aTan(Diff/Dist)*Fctor), 0, (((HdPos-Point).Unit):Cross(TrsoLV)).Y*Fctor)
						end
					end
				end
			end
		end
	end
end))