Roblox/luau_corpus huggingface dataset:
-- 100 == 1  0 == 0  1/0.5

function JamCalculation()
	local L_179_
	if (math.random(1, 100) <= L_24_.JamChance) then	
		L_179_ = true
		L_72_ = true
	else
		L_179_ = false
	end
	return L_179_
end

function TracerCalculation()
	local L_180_
	if (math.random(1, 100) <= L_24_.TracerChance) then	
		L_180_ = true
	else
		L_180_ = false
	end
	return L_180_
end

function ScreamCalculation()
	local L_181_
	if (math.random(1, 100) <= L_24_.SuppressCalloutChance) then	
		L_181_ = true
	else
		L_181_ = false
	end
	return L_181_
end

function SearchResupply(L_182_arg1)
	local L_183_ = false
	local L_184_ = nil
	
	if L_182_arg1:FindFirstChild('ResupplyVal') or L_182_arg1.Parent:FindFirstChild('ResupplyVal') then
		L_183_ = true
		if L_182_arg1:FindFirstChild('ResupplyVal') then
			L_184_ = L_182_arg1.ResupplyVal
		elseif L_182_arg1.Parent:FindFirstChild('ResupplyVal') then
			L_184_ = L_182_arg1.Parent.ResupplyVal
		end
	end
	return L_183_, L_184_
end

function CheckReverb()
	local L_185_, L_186_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_6_.CFrame.p, (L_6_.CFrame.upVector).unit * 30), IgnoreList);
		
	if L_185_ then
		local L_187_ = L_56_:WaitForChild('Fire'):FindFirstChild('ReverbSoundEffect') or Instance.new("ReverbSoundEffect", L_56_:WaitForChild('Fire'))
	elseif not L_185_ then
		if L_56_:WaitForChild('Fire'):FindFirstChild('ReverbSoundEffect') then
			L_56_.Fire.ReverbSoundEffect:Destroy()
		end
	end
end

function UpdateAmmo()
	L_29_.Text = L_100_
	L_30_.Text = L_29_.Text
	
	L_31_.Text = '| ' .. math.ceil(L_101_ / L_24_.StoredAmmo)
	L_32_.Text = L_31_.Text
	
	if L_90_ == 0 then
		L_40_.Image = 'rbxassetid://' .. 1868007495
	elseif L_90_ == 1 then
		L_40_.Image = 'rbxassetid://' .. 1868007947
	elseif L_90_ == 2 then
		L_40_.Image = 'rbxassetid://' .. 1868008584
	end
	
	if L_89_ == 1 then
		L_35_.BackgroundTransparency = 0
		L_36_.BackgroundTransparency = 0.7
		L_37_.BackgroundTransparency = 0.7
		L_38_.BackgroundTransparency = 0.7
		L_39_.BackgroundTransparency = 0.7
	elseif L_89_ == 2 then
		L_35_.BackgroundTransparency = 0
		L_36_.BackgroundTransparency = 0
		L_37_.BackgroundTransparency = 0
		L_38_.BackgroundTransparency = 0
		L_39_.BackgroundTransparency = 0
	elseif L_89_ == 3 then
		L_35_.BackgroundTransparency = 0
		L_36_.BackgroundTransparency = 0
		L_37_.BackgroundTransparency = 0
		L_38_.BackgroundTransparency = 0.7
		L_39_.BackgroundTransparency = 0.7
	elseif L_89_ == 4 then
		L_35_.BackgroundTransparency = 0
		L_36_.BackgroundTransparency = 0
		L_37_.BackgroundTransparency = 0
		L_38_.BackgroundTransparency = 0
		L_39_.BackgroundTransparency = 0.7
	elseif L_89_ == 5 then
		L_35_.BackgroundTransparency = 0
		L_36_.BackgroundTransparency = 0.7
		L_37_.BackgroundTransparency = 0
		L_38_.BackgroundTransparency = 0.7
		L_39_.BackgroundTransparency = 0.7
	elseif L_89_ == 6 then
		L_35_.BackgroundTransparency = 0
		L_36_.BackgroundTransparency = 0.7
		L_37_.BackgroundTransparency = 0
		L_38_.BackgroundTransparency = 0
		L_39_.BackgroundTransparency = 0.7
	end
	
end
--[[
	Returns the current value of this Tween object.
	The object will be registered as a dependency unless `asDependency` is false.
]]
function class:get(asDependency: boolean?): any
	if asDependency ~= false then
		useDependency(self)
	end
	return self._currentValue
