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




VELOCITY = 90

function firenade(mouse_pos)
	nadeloaded=false
	local head=game.Workspace:findFirstChild(script.Parent.Parent.Name).Head
	if head == nil then return end
	
	local dir = mouse_pos - head.Position
	dir = computeDirection(dir)

	local launch = head.Position + 5 * dir

	local delta = mouse_pos - launch
	
	local dy = delta.y
	
	local new_delta = Vector3.new(delta.x, 0, delta.z)
	delta = new_delta

	local dx = delta.magnitude
	local unit_delta = delta.unit

	local g = (-9.81 * 20)

	local theta = computeLaunchAngle(dx, dy, g)

	local vy = math.sin(theta)
	local xz = math.cos(theta)
	local vx = unit_delta.x * xz
	local vz = unit_delta.z * xz

	local missile = Instance.new("Part")
	missile.Size = Vector3.new(1,1,1)
	missile.BrickColor=BrickColor.new(0)
	missile.Shape = 0
	missile.BottomSurface = 0
	missile.TopSurface = 0
	missile.Name = "Grenade"
	missile.Elasticity = .2
	missile.Reflectance = 0
	missile.Friction = .8        
	missile.Position = launch
	missile.Velocity = Vector3.new(vx,vy,vz) * VELOCITY

	script.Parent.GrenadeScript:clone().Parent=missile
	missile.GrenadeScript.Disabled = false

	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = game.Players.LocalPlayer
	creator_tag.Name = "creator"
	creator_tag.Parent = missile
	
	missile.Parent = game.Workspace

	wait(0.5)
	script.Parent.mode.Value=script.Parent.mode.Value-10
	wait(10)
	nadeloaded=true

end

function computeLaunchAngle(dx,dy,grav)
	local g = math.abs(grav)
	local inRoot = (VELOCITY^4) - (g * ((g*dx*dx) + (2*dy*(VELOCITY^2))))
	if inRoot <= 0 then
		return .25 * math.pi
	end
	local root = math.sqrt(inRoot)
	local inATan1 = ((VELOCITY^2) + root) / (g*dx)

	local inATan2 = ((VELOCITY^2) - root) / (g*dx)
	local answer1 = math.atan(inATan1)
	local answer2 = math.atan(inATan2)
	if answer1 < answer2 then return answer1 end
	return answer2
end

function computeDirection(vec)
	local lenSquared = vec.magnitude * vec.magnitude
	local invSqrt = 1 / math.sqrt(lenSquared)
	return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end
-- Call AddStamina or RemoveStamina and add a number into the brackets between 0-100 to add/deduct stamina.



local StaminaSystem = {}
StaminaSystem.StaminaValue = script.Parent.StaminaValue
StaminaSystem.StaminaCanRegen = true

function StaminaSystem.AddStamina(value)
	local newStamina = math.min(StaminaSystem.StaminaValue.Value + value, 100)
	StaminaSystem.StaminaValue.Value = newStamina
end

function StaminaSystem.RemoveStamina(value)
	local newStamina = math.max(StaminaSystem.StaminaValue.Value - value, 0)
	StaminaSystem.StaminaValue.Value = newStamina
end

return StaminaSystem
--Precalculated paths


local t,f,n=true,false,{}
local r={
[58]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58},t},
[49]={{52,47,48,49},t},
[16]={n,f},
[19]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19},t},
[59]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59},t},
[63]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,23,62,63},t},
[34]={{52,47,48,49,45,44,28,29,31,32,34},t},
[21]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,21},t},
[48]={{52,47,48},t},
[27]={{52,47,48,49,45,44,28,27},t},
[14]={n,f},
[31]={{52,47,48,49,45,44,28,29,31},t},
[56]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56},t},
[29]={{52,47,48,49,45,44,28,29},t},
[13]={n,f},
[47]={{52,47},t},
[12]={n,f},
[45]={{52,47,48,49,45},t},
[57]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,57},t},
[36]={{52,47,48,49,45,44,28,29,31,32,33,36},t},
[25]={{52,47,48,49,45,44,28,27,26,25},t},
[71]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71},t},
[20]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20},t},
[60]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76,73,75},t},
[22]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,21,22},t},
[74]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76,73,74},t},
[62]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{52,47,48,49,45,44,28,29,31,32,33,36,37},t},
[2]={n,f},
[35]={{52,47,48,49,45,44,28,29,31,32,34,35},t},
[53]={{52,53},t},
[73]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76,73},t},
[72]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72},t},
[33]={{52,47,48,49,45,44,28,29,31,32,33},t},
[69]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,60,69},t},
[65]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,65},t},
[26]={{52,47,48,49,45,44,28,27,26},t},
[68]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67,68},t},
[76]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76},t},
[50]={{52,50},t},
[66]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{52,47,48,49,45,44,28,27,26,25,24},t},
[23]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,23},t},
[44]={{52,47,48,49,45,44},t},
[39]={{52,47,48,49,45,44,28,29,31,32,34,35,39},t},
[32]={{52,47,48,49,45,44,28,29,31,32},t},
[3]={n,f},
[30]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30},t},
[51]={{52,53,54,55,51},t},
[18]={n,f},
[67]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67},t},
[61]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61},t},
[55]={{52,53,54,55},t},
[46]={{52,47,46},t},
[42]={{52,47,48,49,45,44,28,29,31,32,34,35,38,42},t},
[40]={{52,47,48,49,45,44,28,29,31,32,34,35,40},t},
[52]={{52},t},
[54]={{52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41},t},
[17]={n,f},
[38]={{52,47,48,49,45,44,28,29,31,32,34,35,38},t},
[28]={{52,47,48,49,45,44,28},t},
[5]={n,f},
[64]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64},t},
}
return r
-- Legacy implementation renamed


