Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- functions



local function HandleCharacter(character)
	local player	= Players:GetPlayerFromCharacter(character)
	local playerData
	if player then
		playerData	= PLAYER_DATA:WaitForChild(player.Name)
	end
	
	if character then
		local humanoid	= character.Humanoid
		local armor		= humanoid.Armor
		local slots		= humanoid.ArmorSlots
		
		local lastSlots	= slots.Value
		
		armor.Changed:connect(function()
			local activeSlots	= math.ceil(armor.Value / SLOT_SIZE)
			slots.Value			= activeSlots
		end)
		
		slots.Changed:connect(function()
			if slots.Value > lastSlots then
				REMOTES.Effect:FireAllClients("Booster", character, "Armor")
			elseif slots.Value < lastSlots then
				REMOTES.Effect:FireAllClients("Shatter", character, "Armor")
			end
			
			lastSlots	= slots.Value
			
			-- remove old armor
			character.Armor:ClearAllChildren()
			
			if slots.Value > 0 then
				local armor	= CUSTOMIZATION.Armors.Default
				if playerData then
					if CUSTOMIZATION.Armors:FindFirstChild(playerData.Equipped.Armor.Value) then
						armor	= CUSTOMIZATION.Armors[playerData.Equipped.Armor.Value]
					end
				end
				local armor	= armor["Tier" .. tostring(slots.Value)]:Clone()
				
				local primary	= armor.PrimaryPart
				local attach	= character[primary.Name]
				
				for _, v in pairs(armor:GetChildren()) do
					if v:IsA("BasePart") and v ~= primary then
						v.CanCollide	= false
						v.Massless		= true
						
						local offset	= primary.CFrame:toObjectSpace(v.CFrame)
						
						local weld	= Instance.new("Weld")
							weld.Part0	= attach
							weld.Part1	= v
							weld.C0		= offset
							weld.Parent	= v
							
						v.Anchored	= false
					end
				end
				
				primary:Destroy()
					
				armor.Parent	= character.Armor
			end
		end)
	end
end

local function HandlePlayer(player)
	player.CharacterAdded:connect(HandleCharacter)
	
	HandleCharacter(player.Character)
end

local function AddArmor(character, amount)
	local armor	= character.Humanoid.Armor
	local slots	= character.Humanoid.ArmorSlots
	
	if armor.Value < MAX_SLOTS * SLOT_SIZE then
		slots.Value	= math.min(slots.Value + amount, MAX_SLOTS)
		armor.Value	= math.min(armor.Value + amount * SLOT_SIZE, MAX_SLOTS * SLOT_SIZE)
		
		return true
	end
	
	return false
end

local function Boost(character, amount)
	local humanoid	= character.Humanoid
	local armor		= humanoid.Armor
	local slots		= humanoid.ArmorSlots
	
	local maxArmor	= slots.Value * SLOT_SIZE
	
	armor.Value		= math.min(armor.Value + amount * SLOT_SIZE, maxArmor)
end
--[[ Public API ]]

--
function TouchJump:Enable()
	ExternallyEnabled = true
	enableButton()
end

function TouchJump:Disable()
	ExternallyEnabled = false
	disableButton()
end

