Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- same as jump for now



function moveFreeFall()
	RightShoulder.MaxVelocity = 0.4
	LeftShoulder.MaxVelocity = 0.4
	RightShoulder:SetDesiredAngle(3.14)
	LeftShoulder:SetDesiredAngle(-3.14)
	RightHip:SetDesiredAngle(0)
	LeftHip:SetDesiredAngle(0)
	wait(0.8)
end

function moveSit()
	RightShoulder.MaxVelocity = 0.15
	LeftShoulder.MaxVelocity = 0.15
	RightShoulder:SetDesiredAngle(3.14 /2)
	LeftShoulder:SetDesiredAngle(-3.14 /2)
	RightHip:SetDesiredAngle(3.14 /2)
	LeftHip:SetDesiredAngle(-3.14 /2)
end

function getTool()	
	for _, kid in ipairs(Figure:GetChildren()) do
		if kid.className == "Tool" then return kid end
	end
	return nil
end

function getToolAnim(tool)
	for _, c in ipairs(tool:GetChildren()) do
		if c.Name == "toolanim" and c.className == "StringValue" then
			return c
		end
	end
	return nil
end

function animateTool()
	
	if (toolAnim == "None") then
		RightShoulder:SetDesiredAngle(1.57)
		return
	end

	if (toolAnim == "Slash") then
		RightShoulder.MaxVelocity = 0.5
		RightShoulder:SetDesiredAngle(0)
		return
	end

	if (toolAnim == "Lunge") then
		RightShoulder.MaxVelocity = 0.5
		LeftShoulder.MaxVelocity = 0.5
		RightHip.MaxVelocity = 0.5
		LeftHip.MaxVelocity = 0.5
		RightShoulder:SetDesiredAngle(1.57)
		LeftShoulder:SetDesiredAngle(1.0)
		RightHip:SetDesiredAngle(1.57)
		LeftHip:SetDesiredAngle(1.0)
		return
	end
end

function move(time)
	local amplitude
	local frequency
  
	if (pose == "Jumping") then
		moveJump()
		return
	end

	if (pose == "FreeFall") then
		moveFreeFall()
		return
	end
 
	if (pose == "Seated") then
		moveSit()
		return
	end

	local climbFudge = 0
	
	if (pose == "Running") then
		RightShoulder.MaxVelocity = 0.1
		LeftShoulder.MaxVelocity = 0.1
		amplitude = 1
		frequency = 9
	elseif (pose == "Climbing") then
		RightShoulder.MaxVelocity = 0.3 
		LeftShoulder.MaxVelocity = 0.3
		amplitude = 0
		frequency = 0
		climbFudge = -3.14
	else
		amplitude = 0.1
		frequency = 1
	end

	desiredAngle = amplitude * math.sin(time*frequency)

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


	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
		toolAnim = "None"
		toolAnimTime = 0
	end
end
--[[
	Merges values from zero or more tables onto a target table. If a value is
	set to None, it will instead be removed from the table.

	This function is identical in functionality to JavaScript's Object.assign.
]]
-- Luau TODO: no way to strongly type this accurately, it doesn't eliminate deleted keys of T, and Luau won't do intersections of type packs: <T, ...U>(T, ...: ...U): T & ...U


return function<T, U, V, W>(target: T, source0: U?, source1: V?, source2: W?, ...): T & U & V & W
	if source0 ~= nil and typeof(source0 :: any) == "table" then
		for key, value in pairs(source0 :: any) do
			if value == None then
				(target :: any)[key] = nil
			else
				(target :: any)[key] = value
			end
		end
	end

	if source1 ~= nil and typeof(source1 :: any) == "table" then
		for key, value in pairs(source1 :: any) do
			if value == None then
				(target :: any)[key] = nil
			else
				(target :: any)[key] = value
			end
		end
	end

	if source2 ~= nil and typeof(source2 :: any) == "table" then
		for key, value in pairs(source2 :: any) do
			if value == None then
				(target :: any)[key] = nil
			else
				(target :: any)[key] = value
			end
		end
	end

	for index = 1, select("#", ...) do
		local rest = select(index, ...)

		if rest ~= nil and typeof(rest) == "table" then
			for key, value in pairs(rest) do
				if value == None then
					(target :: any)[key] = nil
				else
					(target :: any)[key] = value
				end
			end
		end
	end

	-- TODO? we can add & Object to this, if needed by real-world code, once CLI-49825 is fixed
	return (target :: any) :: T & U & V & W