function CameraUtils.GetAngleBetweenXZVectors(v1, v2)
	return math.atan2(v2.X*v1.Z-v2.Z*v1.X, v2.X*v1.X+v2.Z*v1.Z)
end

function CameraUtils.RotateVectorByAngleAndRound(camLook, rotateAngle, roundAmount)
	if camLook.Magnitude > 0 then
		camLook = camLook.unit
		local currAngle = math.atan2(camLook.z, camLook.x)
		local newAngle = round((math.atan2(camLook.z, camLook.x) + rotateAngle) / roundAmount) * roundAmount
		return newAngle - currAngle
	end
	return 0
end
-- TUNE


SpeedType = "KPH"	-- MPH or KPH



























local Smoothness = 0.89
local TurboSmoothness = 0.87
local autoscaling	= true					--Estimates top speed
local UNITS	= {								--Click on speed to change units
											--First unit is default	
	{
		units			= "MPH"				,
		scaling			= (10/12) * (60/88)	, -- 1 stud : 10 inches | ft/s to MPH
		maxSpeed		= 230				,
		spInc			= 20				, -- Increment between labelled notches
	},
	
	{
		units			= "KM/H"			,
		scaling			= (10/12) * 1.09728	, -- 1 stud : 10 inches | ft/s to KP/H
		maxSpeed		= 370				,
		spInc			= 40				, -- Increment between labelled notches
	},
	
	{
		units			= "SPS"				,
		scaling			= 1					, -- Roblox standard
		maxSpeed		= 400				,
		spInc			= 40				, -- Increment between labelled notches
	}
}
-- https://stackoverflow.com/a/5732390



type Range = { number }

local function mapRange(n: number, input: Range, output: Range): number
	assert(input[1] ~= input[2], "input min and max must be different numbers to avoid dividing by zero")

	local slope = (output[2] - output[1]) / (input[2] - input[1])
	return slope * (n - input[1]) + output[1]
end

return mapRange
--Precalculated paths


local t,f,n=true,false,{}
local r={
[58]={{59,41,30,56,58},t},
[49]={{59,41,39,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{59,41,30,56,58,20,19},t},
[59]={{59},t},
[63]={{59,41,30,56,58,23,62,63},t},
[34]={{59,41,39,35,34},t},
[21]={{59,41,30,56,58,20,21},t},
[48]={{59,41,39,35,34,32,31,29,28,44,45,49,48},t},
[27]={{59,41,39,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{59,41,39,35,34,32,31},t},
[56]={{59,41,30,56},t},
[29]={{59,41,39,35,34,32,31,29},t},
[13]={n,f},
[47]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{59,41,39,35,34,32,31,29,28,44,45},t},
[57]={{59,41,30,56,57},t},
[36]={{59,41,39,35,37,36},t},
[25]={{59,41,39,35,34,32,31,29,28,27,26,25},t},
[71]={{59,61,71},t},
[20]={{59,41,30,56,58,20},t},
[60]={{59,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{59,61,71,72,76,73,75},t},
[22]={{59,41,30,56,58,20,21,22},t},
[74]={{59,61,71,72,76,73,74},t},
[62]={{59,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{59,41,39,35,37},t},
[2]={n,f},
[35]={{59,41,39,35},t},
[53]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{59,61,71,72,76,73},t},
[72]={{59,61,71,72},t},
[33]={{59,41,39,35,37,36,33},t},
[69]={{59,41,60,69},t},
[65]={{59,41,30,56,58,20,19,66,64,65},t},
[26]={{59,41,39,35,34,32,31,29,28,27,26},t},
[68]={{59,41,30,56,58,20,19,66,64,67,68},t},
[76]={{59,61,71,72,76},t},
[50]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{59,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{59,41,39,35,34,32,31,29,28,27,26,25,24},t},
[23]={{59,41,30,56,58,23},t},
[44]={{59,41,39,35,34,32,31,29,28,44},t},
[39]={{59,41,39},t},
[32]={{59,41,39,35,34,32},t},
[3]={n,f},
[30]={{59,41,30},t},
[51]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{59,41,30,56,58,20,19,66,64,67},t},
[61]={{59,61},t},
[55]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{59,41,39,40,38,42},t},
[40]={{59,41,39,40},t},
[52]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{59,41},t},
[17]={n,f},
[38]={{59,41,39,40,38},t},
[28]={{59,41,39,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{59,41,30,56,58,20,19,66,64},t},
}
return r
--[[ Constants ]]