end
--[[]]--
function FlyOn()
if COOLDOWN == true then return else end
local torso = Cha.Torso
db = true 
Cha["Left Leg"].Transparency = 1
Cha["Right Leg"].Transparency = 1
local gs = script.ParticleEmitter:Clone()
gs.Parent = Cha.Torso
-- declarations
local toolAnim = "None"
local toolAnimTime = 0

local jumpAnimTime = 0
local jumpAnimDuration = 0.3

local toolTransitionTime = 0.1
local fallTransitionTime = 0.2
local jumpMaxLimbVelocity = 0.75
--[=[
	@param data table
	@return Option
	Deserializes the data into an Option. This data should have come from
	the `option:Serialize()` method.
]=]
function Option.Deserialize(data) -- type data = {ClassName: string, Value: any}
	assert(type(data) == "table" and data.ClassName == CLASSNAME, "Invalid data for deserializing Option")
	return data.Value == nil and Option.None or Option.Some(data.Value)
end
--[=[
	@return Shake
	Creates a new shake with identical properties as
	this one. This does _not_ clone over playing state,
	and thus the cloned instance will be in a stopped
	state.

	A use-case for using `Clone` would be to create a module
	with a list of shake presets. These presets can be cloned
	when desired for use. For instance, there might be presets
	for explosions, recoil, or earthquakes.

	```lua
	--------------------------------------
	-- Example preset module
	local ShakePresets = {}

	local explosion = Shake.new()
	-- Configure `explosion` shake here
	ShakePresets.Explosion = explosion

	return ShakePresets
	--------------------------------------

	-- Use the module:
	local ShakePresets = require(somewhere.ShakePresets)
	local explosionShake = ShakePresets.Explosion:Clone()
	```
]=]
function Shake:Clone()
	local shake = Shake.new()
	local cloneFields = {
		"Amplitude", "Frequency", "FadeInTime",
		"FadeOutTime", "SustainTime", "Sustain",
		"PositionInfluence", "RotationInfluence",
		"TimeFunction"
	}
	for _,field in ipairs(cloneFields) do
		shake[field] = self[field]
	end
	return shake
end
--

local function Dash()
	local character = player.Character
	if character and not debounce then
		debounce = true
		-- now we begin the dash script here

		local humanoid = character.Humanoid
		local HRP = character.HumanoidRootPart -- HRP stands for HumanoidRootPart

		local loadedAnimation = humanoid.Animator:LoadAnimation(DashAnimation)

		local dashDirection = nil
		local moveDirection = humanoid.MoveDirection
		local lookVector = HRP.CFrame.LookVector
		local minusVelocity = -velocity -- in CFrame, if we set Z to positive, player will go move backward
		-- instead of forward

		-- checking if player is on ground, not floating
		local isOnGround = humanoid.FloorMaterial ~= Enum.Material.Air and humanoid.FloorMaterial ~= Enum.Material.Water

		if isOnGround then


			if moveDirection == Vector3.new(0,0,0) then -- if player is not currently moving/walking
				dashDirection = HRP.Position + Vector3.new(lookVector.X, 0, lookVector.Z)
			else -- if player are currently moving/walking
				dashDirection = HRP.Position + Vector3.new(moveDirection.X, 0, moveDirection.Z)
			end

			-- using bodygyro to rotate player to the dash direction smoothly
			local bodyGyro = Instance.new("BodyGyro")
			bodyGyro.Parent = HRP
			bodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
			bodyGyro.D = 0 -- D is the dampening
			bodyGyro.P = 500000 -- P is aggressiveness
			bodyGyro.CFrame = CFrame.lookAt(HRP.Position, dashDirection) -- Making player look at the dash direction

			local attachment = Instance.new("Attachment")
			attachment.Parent = HRP

			-- now using VectorForce to move player forward
			local vectorForce = Instance.new("VectorForce")
			vectorForce.Parent = HRP
			-- VectorForce need attachment to tell where is player looking at
			vectorForce.Attachment0 = attachment
			vectorForce.Force = Vector3.new(0,0,minusVelocity) -- now it will move player forward as the settings

			loadedAnimation:Play() -- play the dash animation
			humanoid.AutoRotate = false -- prevent player to rotate by themselves

			wait(duration)

			humanoid.AutoRotate = true

			vectorForce:Destroy()
			bodyGyro:Destroy()
			attachment:Destroy()

			--wait(duration) -- give some time before stopping the dash animation
			loadedAnimation:Stop()

		end


		--
		wait(cooldown)
		debounce = false
	end
