Roblox/luau_corpus huggingface dataset:
--!strict
local makeTimerImpl = require(script.makeTimerImpl)
local makeIntervalImpl = require(script.makeIntervalImpl)
local assign = require(script.Parent.Object.assign)

export type Timeout = makeTimerImpl.Timeout
export type Interval = makeIntervalImpl.Interval

return assign({}, makeTimerImpl(task.delay), makeIntervalImpl(task.delay))
---------------
--// Variables
---------------
local OceanSound = game.SoundService.Ambience.Calm_Ocean_Loop
local WoodsSound = game.SoundService.Ambience["English Forest 14 (SFX)"]
local debounce = false
local isAnimating = false
-- Modules
local Chassis = require(Car.Scripts.Chassis)
local Effects = require(Car.Scripts.Effects)
-- constants
local configuration = require(script.Parent.Parent.Parent.Config)
local DEBUG_HTTP = configuration.DEBUG_HTTP
-- Decompiled with the Synapse X Luau decompiler.

script.Parent:WaitForChild("Humanoid").Touched:connect(function(p1, p2)
	if p1:FindFirstChild("kills") and script.Parent.Humanoid.Health > 0 and p2.Name ~= "Part" and p2.Name == "hitbox" then
		print("Killed because " .. tostring(p2) .. " touched a killing part");
		script.Parent.Humanoid.Health = 0;
	end;
end);
-- StarterGui:SetCore() takes a few frames to set up, need to wait
wait(0.1)

local function setCoreInit()
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)
end

while not pcall(function() setCoreInit() end) do
	wait(0)
end
-------- OMG HAX

r = game:service("RunService")


local damage = 10

local slash_damage = 12
local lunge_damage = 25

sword = script.Parent.Handle
Tool = script.Parent


local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = .7

local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Parent = sword
LungeSound.Volume = .6

local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1


function blow(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
	if humanoid~=nil and humanoid ~= hum and hum ~= nil then
		-- final check, make sure sword is in-hand

		local right_arm = vCharacter:FindFirstChild("Right Arm")
		if (right_arm ~= nil) then
			local joint = right_arm:FindFirstChild("RightGrip")
			if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
				tagHumanoid(humanoid, vPlayer)
				humanoid:TakeDamage(damage)
			end
		end


	end
end


function tagHumanoid(humanoid, player)
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = player
	creator_tag.Name = "creator"
	creator_tag.Parent = humanoid
	game.Debris:AddItem(creator_tag, 1)
end


function attack()
	damage = slash_damage
	SlashSound:play()
	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Slash"
	anim.Parent = Tool
end

function lunge()
	damage = lunge_damage

	LungeSound:play()

	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Lunge"
	anim.Parent = Tool
	
	
	local force = Instance.new("BodyVelocity")
	force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
	force.Parent = Tool.Parent.Torso
	wait(.25)
	swordOut()
	wait(.25)
	force.Parent = nil
	wait(.5)
	swordUp()

	damage = slash_damage
end

function swordUp()
	Tool.GripForward = Vector3.new(-1,0,0)
	Tool.GripRight = Vector3.new(0,1,0)
	Tool.GripUp = Vector3.new(0,0,1)
end

function swordOut()
	Tool.GripForward = Vector3.new(0,0,1)
	Tool.GripRight = Vector3.new(0,-1,0)
	Tool.GripUp = Vector3.new(-1,0,0)
end

function swordAcross()
	-- parry
end


Tool.Enabled = true
local last_attack = 0
function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return 
	end

	t = r.Stepped:wait()

	if (t - last_attack < 4) then
		lunge()
	else
		attack()
	end

	last_attack = t

	--wait(.5)

	Tool.Enabled = true
end


function onEquipped()
	UnsheathSound:play()
end


script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)


connection = sword.Touched:connect(blow)
-- Initialize the tool
local LightingTool = {

	Name = 'Lighting Tool';
	Color = BrickColor.new 'Really black';

};
-- Setup
gradientReference.BackgroundColor3 = START_COLOR
colorGoal = END_COLOR