end
--[[ @brief Normalizes an array using the 1 norm. The satellite array will be multiplied by the same normalizing factor.
     @param array The array to normalize.
--]]


function module.NormalizeArrayWithSatellite(array, satellite)
	local sum = module.Sum(array);
	if sum==0 then return; end
	for i = 1, #array do
		array[i] = array[i] / sum;
	end
	for i = 1, #satellite do
		satellite[i] = satellite[i] / sum;
	end
end
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
-- STATE CHANGE HANDLERS



function onRunning(speed)
	local movedDuringEmote =
		userEmoteToRunThresholdChange and currentlyPlayingEmote and Humanoid.MoveDirection == Vector3.new(0, 0, 0)
	local speedThreshold = movedDuringEmote and Humanoid.WalkSpeed or 0.75
	humanoidSpeed = speed
	if speed > speedThreshold then
		playAnimation("walk", 0.2, Humanoid)
		if pose ~= "Running" then
			pose = "Running"
			updateVelocity(0) -- Force velocity update in response to state change
		end
	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)
	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
-- разместим копии


for i = -4, 4 do
	local ang = rnd:NextInteger(-2,2) * 45	-- расчитываем угол	
	local x = math.sin(math.rad(ang)) * radius
	local y = math.cos(math.rad(ang)) * radius	
	local pos = CFrame.new(x, radius-y-6,10+17*i  + script.Parent.Parent.BasePart.Position.Z ) * CFrame.Angles(0,0, math.rad(ang))
	local tmp = fakel:Clone()	
	tmp:SetPrimaryPartCFrame(pos)
	
	tmp.Fire.Fire.SleepTime.Value	= rnd:NextInteger(1,5)
	tmp.Fire.Fire.SpeedDOWN.Value	= rnd:NextNumber(0.1,0.5)
	tmp.Fire.Fire.SpeedUP.Value		= rnd:NextNumber(0.3,0.7)
	
	tmp.Parent = script.Parent
end
--[[Drivetrain]]

	
	Tune.Config			= "FWD"		--"FWD" , "RWD" , "AWD"
	
	--Differential Settings	
	Tune.FDiffSlipThres	= 75		-- 1 - 100%				(Max threshold of applying full lock determined by deviation from avg speed)
	Tune.FDiffLockThres	= 75		-- 0 - 100%				(0 - Bias toward slower wheel, 100 - Bias toward faster wheel)
	Tune.RDiffSlipThres	= 50		-- 1 - 100%
	Tune.RDiffLockThres	= 50		-- 0 - 100%
	Tune.CDiffSlipThres	= 50		-- 1 - 100%				[AWD Only]
	Tune.CDiffLockThres	= 50		-- 0 - 100%				[AWD Only]
	
	--Traction Control Settings
	Tune.TCSEnabled		= true		-- Implements TCS
	Tune.TCSThreshold	= 20		-- Slip speed allowed before TCS starts working (in SPS)
	Tune.TCSGradient	= 20		-- Slip speed gradient between 0 to max reduction (in SPS)
	Tune.TCSLimit		= 10		-- Minimum amount of torque at max reduction (in percent)
-- Function



Prompt.ProximityPrompt.Triggered:Connect(function(plr)
	Prompt.ProximityPrompt.Enabled = false
	--
	local anim = plr.Character:FindFirstChild("Humanoid"):LoadAnimation(script.Animation)
	anim:Play()
	--
	for i,v in pairs(script.Parent.Quebrar:GetChildren()) do
		v.Transparency = 0
	end
	--
	for money = 1,3 do
		local clone = game.ServerStorage.Dinheiro:Clone()
		clone.Parent = game.Workspace
		clone.Position = Prompt.Position
	end
	--
	soco:Play()
	wait(1)
	alarme:Play()
	--
	tela.BrickColor = BrickColor.new("Really red")
	tela.Material = "Neon"
	--
	wait(60*3)
	tela.BrickColor = BrickColor.new("Dark stone grey")
	tela.Material = "SmoothPlastic"
	--

	Prompt.ProximityPrompt.Enabled = true
	--
	for i,v in pairs(script.Parent.Quebrar:GetChildren()) do
		v.Transparency = 1
	end
end)
--[[ By: Brutez. ]]