function TouchJump:Create(parentFrame)
	if JumpButton then
		JumpButton:Destroy()
		JumpButton = nil
	end
	
	local minAxis = math.min(parentFrame.AbsoluteSize.x, parentFrame.AbsoluteSize.y)
	local isSmallScreen = minAxis <= 500
	local jumpButtonSize = isSmallScreen and 70 or 120
	
	JumpButton = Instance.new('ImageButton')
	JumpButton.Name = "JumpButton"
	JumpButton.Visible = false
	JumpButton.BackgroundTransparency = 1
	JumpButton.Image = TOUCH_CONTROL_SHEET
	JumpButton.ImageRectOffset = Vector2.new(176, 222)
	JumpButton.ImageRectSize = Vector2.new(174, 174)
	JumpButton.Size = UDim2.new(0, jumpButtonSize, 0, jumpButtonSize)

    JumpButton.Position = isSmallScreen and UDim2.new(1, -(jumpButtonSize*1.5-10), 1, -jumpButtonSize - 20) or
        UDim2.new(1, -(jumpButtonSize*1.5-10), 1, -jumpButtonSize * 1.75)
	
	local touchObject = nil	
	JumpButton.InputBegan:connect(function(inputObject)
		--A touch that starts elsewhere on the screen will be sent to a frame's InputBegan event
		--if it moves over the frame. So we check that this is actually a new touch (inputObject.UserInputState ~= Enum.UserInputState.Begin)
		if touchObject or inputObject.UserInputType ~= Enum.UserInputType.Touch
			or inputObject.UserInputState ~= Enum.UserInputState.Begin then
			return
		end
		
		touchObject = inputObject
		JumpButton.ImageRectOffset = Vector2.new(0, 222)
		MasterControl:SetIsJumping(true)
	end)
	
	OnInputEnded = function()
		touchObject = nil
		MasterControl:SetIsJumping(false)
		JumpButton.ImageRectOffset = Vector2.new(176, 222)
	end
	
	JumpButton.InputEnded:connect(function(inputObject)
		if inputObject == touchObject then
			OnInputEnded()
		end
	end)
	
	GuiService.MenuOpened:connect(function()
		if touchObject then
			OnInputEnded()
		end
	end)
	
	if not CharacterAddedConnection then
		setupCharacterAddedFunction()
	end
	
	JumpButton.Parent = parentFrame
end

return TouchJump
------------------------------------------------------------------------
--
-- * used in luaK:goiftrue(), luaK:goiffalse()
------------------------------------------------------------------------


function luaK:jumponcond(fs, e, cond)
  if e.k == "VRELOCABLE" then
    local ie = self:getcode(fs, e)
    if luaP:GET_OPCODE(ie) == "OP_NOT" then
      fs.pc = fs.pc - 1  -- remove previous OP_NOT
      return self:condjump(fs, "OP_TEST", luaP:GETARG_B(ie), 0, cond and 0 or 1)
    end
    -- else go through
  end
  self:discharge2anyreg(fs, e)
  self:freeexp(fs, e)
  return self:condjump(fs, "OP_TESTSET", luaP.NO_REG, e.info, cond and 1 or 0)
end
--[[Susupension]]


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

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

	--Aesthetics	
	Tune.SusVisible		= false			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Bright red"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--AfterHeal = Humanoid.Health + Heal


BeamTween = TAnim(BeamTweenValue, {Value = 0.3}, 0.8, "Quad", "InOut", math.huge, true, 0)

Dead = false

Died = Humanoid.Died:Connect(function()
	BeamTween:Cancel()
	Dead = true
end)

Creator.Changed:Connect(function()
	if not Creator or not Creator.Parent then
		BeamTween:Cancel()
		Dead = true
	end
end)

CreatorHumanoid.Died:Connect(function()
	BeamTween:Cancel()
	Dead = true
end)

TAnim(HealSound, {Volume = 0.3}, 0.4, "Quart", "InOut", 0, false, 0)
for i = 1, 40 do
	if Dead then
		break
	else
		Humanoid.Health = Humanoid.Health + (Heal / 30)
	end
	SWait(0.1)
end
if Died then
	Died:Disconnect()
end
HealParticle.Enabled = false
HealCross.Enabled = false
Del = TAnim(HealSound, {Volume = 0}, 0.4, "Quart", "InOut", 0, false, 0)
spawn(function()
	Del.Completed:Wait()
	HealSound:Stop()
end)
BeamTween:Cancel()
BeamTween = TAnim(BeamTweenValue, {Value = 1}, 0.5, "Quad", "InOut", 0, false, 0)
Debris:AddItem(TargetTorsoAtt, 5)
Debris:AddItem(HealBeam, 5)
Debris:AddItem(HealSound, 5)

