Roblox/luau_corpus huggingface dataset:
---------------------------------------------------------------------------------------------------------------
-- Do not edit past here or you will be risking breaking the script!!!! --
---------------------------------------------------------------------------------------------------------------

	-- VERY UGLY HACK
	-- Will this leak threads?
	-- Is the problem even what I think it is (player arrived before character)?

	while true do
		if newPlayer.Character ~= nil then break end
		wait(5)
	end

	local humanoid = newPlayer.Character.Humanoid

	humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )

	-- start to listen for new humanoid
	newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )


	stats.Parent = newPlayer

end

function Send_DB_Event_Died(victim, killer)
	-- killer may be nil
	local killername = "unknown"
	if killer ~= nil then killername = killer.Name end
	print(victim.Name, " was killed by ", killername)

	if shared["deaths"] ~= nil then 
		shared["deaths"](victim, killer)
		print("Death event sent.")
	end
end

function Send_DB_Event_Kill(killer, victim)
	print(killer.Name, " killed ", victim.Name)
	if shared["kills"] ~= nil then 
		shared["kills"](killer, victim)
		print("Kill event sent.")
	end
end



function onHumanoidDied(humanoid, player)
	local stats = player:findFirstChild("leaderstats")
	if stats ~= nil then
		local deaths = stats:findFirstChild("Deaths")
		deaths.Value = deaths.Value + 1

		-- do short dance to try and find the killer

		local killer = getKillerOfHumanoidIfStillInGame(humanoid)


		Send_DB_Event_Died(player, killer)
		handleKillCount(humanoid, player)
	end
end

function onPlayerRespawn(property, player)
	-- need to connect to new humanoid
	
	if property == "Character" and player.Character ~= nil then
		local humanoid = player.Character.Humanoid
			local p = player
			local h = humanoid
			humanoid.Died:connect(function() onHumanoidDied(h, p) end )
	end
end

function getKillerOfHumanoidIfStillInGame(humanoid)
	-- returns the player object that killed this humanoid
	-- returns nil if the killer is no longer in the game

	-- check for kill tag on humanoid - may be more than one - todo: deal with this
	local tag = humanoid:findFirstChild("creator")

	-- find player with name on tag
	if tag ~= nil then
		
		local killer = tag.Value
		if killer.Parent ~= nil then -- killer still in game
			return killer
		end
	end

	return nil
end

function handleKillCount(humanoid, player)
	local killer = getKillerOfHumanoidIfStillInGame(humanoid)
	if killer ~= nil then
		local stats = killer:findFirstChild("leaderstats")
		if stats ~= nil then
			local kills = stats:findFirstChild("Kills")
		   local cash = stats:findFirstChild("Money")
         local xp = stats:findFirstChild("XP")
			if killer ~= player then
				kills.Value = kills.Value + 1
            cash.Value = cash.Value + 50
            xp.Value = xp.Value + 3
				
			else
				kills.Value = kills.Value - 0
				
			end
			Send_DB_Event_Kill(killer, player)
		end
	end
end

game.Players.ChildAdded:connect(onPlayerEntered)
--- Cleans up all tasks.
-- @alias Destroy
function Maid:DoCleaning()
	local tasks = self._tasks

	-- Disconnect all events first as we know this is safe
	for index, task in pairs(tasks) do
		if (typeof(task) == "RBXScriptConnection") then
			tasks[index] = nil
			task:Disconnect()
		end
	end

	-- Clear out tasks table completely, even if clean up tasks add more tasks to the maid
	local index, task = next(tasks)
	while (task ~= nil) do
		tasks[index] = nil
		if (type(task) == "function") then
			task()
		elseif (typeof(task) == "RBXScriptConnection") then
			task:Disconnect()
		elseif (task.Destroy) then
			task:Destroy()
		end
		index, task = next(tasks)
	end
end


function Maid:Init()
	Promise = self.Shared.Promise
