Roblox/luau_corpus huggingface dataset:
--[[Transmission]]
	Tune.Clutch			= true		-- Implements a realistic clutch, change to "false" for the chassis to act like AC6.81T.

	Tune.TransModes		= {"Auto","Semi","Manual"}												--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
	>First mode is default mode													]]
	
	Tune.ClutchMode		= "New"												--[[
	[Modes]
		"New"		: Speed controls clutch engagement			(AC6C V1.2)
		"Old"		: Speed and RPM control clutch engagement	(AC6C V1.1)		]]
	
	--Transmission Settings
	Tune.Stall			= true		-- Stalling, enables the car to stall. An ignition plugin would be necessary. Disables if Tune.Clutch is false.
	Tune.ClutchRel		= false		-- If true, the driver must let off the gas before shifting to a higher gear. Recommended false for beginners.
	Tune.ClutchEngage	= 25		-- How fast engagement is (0 = instant, 99 = super slow)	
	Tune.SpeedEngage 	= 15		-- Speed the clutch fully engages at (Based on SPS) 
	
	--Clutch: "Old" mode
	Tune.ClutchRPMMult	= 1.0		-- Clutch RPM multiplier, recommended to leave at 1.0
	
	--Automatic Settings
	Tune.AutoShiftMode	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM										]]	
	Tune.AutoShiftType	= "Rev"												--[[
	[Types]
		"Rev"		: Clutch engages fully once RPM reached			(AC6C V1)
		"DCT"		: Clutch engages after a set time has passed	(AC6.81T)	]]
	Tune.AutoShiftVers	= "New"												--[[
	[Versions]
		"New"		: Shift from Reverse, Neutral, and Drive		(AC6.81T)
		"Old"		: Auto shifts into R or D when stopped.			(AC6.52S2)	]]
	Tune.AutoUpThresh	= -200		-- Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		-- Automatic downshift point (relative to peak RPM, positive = Under-rev)
	
	--Automatic: Revmatching
	Tune.ShiftThrot		= 100		-- Throttle level when shifting down to revmatch, 0 - 100%
	
	--Automatic: DCT
	Tune.ShiftUpTime	= 0.25		-- Time required to shift into next gear, from a lower gear to a higher one.
	Tune.ShiftDnTime	= 0.125		-- Time required to shift into next gear, from a higher gear to a lower one.
	
	--Gear Ratios
	
	Tune.FinalDrive		= 4
	Tune.Ratios			= {
		--[[Reverse]]	5			,
		--[[Neutral]]	0			,
		--[[ 1 ]]		3.9			,
		--[[ 2 ]]		2.52		,
		--[[ 3 ]]		1.85		,
		--[[ 4 ]]		1.38		,
		--[[ 5 ]]		1.05		,
		--[[ 6 ]]		.87			,
		--[[ 7 ]]		.845		,
	}
	Tune.FDMult			= 1			-- Ratio multiplier (keep this at 1 if car is not struggling with torque)
--[[**
	ensures Roblox NumberRange type

	@param value The value to check against

	@returns True iff the condition is satisfied, false otherwise
**--]]
t.NumberRange = primitive("NumberRange")
-- Initialize lighting tool
local LightingTool = require(CoreTools.LightingTool)
Core.AssignHotkey('U', Core.Support.Call(Core.EquipTool, LightingTool));
Core.Dock.AddToolButton(Core.Assets.LightingIcon, 'U', LightingTool, 'LightingInfo');
--[[Weight and CG]]
	Tune.Weight			= 3439		-- Total weight (in pounds, under Earth's gravity)
	Tune.WeightBSize	= {			-- Size of weight brick, dimensions of your car in inches divided by 10
	 --[[Width]]		7.03	,
	 --[[Height]]		5.35	,
	 --[[Length]]		18.11	}
	Tune.WeightDist		= 55		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .8		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .1		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- Rear Wheel Density
	
	Tune.AxleSize		= 1.5		-- Size of structural members (larger = MORE STABLE / carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members

	Tune.CustomSuspensionDensity	= 0	-- Density of suspension joints, only applies to custom suspension
------------------------------------------------------------------------
-- count separators ("=") in a long string delimiter
-- * used by luaX:read_long_string
------------------------------------------------------------------------
function luaX:skip_sep(ls)
  local count = 0
  local s = ls.current
  -- lua_assert(s == "[" or s == "]")
  self:save_and_next(ls)
  while ls.current == "=" do
    self:save_and_next(ls)
    count = count + 1
  end
  return (ls.current == s) and count or (-count) - 1
end
--[[Transmission]]
	Tune.TransModes		= {"Auto", "Semi", "Manual"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
		>First mode is default mode													]]
	
	--Automatic Settings
	Tune.AutoShiftMode	= "RPM"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
	Tune.AutoUpThresh	= -200		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)
	
	--Gear Ratios
	Tune.FinalDrive		= 4.06			-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	3.70		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		3.53		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		2.04		,
		--[[ 3 ]]		1.38		,
		--[[ 4 ]]		1.03		,
		--[[ 5 ]]		0.81		,
		--[[ 6 ]]		0.64		,
	}
	Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