SWait(5)
script:Destroy()
--Script


feedbackMain.CharactersLeft.Text = maxCharacters - #feedbackMain.InputBox.Input.Text
feedbackMain.InputBox.Input.Changed:Connect(function()
	feedbackMain.CharactersLeft.Text = maxCharacters - #feedbackMain.InputBox.Input.Text
	if maxCharacters - #feedbackMain.InputBox.Input.Text < 0 then
		feedbackMain.CharactersLeft.TextColor3 = Color3.fromRGB(255,50,50)
		feedbackMain.SendButton.Style = Enum.ButtonStyle.RobloxRoundButton
	else
		feedbackMain.CharactersLeft.TextColor3 = Color3.fromRGB(255,255,255)
		feedbackMain.SendButton.Style = Enum.ButtonStyle.RobloxRoundDefaultButton
	end
end)

local db = false
feedbackMain.SendButton.MouseButton1Click:Connect(function()
	if not db and maxCharacters - #feedbackMain.InputBox.Input.Text >= 0 then
		db = true
		local msg = feedbackMain.InputBox.Input.Text
		if msg == "Type feedback/bug report here" then
			db = false
			return
		end
		feedbackMain.InputBox.Input.Text = "Sending Message..."
		local response = game.ReplicatedStorage.FilteringFunction:InvokeServer(msg)
		feedbackMain.InputBox.Input.Text = response
		wait(5)
		if feedbackMain.InputBox.Input.Text == response then
			feedbackMain.InputBox.Input.Text = "Type feedback/bug report here"
		end
		db = false
	end
end)

script.Parent.Button.MouseButton1Click:Connect(function()
	open = not open
	if open then
		feedbackMain:TweenPosition(UDim2.new(1,-300,1,-300),"Out","Quint",0.3,true)
	else
		feedbackMain:TweenPosition(UDim2.new(1,100,1,-300),"Out","Quint",0.3,true)
	end
end)
--[[Steering]]


Tune.SteerInner		= 36		-- Inner wheel steering angle (in degrees)
Tune.SteerOuter		= 37		-- Outer wheel steering angle (in degrees)
Tune.SteerSpeed		= .05		-- Steering increment per tick (in degrees)
Tune.ReturnSpeed	= .1		-- Steering increment per tick (in degrees)
Tune.SteerDecay		= 320		-- Speed of gradient cutoff (in SPS)
Tune.MinSteer		= 10		-- Minimum steering at max steer decay (in percent)
Tune.MSteerExp		= 1			-- Mouse steering exponential degree
--- Registers a command based purely on its definition.
-- Prefer using Registry:RegisterCommand for proper handling of server/client model.


function Registry:RegisterCommandObject (commandObject, fromCmdr)
	for key in pairs(commandObject) do
		if self.CommandMethods[key] == nil then
			error("Unknown key/method in command " .. (commandObject.Name or "unknown command") .. ": " .. key)
		end
	end

	if commandObject.Args then
		for i, arg in pairs(commandObject.Args) do
			if type(arg) == "table" then
				for key in pairs(arg) do
					if self.CommandArgProps[key] == nil then
						error(('Unknown property in command "%s" argument #%d: %s'):format(commandObject.Name or "unknown", i, key))
					end
				end
			end
		end
	end

	if commandObject.AutoExec and RunService:IsClient() then
		table.insert(self.AutoExecBuffer, commandObject.AutoExec)
		self:FlushAutoExecBufferDeferred()
	end

	-- Unregister the old command if it exists...
	local oldCommand = self.Commands[commandObject.Name:lower()]
	if oldCommand and oldCommand.Aliases then
		for _, alias in pairs(oldCommand.Aliases) do
			self.Commands[alias:lower()] = nil
		end
	elseif not oldCommand then
		table.insert(self.CommandsArray, commandObject)
	end

	self.Commands[commandObject.Name:lower()] = commandObject

	if commandObject.Aliases then
		for _, alias in pairs(commandObject.Aliases) do
			self.Commands[alias:lower()] = commandObject
		end
	end