end

UserInputService.InputBegan:Connect(function(input)
	if input.KeyCode == key then
		Dash()
	end
end)
--//

function Raycast:Raycast(Origin, Direction)
	local CompletedRaycast = false
	local NumberPenetrations = 0
	local NumberChecks = 0
	local MaxChecks = 10000
	local FinalResult = nil
	
	while not CompletedRaycast do
		local RaycastResult = workspace:Raycast(Origin, Direction, self.Parameters)
		local NormalizedSize = RaycastResult and (RaycastResult.Instance.Size * RaycastResult.Normal)
		local Distance = RaycastResult and Direction.Unit * (RaycastResult.Position - Origin).Magnitude
		
		if NumberChecks == MaxChecks then
			break
		end

		local canCollideCheck, visibilityCheck, penetrateBecauseSmallSize, ignorePart
		
		if RaycastResult == nil then
			break
		else
			local transparency = RaycastResult.Instance.Transparency + (1 * RaycastResult.Instance.localTransparencyModifier)

			visibilityCheck = not self.InvisiblePartsBlockRaycast and transparency >= self.MinTransparencyToBeInvisible
			canCollideCheck = self.AllowCanCollideFalse and RaycastResult.Instance.CanCollide == false
			ignorePart = canCollideCheck or visibilityCheck

			penetrateBecauseSmallSize = NumberPenetrations < self.MaxPenetrations and NormalizedSize.Magnitude <= self.Penetration
		end

		if ignorePart then
			Origin = RaycastResult.Position - RaycastResult.Normal*0.001
			Direction -= Distance
		elseif penetrateBecauseSmallSize then
			NumberPenetrations += 1
			Origin = RaycastResult.Position - RaycastResult.Normal * NormalizedSize.Magnitude * 0.999
			Direction -= Distance
		else
			FinalResult = RaycastResult
			CompletedRaycast = true
			break
		end
		
		NumberChecks += 1
	end

	return FinalResult, NumberPenetrations
end
--Raycasting collision
function collision_module.Raycast(wl, from, dir)
	local param = RaycastParams.new()
	param.FilterType = Enum.RaycastFilterType.Whitelist
	param.FilterDescendantsInstances = wl
	param.IgnoreWater = true
	local result = workspace:Raycast(from, dir, param)
	if result then
		return result.Instance, result.Position, result.Normal, result.Material
	else
		return nil, from + dir, nil, Enum.Material.Air
	end
end
-- GUI Elements
local gui = script.Parent
local textDisplay = gui.Header
local displayImage = gui.DisplayImage

local scriptAttributes = script:GetAttributes()

local function displayEndScreen(state, transitionTime)
	-- Make the GUI visible
	
	gui.Visible = true
	
	if state == "Victory" then
		textDisplay.Text = gui:GetAttribute("messageVictory")
		displayImage.Image = gui:GetAttribute("imageVictory")
	elseif state == "Defeat" then
		textDisplay.Text = gui:GetAttribute("messageDefeat")
		displayImage.Image = gui:GetAttribute("imageDefeat")
	else
		warn("Invalid end game state fired on client GUI")
	end
	
	wait(transitionTime)
	gui.Visible = false
	
end

ClientEndGame.OnClientEvent:Connect(displayEndScreen)
-- emote bindable hook
if FFlagAnimateScriptEmoteHook then
	script:WaitForChild("PlayEmote").OnInvoke = function(emote)
		-- Only play emotes when idling
		if pose ~= "Standing" then
			return
		end

		if emoteNames[emote] ~= nil then
			-- Default emotes
			playAnimation(emote, EMOTE_TRANSITION_TIME, Humanoid)

			if userPlayEmoteByIdAnimTrackReturn then
				return true, currentAnimTrack
			else
				return true
			end
		elseif typeof(emote) == "Instance" and emote:IsA("Animation") then
			-- Non-default emotes
			playEmote(emote, EMOTE_TRANSITION_TIME, Humanoid)

			if userPlayEmoteByIdAnimTrackReturn then
				return true, currentAnimTrack
			else
				return true
			end
		end

		-- Return false to indicate that the emote could not be played
		return false
	end
end
-- Decompiled with the Synapse X Luau decompiler.