--
local JeffTheKillerScript = script;
repeat wait(0)until JeffTheKillerScript and JeffTheKillerScript.Parent and JeffTheKillerScript.Parent.ClassName=="Model"and JeffTheKillerScript.Parent:FindFirstChild("Head")and JeffTheKillerScript.Parent:FindFirstChild("HumanoidRootPart");
local JeffTheKiller=JeffTheKillerScript.Parent;
function raycast(Spos,vec,currentdist)
local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(Spos+(vec*.05),vec*currentdist),JeffTheKiller);
if hit2~=nil and pos2 then
if hit2.Name=="Handle" and not hit2.CanCollide or string.sub(hit2.Name,1,6)=="Effect"and not hit2.CanCollide then
local currentdist=currentdist-(pos2-Spos).magnitude;
return raycast(pos2,vec,currentdist);
end;
end;
return hit2,pos2;
end;
function RayCast(Position,Direction,MaxDistance,IgnoreList)
return game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position,Direction.unit*(MaxDistance or 999.999)),IgnoreList);
end;
--Code--


local function PlayerTouched(Part)
	local Parent = Part.Parent
	if game.Players:GetPlayerFromCharacter(Parent) then
		wait(0.8)
		Brick.Transparency=Brick.Transparency+0.8
		Brick.CanCollide=false
		wait(3.2)
		Brick.Transparency=0
		Brick.CanCollide=true
	end
end

Brick.Touched:connect(PlayerTouched)
--[[ @brief Produces a cumulative sum along a table.
     @details The passed-in table will be mutated.
     @example Accumulate({1, 2, 3}) = {1, 3, 6}.
     @param t The table to accumulate.
--]]


function module.Accumulate(t)
	local s = 0;
	for i, v in pairs(t) do
		s = s + t[i];
		t[i] = s;
	end
	return t;
end
--// Use the power of the stars and hit as many people as you can to perform a chain attack!



local Properties = {
	DamageMode = "Normal", --What mode to reference the damage tables listed below
	
	Special = true,--The internal logical indicator to determine if we can use our special.
	
	Special_Reload = 10, --The Cooldown time until the ability is ready to be used.
	
	SpeedCap = 30, --This is the wielder's walkspeed when equipped

	DamageValues = {
		Normal = {
			Min = 10,
			Max = 50,
		},
		
		Lunge = {
			Min = 7,
			Max = 10
		}
	}

}

local FindFirstChild, FindFirstChildOfClass, WaitForChild = script.FindFirstChild, script.FindFirstChildOfClass, script.WaitForChild

local Clone, Destroy = script.Clone, script.Destroy

local GetChildren = script.GetChildren

local IsA = script.IsA

local Tool = script.Parent
Tool.Enabled = true

local DefaultGrip = FindFirstChild(Tool, "DefaultGrip") 
if not DefaultGrip then
	-- Create a new grip reference
	DefaultGrip = Instance.new("CFrameValue")
	DefaultGrip.Name = "DefaultGrip"
	DefaultGrip.Value = Tool.Grip
	DefaultGrip.Parent = Tool
end

Tool.Grip = DefaultGrip.Value --Reset the Tool's grip values to the DefaultGrip Value

local Handle = WaitForChild(Tool, "Handle")

pcall(function()
	Handle["Sparkle_Large_Blue"].Enabled = true --We're gonna use this as our visual indicator for our special.
end)

local Sounds = {
	Equip = WaitForChild(Handle, "Equip"),
	Slash = WaitForChild(Handle, "Slash"),
	Lunge = WaitForChild(Handle, "Lunge") 
}

local Players = (game:FindService("Players") or game:GetService("Players"))
local Debris = (game:FindService("Debris") or game:GetService("Debris"))
local RunService = (game:FindService("RunService") or game:GetService("RunService"))
local ServerScriptService = (game:FindService("ServerScriptService") or game:GetService("ServerScriptService"))

local NewRay = Ray.new
--MainScriptValues