end
--[=[
	Requires all the modules that are children of the given parent. This is an easy
	way to quickly load all services that might be in a folder.
	```lua
	Knit.AddServices(somewhere.Services)
	```
]=]


function KnitServer.AddServices(parent: Instance): {Service}
	local addedServices = {}
	for _,v in ipairs(parent:GetChildren()) do
		if not v:IsA("ModuleScript") then continue end
		table.insert(addedServices, require(v))
	end
	return addedServices
end
--[[
	
	CameraShakePresets.Bump
	CameraShakePresets.Explosion
	CameraShakePresets.Earthquake
	CameraShakePresets.BadTrip
	CameraShakePresets.HandheldCamera
	CameraShakePresets.Vibration
	CameraShakePresets.RoughDriving
	
--]]





local CameraShakeInstance = require(script.Parent.CameraShakeInstance)

local CameraShakePresets = {
	
	
	-- A high-magnitude, short, yet smooth shake.
	-- Should happen once.
	Bump = function()
		local c = CameraShakeInstance.new(2.5, 4, 0.1, 0.75)
		c.PositionInfluence = Vector3.new(0.15, 0.15, 0.15)
		c.RotationInfluence = Vector3.new(1, 1, 1)
		return c
	end;
	
	
	-- An intense and rough shake.
	-- Should happen once.
	Explosion = function()
		local c = CameraShakeInstance.new(5, 10, 0, 1.5)
		c.PositionInfluence = Vector3.new(0.25, 0.25, 0.25)
		c.RotationInfluence = Vector3.new(4, 1, 1)
		return c
	end;
	
	
	-- A continuous, rough shake
	-- Sustained.
	Earthquake = function()
		local c = CameraShakeInstance.new(0.6, 3.5, 2, 10)
		c.PositionInfluence = Vector3.new(0.25, 0.25, 0.25)
		c.RotationInfluence = Vector3.new(1, 1, 4)
		return c
	end;
	
	
	-- A bizarre shake with a very high magnitude and low roughness.
	-- Sustained.
	BadTrip = function()
		local c = CameraShakeInstance.new(10, 0.15, 5, 10)
		c.PositionInfluence = Vector3.new(0, 0, 0.15)
		c.RotationInfluence = Vector3.new(2, 1, 4)
		return c
	end;
	
	
	-- A subtle, slow shake.
	-- Sustained.
	HandheldCamera = function()
		local c = CameraShakeInstance.new(.5, 1, 4, 4)
		c.PositionInfluence = Vector3.new(2,0,0)
		c.RotationInfluence = Vector3.new(1.25,0,0)
		return c
	end;
	
	
	-- A very rough, yet low magnitude shake.
	-- Sustained.
	Vibration = function()
		local c = CameraShakeInstance.new(0.4, 20, 2, 2)
		c.PositionInfluence = Vector3.new(0, 0.15, 0)
		c.RotationInfluence = Vector3.new(1.25, 0, 4)
		return c
	end;
	
	
	-- A slightly rough, medium magnitude shake.
	-- Sustained.
	RoughDriving = function()
		local c = CameraShakeInstance.new(1, 2, 1, 1)
		c.PositionInfluence = Vector3.new(0, 0, 0)
		c.RotationInfluence = Vector3.new(1, 1, 1)
		return c
	end;
	
	
}


return setmetatable({}, {
	__index = function(t, i)
		local f = CameraShakePresets[i]
		if (type(f) == "function") then
			return f()
		end
		error("No preset found with index \"" .. i .. "\"")
	end;
})
----------do not edit anything below this line


local function createMessageOnClient(msg)
	game.StarterGui:SetCore("ChatMakeSystemMessage", {
		Text = msg;
		Font = Enum.Font.Arcade;
		Color = sm;
		FontSize = Enum.FontSize.Size18;
	})