-- Make sure to add any characters that are currently in the game
-- to the collision group (otherwise the above event wouldn't catch
-- them
for _, player in ipairs(Players:GetPlayers()) do
	onPlayerAdded(player)
end
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------

function onSwimming(speed)
	if speed > 1.00 then
		local scale = 10.0
		playAnimation("swim", 0.4, Humanoid)
		setAnimationSpeed(speed / scale)
		pose = "Swimming"
	else
		playAnimation("swimidle", 0.4, Humanoid)
		pose = "Standing"
	end
end

function animateTool()
	if (toolAnim == "None") then
		playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
		return
	end

	if (toolAnim == "Slash") then
		playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
		return
	end

	if (toolAnim == "Lunge") then
		playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
		return
	end
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

local lastTick = 0

function stepAnimate(currentTime)
	local amplitude = 1
	local frequency = 1
  	local deltaTime = currentTime - lastTick
  	lastTick = currentTime

	local climbFudge = 0
	local setAngles = false

  	if (jumpAnimTime > 0) then
  		jumpAnimTime = jumpAnimTime - deltaTime
  	end

	if (pose == "FreeFall" and jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, Humanoid)
	elseif (pose == "Seated") then
		playAnimation("sit", 0.5, Humanoid)
		return
	elseif (pose == "Running") then
		playAnimation("walk", 0.2, Humanoid)
	elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
		stopAllAnimations()
		amplitude = 0.1
		frequency = 1
		setAngles = true
	end

	-- Tool Animation handling
	local tool = Character:FindFirstChildOfClass("Tool")
	if tool and tool:FindFirstChild("Handle") then
		local animStringValueObject = getToolAnim(tool)

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

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

		animateTool()		
	else
		stopToolAnimations()
		toolAnim = "None"
		toolAnimInstance = nil
		toolAnimTime = 0
	end
end
--[[Wheel Alignment]]
	--[Don't physically apply alignment to wheels]
	--[Values are in degrees]
	Tune.FCamber		= 0
	Tune.RCamber		= 0
	Tune.FCaster		= 0
	Tune.RCaster		= 0	--Will only work with 4WS enabled (Avxnturador)
	Tune.FToe			= 0	
	Tune.RToe			= 0
-- Returns the ancestor that contains a Humanoid, if it exists
local function FindCharacterAncestor(subject)
	if subject and subject ~= workspace then
		local humanoid = subject:FindFirstChildOfClass('Humanoid')
		if humanoid then
			return subject, humanoid
		else
			return FindCharacterAncestor(subject.Parent)
		end
	end
	return nil
end
--Returns the selected frame.
function ControllerGroups:GetSelectedFrame()
	return GuiService.SelectedObject
end
--[=[
	@within TableUtil
	@function Zip
	@param ... table
	@return (iter: (t: table, k: any) -> (key: any?, values: table?), tbl: table, startIndex: any?)

	Returns an iterator that can scan through multiple tables at the same time side-by-side, matching
	against shared keys/indices.

	```lua
	local t1 = {10, 20, 30, 40, 50}
	local t2 = {60, 70, 80, 90, 100}

	for key,values in TableUtil.Zip(t1, t2) do
		print(key, values)
	end

	--[[
		Outputs:
		1 {10, 60}
		2 {20, 70}
		3 {30, 80}
		4 {40, 90}
		5 {50, 100}
	--]]
	```
]=]
local function Zip(...: { [any]: any }): ((t: { any }, k: any) -> (any, any), { any }, any)
	assert(select("#", ...) > 0, "Must supply at least 1 table")
	local function ZipIteratorArray(all: { any }, k: number): (number?, { any }?)
		k += 1
		local values = {}
		for i, t in all do
			local v = t[k]
			if v ~= nil then
				values[i] = v
			else
				return nil, nil
			end
		end
		return k, values
	end
	local function ZipIteratorMap(all: { [any]: any }, k: any): (number?, { any }?)
		local values = {}
		for i, t in all do
			local v = next(t, k)
			if v ~= nil then
				values[i] = v
			else
				return nil, nil
			end
		end
		return k, values
	end
	local all = { ... }
	if #all[1] > 0 then
		return ZipIteratorArray, all, 0
	else
		return ZipIteratorMap, all, nil
	end
end
-----------------
--| Functions |--
-----------------

local function OnActivated()
	local myModel = MyPlayer.Character
	if Tool.Enabled and myModel and myModel:FindFirstChildOfClass("Humanoid") and myModel.Humanoid.Health > 0 then
		Tool.Enabled = false
		local Pos = MouseLoc:InvokeClient(MyPlayer)
		-- Create a clone of Rocket and set its color
		local rocketClone = Rocket:Clone()
		DebrisService:AddItem(rocketClone, 30)
		rocketClone.BrickColor = MyPlayer.TeamColor

		-- Position the rocket clone and launch!
		local spawnPosition = (ToolHandle.CFrame * CFrame.new(5, 0, 0)).p
		rocketClone.CFrame = CFrame.new(spawnPosition, Pos) --NOTE: This must be done before assigning Parent
		rocketClone.Velocity = rocketClone.CFrame.lookVector * ROCKET_SPEED --NOTE: This should be done before assigning Parent
		rocketClone.Parent = workspace
		rocketClone:SetNetworkOwner(nil)

		wait(RELOAD_TIME)

		Tool.Enabled = true
	end
end

function OnEquipped()
	MyPlayer = PlayersService:GetPlayerFromCharacter(Tool.Parent)
end
--[=[
	Disconnects all connections from a ScriptSignal object without making it unusable.

	```lua
	local connection = ScriptSignal:Connect(function() end)

	connection.Connected -> true
	ScriptSignal:DisconnectAll()
	connection.Connected -> false
	```

	@ignore
]=]
function ScriptSignal:DisconnectAll()
    local node: ScriptConnectionNode? = self._head
    while node ~= nil do
        local _connection = node._connection

        if _connection ~= nil then
            _connection.Connected = false
            _connection._node = nil
            node._connection = nil
        end

        node = node._next
    end

    self._head = nil
end
--///////////////////////// Constructors
--//////////////////////////////////////

function module.new()
	local obj = setmetatable({}, methods)

	obj.ObjectPool = moduleObjectPool.new(OBJECT_POOL_SIZE)
	obj.MessageCreators = GetMessageCreators()
	obj.DefaultCreatorType = messageCreatorUtil.DEFAULT_MESSAGE_CREATOR

	messageCreatorUtil:RegisterObjectPool(obj.ObjectPool)

	return obj
end

function module:GetStringTextBounds(text, font, textSize, sizeBounds)
	return messageCreatorUtil:GetStringTextBounds(text, font, textSize, sizeBounds)
end

return module
--[[
TheNexusAvenger

Creates buffer and non-buffer rockets.
--]]

local RocketCreator = {}

local Resources = require(script.Parent)

local RocketScript = script:WaitForChild("RocketScript")
local PlayerDamagerScript = Resources:GetResource("PlayerDamager")
local ConfigurationScript = Resources:GetResource("Configuration")
-- DRIVE LOOP
----------------------------------------
while true do

	-- Input values taken from the VehicleSeat
	local steerFloat = vehicleSeat.SteerFloat  -- Forward and backward direction, between -1 and 1
	local throttle = vehicleSeat.ThrottleFloat  -- Left and right direction, between -1 and 1

	-- Convert "steerFloat" to an angle for the HingeConstraint servos
	local turnAngle = steerFloat * MAX_TURN_ANGLE
	wheelHingeR.TargetAngle = turnAngle
	wheelHingeL.TargetAngle = turnAngle

	-- Apply torque to the CylindricalConstraint motors depending on our throttle input and the current speed of the car
	local currentVel = getAverageVelocity()
	local targetVel = 0
	local motorTorque = 0

	-- Idling
	if math.abs(throttle) < 0.1 then
		motorTorque = 100

	-- Accelerating
	elseif math.abs(throttle * currentVel) > 0 then
		-- Reduce torque with speed (if torque was constant, there would be a jerk reaching the target velocity)
		-- This also produces a reduction in speed when turning
		local r = math.abs(currentVel) / MAX_SPEED
		-- Torque should be more sensitive to input at low throttle than high, so square the "throttle" value
		motorTorque = math.exp( - 3 * r * r ) * TORQUE * throttle * throttle
		targetVel = math.sign(throttle) * 10000  -- Arbitrary large number

	-- Braking
	else
		motorTorque = BRAKING_TORQUE * throttle * throttle
	end

	-- Use helper functions to apply torque and target velocity to all motors
	setMotorTorque(motorTorque)
	setMotorVelocity(targetVel)
	wait()
end
-- ROBLOX TODO: spyOn is not implemented
-- local spyOn = JestMock.spyOn
-- exports.spyOn = spyOn
local mocked = JestMock.mocked
exports.mocked = mocked

return exports
-- 3D TextGen

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

CustomLabel = Config["CUSTOMFLOORLABEL"][tonumber(Btn.Name)]

function ChangeFloor(SF)
	if string.len(SF) == 1 then
		SetLabel(1,SF,-0.04)	
		SetLabel(2,"NIL",0)
	else
		SetLabel(1,SF:sub(1,1),0)	
		SetLabel(2,SF:sub(2,2),0)
	end
end


function SetLabel(ID,CHAR,OFFSET)
	if This:FindFirstChild("L"..ID) and Characters[CHAR] ~= nil then
		This["L"..ID].Mesh.Offset = Vector3.new(OFFSET, 0, 0)
		for i,l in pairs(Characters[CHAR]) do 
			This["L"..ID].Mesh.MeshId = "rbxassetid://"..l
		end
		This["L"..ID].Mesh.Scale = Vector3.new(0.006, 0.008, 0.019)
	end
end


if CustomLabel then
	ChangeFloor(CustomLabel)
else
	ChangeFloor(Btn.Name)
end

script:Destroy()
--[[**
	ensures Roblox NumberSequence type

	@param value The value to check against

	@returns True iff the condition is satisfied, false otherwise
**--]]
t.NumberSequence = primitive("NumberSequence")
---- ARITHMETIC ----

function ActiveCastStatic:AddVelocity(velocity: Vector3)
	assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("AddVelocity", "ActiveCast.new(...)"))
	assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
	self:SetVelocity(self:GetVelocity() + velocity)
end

function ActiveCastStatic:AddAcceleration(acceleration: Vector3)
	assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("AddAcceleration", "ActiveCast.new(...)"))
	assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
	self:SetAcceleration(self:GetAcceleration() + acceleration)