end
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
print 'Creating a Source of Audio'
local music = Instance.new("Sound") -- This creates the sound. Since this is an Independent Variable, You should not change it at all.
music.Archivable = true -- This MUST be true or you may have some problems.
print 'Inspecting the Configurable Variables'
-- enumName, enumValue, additionalProperty
return {
	{"Automatic", 1}, -- ZonePlus will dynamically switch between 'WholeBody' and 'Centre' depending upon the number of players in a server (this typically only occurs for servers with 100+ players when volume checks begin to exceed 0.5% in script performance).
	{"Centre", 2}, -- A tiny lightweight Region3 check will be casted at the centre of the player of part
	{"WholeBody", 3}, -- A RotatedRegion3 check will be casted over a player or parts entire body
}
-- Wait until the PlayerGui has loaded
while not player.PlayerGui do
	wait()
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	= "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.9			-- 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		,
		--[[ 7 ]]		0.50		,
	}
	Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--		debug.profilebegin("COLOR3_LERP_START")
		local L0, U0, V0
		local R0, G0, B0 = C0.R, C0.G, C0.B
		R0 = R0 < 0.0404482362771076 and R0 / 12.92 or 0.87941546140213 * (R0 + 0.055) ^ 2.4
		G0 = G0 < 0.0404482362771076 and G0 / 12.92 or 0.87941546140213 * (G0 + 0.055) ^ 2.4
		B0 = B0 < 0.0404482362771076 and B0 / 12.92 or 0.87941546140213 * (B0 + 0.055) ^ 2.4

		local Y0 = 0.2125862307855956 * R0 + 0.71517030370341085 * G0 + 0.0722004986433362 * B0
		local Z0 = 3.6590806972265883 * R0 + 11.4426895800574232 * G0 + 4.1149915024264843 * B0
		local _L0 = Y0 > 0.008856451679035631 and 116 * Y0 ^ (1 / 3) - 16 or 903.296296296296 * Y0

		if Z0 > 1E-15 then
			local X = 0.9257063972951867 * R0 - 0.8333736323779866 * G0 - 0.09209820666085898 * B0
			L0, U0, V0 = _L0, _L0 * X / Z0, _L0 * (9 * Y0 / Z0 - 0.46832)
		else
			L0, U0, V0 = _L0, -0.19783 * _L0, -0.46832 * _L0
		end

		local L1, U1, V1
		local R1, G1, B1 = C1.R, C1.G, C1.B
		R1 = R1 < 0.0404482362771076 and R1 / 12.92 or 0.87941546140213 * (R1 + 0.055) ^ 2.4
		G1 = G1 < 0.0404482362771076 and G1 / 12.92 or 0.87941546140213 * (G1 + 0.055) ^ 2.4
		B1 = B1 < 0.0404482362771076 and B1 / 12.92 or 0.87941546140213 * (B1 + 0.055) ^ 2.4

		local Y1 = 0.2125862307855956 * R1 + 0.71517030370341085 * G1 + 0.0722004986433362 * B1
		local Z1 = 3.6590806972265883 * R1 + 11.4426895800574232 * G1 + 4.1149915024264843 * B1
		local _L1 = Y1 > 0.008856451679035631 and 116 * Y1 ^ (1 / 3) - 16 or 903.296296296296 * Y1

		if Z1 > 1E-15 then
			local X = 0.9257063972951867 * R1 - 0.8333736323779866 * G1 - 0.09209820666085898 * B1
			L1, U1, V1 = _L1, _L1 * X / Z1, _L1 * (9 * Y1 / Z1 - 0.46832)
		else
			L1, U1, V1 = _L1, -0.19783 * _L1, -0.46832 * _L1
		end