local Color = Color3.fromRGB(99, 95, 98)
local CodeT1 = script.Parent.Code1
local CodeT2 = script.Parent.Code2
local CodeT3 = script.Parent.Code3
local CodeT1C = script.Parent.Code1.ClickDetector
local CodeT2C = script.Parent.Code2.ClickDetector
local CodeT3C = script.Parent.Code3.ClickDetector
------------------------------------------------------------


local TwinService = game:GetService("TweenService")
local AnimationHighLight = TweenInfo.new(2, Enum.EasingStyle.Sine ,Enum.EasingDirection.InOut)
local Info1 = {Position = Vector3.new(pos1,Positionn,pos3)}
local Info2 = {Position = Vector3.new(pos1,Positionn2,pos3)}
local AnimkaUp = TwinService:Create(Danger, AnimationHighLight, Info1 )
local AnimkaDown = TwinService:Create(Danger, AnimationHighLight, Info2 )
while true do
	AnimkaDown:Play()
	wait(2)
	AnimkaUp:Play()
	wait(2)
end
--[[ Private Functions ]]

--
local function getVehicleMotors()
	local motors = {}
	for _, c in pairs(constraints:GetChildren()) do
		if c:IsA("CylindricalConstraint") then
			table.insert(motors, c)
        end
    end
	return motors
end

local function getSprings(springType)
	local springs = {}
	local trailer = PackagedVehicle:FindFirstChild("Trailer")
	
	local function search(children)
		local searchStrutSpring = "StrutSpring"
		local searchFrontSpring = "StrutSpringF"
		local searchTorsionSpring = "TorsionBarSpring"
		for _, c in pairs(children) do
			if c:IsA("SpringConstraint") then
				if springType == "StrutFront" then
					if string.find(c.Name, searchFrontSpring) then
						table.insert(springs, c)
					end
				elseif springType == "StrutRear" then
					if (not string.find(c.Name, searchFrontSpring)) and string.find(c.Name, searchStrutSpring) then
						table.insert(springs, c) -- we have option of Mid and Rear for these
					end
				elseif springType == "TorsionBar" then
					if string.find(c.Name, searchTorsionSpring) then
						table.insert(springs, c)
					end
				end
			end
		end
	end

	search(constraints:GetChildren())
	if trailer then
		search(trailer.Constraints:GetChildren())
	end
	
	return springs
end

local function getMotorVelocity(motor)
	return motor.Attachment1.WorldAxis:Dot( motor.Attachment1.Parent.RotVelocity )
end

local function adjustSpring( spring, stiffness, damping )
	spring.Stiffness = stiffness
	spring.Damping = damping
end

local function setMotorTorque(torque)
	for _, motor in pairs(Motors) do		
		motor.MotorMaxTorque = torque
	end
end

local function setMotorTorqueDamped(torque, velocityDirection, accelDirection)
	for _, motor in pairs(Motors) do
		if VehicleParameters.MaxSpeed == 0 then 
			motor.MotorMaxTorque = 0
		else
			local maxSpeed = VehicleParameters.MaxSpeed
			if accelDirection < 0 and velocityDirection < 0 then
				maxSpeed = VehicleParameters.ReverseSpeed
			end
			
			local r = math.abs(Chassis.driverSeat.Velocity.Magnitude / maxSpeed)
			motor.MotorMaxTorque = math.exp( -3 * r * r ) * torque
		end
	end
end

local function setMotorMaxAcceleration(acceleration)
	for _, motor in pairs(Motors) do
		motor.MotorMaxAngularAcceleration = acceleration
	end
end
--------------------[ KNIFING FUNCTION ]----------------------------------------------