end

function ActiveCastStatic:AddPosition(position: Vector3)
	assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("AddPosition", "ActiveCast.new(...)"))
	assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
	self:SetPosition(self:GetPosition() + position)
end

function ActiveCastStatic:DbgVisualizeSegment(castStartCFrame: CFrame, castLength: number): ConeHandleAdornment?
	return DbgVisualizeSegment(castStartCFrame, castLength)
end

function ActiveCastStatic:DbgVisualizeHit(atCF: CFrame, wasPenetrated: boolean): SphereHandleAdornment?
	return DbgVisualizeHit(atCF, wasPenetrated)
end
-- Preload animations
function playAnimation(animName, transitionTime, humanoid)
	if (animName ~= currentAnim) then		 
		
		if (oldAnimTrack ~= nil) then
			oldAnimTrack:Stop()
			oldAnimTrack:Destroy()
		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
-- A table that defines an instance's properties, handlers and children.
export type PropertyTable = {[string | SpecialKey]: any}

return nil
--[[
	INPUT: Object character
	OUTPUT: Humanoid humanoid
--]]

return function(obj)
	if obj then
		for i, child in next, obj:GetChildren() do
			if child:IsA'Humanoid' then
				return child
			end
		end
	else
		return nil
	end
end
--									print("Distance from "..character.Name.." = "..distance)
									if distance <= 2*radius then
										torso.Velocity = (torso.Position - position).unit * 100;
										human:takeDamage(100-(distance-radius)*(100/radius))
										
										-- If player died