-- EASING FUNCTIONS --
local function quadIn(t,b,c,d) t=t/d; return c*t*t+b; end;
local function quadOut(t,b,c,d) t=t/d; return -c*t*(t-2)+b; end;
local function Quad(obj,val,ease,d)
	local t,f,con,nt,st,sd=tick()
	Tweens[obj]=t -- Set identifier
	st=obj.Size.Y.Scale -- Start Value
	sd=val-st -- Change in Value
	f=ease=='In' and quadIn or quadOut -- Choose between Out/In
	con = game:GetService'RunService'.RenderStepped:connect(function() nt=tick()-t
		if Tweens[obj]~=t then -- Check for override
			con:disconnect()
			return
		end
		local nv=math.max(.05,f(math.min(d,nt),st,sd,d)) -- New Value
		obj.Size = UDim2.new(0.1,-3,nv,0)
		obj.BackgroundColor3=Color3.new(.7,.3,1):lerp(Color3.new(.3,1,.7),nv/Height)
		if nt>d then -- Easing done?
			con:disconnect()
			if ease~='In' then
				Quad(obj,.05,'In',.3) -- Drop the bar
			end
		end
	end)
end
----  \/TakeDown\/
model = script.Parent
wait(0.5)
currentP = "Off"
script.Parent.Events.TakeDown.OnServerEvent:Connect( function(player, pattern)
	if script.Parent.Values.TakeDown.Value == true then
		script.Parent.Values.TakeDown.Value = false
	else
		script.Parent.Values.TakeDown.Value = true
	end
end)
--Weld stuff here


car.DriveSeat.ChildAdded:connect(function(child)
	if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		if child.Part1.Parent:FindFirstChild("Humanoid").RigType == Enum.HumanoidRigType.R15 then
			child.C0=CFrame.new(-.1,-.3,-.1)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(5),0,0)
		else
			child.C0=CFrame.new(0,-.4,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)
		end
	end
end)
--You can change the values below to suit your needs

local max_mode = 10 --The maximum amount of modes forwards. Set to 0 to disable forwards motion.

local min_mode = 0 --The minimum amount of modes backwards. Set to 0 to disable backwards motion.

local increment_speed = 0.1 --The amount in which the speed value increments with every mode.
-- Player Stats
local stats = player:WaitForChild("stats")
local totalPoints = stats:WaitForChild("Total"..GameSettings.pointsName)
---[[ Fade Out and In Settings ]]
module.ChatWindowBackgroundFadeOutTime = 3.5 --Chat background will fade out after this many seconds.
module.ChatWindowTextFadeOutTime = 30 --Chat text will fade out after this many seconds.
module.ChatDefaultFadeDuration = 0.8
module.ChatShouldFadeInFromNewInformation = false
module.ChatAnimationFPS = 40.0
--"False" = Not Acceptable Keycard To Open. "True" = Acceptable Keycard To Open.--

local door = script.Parent
local CanOpen1 = true
local CanClose1 = false
local clearance = {
	["[SCP] Card-Omni"] = true, 
	["[SCP] Card-L5"] = true, 
	["[SCP] Card-L4"] = true,
	["[SCP] Card-L3"] = true,
	["[SCP] Card-L2"] = false,
	["[SCP] Card-L1"] = false
}
						
						--DO NOT EDIT PAST THIS LINE--
function openDoor()
	for i = 3,(door.Size.z / 0.15) do
		wait()
		door.CFrame = door.CFrame - (door.CFrame.lookVector * 0.15)
	end
end

function closeDoor()
	for i = 3,(door.Size.z / 0.15) do
		wait()
		door.CFrame = door.CFrame + (door.CFrame.lookVector * 0.15)
	end
end

script.Parent.Parent.KeycardReader1.touched:connect(function(touch)
	if touch.Name == "Handle" and clearance[touch.Parent.Name] and CanOpen1 == true then
		CanOpen1 = false
		wait(0.75)
		openDoor()
		wait(1)
		CanClose1 = true
	elseif touch.Name == "Handle" and clearance[touch.Parent.Name] and CanClose1 == true then
		CanClose1 = false
		wait(0.75)
		closeDoor()
		wait(1)
		CanOpen1 = true
	end
end)