local tweenInfo = TweenInfo.new(TWEEN_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 1, true)
local tween = TweenService:Create(gradientReference, tweenInfo, {BackgroundColor3 = colorGoal} )

tween:Play()

tween.Completed:Connect(function()
	if gradientReference.BackgroundColor3 == END_COLOR then gradientReference.BackgroundColor3 = START_COLOR end
	tween:Play()
end)
--[ FUNCTIONS ]--

game.Players.PlayerAdded:Connect(function(player) -- When Player Join
	player.CharacterAdded:Connect(function(chr) -- Grabs Player Character
		player.Chatted:Connect(function(msg) -- When Player Chats
			
			local Humanoid = chr:WaitForChild("Humanoid") -- Getting Humanoid
			local Desc = Humanoid:GetAppliedDescription() -- Getting Humanoid Description
			Desc.RightLeg = 139607718 -- Korblox Leg
			
			-- IF command match start --
			
			if msg:sub(1, Command:len()):lower() == Command:lower() then -- if msg is /e headless then
				Humanoid:ApplyDescription(Desc)	
			end

			-- IF command match end --
			
		end)
	end)
end)
-- player removing event
players.PlayerRemoving:connect(function(leaving)
	adjust(leaving.Name)
end)
-------------------Speed Controls ( Up/down/Forward/Backward)-------------------
				if(key == "d")  and (faster == false) and (slower == false) and (Spd_keep == true) and ( on == true) then 
					local val = plane.Engine:findFirstChild("Speed")
					faster = true
					while faster do
						if(val.Value < minspeed) or (val.Value > maxv) then return end							
						if(val.Value == maxv) then faster = false end 
						val.Value = val.Value +1
						wait()
						end 		
				
				elseif(key == "a")  and (faster == false)  and ( on==true) and (Spd_keep == true) then
				if(on == false) or (plane.Engine:findFirstChild("Speed") == nil) then return end
					if(slower == false) and (faster == false) then
						local val = plane.Engine:findFirstChild("Speed")
						slower = true
						while slower do
						if(val.Value >=minspeed) then
						val.Value = val.Value -1
						elseif(val.Value < minspeed) then
						val.Value = minspeed
						slower = false
						end 
						wait()
						end 
				end
					end 
			
			--Below u can see 2 if's these are if the Vert_keep value is set to true
				if(key == "s")  and planedebounce == false and on == true then
				local val = plane.Engine:findFirstChild("VerticalSpeed")
				if(val == nil) then return end
					downer = true
					uper = false 
					while downer do
					if(val.Value == -20) then downer = false break end
					if(downer==false) then break end
					val.Value = val.Value  -1
					wait(.1)
					end	
				end 

				if(key == "w")  and planedebounce == false and on == true then
				local val = plane.Engine:findFirstChild("VerticalSpeed")
				if(val == nil) then return end
					uper = true
					downer = false
					while uper==true do 
					if(uper == false) then break end
					if(val.Value >= 20) then
						uper = false
 
					end
					val.Value = val.Value +1
					
					wait(.1)
						end
				end 
		

	--[[	if(string.byte(key) == 20) and (on == true) then 
			local engine = plane.Engine
			local bg = engine.BodyGyro
				sideleft = true
				while sideleft do
				sideway = 20
				wait(.1)
			end
		end 
			
		if(string.byte(key) == 19) and (on == true) then 
			local engine = plane.Engine
			local bg = engine.BodyGyro
				sideright = true
				while sideright do
				sideway = -20
				wait(.1)
			end
		end 	]]--
	
		if(string.byte(key) == 23) and on then 
			local engine = plane.Engine
			local spd = engine.Speed
			if(spd.Value < 0) then 
			while spd.Value ~= 0 do
				spd.Value = spd.Value +1
			wait(.1)
			end
			elseif(spd.Value > 0) then 
			while spd.Value ~= 0 do
					spd.Value = spd.Value -1
			wait(.1)
			end
			elseif(spd.Value == 0) then spd.Value = 0
			return 
			end
		end