-- Public Functions
function WaypointController:TrackPlayer()
	if self.isPlayerMoving == false then
		self.isPlayerMoving = true
		self.waypointPath:MoveTo()
---Place this INSIDE the model. Don't replace the model name or anything.
------------------------------------------------------------------------------------------ 
object = script.Parent 
if (object ~= nil) and (object ~= game.Workspace) then 
model = object 

backup = model:clone() -- Make the backup 
waitTime = 65 --Time to wait between regenerations 
wait(math.random(0, waitTime)) 
while true do 
wait(waitTime) -- Regen wait time 

model:remove() 

wait(2.5) -- Display regen message for this amount of time 

model = backup:clone() 
model.Parent = game.Workspace 
model:makeJoints() 
message.Parent = nil 
end 
end
----------------------------------------
-- TEMP:  Implicit run should possibly be removed and done elsewhere as appropriate.
StageManager.run()
--[[**
	ensures value is a table and all keys pass valueCheck and all values are true

	@param valueCheck The function to use to check the values

	@returns A function that will return true iff the condition is passed
**--]]
function t.set(valueCheck)
	return t.map(valueCheck, t.literal(true))
end

do
	local arrayKeysCheck = t.keys(t.integer)
--ASIAN REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

function weldlol()
	local counts = {}
	local function scan(parent, topart)
		for _,v in pairs(parent:GetDescendants()) do
			if (v:IsA("BasePart")) then
				local weld = Instance.new("WeldConstraint")
				weld.Parent = v
				weld.Part0 = topart
				weld.Part1 = v
				v.Anchored = false
				table.insert(counts,v)
			end
			scan(v)
		end
	end
	scan(script.Parent.LightsPart, script.Parent.HPart)
	scan(script.Parent.LightsPart2, script.Parent.HPart2)
	for _,v in pairs(counts) do
	end