script.Parent.Parent.KeycardReader2.touched:connect(function(touch)
	if touch.Name == "Handle" and clearance[touch.Parent.Name] and CanOpen1 == true then
		CanOpen1 = false
		wait(0.75)
		openDoor()
		wait(1)
		CanClose1 = true
	elseif touch.Name == "Handle" and clearance[touch.Parent.Name] and CanClose1 == true then
		CanClose1 = false
		wait(0.75)
		closeDoor()
		wait(1)
		CanOpen1 = true
	end
end)
-- Decompiled with the Synapse X Luau decompiler.

return function(p1)
	local u1 = nil;
	local u2 = nil;
	local u3 = nil;
	local u4 = nil;
	if not pcall(function()
		u1 = p1.Left;
		u2 = p1.Right;
		u3 = u1:FindFirstChildOfClass("UIGradient");
		u4 = u2:FindFirstChildOfClass("UIGradient");
	end) or p1:GetAttribute("Progress") then
		return;
	end;
	p1:SetAttribute("Progress", 1);
	local function u5(p2)
		p2 = math.clamp(p2, 0, 1);
		if p1 and u3 and u4 then
			u4.Rotation = math.clamp(p2 * 2, 0, 1) * 180;
			u3.Rotation = 180 + math.clamp((p2 - 0.5) * 2, 0, 1) * 180;
			u4.Enabled = p2 < 0.5;
			u3.Enabled = p2 < 1;
			p1.Visible = p2 > 0;
		end;
	end;
	return p1:GetAttributeChangedSignal("Progress"):Connect(function()
		u5(p1:GetAttribute("Progress"));
	end);
end;
--Variables--
local set = script.Settings
local sp = set.Speed
local enabled = set.Enabled
local hum = script.Parent:WaitForChild("Humanoid")
if hum then
--Made by Luckymaxer

Humanoid = script.Parent
Character = Humanoid.Parent

Debris = game:GetService("Debris")

Creator = script:WaitForChild("Creator")

Health = Humanoid.Health

IgnoreChange = false

Colors = {"Med. yellowish green", "Br. yellowish green", "Medium green", "Tr. Green", "Faded green", "Bright green", "Dark green", "Earth green"}

Parts = {}

function TagHumanoid(humanoid, player)
	local Creator_Tag = Instance.new("ObjectValue")
	Creator_Tag.Name = "creator"
	Creator_Tag.Value = player
	Debris:AddItem(Creator_Tag, 2)
	Creator_Tag.Parent = humanoid
end

function UntagHumanoid(humanoid)
	for i, v in pairs(humanoid:GetChildren()) do
		if v:IsA("ObjectValue") and v.Name == "creator" then
			v:Destroy()
		end
	end
end

Humanoid.Changed:connect(function(Property)
	if Property == "Health" then
		if Humanoid.Health < Health and not IgnoreChange then
			local HealthLost = (Health - Humanoid.Health)
			IgnoreChange = true
			UntagHumanoid(Humanoid)
			TagHumanoid(Humanoid, Creator.Value)
			Humanoid:TakeDamage(HealthLost)
			Health = Humanoid.Health
			IgnoreChange = false
		elseif Humanoid.Health >= Health then
			Health = Humanoid.Health
		end
	elseif Property == "Jump" then
		Humanoid.Jump = false
	end
end)

Humanoid.WalkSpeed = (16 / 2)

for i, v in pairs(Character:GetChildren()) do
	if v:IsA("BasePart") then
		table.insert(Parts, {Part = v, BrickColor = v.BrickColor})
	end
end