end

if welcomeMessageOn then
	createMessageOnClient(welcomeMessage)
end

if displayJoinMessage then
	createMessageOnClient(game:GetService("Players").LocalPlayer.Name..joinMessage)
	game:GetService('Players').PlayerAdded:Connect(function(plr)
		createMessageOnClient(plr.Name..joinMessage)
	end)
end

if displayLeaveMessage then
	game:GetService('Players').PlayerRemoving:Connect(function(plr)
		createMessageOnClient(plr.Name..leftMessage)
	end)
end
--Remove Existing Mass


function DReduce(p)
	for i,v in pairs(p:GetChildren())do
		if v:IsA("BasePart") then
			if v.CustomPhysicalProperties == nil then v.CustomPhysicalProperties = PhysicalProperties.new(v.Material) end
			v.CustomPhysicalProperties = PhysicalProperties.new(
				0,
				v.CustomPhysicalProperties.Friction,
				v.CustomPhysicalProperties.Elasticity,
				v.CustomPhysicalProperties.FrictionWeight,
				v.CustomPhysicalProperties.ElasticityWeight
			)
		end
		DReduce(v)
	end
end
DReduce(bike)
-- Adjust the movement of the firefly, allowing them to roam around.



local Fly = script.Parent

while true do -- Alter the flies movement direction every once a while to make it roam around
	Fly.BodyVelocity.velocity = Vector3.new(math.random(-20,20)*0.1,math.random(-20,20)*0.1,math.random(-20,20)*0.1)
	wait(math.random(10,25)*0.1)
end
--// Holstering


	HolsteringEnabled = false;
	HolsterPos = CFrame.new(0.140751064, 0, -0.616261482, -4.10752676e-08, -0.342020065, 0.939692616, -1.49501727e-08, 0.939692557, 0.342020094, -0.99999994, 0, -4.37113847e-08);

	}

return Settings
-- Edit stuff here



DATA_STORE 		= "TopCoins" --< Name of the Data store values will be saved in

SCORE_UPDATE 	= 30 --< How often you want the leaderboards to update in seconds (no less than 30)

PLAYER_UPDATE 	= 30 --< How often you want the player's current stat to save in seconds (no less than 30)

PLAYER_SAVE 	= "leaderstats" --< Do not change unless you are using something that is not leaderstats

NAME_OF_STAT 	= "Coins" --< Name of the stat you want to save (HAS to be inside 'leaderstats' or whatever PLAYER_SAVE is)
-- Tween



local tween = game:GetService("TweenService")
local info = TweenInfo.new(
	3,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)

local abrindo = {
	CFrame = cf1.CFrame
}

local fechando = {
    CFrame = doorpos
}