--[[Wheel Alignment]]
	--[Don't physically apply alignment to wheels]
	--[Values are in degrees]
	Tune.FCamber		= -1.5
	Tune.RCamber		= -1.5
	Tune.FToe			= 0.1
	Tune.RToe			= 0.1
--- Replace with true/false to force the chat type. Otherwise this will default to the setting on the website.
module.BubbleChatEnabled = PlayersService.BubbleChat
module.ClassicChatEnabled = PlayersService.ClassicChat
-- Waits for the child of the specified parent
local function WaitForChild(parent, childName)
	while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
	return parent[childName]
end


local Tool = script.Parent
local Handle = WaitForChild(Tool, 'Handle')
local Debounce = false

local TouchConnection


function OnTouched(hit)
	local humanoid = hit.Parent:findFirstChild('Humanoid')
	if Debounce == false then
		Debounce = true
		if humanoid then
			Handle.Splat:Play()
		else
		end
	end
	wait(0.5)
	Debounce = false
end


Tool.Equipped:connect(function()
	TouchConnection = Handle.Touched:connect(OnTouched)
end)

Tool.Unequipped:connect(function()
	if TouchConnection then
		TouchConnection:disconnect()
		TouchConnection = nil
	end
end)
--[=[
	@function Burn
	@within Blend

	@param background Color3 -- The background colour.
	@param foreground Color3 -- The foreground colour.
	@return Color3 -- The resulting colour.
]=]
return PrepFilter("Burn", function(background: number, foreground: number): number
	local bg = clamp(background * 255, 0, 255)
	local fg = foreground * 255

	return (bg == 0) and bg or max(0, (255 - lshift((255 - fg), 8) / bg))
end)
------------------------------------------------------------------------------------Raycasting functions
function cross(vector1, vector2)
	return Vector3.new(vector1.y * vector2.z - vector2.y * vector1.z, vector1.z * vector2.x - vector1.x * vector2.z, vector1.x * vector2.y - vector2.x * vector1.y)
end
function dot(vector1, vector2)
	return (vector1.x * vector2.x + vector1.y * vector2.y + vector1.z * vector2.z)
end
function getLineSphereCollide(linePoint1, lineVector, sphereCenter, radius)
	local a = lineVector.x * lineVector.x + lineVector.y * lineVector.y + lineVector.z * lineVector.z
	local b = lineVector.x * (linePoint1.x - sphereCenter.x) + lineVector.y * (linePoint1.y - sphereCenter.y) + lineVector.z * (linePoint1.z - sphereCenter.z)
	local c = (linePoint1.x - sphereCenter.x) * (linePoint1.x - sphereCenter.x) + (linePoint1.y - sphereCenter.y) * (linePoint1.y - sphereCenter.y) + (linePoint1.z - sphereCenter.z) * (linePoint1.z - sphereCenter.z) - radius * radius
	if (a > 0) and (b * b >= a * c) then
		local diff = math.sqrt(b * b - a * c)
		return ((-b - diff) / a), ((diff - b) / a)
	else
		return -1, -1
	end
end
--Objects
local Remotes = game.ReplicatedStorage.VehicleSeatingModule
local ButtonGui = script:WaitForChild("ButtonGui")
local ButtonImage = ButtonGui:WaitForChild("KeyboardImage")
local RingSprite = ButtonGui:WaitForChild("Ring")
--[[**
	ensures Lua primitive table type

	@param value The value to check against

	@returns True iff the condition is satisfied, false otherwise
**--]]
t.table = primitive("table")
--[[ PRIVATE FUNCTIONS ]]--
local function declareError(self, errorType)
	self._lastError = errorType
	self._events.Error:Fire(errorType)
end
--------------------[ CAMERA STEADYING FUNCTIONS ]------------------------------------

function SteadyCamera()
	Gui_Clone.Scope.Steady.Text = "Steadying..."
	Gui_Clone.Scope.Steady.TextColor3 = Color3.new(1, 1, 0)
	CameraSteady = true
	local OriginalSway = CameraSway
	for X = 0, 90, 1.5 / 0.6 do
		if (not Run_Key_Pressed) then break end
		local Alpha = SIN(RAD(X))
		CameraSway = NumLerp(OriginalSway, 0, Alpha)
		RS:wait()
	end
	while Run_Key_Pressed and Aimed do
		if CurrentSteadyTime > 0 then
			local NewSteadyTime = CurrentSteadyTime - 1
			CurrentSteadyTime = (NewSteadyTime < 0 and 0 or NewSteadyTime)
			CameraSway = 0
		elseif CurrentSteadyTime == 0 then
			break
		end
		RS:wait()
	end
	CameraSteady = false
	spawn(function()
		for X = 0, 90, 1.5 / 0.2 do
			local Alpha = math.log10(X) / math.log10(90)
			CameraSway = NumLerp(0, 3, Alpha)
			RS:wait()
		end
		for X = 0, 90, 1.5 / S.ScopeSteadyTime do
			if CameraSteady then break end
			local Alpha = SIN(RAD(X))
			CameraSway = NumLerp(3, 1, Alpha)
			RS:wait()
		end
	end)
	RetakeBreath()
end

function RetakeBreath()
	local Steady = Gui_Clone.Scope.Steady
	Steady.Text = "Re-taking Breath"
	Steady.TextColor3 = Color3.new(1, 0, 0)
	TakingBreath = true
	while TakingBreath do
		if CurrentSteadyTime < MaxSteadyTime then
			local NewSteadyTime = CurrentSteadyTime + (S.ScopeSteadyTime / S.SteadyCooldownTime)
			CurrentSteadyTime = (NewSteadyTime > MaxSteadyTime and MaxSteadyTime or NewSteadyTime)
		elseif CurrentSteadyTime >= MaxSteadyTime then
			break
		end
		RS:wait()
	end
	if TakingBreath then
		Steady.Text = "Hold "..ConvertKey(S.ScopeSteadyKey).." to Steady"
		Steady.TextColor3 = Color3.new(1, 1, 0)
		TakingBreath = false
	end
end
--[[
	Fired when state is left
]]
function Transitions.onLeavePostGame(stateMachine, event, from, to, playerComponent)
	PlayerPostGame.leave(stateMachine, playerComponent)
end

return Transitions
--// Ammo Settings			
	Ammo = 12;
	StoredAmmo = 12;
	MagCount = math.huge; --  If you want infinate ammo, set to math.huge EX. MagCount = math.huge;
	ExplosiveAmmo = 0;
--Disconnect MoveToFinished connection when pathfinding ends
local function disconnectMoveConnection(self)
	self._moveConnection:Disconnect()
	self._moveConnection = nil
end
--gui data
local gui = tool:WaitForChild("gui")
local ammogui = gui:WaitForChild("ammo")
local maggui = ammogui:WaitForChild("mag")
local chamberedgui = ammogui:WaitForChild("chambered")

magleft.Changed:Connect(function(new)
	maggui.Text = tostring(new)
end)
binmag.Changed:Connect(function(new)
	ammogui.Text = tostring(new)
end)
bchambered.Changed:Connect(function(new)
	chamberedgui.Text = tostring(new)
end)
-- regeneration
while true do
	local s = wait(1)
	local health = Humanoid.Health
	if health > 0 and health < Humanoid.MaxHealth then
		health = health + 0.01 * s * Humanoid.MaxHealth
		if health * 1.05 < Humanoid.MaxHealth then
			Humanoid.Health = health
		else
			Humanoid.Health = Humanoid.MaxHealth
		end
	end
end
-- Function to run when the button is clicked
local function onButtonClicked()
	gui4567.Visible = false
end
---Drivetrain Initialize
local wDia = 0
local Drive={}
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
	for i,v in pairs(car.Wheels:GetChildren()) do
		if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
			table.insert(Drive,v)
		end
	end
end
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
	for i,v in pairs(car.Wheels:GetChildren()) do
		if v.Name=="RL" or v.Name=="RR" or v.Name=="R" then
			table.insert(Drive,v)
		end
	end
end
for i,v in pairs(Drive) do
	if v.Size.x>wDia then wDia = v.Size.x end
end
-- constants

local PLAYER	= Players.LocalPlayer
local CAMERA	= Workspace.CurrentCamera
local EFFECTS	= Workspace:WaitForChild("Effects")
local EVENTS	= ReplicatedStorage:WaitForChild("Events")
local REMOTES	= ReplicatedStorage:WaitForChild("Remotes")
local MODULES	= ReplicatedStorage:WaitForChild("Modules")
	local MOUSE		= require(MODULES:WaitForChild("Mouse"))
	local SPRING	= require(MODULES:WaitForChild("Spring"))
	
local GUI		= script.Parent
local MOUSE_GUI	= GUI:WaitForChild("Mouse")
local SCOPE_GUI	= GUI:WaitForChild("Scope")
-- Variables
local InterfaceModule = {}
InterfaceModule.Open = false

InterfaceModule.Changing = false
InterfaceModule.Page = "Quests"

local debounce = false
local spawndebounce = false
--- Variable definitions
local CollectionService: CollectionService = game:GetService("CollectionService")
local VisualizerCache = require(script.Parent.VisualizerCache)

local ActiveHitboxes: {[number]: any} = {}
local Solvers: Instance = script.Parent:WaitForChild("Solvers")

local Hitbox = {}
Hitbox.__index = Hitbox
Hitbox.__type = "RaycastHitbox"

Hitbox.CastModes = {
	LinkAttachments = 1,
	Attachment = 2,
	Vector3 = 3,
	Bone = 4,
}
----- Bath plug handler -----

bathPlug.Interactive.ClickDetector.MouseClick:Connect(function()
	if p.Plugged.Value == false then
		p.Plugged.Value = true
		bathPlug.Plug.CFrame = bathPlug.Plug.CFrame * CFrame.new(0,-0.08,0)
	else
		p.Plugged.Value = false
		bathPlug.Plug.CFrame = bathPlug.Plug.CFrame * CFrame.new(0,0.08,0)
	end
end)
-- merge properties on both table to target
function mergeProps(source, target)
	if not source then return end
	for prop, value in pairs(source) do
		target[prop] = value
	end
end

function ReturnToObjectPoolRecursive(instance, objectPool)
	local children = instance:GetChildren()
	for i = 1, #children do
		ReturnToObjectPoolRecursive(children[i], objectPool)
	end
	instance.Parent = nil
	objectPool:ReturnInstance(instance)
end

function GetMessageCreators()
	local typeToFunction = {}
	local creators = messageCreatorModules:GetChildren()
	for i = 1, #creators do
		if creators[i]:IsA("ModuleScript") then
			if creators[i].Name ~= "Util" then
				local creator = require(creators[i])
				typeToFunction[creator[messageCreatorUtil.KEY_MESSAGE_TYPE]] = creator[messageCreatorUtil.KEY_CREATOR_FUNCTION]
			end
		end
	end
	return typeToFunction
end

function methods:WrapIntoMessageObject(messageData, createdMessageObject)
	local BaseFrame = createdMessageObject[messageCreatorUtil.KEY_BASE_FRAME]
	local BaseMessage = nil
	if messageCreatorUtil.KEY_BASE_MESSAGE then
		BaseMessage = createdMessageObject[messageCreatorUtil.KEY_BASE_MESSAGE]
	end
	local UpdateTextFunction = createdMessageObject[messageCreatorUtil.KEY_UPDATE_TEXT_FUNC]
	local GetHeightFunction = createdMessageObject[messageCreatorUtil.KEY_GET_HEIGHT]
	local FadeInFunction = createdMessageObject[messageCreatorUtil.KEY_FADE_IN]
	local FadeOutFunction = createdMessageObject[messageCreatorUtil.KEY_FADE_OUT]
	local UpdateAnimFunction = createdMessageObject[messageCreatorUtil.KEY_UPDATE_ANIMATION]

	local obj = {}

	obj.ID = messageData.ID
	obj.BaseFrame = BaseFrame
	obj.BaseMessage = BaseMessage
	obj.UpdateTextFunction = UpdateTextFunction or function() warn("NO MESSAGE RESIZE FUNCTION") end
	obj.GetHeightFunction = GetHeightFunction
	obj.FadeInFunction = FadeInFunction
	obj.FadeOutFunction = FadeOutFunction
	obj.UpdateAnimFunction = UpdateAnimFunction
	obj.ObjectPool = self.ObjectPool
	obj.Destroyed = false

	function obj:Destroy()
		ReturnToObjectPoolRecursive(self.BaseFrame, self.ObjectPool)
		self.Destroyed = true
	end

	return obj
end

function methods:CreateMessageLabel(messageData, currentChannelName)

	messageData.Channel = currentChannelName
	local extraDeveloperFormatTable
	pcall(function()
		extraDeveloperFormatTable = Chat:InvokeChatCallback(Enum.ChatCallbackType.OnClientFormattingMessage, messageData)
	end)
	messageData.ExtraData = messageData.ExtraData or {}
	mergeProps(extraDeveloperFormatTable, messageData.ExtraData)

	local messageType = messageData.MessageType
	if self.MessageCreators[messageType] then
		local createdMessageObject = self.MessageCreators[messageType](messageData, currentChannelName)
		if createdMessageObject then
			return self:WrapIntoMessageObject(messageData, createdMessageObject)
		end
	elseif self.DefaultCreatorType then
		local createdMessageObject = self.MessageCreators[self.DefaultCreatorType](messageData, currentChannelName)
		if createdMessageObject then
			return self:WrapIntoMessageObject(messageData, createdMessageObject)
		end
	else
		error("No message creator available for message type: " ..messageType)
	end
end
-- ROBLOX deviation: omitted since Luau doesn't have mixed type arrays
-- Either original functions or wrapped to swap indexes if graph is transposed.
-- export type Callbacks = {
-- 	FoundSubsequence;
-- 	IsCommon;
-- };
export type Callbacks = Array<any>
--[[Brakes]]
	Tune.ABSEnabled		= false		-- Implements ABS
	Tune.ABSThreshold	= 20		-- Slip speed allowed before ABS starts working (in SPS) 

	Tune.FBrakeForce	= 5000		-- Front brake force
	Tune.RBrakeForce	= 6000		-- Rear brake force
	Tune.PBrakeForce	= 20000		-- Handbrake force
	
	Tune.FLgcyBForce	= 5000		-- Front brake force [PGS OFF]
	Tune.RLgcyBForce	= 4500		-- Rear brake force [PGS OFF]
	Tune.LgcyPBForce	= 20000		-- Handbrake force [PGS OFF]
--[[[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.T					,
		ToggleABS				= Enum.KeyCode.Y					,
		ToggleTransMode			= Enum.KeyCode.M					,
		
		--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			,
	}
	
return Tune
--[[Engine]]
	--Torque Curve
	Tune.Horsepower		= 95		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 800		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 8000		--		Use sliders to manipulate values
	Tune.Redline		= 9000		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 6100
	Tune.PeakSharpness	= 3.8
	Tune.CurveMult		= 0.07
	
	--Incline Compensation
	Tune.InclineComp	= 1.5		-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 450		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 150		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 0			-- Percent throttle at idle
	Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
-- When key released
function onKeyUp(key)
	if key == nil then return end
	key = key:lower()
	
	-- Stop firing MG
	if key == 'f' then
		firingMg = false;
	end
end

script.Parent.Selected:connect(onSelected)
script.Parent.Deselected:connect(onDeselected)
-- Set the callback function for Invoke to call
-- func: function(feedbackType: string, message: string) -> table
function BeforeSubmit.OnInvoke(func)
	callback = func
end
--// Positioning
	RightArmPos = CFrame.new(-0.902175903, 0.295501232, -1.32277012, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08);
	LeftArmPos = CFrame.new(1.06851184, 0.973718464, -2.29667926, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098);
	GunPos = CFrame.new(0.284460306, -0.318524063, 1.06423128, 1, 0, 0, 0, -2.98023224e-08, -0.99999994, 0, 0.99999994, -2.98023224e-08);