for i, v in pairs(Colors) do
	for ii, vv in pairs(Parts) do
		if vv.Part and vv.Part.Parent then
			vv.Part.BrickColor = BrickColor.new(v)
		end
	end
	wait(60 / #Colors)
end

for i, v in pairs(Parts) do
	v.Part.BrickColor = v.BrickColor
end

Humanoid.WalkSpeed = 16

script:Destroy()
--Script to become the Indiana Jones boulder!

local Character = script.Parent

local Humanoid = Character:FindFirstChildOfClass("Humanoid")

local Root = Character:WaitForChild("HumanoidRootPart",10)

local Orb = script:WaitForChild("Orb",10).Value

local Camera = workspace.CurrentCamera

local Services = {
	Players = (game:FindService("Players") or game:GetService("Players")),
	TweenService = (game:FindService("TweenService") or game:GetService("TweenService")),
	RunService = (game:FindService("RunService") or game:GetService("RunService")),
	Input = (game:FindService("ContextActionService") or game:GetService("ContextActionService"))
}



local Moving = false


Services.RunService.RenderStepped:Connect(function()
	if Humanoid.MoveDirection.Magnitude > 0 then
		Orb.Velocity = Orb.Velocity + Humanoid.MoveDirection * 2
	end
end)
-- Torso

character.HumanoidRootPart.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,FrW,ElW)
character.UpperTorso.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,FrW,ElW)
character.LowerTorso.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,FrW,ElW)
-- CreateFadeFunctions usage:
-- fadeObjects is a map of text labels and button to start and end values for a given property.
-- e.g {
--   NameButton = {
--     TextTransparency = {
--       FadedIn = 0.5,
--       FadedOut = 1,
--     }
--   },
--  ImageOne = {
--	  ImageTransparency = {
--       FadedIn = 0,
--       FadedOut = 0.5,
--     }
--   }
-- }
function methods:CreateFadeFunctions(fadeObjects)
	local AnimParams = {}
	for object, properties in pairs(fadeObjects) do
		AnimParams[object] = {}
		for property, values in pairs(properties) do
			AnimParams[object][property] = {
				Target = values.FadedIn,
				Current = object[property],
				NormalizedExptValue = 1,
			}
		end
	end

	local function FadeInFunction(duration, CurveUtil)
		for object, properties in pairs(AnimParams) do
			for property, values in pairs(properties) do
				values.Target = fadeObjects[object][property].FadedIn
				values.NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
			end
		end
	end

	local function FadeOutFunction(duration, CurveUtil)
		for object, properties in pairs(AnimParams) do
			for property, values in pairs(properties) do
				values.Target = fadeObjects[object][property].FadedOut
				values.NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
			end
		end
	end

	local function AnimGuiObjects()
		for object, properties in pairs(AnimParams) do
			for property, values in pairs(properties) do
				object[property] = values.Current
			end
		end
	end

	local function UpdateAnimFunction(dtScale, CurveUtil)
		for object, properties in pairs(AnimParams) do
			for property, values in pairs(properties) do
				values.Current = CurveUtil:Expt(
					values.Current,
					values.Target,
					values.NormalizedExptValue,
					dtScale
				)
			end
		end

		AnimGuiObjects()
	end

	return FadeInFunction, FadeOutFunction, UpdateAnimFunction
end

function methods:NewBindableEvent(name)
	local bindable = Instance.new("BindableEvent")
	bindable.Name = name
	return bindable
end

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

	obj.ObjectPool = nil
	obj.ChatWindow = nil

	obj.DEFAULT_MESSAGE_CREATOR = DEFAULT_MESSAGE_CREATOR
	obj.MESSAGE_CREATOR_MODULES_VERSION = MESSAGE_CREATOR_MODULES_VERSION

	obj.KEY_MESSAGE_TYPE = KEY_MESSAGE_TYPE
	obj.KEY_CREATOR_FUNCTION = KEY_CREATOR_FUNCTION

	obj.KEY_BASE_FRAME = KEY_BASE_FRAME
	obj.KEY_BASE_MESSAGE = KEY_BASE_MESSAGE
	obj.KEY_UPDATE_TEXT_FUNC = KEY_UPDATE_TEXT_FUNC
	obj.KEY_GET_HEIGHT = KEY_GET_HEIGHT
	obj.KEY_FADE_IN = KEY_FADE_IN
	obj.KEY_FADE_OUT = KEY_FADE_OUT
	obj.KEY_UPDATE_ANIMATION = KEY_UPDATE_ANIMATION

	return obj
