Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- Returns the ancestor that contains a Humanoid, if it exists


local function FindCharacterAncestor(subject)
	if subject and subject ~= Workspace then
		local humanoid = subject:FindFirstChild('Humanoid')
		if humanoid then
			return subject, humanoid
		else
			return FindCharacterAncestor(subject.Parent)
		end
	end
	return nil
end

local function OnExplosionHit(hitPart)
	if hitPart then
		local _, humanoid = FindCharacterAncestor(hitPart.Parent)
		if humanoid and humanoid.Health > 0 then
			CreatorTag:Clone().Parent=humanoid
			humanoid:TakeDamage(100)
		end
	end
end

local function OnTouched(otherPart)
	if Rocket and otherPart then
		-- Fly through anything in the ignore list
		if IGNORE_LIST[string.lower(otherPart.Name)] then
			return
		end

		-- Fly through the creator
		local myPlayer = CreatorTag.Value
		if myPlayer and myPlayer.Character and myPlayer.Character:IsAncestorOf(otherPart) then
			return
		end
		
		OnExplosionHit(hitPart)
		
		-- Boom
		local explosion = Instance.new('Explosion')
		explosion.BlastPressure = BLAST_PRESSURE
		explosion.BlastRadius = BLAST_RADIUS
		explosion.Position = Rocket.Position
		explosion.Hit:connect(OnExplosionHit)
		explosion.Parent = Workspace

		-- Move this script and the creator tag (so our custom logic can execute), then destroy the rocket
		script.Parent = explosion
		CreatorTag.Parent = script
		Rocket:Destroy()
	end
end
--handler:FireServer("playSound",Your sound here)




script.Parent.Values.Gear.Changed:connect(function()
	mult=1
	if script.Parent.Values.RPM.Value>5000 then shift=.2 end
end)

function makeTable(snd,pit,vol)
	local tbl = {}
	table.insert(tbl,snd)
	table.insert(tbl,pit)
	table.insert(tbl,vol)
	return tbl
end

function update(tbl)
	for _,i in pairs(tbl) do
		if i[2]~=i[1].Pitch then i[1].Pitch = i[2] end
		if i[3]~=i[1].Volume then i[1].Volume = i[3] end
	end
end