--

local TOUCH_CONTROLS_SHEET = "rbxasset://textures/ui/Input/TouchControlsSheetV2.png"

local MIDDLE_TRANSPARENCIES = {
	1 - 0.89,
	1 - 0.70,
	1 - 0.60,
	1 - 0.50,
	1 - 0.40,
	1 - 0.30,
	1 - 0.25
}
local NUM_MIDDLE_IMAGES = #MIDDLE_TRANSPARENCIES

local TOUCH_IS_TAP_TIME_THRESHOLD = 0.5
local TOUCH_IS_TAP_DISTANCE_THRESHOLD = 25

local HasFadedBackgroundInPortrait = false
local HasFadedBackgroundInLandscape = false
local FadeInAndOutBackground = true
local FadeInAndOutMaxAlpha = 0.35
local TweenInAlphaStart = nil
local TweenOutAlphaStart = nil

local FADE_IN_OUT_HALF_DURATION_DEFAULT = 0.3
local FADE_IN_OUT_HALF_DURATION_ORIENTATION_CHANGE = 2
local FADE_IN_OUT_BALANCE_DEFAULT = 0.5
local FadeInAndOutHalfDuration = FADE_IN_OUT_HALF_DURATION_DEFAULT
local FadeInAndOutBalance = FADE_IN_OUT_BALANCE_DEFAULT

local ThumbstickFadeTweenInfo = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
--[=[
	Observes an instance's ancestry with a brio

	@param instance Instance
	@param className string
	@return Observable<Brio<Instance>>
]=]


function RxInstanceUtils.observeFirstAncestorBrio(instance, className)
	assert(typeof(instance) == "Instance", "Bad instance")
	assert(type(className) == "string", "Bad className")

	return Observable.new(function(sub)
		local maid = Maid.new()

		local lastFound = nil
		local function handleAncestryChanged()
			local found = instance:FindFirstAncestorWhichIsA(className)

			if found then
				if found ~= lastFound then
					lastFound = found
					local brio = Brio.new(found)
					maid._current = brio
					sub:Fire(brio)
				end
			elseif lastFound then
				maid._current = nil
				lastFound = nil
			end
		end

		maid:GiveTask(instance.AncestryChanged:Connect(handleAncestryChanged))
		handleAncestryChanged()

		return maid
	end)
end
--Weld stuff here



MakeWeld(car.Misc.Hinges.Hinge,car.DriveSeat,"Motor",0).Name="ENGINE"
ModelWeld(misc.Hinges.Parts,misc.Hinges.Hinge)
MakeWeld(car.Misc.ActualCam.Hinge,car.Misc.Hinges.Parts.Hinge2,"Motor",0).Name="ENGINE"
ModelWeld(misc.ActualCam.Parts,misc.ActualCam.Hinge)

MakeWeld(car.Misc.Tach.M,car.DriveSeat,"Motor").Name="M"
ModelWeld(misc.Tach.Parts,misc.Tach.M)
MakeWeld(car.Misc.Speedo.N,car.DriveSeat,"Motor").Name="N"
ModelWeld(misc.Speedo.Parts,misc.Speedo.N)

MakeWeld(misc.Popups.Hinge, car.DriveSeat,"Motor",.1)
ModelWeld(misc.Popups.Parts, misc.Popups.Hinge)