end

return module.new()
-- Raycasting function
local raycast = function(character, raycastOrigin, raycastDirection)
    
    local params = RaycastParams.new()
    params.FilterDescendantsInstances = {character, bloodCache}
    params.FilterType = Enum.RaycastFilterType.Blacklist
    params.IgnoreWater = true
    
    local raycastResult = workspace:Raycast(raycastOrigin, raycastDirection, params)
    
    if raycastResult then
        return raycastResult
    end
end
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder)
	local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
	return plrData.Money.Gold.Value < 100
end
--
faketorso.Size = torso.Size
fakeroot.Size = rootpart.Size
faketorso.CFrame = fakeroot.CFrame
roothipclone = roothip:Clone()
roothipclone.Parent = fakeroot
roothipclone.Part0 = fakeroot
roothipclone.Part1 = faketorso
--[[[Default Controls]]
	--Peripheral Deadzones
	Tune.Peripherals = {
		MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
		MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)
		
		ControlLDZone			= 5			,	-- Controller steering L-deadzone (0 - 100%)
		ControlRDZone			= 5			,	-- Controller steering R-deadzone (0 - 100%)
	}
	
	--Control Mapping
	Tune.Controls = {
		
	--Keyboard Controls
		--Mode Toggles
		ToggleTCS				= Enum.KeyCode.Q					,
		ToggleABS				= Enum.KeyCode.E					,
		ToggleTransMode			= Enum.KeyCode.M					,
		ToggleMouseDrive		= Enum.KeyCode.I					,
		
		--Primary Controls
		Throttle				= Enum.KeyCode.Up					,
		Brake					= Enum.KeyCode.Down					,
		SteerLeft				= Enum.KeyCode.Left					,
		SteerRight				= Enum.KeyCode.Right				,
		
		--Secondary Controls
		Throttle2				= Enum.KeyCode.W					,
		Brake2					= Enum.KeyCode.S					,
		SteerLeft2				= Enum.KeyCode.A					,
		SteerRight2				= Enum.KeyCode.D					,
		
		--Manual Transmission
		ShiftUp					= Enum.KeyCode.E					,
		ShiftDown				= Enum.KeyCode.Q					,
		Clutch					= Enum.KeyCode.LeftShift			,
		
		--Handbrake
		PBrake					= Enum.KeyCode.P					,
		
	--Mouse Controls
		MouseThrottle			= Enum.UserInputType.MouseButton1	,
		MouseBrake				= Enum.UserInputType.MouseButton2	,
		MouseClutch				= Enum.KeyCode.W					,
		MouseShiftUp			= Enum.KeyCode.E					,
		MouseShiftDown			= Enum.KeyCode.Q					,
		MousePBrake				= Enum.KeyCode.LeftShift			,
		
	--Controller Mapping
		ContlrThrottle			= Enum.KeyCode.ButtonR2				,
		ContlrBrake				= Enum.KeyCode.ButtonL2				,
		ContlrSteer				= Enum.KeyCode.Thumbstick1			,
		ContlrShiftUp			= Enum.KeyCode.ButtonY				,
		ContlrShiftDown			= Enum.KeyCode.ButtonX				,
		ContlrClutch			= Enum.KeyCode.ButtonR1				,
		ContlrPBrake			= Enum.KeyCode.ButtonL1				,
		ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
		ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
		ContlrToggleABS			= Enum.KeyCode.DPadRight			,
	}
-----------------------------------------------------------------------------------------------

local player=game.Players.LocalPlayer
local mouse=player:GetMouse()

local car = script.Parent.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])