local v1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
while not v1.Loaded do
	game:GetService("RunService").Heartbeat:Wait();
end;
function CanOpenWindow()
	local v2 = v1.Variables.OpeningEgg;
	if not v2 then
		v2 = v1.Variables.UsingMachine or (v1.Variables.UsingCannon or (v1.Variables.LoadingWorld or (v1.Variables.PickingStarter or v1.Variables.Trading)));
	end;
	return not v2;
end;
local u1 = false;
local l__ID__2 = v1.Directory.Gamepasses.Teleport.ID;
function HookButton(p1)
	local l__Button__3 = p1.Button;
	local l__Name__4 = p1.Name;
	local v5 = v1.GUI[l__Name__4];
	v1.GFX.Button(l__Button__3);
	if not v5 then
		return;
	end;
	local function u3()
		if not u1 then
			u1 = true;
			if not CanOpenWindow() then
				if v5.Gui.Enabled then
					if v5.Gui.Name ~= "Trading" then
						if v5.Gui.Enabled == true then
						
							v1.Window.GuaranteeCloseCurrentWindow(l__Name__4)
						else
							v1.Window.GuaranteeOpenWindow(l__Name__4)
						end
					end;
				end;
			elseif l__Name__4 == "Teleport" then
				if not v1.Gamepasses.Owns(l__ID__2) then
					v1.Functions.PromptPurchase(l__ID__2);
				else
					if v5.Gui.Enabled == true then
						v1.Window.GuaranteeCloseCurrentWindow(l__Name__4)
					else
						v1.Window.GuaranteeOpenWindow(l__Name__4)					
					end
				end;
			else
				if v5.Gui.Enabled == true then
					v1.Window.GuaranteeCloseCurrentWindow(l__Name__4)
				else
					v1.Window.GuaranteeOpenWindow(l__Name__4)
				end
			end;
			u1 = false;
		end;
	end;
	l__Button__3.Activated:Connect(function()
		u3();
	end);
	if p1.Name == "Inventory" then
		v1.UserInputService.InputBegan:Connect(function(p2, p3)
			if not p3 then
				if p2.KeyCode ~= Enum.KeyCode.X then
					if p2.KeyCode == Enum.KeyCode.ButtonY then

					else
						return;
					end;
				else
					u3();
					return;
				end;
			else
				return;
			end;
			u3();
		end);
	end;
	if p1:FindFirstChild("Title") then
		l__Button__3.MouseEnter:Connect(function()
			if not v1.Variables.Mobile then
				p1.Title.Visible = true;
			end;
		end);
		l__Button__3.MouseLeave:Connect(function()
			if not v1.Variables.Mobile then
				p1.Title.Visible = false;
			end;
		end);
	end;
end;

	for v6, v7 in ipairs(v1.GUI.Main.LeftButtons:GetChildren()) do
	if not v6 then
		break;
	end;
	if v7:IsA("GuiObject") then

			for v9, v10 in ipairs(v7:GetChildren()) do
			if not v9 then
				break;
			end;
			if v10:IsA("GuiObject") then
				HookButton(v10);
			end;		
		end;
	end;
end;
-- Get the NPC's Humanoid
local humanoid = npc:FindFirstChild("Humanoid")

if humanoid then
	-- Set the NPC's health to the new value
	humanoid.MaxHealth = newHealth
	humanoid.Health = newHealth
else
	warn("This NPC does not have a Humanoid.")
end
--[=[
	Start the shake effect.

	:::note
	This **must** be called before calling `Update`. As such, it should also be
	called once before or after calling `OnSignal` or `BindToRenderStep` methods.
	:::
]=]
function Shake:Start()
	self._startTime = self.TimeFunction()
	self._running = true
	self._trove:Add(function()
		self._running = false
	end)
end
--[[
	Create a new expectation
]]
function Expectation.new(value)
	local self = {
		value = value,
		successCondition = true,
		condition = false
	}

	setmetatable(self, Expectation)

	self.a = bindSelf(self, self.a)
	self.an = self.a
	self.ok = bindSelf(self, self.ok)
	self.equal = bindSelf(self, self.equal)
	self.throw = bindSelf(self, self.throw)
	self.near = bindSelf(self, self.near)

	return self
end

function Expectation.__index(self, key)
	-- Keys that don't do anything except improve readability
	if SELF_KEYS[key] then
		return self
	end

	-- Invert your assertion
	if NEGATION_KEYS[key] then
		local newExpectation = Expectation.new(self.value)
		newExpectation.successCondition = not self.successCondition

		return newExpectation
	end

	-- Fall back to methods provided by Expectation
	return Expectation[key]