local INT_PCK = nil
for i,v in pairs(misc:GetDescendants()) do
	if v:IsA("ObjectValue") and v.Name == "INTERIOR_PACK" then INT_PCK = v.Value end
end
if INT_PCK then

	if INT_PCK:FindFirstChild("Handbrake") then
		local HB = INT_PCK.Handbrake
		MakeWeld(HB.W,car.DriveSeat,"Motor",0.1)
		ModelWeld(HB.Parts,HB.W)
		ModelWeld(HB.Misc,car.DriveSeat)
	end

	if INT_PCK:FindFirstChild("Pedals") then
		local PD = INT_PCK.Pedals
		MakeWeld(PD.B,car.DriveSeat,"Motor",0.1)
		ModelWeld(PD.Brake,PD.B)
		MakeWeld(PD.C,car.DriveSeat,"Motor",0.1)
		ModelWeld(PD.Clutch,PD.C)
		MakeWeld(PD.T,car.DriveSeat,"Motor",0.1)
		ModelWeld(PD.Throttle,PD.T)
	end

	if INT_PCK:FindFirstChild("Shifter") then
		local SH = INT_PCK.Shifter
		MakeWeld(SH.Hinge,car.DriveSeat,"Weld")
		MakeWeld(SH.W1,SH.Hinge,"Motor",0.05)
		MakeWeld(SH.W2,SH.W1,"Motor",0.05)
		ModelWeld(SH.Parts,SH.W2)
		ModelWeld(SH.Misc,car.DriveSeat)
	end

	if INT_PCK:FindFirstChild("Steering_Wheel") then
		local SW = INT_PCK.Steering_Wheel
		MakeWeld(SW.W,car.DriveSeat,"Motor",0.5)
		ModelWeld(SW.Parts,SW.W)
	end

end

car.DriveSeat.ChildAdded:connect(function(child)
	if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(13),0,0)
	end
end)
--[[
	Updates the value stored in this State object.

	If `force` is enabled, this will skip equality checks and always update the
	state object and any dependents - use this with care as this can lead to
	unnecessary updates.
]]


function class:set(newValue: any, force: boolean?)
	local oldValue = self._value
	if force or not isSimilar(oldValue, newValue) then
		self._value = newValue
		updateAll(self)
	end
end

local function Value<T>(initialValue: T): Types.State<T>
	local self = setmetatable({
		type = "State",
		kind = "Value",
		-- if we held strong references to the dependents, then they wouldn't be
		-- able to get garbage collected when they fall out of scope
		dependentSet = setmetatable({}, WEAK_KEYS_METATABLE),
		_value = initialValue
	}, CLASS_METATABLE)

	initDependency(self)

	return self
end

return Value
--This is the server sided module for handling this vehicles seating requests


local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local HttpService = game:GetService("HttpService")

local DOOR_OPEN_SPEED = 2.15
local DOOR_OPEN_ANGLE = 55
local DOOR_OPEN_TIME = 0.5 --How long the door stays open for when entering/leaving

local MAX_SEATING_DISTANCE = 15
local MIN_FLIP_ANGLE = 70 --degrees from vertical

local PackagedScripts = script.Parent
local PackagedVehicle = PackagedScripts.Parent

local RemotesFolder = nil --Set later in the code by the SetRemotesFolder function
-- // Vars



local TweenService = game:GetService("TweenService")

local frame = script.Parent.Parent
local button = script.Parent

local onPosition = UDim2.new(0, 0,0, 0)
local onColor = Color3.new(0.333333, 1, 0)
local offPosition = UDim2.new(0.519, 0,0, 0)
local offColor = Color3.new(1, 0, 0)

local debounce = false
local waitTime = 0.5
-- setup emote chat hook


game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
	local emote = ""
	if string.sub(msg, 1, 3) == "/e " then
		emote = string.sub(msg, 4)
	elseif string.sub(msg, 1, 7) == "/emote " then
		emote = string.sub(msg, 8)
	end
	
	if (pose == "Standing" and emoteNames[emote] ~= nil) then
		playAnimation(emote, 0.1, Humanoid)
	end
end)
-----------------
--| Constants |--
-----------------



local ROCKET_MESH_ID = 'http://www.roblox.com/asset/?id=94690081'
local ROCKET_MESH_SCALE = Vector3.new(1, 1, 1)