function KnifeAnim()
	local Connection = nil
	local Blade = Instance.new("Part")
	Blade.BrickColor = BrickColor.new("Really black")
	Blade.Name = "Blade"
	Blade.CanCollide = false
	Blade.FormFactor = Enum.FormFactor.Custom
	Blade.Size = VEC3(0.5, 2.5, 1)
	local Mesh = Instance.new("SpecialMesh")
	Mesh.MeshId = S.KnifeMeshId
	Mesh.MeshType = Enum.MeshType.FileMesh
	Mesh.Scale = VEC3(0.7, 0.7, 0.7)
	Mesh.TextureId = S.KnifeTextureId
	Mesh.Parent = Blade
	Blade.Parent = Gun_Ignore
	local BladeWeld = Instance.new("Weld")
	BladeWeld.Part0 = Blade
	BladeWeld.Part1 = FakeLArm
	BladeWeld.C0 = CFANG(RAD(-90), 0, RAD(180))
	BladeWeld.C1 = CF(0, -1, 0.75)
	BladeWeld.Parent = Blade
	Connection = Blade.Touched:connect(function(Obj)
		if Obj then
			local HitHumanoid = FindFirstClass(Obj.Parent, "Humanoid")
			if HitHumanoid and IsEnemy(HitHumanoid) then
				local CreatorTag = Instance.new("ObjectValue")
				CreatorTag.Name = "creator"
				CreatorTag.Value = Player
				CreatorTag.Parent = HitHumanoid
				HitHumanoid:TakeDamage(HitHumanoid.MaxHealth)
				MarkHit()
			end
		end
	end)
	TweenJoint(LWeld2, CF(), CFANG(0, RAD(90), 0), Linear, 0.05)
	TweenJoint(LWeld, ArmC0[1], CF(-0.1, 0.2, -0.1) * CFANG(0, 0, RAD(-20)), Linear, 0.05)
	TweenJoint(RWeld, ArmC0[2], CFANG(RAD(-30), 0, 0), Linear, 0.1)
	TweenJoint(Grip, Grip.C0, CF(), Linear, 0.1)
	spawn(function()
		local Force = HRP.CFrame.lookVector * 8e4
		local BF = Instance.new("BodyForce")
		BF.force = Force
		BF.Parent = HRP
		delay(0.03, function()
			BF.force = -Force / 2
			wait(0.03)
			BF:Destroy()
		end)
	end)
	wait(0.05)
	RotCamera(RAD(6), 0, true, 0.1)
	delay(0.1, function()
		RotCamera(RAD(-2), 0, true, 0.05)
	end)
	TweenJoint(LWeld, ArmC0[1], CF(0.8, 1.7, 0.2) * CFANG(0, 0, RAD(-80)), Linear, 0.06)
	wait(0.2)
	Connection:disconnect()
	wait(0.2)
	TweenJoint(LWeld2, CF(), CF(), Linear, 0.15)
	TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Linear, 0.15)
	TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Linear, 0.15)
	Blade:Destroy()
end
--[=[
	Requires all children ModuleScripts

	@param parent Instance -- Parent to scan
	@return {ModuleScript} -- Array of required modules
]=]


function Loader.LoadChildren(parent: Instance): Modules
	local modules: Modules = {}
	for _,child in ipairs(parent:GetChildren()) do
		if child:IsA("ModuleScript") then
			local m = require(child)
			table.insert(modules, m)
		end
	end
	return modules
end
--Precalculated paths