end

weldlol()
-- Setup animation objects
function scriptChildModified(child)
	local fileList = animNames[child.Name]
	if (fileList ~= nil) then
		configureAnimationSet(child.Name, fileList)
	end	
end

script.ChildAdded:connect(scriptChildModified)
script.ChildRemoved:connect(scriptChildModified)


for name, fileList in pairs(animNames) do 
	configureAnimationSet(name, fileList)
end
--		print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
		local anim = animTable[animName][idx].anim

		-- load it to the humanoid; get AnimationTrack
		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
--[[Misc]]
	Tune.LoadDelay		= .1		-- Delay before initializing chassis (in seconds)
	Tune.AutoStart		= true		-- Set to false if using manual ignition plugin
	Tune.AutoFlip		= true		-- Set to false if using manual flip plugin
--- Initialize required modules
local CollectionService: CollectionService = game:GetService("CollectionService")
local HitboxData = require(script.HitboxCaster)
local Signal = require(script.Signal)

local RaycastHitbox = {}
RaycastHitbox.__index = RaycastHitbox
RaycastHitbox.__type = "RaycastHitboxModule"
--// Bullet Physics
	BulletPhysics = Vector3.new(0,55,0); -- Drop fixation: Lower number = more drop
	BulletSpeed = 2000; -- Bullet Speed
	BulletSpread = 0; -- How much spread the bullet has
	
	ExploPhysics = Vector3.new(0,20,0); -- Drop for explosive rounds
	ExploSpeed = 600; -- Speed for explosive rounds
	
	BulletDecay = 10000; -- How far the bullet travels before slowing down and being deleted (BUGGY)
--[[
	Fired when state is left
]]
function Transitions.onLeaveWarmup(stateMachine, event, from, to)
	ServerWarmup.leave(stateMachine)
end
--[[Engine]]
	--Torque Curve
	Tune.Horsepower		= 300		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6000		--		Use sliders to manipulate values
	Tune.Redline		= 6700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 150		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)
--script.Parent.Parent.CameraMode="LockFirstPerson" --first person
local head = game.Workspace:findFirstChild(person.Name):findFirstChild("Head")
---Steering
function Steering()
	if _MSteer then
		local msWidth = math.max(1,mouse.ViewSizeX*_Tune.Peripherals.MSteerWidth/200)
		local mdZone = _Tune.Peripherals.MSteerDZone/100
		local mST = ((mouse.X-mouse.ViewSizeX/2)/msWidth)
		if math.abs(mST)<=mdZone then
			_GSteerT = 0
		else
			_GSteerT = (math.max(math.min((math.abs(mST)-mdZone),(1-mdZone)),0)/(1-mdZone))^_Tune.MSteerExp * (mST / math.abs(mST))
		end
	end
	if _GSteerC < _GSteerT then
		_GSteerC = math.min(_GSteerT,_GSteerC+_Tune.SteerSpeed)
	else
		_GSteerC = math.max(_GSteerT,_GSteerC-_Tune.SteerSpeed)
	end
	local sDecay = (1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-_Tune.MinSteer))
	for i,v in pairs(car.Wheels:GetChildren()) do
		if v.Name=="F" then
			v.Arm.Steer.cframe=car.Wheels.F.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
		elseif v.Name=="FL" then
			if _GSteerC>= 0 then
				v.Arm.Steer.cframe=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerOuter*sDecay),0)
			else
				v.Arm.Steer.cframe=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
			end
		elseif v.Name=="FR" then
			if _GSteerC>= 0 then
				v.Arm.Steer.cframe=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
			else
				v.Arm.Steer.cframe=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerOuter*sDecay),0)
			end
		end
	end
end