local ROCKET_SHOW_TIME = 1.5 -- Seconds after animation begins to show the rocket
local ROCKET_HIDE_TIME = 2.2 -- Seconds after animation begins to hide the rocket
--[[[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
		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.R					,
		ShiftDown				= Enum.KeyCode.F					,
		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			,
	}
--edit the below function to execute code when this response is chosen OR this prompt is shown
--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)
	plrData.Classes.Base.Smasher.NoHumor.Value = true
	plrData.Classes.Base.Smasher.HeavyWeaponTraining.Value = true
	plrData.Classes.Base.Smasher.PlateTraining.Value = true
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
--[[Weight and CG]]


	Tune.Weight			= 6000 		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		5		,
	 --[[Height]]		8		,
	 --[[Length]]		17		}
	Tune.WeightDist		= 65		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .100		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .1		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- Rear Wheel Density
	Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
	Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]
	
	Tune.AxleSize		= 2			-- Size of structural members (larger = more stable/carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members
-- ROBLOX deviation END



local function extractValidTemplateHeadings(headings: string): string
	-- ROBLOX deviation START: get lines with value, return the first one, check for spaces in headings
	local match = headings:match(HEADINGS_FORMAT)
	local matches, hasEmptySpacesInHeading
	if match then
		matches = Array.filter(String.split(match, "\n"), function(line)
			return String.trim(line) ~= ""
		end)
	end
	if matches and #matches > 0 then
		local headings_ = Array.map(String.split(matches[1], "|"), function(heading)
			return String.trim(heading)
		end)
		hasEmptySpacesInHeading = Array.some(headings_, function(heading)
			return heading:match("%s") ~= nil
		end)
	end

	if match == nil or hasEmptySpacesInHeading then
		error(
			Error.new(
				"Table headings do not conform to expected format:\n\n"
					.. EXPECTED_COLOR("heading1 | headingN")
					.. "\n\n"
					.. "Received:\n\n"
					.. RECEIVED_COLOR(pretty(headings))
			)
		)
	end
	-- ROBLOX deviation END
	return matches[1]
end
exports.extractValidTemplateHeadings = extractValidTemplateHeadings

return exports
--HUB.Default.Lock.MouseButton1Click:connect(function()
--	if carSeat.Seatlock.Value == false then
--		handler:FireServer('seatlock',true,0)
--	else
--		handler:FireServer('seatlock',false,12)
--	end
--end)



radio.Buttons.Play.MouseButton1Click:connect(function()
	handler:FireServer('updateSong', radio.Buttons.Input.Text)
end)

radio.Buttons.Stop.MouseButton1Click:connect(function() 
	handler:FireServer('pauseSong')
end)
game:GetService("RunService").RenderStepped:connect(function()
	if cam == "lockplr" then
		local XLook=math.max(math.min(((mouse.X-(mouse.ViewSizeX/2))/300)^3,1),-1)
		local YLook=math.max(math.min(((mouse.Y-(mouse.ViewSizeY/2))/300)^3,1),-1)
		local LookOffset
		if player.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
			LookOffset=player.Character.Head.CFrame:toWorldSpace(CFrame.new(0.05,.2,-.1)*CFrame.Angles(-YLook,-XLook,0))
		else
			LookOffset=player.Character.Head.CFrame:toWorldSpace(CFrame.new(0.05,0,-.3)*CFrame.Angles(-YLook,-XLook,0))
		end
		Camera.CameraType="Scriptable"
		Camera.CameraSubject=player.Character.Humanoid
		Camera.CoordinateFrame=LookOffset
		player.CameraMaxZoomDistance=0
	else
		player.CameraMaxZoomDistance=400
	end
end)

while wait() do
	HUB.Misc.SS.ImageTransparency = carSeat.SST.Value and 0 or 0.7
	if carSeat.Tic.Value then
		HUB.Misc.SS.ImageColor3 = Color3.new(0,1,0)
	else
		HUB.Misc.SS.ImageColor3 = Color3.new(0,0,0)
	end
	HUB.Misc.CC.ImageColor3 = carSeat.CC.Value and Color3.new(0,1,0) or Color3.new(0,0,0)
end
--[[
	wpcallPacked is a version of xpcall that:
	* Returns the length of the result first
	* Returns the result packed into a table
	* Passes extra arguments through to the passed function; xpcall doesn't
	* Issues a warning if PROMISE_DEBUG is enabled
]]


local function wpcallPacked(f, ...)
	local argsLength, args = pack(...)

	local body = function()
		return f(unpack(args, 1, argsLength))
	end

	local resultLength, result = pack(xpcall(body, debug.traceback))

	-- If promise debugging is on, warn whenever a pcall fails.
	-- This is useful for debugging issues within the Promise implementation
	-- itself.
	if PROMISE_DEBUG and not result[1] then
		warn(result[2])
	end

	return resultLength, result
end