local t,f,n=true,false,{}
local r={
[58]={{24,25,26,27,28,29,31,32,34,35,39,41,30,56,58},t},
[49]={{24,25,26,27,28,44,45,49},t},
[16]={n,f},
[19]={{24,25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,19},t},
[59]={{24,25,26,27,28,29,31,32,34,35,39,41,59},t},
[63]={{24,25,26,27,28,29,31,32,34,35,39,41,30,56,58,23,62,63},t},
[34]={{24,25,26,27,28,29,31,32,34},t},
[21]={{24,25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,21},t},
[48]={{24,25,26,27,28,44,45,49,48},t},
[27]={{24,25,26,27},t},
[14]={n,f},
[31]={{24,25,26,27,28,29,31},t},
[56]={{24,25,26,27,28,29,31,32,34,35,39,41,30,56},t},
[29]={{24,25,26,27,28,29},t},
[13]={n,f},
[47]={{24,25,26,27,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{24,25,26,27,28,44,45},t},
[57]={{24,25,26,27,28,29,31,32,34,35,39,41,30,56,57},t},
[36]={{24,25,26,27,28,29,31,32,33,36},t},
[25]={{24,25},t},
[71]={{24,25,26,27,28,29,31,32,34,35,39,41,59,61,71},t},
[20]={{24,25,26,27,28,29,31,32,34,35,39,41,30,56,58,20},t},
[60]={{24,25,26,27,28,29,31,32,34,35,39,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{24,25,26,27,28,29,31,32,34,35,39,41,59,61,71,72,76,73,75},t},
[22]={{24,25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,21,22},t},
[74]={{24,25,26,27,28,29,31,32,34,35,39,41,59,61,71,72,76,73,74},t},
[62]={{24,25,26,27,28,29,31,32,34,35,39,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{24,25,26,27,28,29,31,32,33,36,37},t},
[2]={n,f},
[35]={{24,25,26,27,28,29,31,32,34,35},t},
[53]={{24,25,26,27,28,44,45,49,48,47,52,53},t},
[73]={{24,25,26,27,28,29,31,32,34,35,39,41,59,61,71,72,76,73},t},
[72]={{24,25,26,27,28,29,31,32,34,35,39,41,59,61,71,72},t},
[33]={{24,25,26,27,28,29,31,32,33},t},
[69]={{24,25,26,27,28,29,31,32,34,35,39,41,60,69},t},
[65]={{24,25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,65},t},
[26]={{24,25,26},t},
[68]={{24,25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67,68},t},
[76]={{24,25,26,27,28,29,31,32,34,35,39,41,59,61,71,72,76},t},
[50]={{24,25,26,27,28,44,45,49,48,47,50},t},
[66]={{24,25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{24},t},
[23]={{24,25,26,27,28,29,31,32,34,35,39,41,30,56,58,23},t},
[44]={{24,25,26,27,28,44},t},
[39]={{24,25,26,27,28,29,31,32,34,35,39},t},
[32]={{24,25,26,27,28,29,31,32},t},
[3]={n,f},
[30]={{24,25,26,27,28,29,31,32,34,35,39,41,30},t},
[51]={{24,25,26,27,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{24,25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67},t},
[61]={{24,25,26,27,28,29,31,32,34,35,39,41,59,61},t},
[55]={{24,25,26,27,28,44,45,49,48,47,52,53,54,55},t},
[46]={{24,25,26,27,28,44,45,49,48,47,46},t},
[42]={{24,25,26,27,28,29,31,32,34,35,38,42},t},
[40]={{24,25,26,27,28,29,31,32,34,35,40},t},
[52]={{24,25,26,27,28,44,45,49,48,47,52},t},
[54]={{24,25,26,27,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{24,25,26,27,28,29,31,32,34,35,39,41},t},
[17]={n,f},
[38]={{24,25,26,27,28,29,31,32,34,35,38},t},
[28]={{24,25,26,27,28},t},
[5]={n,f},
[64]={{24,25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64},t},
}
return r
--[[ @brief Sums all elements in a table.
     @param t A table of numbers.
     @return The total sum of all numbers in t.
--]]


function module.Sum(t, n)
	local sum = 0;
	if n then
		for i = 1, n do
			sum = sum + t[i>#t and #t or i] or 0;
		end
	else
		for i, v in pairs(t) do
			sum = sum + v;
		end
	end
	return sum;
end
--[[Weight and CG]]


Tune.Weight			= 3400		-- 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
--// # key, Yelp


mouse.KeyDown:connect(function(key)
	if key=="g" then 
		if veh.Lightbar.middle.Yelp2.IsPlaying == true then
			veh.Lightbar.middle.Wail2:Stop()
			veh.Lightbar.middle.Yelp2:Stop()
			veh.Lightbar.middle.Priority:Stop()
			script.Parent.Parent.Sirens.Yelp.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		else
			veh.Lightbar.middle.Wail2:Stop()
			veh.Lightbar.middle.Yelp2:Play()
			veh.Lightbar.middle.Priority:Stop()
			script.Parent.Parent.Sirens.Yelp.BackgroundColor3 = Color3.fromRGB(215, 135, 110)
			script.Parent.Parent.Sirens.Wail.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
			script.Parent.Parent.Sirens.Priority.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		end
	end
end)





mouse.KeyDown:connect(function(key)
	if key=="j" then 
		veh.Lightbar.middle.Beep:Play()
veh.Lightbar.RemoteEvent:FireServer(true)
	end
	end)

mouse.KeyDown:connect(function(key)
	if key=="k" then 
		veh.Lightbar.middle.Beep:Play()
		veh.Lightbar.DirectionalEvent:FireServer(true)
	end
end)
--------LEFT DOOR --------



game.Workspace.doorleft.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)

game.Workspace.doorleft.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.doorleft.l31.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)

game.Workspace.doorleft.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)

game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)