local gauges = script.Parent
local values = script.Parent.Parent.Values
local isOn = script.Parent.Parent.IsOn
local RPM = 0
local RPM2 = 0

gauges:WaitForChild("Tach")
gauges:WaitForChild("ln")
gauges:WaitForChild("bln")
gauges:WaitForChild("Gear")

car.DriveSeat.HeadsUpDisplay = false

local _pRPM = _Tune.PeakRPM
local _lRPM = _Tune.Redline

local currentUnits = 1
local revEnd = math.ceil(_lRPM/1000)
local BST = 0
if _Tune.Turbochargers ==1 then
BST = _Tune.T_Boost
end
if _Tune.Turbochargers == 2 then
BST = _Tune.T_Boost*2
end
if _Tune.Superchargers == 1 then
BST = _Tune.S_Boost
end
-- RANK, RANK NAMES & SPECIFIC USERS
Ranks = {
	{8,	"GameMaster",		};
	{7,	"Rank Manager",	{"",0},	};
	{6,	"Head Mod",		{"",0},	};
	{5,	"Gamemod",			{"",0},	};
	{4,	"Owner",			{"",0},	};
	{3,	"Head Admin",			{"",0},	};
	{2,	"Mod",			{"",0},	};
	{0,	"Unranked",		};
};
--Turbo Settings
Tune.Aspiration		= "Single"												--[[
	[Aspiration]
		"Natural"		: N/A, Naturally aspirated engine
		"Single"		: Single turbocharger
		"Double"		: Twin turbocharger											]]

Tune.Boost			= 18		--Max PSI per turbo (If you have two turbos and this is 15, the PSI will be 30)
Tune.TurboSize		= 80		--Turbo size; the bigger it is, the more lag it has.
Tune.CompressRatio	= 9			--The compression ratio (look it up)
--[[ Constants ]]--
local ZERO_VECTOR3 = Vector3.new(0,0,0)
local USE_STACKING_TRANSPARENCY = true	-- Multiple items between the subject and camera get transparency values that add up to TARGET_TRANSPARENCY
local TARGET_TRANSPARENCY = 0.75 -- Classic Invisicam's Value, also used by new invisicam for parts hit by head and torso rays
local TARGET_TRANSPARENCY_PERIPHERAL = 0.5 -- Used by new SMART_CIRCLE mode for items not hit by head and torso rays

local MODE = {
	--CUSTOM = 1, 		-- Retired, unused
	LIMBS = 2, 			-- Track limbs
	MOVEMENT = 3, 		-- Track movement
	CORNERS = 4, 		-- Char model corners
	CIRCLE1 = 5, 		-- Circle of casts around character
	CIRCLE2 = 6, 		-- Circle of casts around character, camera relative
	LIMBMOVE = 7, 		-- LIMBS mode + MOVEMENT mode
	SMART_CIRCLE = 8, 	-- More sample points on and around character
	CHAR_OUTLINE = 9,	-- Dynamic outline around the character
}

local LIMB_TRACKING_SET = {
	-- Body parts common to R15 and R6
	['Head'] = true,
	
	-- Body parts unique to R6
	['Left Arm'] = true,
	['Right Arm'] = true,
	['Left Leg'] = true,
	['Right Leg'] = true,
	
	-- Body parts unique to R15
	['LeftLowerArm'] = true,
	['RightLowerArm'] = true,
	['LeftUpperLeg'] = true,
	['RightUpperLeg'] = true
}

local CORNER_FACTORS = {
	Vector3.new(1,1,-1),
	Vector3.new(1,-1,-1),
	Vector3.new(-1,-1,-1),
	Vector3.new(-1,1,-1)
}

local CIRCLE_CASTS = 10
local MOVE_CASTS = 3
local SMART_CIRCLE_CASTS = 24
local SMART_CIRCLE_INCREMENT = 2.0 * math.pi / SMART_CIRCLE_CASTS
local CHAR_OUTLINE_CASTS = 24