local create1 = tween:Create(portao,info,abrindo)
local create2 = tween:Create(portao,info,fechando)
--[[Steering]]



	function Steering()
		--Mouse Steer
		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
		
		--Interpolate Steering
		if _GSteerC < _GSteerT then
			if _GSteerC<0 then
				_GSteerC = math.min(_GSteerT,_GSteerC+_Tune.ReturnSpeed)
			else
				_GSteerC = math.min(_GSteerT,_GSteerC+_Tune.SteerSpeed)
			end
		else
			if _GSteerC>0 then
				_GSteerC = math.max(_GSteerT,_GSteerC-_Tune.ReturnSpeed)
			else
				_GSteerC = math.max(_GSteerT,_GSteerC-_Tune.SteerSpeed)
			end
		end
		
		--Steer Decay Multiplier
		local sDecay = (1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
		
		--Apply Steering
		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
--------------------------------------------------------------------------------------
--------------------[ PRE-CONNECTIONS ]-----------------------------------------------
--------------------------------------------------------------------------------------


		
RS:connect(function()
	local Forward = (Keys["w"] or Keys[string.char(17)])
	local Backward = (Keys["s"] or Keys[string.char(18)])
	local Right = (Keys["d"] or Keys[string.char(19)])
	local Left = (Keys["a"] or Keys[string.char(20)])
	
	if (Forward or Backward or Right or Left) then
		Walking, Idleing = true, false
	elseif (not (Forward and Backward and Right and Left)) then
		Walking, Idleing = false, true
	end
end)

M2.KeyDown:connect(function(Key) Keys[Key] = true end)
M2.KeyUp:connect(function(Key) Keys[Key] = false end)
------------------------------------------------------------------


local AimingCursor = "http://www.roblox.com/asset/?id=107455536"
local LockedCursor = "http://www.roblox.com/asset/?id=107455986"
local TargetCursor = "http://www.roblox.com/asset/?id=107455960"
local NormalCursor = "http://www.roblox.com/asset/?id=116176885"
--[[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	= "Speed"												--[[
	[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		= 3.92			-- 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.6			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
-- #endif
--]]


        f.is_vararg = f.is_vararg + self.VARARG_ISVARARG
      else
        luaX:syntaxerror(ls, "<name> or "..self:LUA_QL("...").." expected")
      end
    until f.is_vararg ~= 0 or not self:testnext(ls, ",")
  end--if
  self:adjustlocalvars(ls, nparams)
  -- NOTE: the following works only when HASARG_MASK is 2!
  f.numparams = fs.nactvar - (f.is_vararg % self.HASARG_MASK)
  luaK:reserveregs(fs, fs.nactvar)  -- reserve register for parameters
end
--[=[
	@within Touch
	@prop TouchTapInWorld Signal<(position: Vector2, processed: boolean)>
	@tag Event
	Proxy for [UserInputService.TouchTapInWorld](https://developer.roblox.com/en-us/api-reference/event/UserInputService/TouchTapInWorld).
]=]
--[=[
	@within Touch
	@prop TouchPan Signal<(touchPositions: {Vector2}, totalTranslation: Vector2, velocity: Vector2, state: Enum.UserInputState, processed: boolean)>
	@tag Event
	Proxy for [UserInputService.TouchPan](https://developer.roblox.com/en-us/api-reference/event/UserInputService/TouchPan).
]=]
--[=[
	@within Touch
	@prop TouchPinch Signal<(touchPositions: {Vector2}, scale: number, velocity: Vector2, state: Enum.UserInputState, processed: boolean)>
	@tag Event
	Proxy for [UserInputService.TouchPinch](https://developer.roblox.com/en-us/api-reference/event/UserInputService/TouchPinch).
]=]
-- This script gets placed into StarterPlayerScripts where it will locally play the background music for each player.



local plr = game.Players.LocalPlayer
local char
local torso

local container = game.ReplicatedStorage:WaitForChild("CinderingBGM")
local settings = require(container:WaitForChild("Settings"))
local musicfolder = container:WaitForChild("MusicFolder")
local globalfolder = musicfolder:WaitForChild("GlobalMusic")
local zonesfolder = musicfolder:WaitForChild("MusicZones")
local servercount = container:WaitForChild("ObjectCount").Value

function GetMatchingCount() --objects can take some time to actually replicate to the client. make sure that the client sees the correct # of objects in the music folder before initializing the rest of the script
	local count = 0
	local function recurse(instance)
		for _,v in pairs(instance:GetChildren()) do
			count = count + 1
			recurse(v)
		end
	end
	recurse(musicfolder)
	if count == servercount then return true end
end

while not GetMatchingCount() do
	wait(.5)
end


function IsCleanRotation(v3values) --check to see whether the rotation is at clean 90 degree increments so we can use the more simplistic calculations for it
	for _,v in pairs(v3values) do
		if not (v%90 <= 0.01 or v%90 >= 89.99) then --why not just check for (v%90 == 0)? because rotations can suffer from floating point inaccuracies
			return false
		end
	end
	return true
end