end
-- find player's head pos

	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)

	local head = vCharacter:findFirstChild("Head")
	if head == nil then return end

	local dir = head.CFrame.LookVector

	--local launch = head.Position + 5 * dir

	--local delta = mouse_pos - launch
	
	--local dy = delta.y
	
	--local new_delta = Vector3.new(delta.x, 0, delta.z)
	--delta = new_delta

	--local dx = delta.magnitude
	--local unit_delta = delta.unit
	
	-- acceleration due to gravity in RBX units
	local g = (-9.81 * 20)

	

	local missile = Pellet:clone()
        

	Tool.Handle.Mesh:clone().Parent = missile
		

	missile.Position = head.Position + 5 * dir
	missile.Velocity = dir * VELOCITY
	missile.RotVelocity = Vector3.new(5,0,0)

	missile.PelletScript.Disabled = false

	missile.Parent = game.Workspace

end


function computeLaunchAngle(dx,dy,grav)
	-- arcane
	-- http://en.wikipedia.org/wiki/Trajectory_of_a_projectile
	
	local g = math.abs(grav)
	local inRoot = (VELOCITY*VELOCITY*VELOCITY*VELOCITY) - (g * ((g*dx*dx) + (2*dy*VELOCITY*VELOCITY)))
	if inRoot <= 0 then
		return .25 * math.pi
	end
	local root = math.sqrt(inRoot)
	local inATan1 = ((VELOCITY*VELOCITY) + root) / (g*dx)

	local inATan2 = ((VELOCITY*VELOCITY) - root) / (g*dx)
	local answer1 = math.atan(inATan1)
	local answer2 = math.atan(inATan2)
	if answer1 < answer2 then return answer1 end
	return answer2
end

function computeDirection(vec)
	local lenSquared = vec.magnitude * vec.magnitude
	local invSqrt = 1 / math.sqrt(lenSquared)
	return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end




Tool.Enabled = true
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



	local targetPos = humanoid.TargetPoint

	fire(targetPos)
	wait(3)
	
	if (Tool.Parent:FindFirstChild("Torso") ~= nil) then
		Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 0.6
		Tool.Parent.Torso["Right Shoulder"].DesiredAngle = -3.6
	end
		wait(.1)
	Tool.Handle.Transparency=0
	wait(.1)
	Tool.Enabled = true


end

script.Parent.Activated:connect(onActivated)
--custom cat stuff

function AlarmHazards(typ)
	blinking = false
	blinking = true
	while blinking and script.Parent.Parent.Alarm.Value == true do
		Toggle("Hazards", true)
		wait(1/3)
		Toggle("Hazards", false)
		wait(1/3)
	end
	Toggle('Hazards', false)
end

script.Parent.Parent.Alarm.Changed:Connect(function()
	if script.Parent.Parent.Alarm.Value == true then
		AlarmHazards()
	end
end)
--[[**
	ensures value is either nil or passes check

	@param check The check to use

	@returns A function that will return true iff the condition is passed
**--]]
function t.optional(check)
	assert(t.callback(check))
	return function(value)
		if value == nil then
			return true
		end
		local success, errMsg = check(value)
		if success then
			return true
		else
			return false, string.format("(optional) %s", errMsg or "")
		end
	end
end
--Used to visualize waypoints
local visualWaypoint = Instance.new("Part")
visualWaypoint.Size = Vector3.new(0.3, 0.3, 0.3)
visualWaypoint.Anchored = true
visualWaypoint.CanCollide = false
visualWaypoint.Material = Enum.Material.Neon
visualWaypoint.Shape = Enum.PartType.Ball
--[=[
	A boolean which determines if a ScriptConnection is active or not.

	@prop Connected boolean
	@within ScriptConnection

	@readonly
	@ignore
]=]

export type Class = typeof(setmetatable({
    _active = true,
    _head = nil :: ScriptConnectionNode?,
}, ScriptSignal))

export type ScriptConnection = typeof(setmetatable({
    Connected = true,
    _node = nil :: ScriptConnectionNode?,
}, ScriptConnection))

type ScriptConnectionNode = {
    _signal: Class,
    _connection: ScriptConnection?,
    _handler: (...any) -> (),

    _next: ScriptConnectionNode?,
    _prev: ScriptConnectionNode?,
}