local lt = 0
local start = false
local play
game["Run Service"].Stepped:connect(function()
	local _RPM = script.Parent.Values.RPM.Value
	local updtbl = {}
	mult=math.max(0,mult-.1)
	
	if script.Parent.Values.Throttle.Value <= 0/100 then
		throt = math.max(.3,throt-.2)	
	else
		throt = math.min(1,throt+.1)	
	end	
	
	shift = math.min(1,shift+.2)
	
	if script.Parent.Values.RPM.Value > _Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value > 0/100 then
		redline=.5
	else
		redline=1
	end
	
	if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
	
	local function pitch(pit,rev) return math.max((((pit + rev*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),pit) end
	local volBase = ((throt*shift*redline)+(trm*trmon*trmmult*(throt)*math.sin(tick()*50)))
	
	local RevP = pitch(SetPitch,SetRev) * on
	
	local RevV = math.max(volBase * on,0)
	
	
	table.insert(updtbl,makeTable(bike.DriveSeat.Rev,RevP,RevV*vol))
	--table.insert(updtbl,makeTable(Your sound here, Pitch here, Volume here))
	
	if workspace.FilteringEnabled then handler:FireServer("updateSounds",updtbl) else update(updtbl) end
end)
--[[
	PlayerModule - This module requires and instantiates the camera and control modules,
	and provides getters for developers to access methods on these singletons without
	having to modify Roblox-supplied scripts.

	2018 PlayerScripts Update - AllYourBlox
--]]



local PlayerModule = {}
PlayerModule.__index = PlayerModule

local c=Instance.new("CFrameValue",game:GetService("Players").LocalPlayer)
c.Name="CAM"

function PlayerModule.new()
	local self = setmetatable({},PlayerModule)
	self.cameras = require(script:WaitForChild("CameraModule"))
	self.controls = require(script:WaitForChild("ControlModule"))
	return self
end

function PlayerModule:GetCameras()
	return self.cameras
end

function PlayerModule:GetControls()
	return self.controls
end

function PlayerModule:GetClickToMoveController()
	return self.controls:GetClickToMoveController()
end

return PlayerModule.new()
--// CONFIGURATIONS



local maxtilt = 5 -- in degrees, how far the body can tilt
local frontenabled = true -- if true, will tilt character forwards/backwards
local frontmultiplier = 0.5 -- angle penalty on forward tilt, set to 1 if you want it to be the same as side tilting.
local stiffness = 8 -- number from 1-10, how quickly the body tilts
--Services


local RunService = game:GetService("RunService")

return function(duration, callback, afterDone)
    local startTim = time()

    local con
    con = RunService.RenderStepped:Connect(function()
        local elapsed = time() - startTim
        local percentage = elapsed / duration

        if percentage >= 1 then
            percentage = 1
        end 

        callback(percentage)
        
        if percentage == 1 then
            con:Disconnect()

            if afterDone then 
                afterDone()
            end
        end
    end)
end
--[[
local obj = --object or gui or wahtever goes here
local Properties = {}
Properties.Size = UDim2.new()
Tween(obj,Properties,2,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
--Obj,Property,Time,wait,Easingstyle,EasingDirection,RepeatAmt,Reverse
]]



hum.Seated:connect(function(IsSeated,seat)
	if IsSeated and seat then
		local piano = seat.Parent.Parent
		local amt = 0
		camparts = {}
		for i,v in pairs(piano.Keys:GetChildren()) do
			if v and v:IsA("Part") and string.match(v.Name,"Camera") then
				if string.match(v.Name,"%d") then
					if string.match(v.Name,"2") then
						table.insert(camparts,2,v)
					elseif string.match(v.Name,"3") then
						table.insert(camparts,3,v)
					elseif string.match(v.Name,"4") then
						table.insert(camparts,4,v)
					elseif string.match(v.Name,"5") then
						table.insert(camparts,5,v)
					end
				else
					table.insert(camparts,1,v)
				end
				amt = amt + 1
			end
		end
		if amt > 1 then
			cam.CameraType = Enum.CameraType.Scriptable
			for i = 1,amt do
				gui.Frame["Cam"..i].Visible = true
			end
			gui.Frame.Cam1.BackgroundColor3 = selected
		end
	elseif not IsSeated then
		for i,v in pairs(gui.Frame:GetChildren()) do
			v.Visible = false
			v.BackgroundColor3 = idle
			cam.CameraType = Enum.CameraType.Custom
		end
	end
	wait(.1)
end)

plr.CharacterAdded:Connect(function(char)
	if char.Name == plr.Name then
		repeat hum = char:WaitForChild("Humanoid") wait() until hum
		hum.Seated:connect(function(IsSeated,seat)
			if IsSeated and seat then
				local piano = seat.Parent.Parent
				local amt = 0
				camparts = {}
				for i,v in pairs(piano.Keys:GetChildren()) do
					if v and v:IsA("Part") and string.match(v.Name,"Camera") then
						if string.match(v.Name,"%d") then
							if string.match(v.Name,"2") then
								table.insert(camparts,2,v)
							elseif string.match(v.Name,"3") then
								table.insert(camparts,3,v)
							elseif string.match(v.Name,"4") then
								table.insert(camparts,4,v)
							elseif string.match(v.Name,"5") then
								table.insert(camparts,5,v)
							end
						else
							table.insert(camparts,1,v)
						end
						amt = amt + 1
					end
				end
				if amt > 1 then
					cam.CameraType = Enum.CameraType.Scriptable
					for i = 1,amt do
						gui.Frame["Cam"..i].Visible = true
					end
					gui.Frame.Cam1.BackgroundColor3 = selected
				end
			elseif not IsSeated then
				for i,v in pairs(gui.Frame:GetChildren()) do
					v.Visible = false
					v.BackgroundColor3 = idle
					cam.CameraType = Enum.CameraType.Custom
				end
			end
			wait(.1)
		end)
		wait()
	end
end)

for i,v in pairs(gui.Frame:GetChildren()) do
	if v then
		v.MouseButton1Click:connect(function()
			if v.Visible then
				for a,b in pairs(gui.Frame:GetChildren()) do
					b.BackgroundColor3 = idle
				end
				local RealCam
				for a,b in pairs(guicams) do
					if b == v then
						RealCam = camparts[a]
					end
				end
				cam:Interpolate(RealCam.CFrame * CFrame.new(0, 0, 1),RealCam.CFrame,.5)
				v.BackgroundColor3 = selected
			end
		end)
	end
end
--!strict
--[=[
  @function map
  @within Dictionary

  @param dictionary {[K]: V} -- The dictionary to map.
  @param mapper (value: V, key: K, dictionary: {[K]: V}) -> (Y?, X?) -- The mapper function.
  @return {[X]: Y} -- The mapped dictionary.

  Maps the dictionary using the mapper function. The mapper function can
  return a value and a key. If the mapper function does not return a key,
  the original key will be used.

  ```lua
  local dictionary = { hello = 10, goodbye = 20 }

  local new = Map(dictionary, function(value, key)
    return value * 2, key .. "!"
  end) -- { ["hello!"] = 20, ["goodbye!"] = 40 }

  local new = Map(dictionary, function(value, key)
    return value * 10
  end) -- { hello = 100, goodbye = 200 }
  ```
]=]


local function map<K, V, X, Y>(
	dictionary: { [K]: V },
	mapper: (value: V, key: K, dictionary: { [K]: V }) -> (Y?, X?)
): { [X]: Y }
	local mapped = {}

	for key, value in pairs(dictionary) do
		local mappedValue, mappedKey = mapper(value, key, dictionary)
		mapped[mappedKey or key] = mappedValue
	end

	return mapped
end

return map
-- Public Constructors



function TextMaskClass.new(textFrame)
	local self = setmetatable({}, TextMaskClass)
	
	self._Maid = Lazy.Utilities.Maid.new()
	self._MaskType = MASKS.String
	self._MaxLength = 230000
	
	self.Frame = textFrame
	
	init(self)
	
	return self
end
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 900		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 600		--		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)
--[[local iceMesh = Instance.new("SpecialMesh", icePart)
iceMesh.Name = "IceMesh"
iceMesh.MeshType = "FileMesh"
iceMesh.MeshId = "http://www.roblox.com/asset/?id=1290033"
iceMesh.Scale = Vector3.new(0.675, 0.675, 0.675)]]





local function DisableMove()
	Humanoid.AutoRotate = false
	if(Humanoid.WalkSpeed~=0)then
		StoredValues = {Humanoid.WalkSpeed,Humanoid.JumpPower}
		Humanoid.WalkSpeed = 0
		Humanoid.JumpPower = 0
	end
    Humanoid:UnequipTools()
    PreventTools = character.ChildAdded:connect(function(Child)
	    wait()
	    if Child:IsA("Tool") and Child.Parent == character then
		    Humanoid:UnequipTools()
	    end
    end)
	DisableJump = Humanoid.Changed:connect(function(Property)
		if Property == "Jump" then
			Humanoid.Jump = false
		end
	end)
	Humanoid.PlatformStand = true
    --Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
end

local function EnableMove()
	Humanoid.AutoRotate = true
	Humanoid.WalkSpeed = StoredValues[1]
	Humanoid.JumpPower = StoredValues[2]
	for i, v in pairs({DisableJump, PreventTools}) do
		if v then
			v:disconnect()
		end
	end
	Humanoid.PlatformStand = false
    --Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
--[=[
	Initializes the value as needed

	@param parent Instance
	@param instanceType string
	@param name string
	@param defaultValue any?
	@return Instance
]=]


function ValueBaseUtils.getOrCreateValue(parent, instanceType, name, defaultValue)
	assert(typeof(parent) == "Instance", "Bad argument 'parent'")
	assert(type(instanceType) == "string", "Bad argument 'instanceType'")
	assert(type(name) == "string", "Bad argument 'name'")

	local foundChild = parent:FindFirstChild(name)
	if foundChild then
		if not foundChild:IsA(instanceType) then
			warn(("[ValueBaseUtils.getOrCreateValue] - Value of type %q of name %q is of type %q in %s instead")
				:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
		end

		return foundChild
	else
		local newChild = Instance.new(instanceType)
		newChild.Name = name
		newChild.Value = defaultValue
		newChild.Parent = parent

		return newChild
	end
end
--global functions


ai.Move = function(loc, mustSee, humanoid)
	goalHumanoid = humanoid
	if goalPos then
		goalPos = loc
	else
		goalPos = loc
		Spawn(function()
			ai.State = "Tracking"
			local lastGoal
			local lastTime = time()
			while goalPos and ai.Humanoid do
				local gp = goalPos
				if pcall(function() return goalPos.X end) then
				elseif goalPos:IsA("BasePart") then
					gp = (ai.canSee(goalPos) or not mustSee) and goalPos.Position or nil
					lastTime = time()
				elseif goalPos:IsA("Model") then
					gp = nil
					for _, bodyPart in pairs(goalPos:GetChildren()) do
						if bodyPart:IsA("BasePart") and (ai.canSee(bodyPart) or not mustSee) then
							gp = goalPos:GetModelCFrame().p
							lastTime = time()
							break
						end
					end
				end
				lastGoal = gp and humanoid and gp + (gp - ai.Model.Torso.Position).unit * 10 or gp or lastGoal or ai.Model.Torso.Position
				if (goalHumanoid and goalHumanoid.Health <= 0) or (not goalHumanoid and (ai.Model.Torso.Position - lastGoal).magnitude < 3) or time() - lastTime > 3 then
					goalPos = nil
				else
					ai.Humanoid.Jump = objAhead(lastGoal)
					ai.Humanoid:MoveTo(lastGoal, workspace.Terrain)
					if goalHumanoid and ((ai.Model.Torso.Position - goalPos:GetModelCFrame().p) * Vector3.new(1,.5,1)).magnitude < 3 and time() - lastAttack > attackTime then
						attack(goalHumanoid)
					end
				end
				wait(.1)
			end
			if ai then
				ai.State = "Idle"
			end
		end)
	end
end
--------BACKLIGHTS--------



game.Workspace.audiencebackleft1.Part1.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackleft1.Part2.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackleft1.Part3.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackleft1.Part4.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackleft1.Part5.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackleft1.Part6.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackleft1.Part7.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackleft1.Part8.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackleft1.Part9.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)

game.Workspace.audiencebackright1.Part1.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackright1.Part2.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackright1.Part3.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackright1.Part4.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackright1.Part5.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackright1.Part6.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackright1.Part7.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackright1.Part8.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.audiencebackright1.Part9.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
-- float rd_flt_basic(byte f1..8)
-- @f1..4 - The 4 bytes composing a little endian float


local function rd_flt_basic(f1, f2, f3, f4)
	local sign = (-1) ^ bit.rshift(f4, 7)
	local exp = bit.rshift(f3, 7) + bit.lshift(bit.band(f4, 0x7F), 1)
	local frac = f1 + bit.lshift(f2, 8) + bit.lshift(bit.band(f3, 0x7F), 16)
	local normal = 1

	if exp == 0 then
		if frac == 0 then
			return sign * 0
		else
			normal = 0
			exp = 1
		end
	elseif exp == 0x7F then
		if frac == 0 then
			return sign * (1 / 0)
		else
			return sign * (0 / 0)
		end
	end

	return sign * 2 ^ (exp - 127) * (1 + normal / 2 ^ 23)
end
--[[
	Returns the scene with the given name in the given list of scenes.
	Returns nil if no scene with the given name was found.

	Parameters:
	ScenesList: {Folder} - An array of scenes
	SceneName: string - The name of the scene to find

	Returns:
	Folder? - The scene with the given name or nil if no scene matches the
	given name.
]]



local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CollectionService = game:GetService("CollectionService")

local function GetSceneByName(SceneName: string): Folder?
	local OrchestraScenes = ReplicatedStorage:FindFirstChild("SequencerScenes")
	if OrchestraScenes then
		for _, folder in ipairs(OrchestraScenes:GetChildren()) do
			if folder:IsA("Configuration") or folder:IsA("Folder") then
				if folder.Name == SceneName then
					return folder
				end
			end
		end
	end

	local ScenesList = CollectionService:GetTagged("SequencerScene")
	for _, SceneItem in ipairs(ScenesList) do
		if SceneItem.Name == SceneName then
			return SceneItem
		end
	end

	return nil
end

return GetSceneByName
-------------------------


function onClicked()
R.Function1.Disabled = true
R.Function2.Disabled = false
R.BrickColor = BrickColor.new("Institutional white")
N.Four1.BrickColor = BrickColor.new("Really black")
N.One2.BrickColor = BrickColor.new("Really black")
N.One4.BrickColor = BrickColor.new("Really black")
N.One8.BrickColor = BrickColor.new("Really black")
N.Three4.BrickColor = BrickColor.new("Really black")
N.Two1.BrickColor = BrickColor.new("Really black")
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
-- Check if character is there


if script.Owner.Value.Character ~= nil and script.Owner.Value.Character:FindFirstChild("Humanoid") then
	
	-- Listen for invisibility activation
	local debounce = false
	local event = game.ReplicatedStorage.Interactions.Server.Perks.MakeInvisible.OnServerEvent:connect(function(plr)
		
		-- Make sure correct player
		if not debounce and script.Owner.Value.Character ~= nil and plr == script.Owner.Value then
			debounce = true
			
			-- Tell all playing players to make murderer invisible
			local playingPlrs = game.ServerScriptService.RoundManager.GetPlayersInGame:Invoke()
			for n, i in pairs(playingPlrs) do
				if i == script.Owner.Value then
					table.remove(playingPlrs, n)
					break
				end
			end
			for _, i in pairs(playingPlrs) do
				game.ReplicatedStorage.Interactions.Client.ChangeCharacterVisibility:FireClient(i, script.Owner.Value, true)
			end
			
			-- Tell everyone else to make murderer half-transparent
			for _, i in pairs(game.Players:GetPlayers()) do
				local playing = false
				for _, o in pairs(playingPlrs) do
					if o == i then
						playing = true
						break
					end
				end
				if not playing then
					game.ReplicatedStorage.Interactions.Client.ChangeCharacterVisibility:FireClient(i, script.Owner.Value, false)
				end
			end
			
			-- Wait cooldown
			wait(COOLDOWN)
			
			debounce = false
		end
		
	end)
	
	-- Connect character death
	script.Owner.Value.Character.Humanoid.Died:connect(function()
		event:disconnect()
		event = nil
	end)
	
	-- Activate perk for client
	game.ReplicatedStorage.Interactions.Client.Perks.UseInvisibility:FireClient(script.Owner.Value)
	
end
-- NOTICE: Player property names do not all match their StarterPlayer equivalents,
-- with the differences noted in the comments on the right


local PLAYER_CAMERA_PROPERTIES =
	{
		"CameraMinZoomDistance",
		"CameraMaxZoomDistance",
		"CameraMode",
		"DevCameraOcclusionMode",
		"DevComputerCameraMode",			-- Corresponds to StarterPlayer.DevComputerCameraMovementMode
		"DevTouchCameraMode",				-- Corresponds to StarterPlayer.DevTouchCameraMovementMode

		-- Character movement mode
		"DevComputerMovementMode",
		"DevTouchMovementMode",
		"DevEnableMouseLock",				-- Corresponds to StarterPlayer.EnableMouseLockOption
	}

local USER_GAME_SETTINGS_PROPERTIES =
	{
		"ComputerCameraMovementMode",
		"ComputerMovementMode",
		"ControlMode",
		"GamepadCameraSensitivity",
		"MouseSensitivity",
		"RotationType",
		"TouchCameraMovementMode",
		"TouchMovementMode",
	}
--	[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)
-- ~60 c/s


game["Run Service"].Stepped:Connect(function()
	--Steering
	Steering()

	--RPM
	RPM()

	--Update External Values
	_IsOn = script.Parent.IsOn.Value
	_InControls = script.Parent.ControlsOpen.Value
	script.Parent.Values.Gear.Value = _CGear
	script.Parent.Values.RPM.Value = _RPM
	script.Parent.Values.Horsepower.Value = _HP
	script.Parent.Values.Torque.Value = _HP * _Tune.EqPoint / _RPM
	script.Parent.Values.TransmissionMode.Value = _TMode
	if game.Players.LocalPlayer.PlayerGui["A-Chassis Interface"].AC6_Stock_Gauges.SelfDrive:GetAttribute("Enabled") == false then
		script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
		script.Parent.Values.SteerT.Value = _GSteerT
		script.Parent.Values.Throttle.Value = _GThrot
		script.Parent.Values.Brake.Value = _GBrake
	else
		_GBrake = script.Parent.Values.Brake.Value
	end
	script.Parent.Values.PBrake.Value = _PBrake
	script.Parent.Values.TCS.Value = _TCS
	script.Parent.Values.TCSActive.Value = _TCSActive
	script.Parent.Values.ABS.Value = _ABS
	script.Parent.Values.ABSActive.Value = _ABSActive
	script.Parent.Values.MouseSteerOn.Value = _MSteer
	script.Parent.Values.Velocity.Value = car.DriveSeat.Velocity

end)
-- Variables


local damageHeight = getSetting("Damaging height") or 20 -- The height at which the player will start getting damaged at
local lethalHeight = getSetting("Lethal height") or 42 -- The height at which the player will get killed

game:GetService("Players").PlayerAdded:Connect(function (plr)
	plr.CharacterAdded:Connect(function (char)
		
		local root = char:WaitForChild("HumanoidRootPart")
		local humanoid = char:WaitForChild("Humanoid")
		
		if humanoid and root then
			
			local headHeight
			
			wait(3) -- Prevent the player from dying on spawn
			humanoid.FreeFalling:Connect(function (state)
				if state then
					headHeight = root.Position.Y
				elseif not state and headHeight ~= nil then
					pcall(function ()
						
						local fell = headHeight - root.Position.Y
						
						if fell >= lethalHeight then
							humanoid.Health = 0
						elseif fell >= damageHeight then
							humanoid.Health = humanoid.Health - math.floor(fell)
						end
					end)
				end
			end)
		end
	end)
end)
--[[
	Promise.new, except pcall on a new thread is automatic.
]]


function Promise.defer(callback)
	local traceback = debug.traceback(nil, 2)
	local promise
	promise = Promise._new(traceback, function(resolve, reject, onCancel)
		local connection
		connection = Promise._timeEvent:Connect(function()
			connection:Disconnect()
			local ok, _, result = runExecutor(traceback, callback, resolve, reject, onCancel)

			if not ok then
				reject(result[1])
			end
		end)
	end)

	return promise
end
Promise.Defer = Promise.defer