local FreeThread: thread? = nil

local function RunHandlerInFreeThread(handler, ...)
    local thread = FreeThread :: thread
    FreeThread = nil

    handler(...)

    FreeThread = thread
end

local function CreateFreeThread()
    FreeThread = coroutine.running()

    while true do
        RunHandlerInFreeThread(coroutine.yield())
    end
end
--// Adonis Client Loader (Non-ReplicatedFirst Version)

local wait = wait;
local tick = tick;
local pcall = pcall;
local xpcall = xpcall;
local setfenv = setfenv;
local tostring = tostring;

local players = game:GetService("Players");
local player = players.LocalPlayer;
local folder = script.Parent;
local container = folder.Parent;
local Kick = player.Kick;
local module = folder:WaitForChild("Client");
local target = player;
local realPrint = print;
local realWarn = warn;
local DebugMode = false;
local start = tick();

local function print(...)
	if true then
		--realPrint(...)
	end
end

local function warn(str)
	if DebugMode or player.UserId == 1237666 then
		realWarn("ACLI: "..tostring(str))
	end
end

local function Kill(info)
	if DebugMode then warn(info) return end
	pcall(function() Kick(player, info) end) 
	wait(1)
	pcall(function() while not DebugMode and wait() do pcall(function() while true do end end) end end)
end

local function Locked(obj)
	return (not obj and true) or not pcall(function() return obj.GetFullName(obj) end)
end

local function loadingTime()
	warn("LoadingTime Called")
	setfenv(1,{})
	warn(tostring(tick() - start))
end

local function callCheck(child)
	warn("CallCheck: "..tostring(child))
	if Locked(child) then
		warn("Child locked?")
		Kill("ACLI: Locked")
	else
		warn("Child not locked")
		xpcall(function()
			return child[{}]
		end, function()
			if getfenv(1) ~= getfenv(2) then
				Kill("ACLI: Error")
			end
		end)
	end
end

local function doPcall(func, ...)
	local ran,ret = pcall(func, ...)
	if ran then
		return ran,ret
	else
		warn(tostring(ret))
		Kill("ACLI: Error\n"..tostring(ret))
		return ran,ret
	end
end
-- R15 --

function   waitForChild(parent, childName)
	local child = parent:findFirstChild(childName)
	if child then return child end
	while true do
		child = parent.ChildAdded:wait()
		if child.Name==childName then return child end
	end
end

local Figure = script.Parent
local Humanoid = waitForChild(Figure, "Humanoid")
local pose = "Standing"

if ( Humanoid.RigType == Enum.HumanoidRigType.R6 ) then
	-- We dont want this script to run, so we'll just wait until this script is eventually destroyed.
	wait(1);
	repeat wait(100) until 1 == 2
end

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

local CurrentToyAnimation = nil;

local runAnimTrack = nil
local runAnimKeyframeHandler = nil

local AnimSpeedChangeDebounce = nil;

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=507768133", weight = 10 } 
			},	
	toolnone = {
				{ id = "http://www.roblox.com/asset/?id=507768375", weight = 10 } 
			},
	toolslash = {
				{ id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
--[[
	Tween Event handler
	Phoenix
]]

local Sender    	 = game:GetService("ReplicatedStorage").Game.Events.Game.Tween
local ServerListener = game:GetService("ServerScriptService").Server.Events.Tween

local CatchUpData = {} -- Instance = {InstanceTweened = Instance, Frame = CFrame}

ServerListener.Event:Connect(function(InstanceToTween, ToCFrame, Time, Data)
	local Ins
	
	if InstanceToTween ~= nil then
		if InstanceToTween:IsA("Model") then
			if InstanceToTween.PrimaryPart then
				Ins = InstanceToTween.PrimaryPart
			end
		else
			Ins = InstanceToTween
		end

		local Players = game:GetService("Players"):GetChildren()

		for I = 1, #Players do
			local Player = Players[I]

			Sender:FireClient(Player, InstanceToTween, ToCFrame, Time, Data)
		end

		wait(Time)

		if InstanceToTween.PrimaryPart then
			InstanceToTween:SetPrimaryPartCFrame(ToCFrame)
		elseif InstanceToTween:IsA("BasePart") then
			InstanceToTween.CFrame = ToCFrame
		else
			print("Attempted to tween a non model Instance: ".. InstanceToTween:GetFullName())
		end
	end	
end)