Pinkstack/roblox-luau-corpus-text huggingface dataset:
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
---- Option Bindables



do
	local optionCallback = {
		Modifiable = function(value)
			for i = 1,#actionButtons do
				actionButtons[i].Obj.Visible = value and Option.Selectable
			end
			cancelReparentDrag()
		end;
		Selectable = function(value)
			for i = 1,#actionButtons do
				actionButtons[i].Obj.Visible = value and Option.Modifiable
			end
			cancelSelectDrag()
			Selection:Set({})
		end;
	}

	local bindSetOption = explorerPanel:FindFirstChild("SetOption")
	if not bindSetOption then
		bindSetOption = Create('BindableFunction',{Name = "SetOption"})
		bindSetOption.Parent = explorerPanel
	end

	bindSetOption.OnInvoke = function(optionName,value)
		if optionCallback[optionName] then
			Option[optionName] = value
			optionCallback[optionName](value)
		end
	end

	local bindGetOption = explorerPanel:FindFirstChild("GetOption")
	if not bindGetOption then
		bindGetOption = Create('BindableFunction',{Name = "GetOption"})
		bindGetOption.Parent = explorerPanel
	end

	bindGetOption.OnInvoke = function(optionName)
		if optionName then
			return Option[optionName]
		else
			local options = {}
			for k,v in pairs(Option) do
				options[k] = v
			end
			return options
		end
	end
end

function SelectionVar()
	return Selection
end

Input.InputBegan:connect(function(key)
	if key.KeyCode == Enum.KeyCode.LeftControl then
		HoldingCtrl = true
	end
	if key.KeyCode == Enum.KeyCode.LeftShift then
		HoldingShift = true
	end
end)

Input.InputEnded:connect(function(key)
	if key.KeyCode == Enum.KeyCode.LeftControl then
		HoldingCtrl = false
	end
	if key.KeyCode == Enum.KeyCode.LeftShift then
		HoldingShift = false
	end
end)

while RbxApi == nil do
	RbxApi = GetApiRemote:Invoke()
	wait()
end

explorerFilter.Changed:connect(function(prop)
	if prop == "Text" then
		Selection.Finding = true
		rawUpdateList()
	end
end)

explorerFilter.FocusLost:connect(function()
	if explorerFilter.Text == "" then
		if Selection.Found[1] then
			scrollBar:ScrollTo(NodeLookup[Selection.Found[1]].Index)
		end

		Selection.Finding = false
		Selection.Found = {}
	end
end)

CurrentInsertObjectWindow = CreateInsertObjectMenu(
	GetClasses(),
	"",
	false,
	function(option)
		CurrentInsertObjectWindow.Visible = false
		local list = SelectionVar():Get()
		for i = 1,#list do
			RemoteEvent:InvokeServer("InstanceNew", option, list[i])
		end
		DestroyRightClick()
	end
)
--script.Parent:Destroy()


r=script.Parent
script:WaitForChild'To'
pos=script.Parent.CFrame
g,p=r:FindFirstChild'bg'or script.bg,r:FindFirstChild'bp'or script.bp
g.Parent,p.Parent=r,r
p.position=r.Position
function got(t)
if t:IsDescendantOf(workspace.Pick)then
	if t.Parent.Name=='Mod'then
	r.Parent=t.Parent
	script.To.Value=workspace.Finish
	else
	local m=Instance.new('Model',workspace.Pick)
	r.Parent,t.Parent=m,m
	m.Name='Mod'
	end
	local w=Instance.new('Weld',r)
	w.Part0=r
	w.Part1=t
	w.C0=CFrame.new(0,0,-r.Size.Z/2-.1)
	w.C1=CFrame.new(0,0,t.Size.Z/2)
elseif r.Parent.Name=='Mod'then
r.Parent:Destroy()script.Disabled=true
r:Destroy()script:Destroy()
return true
else
script.Disabled=true
r:Destroy()script:Destroy()
return true
end
end
wait(.1)
local rss=script.To.Value.Parent
while 1 do if script.To.Value and script.To.Value.Parent and script.To.Value.Parent==rss then
path=game:GetService'PathfindingService':ComputeRawPathAsync(pos.p,script.To.Value.Position,100)--wait(2)
s2=path:GetPointCoordinates()[2]or path:GetPointCoordinates()[1]
a,b=workspace:FindPartOnRay(Ray.new(pos.p,Vector3.new(0,-6)),r.Parent)
w=0
repeat w=w+1
if s2 then
local cf=CFrame.new(pos.p,s2)
pos=cf*CFrame.new(0,0,-.3)
a,b=workspace:FindPartOnRay(Ray.new(pos.p,Vector3.new(0,-6)),r.Parent)
p.position=Vector3.new(pos.X,b.Y+.3,pos.Z)
g.cframe=r.Velocity.magnitude>.5 and CFrame.new(r.Position,r.Position+r.Velocity)or g.cframe
if(Vector3.new(r.Position.X,0,r.Position.Z)-Vector3.new(pos.X,0,pos.Z)).magnitude>3 then
r.CFrame=r.CFrame-r.Position+Vector3.new(pos.X,b.Y+.3,pos.Z)
end
else break end
wait()until(r.Position-Vector3.new(s2.X,b.y,s2.Z)).magnitude<1 or(r.Position-Vector3.new(s2.X,b.y,s2.Z)).magnitude>6 or w>20
if script.To.Value and(r.Position-script.To.Value.Position).magnitude<8 then if got(script.To.Value)then break end end
else script.To.Value,rss=workspace.Finish,workspace wait()
end end
-- TODO Luau: annoying type erasure here, probably needs the new Records language feature


function Map:set(key: any, value: any): Map<any, any>
	-- preserve initial insertion order
	if self._map[key] == nil then
		-- Luau FIXME: analyze should know self is Map<K, V> which includes size as a number
		self.size = self.size :: number + 1
		table.insert(self._array, key)
	end
	-- always update value
	self._map[key] = value
	return self
end

function Map:get(key)
	return self._map[key]
end

function Map:clear()
	local table_: any = table
	self.size = 0
	table_.clear(self._map)
	table_.clear(self._array)
end

function Map:delete(key): boolean
	if self._map[key] == nil then
		return false
	end
	-- Luau FIXME: analyze should know self is Map<K, V> which includes size as a number
	self.size = self.size :: number - 1
	self._map[key] = nil
	local index = table.find(self._array, key)
	if index then
		table.remove(self._array, index)
	end
	return true
end
--Rescripted by Luckymaxer



Tool = script.Parent
Handle = Tool:WaitForChild("Handle")

Players = game:GetService("Players")

Sounds = {
	CoilSound = Handle:WaitForChild("CoilSound"),
}

Gravity = 196.20
JumpHeightPercentage = 0.2

ToolEquipped = false

function GetAllConnectedParts(Object)
	local Parts = {}
	local function GetConnectedParts(Object)
		for i, v in pairs(Object:GetConnectedParts()) do
			local Ignore = false
			for ii, vv in pairs(Parts) do
				if v == vv then
					Ignore = true
				end
			end
			if not Ignore then
				table.insert(Parts, v)
				GetConnectedParts(v)
			end
		end
	end
	GetConnectedParts(Object)
	return Parts
end

function SetGravityEffect()
	if not GravityEffect or not GravityEffect.Parent then
		GravityEffect = Instance.new("BodyForce")
		GravityEffect.Name = "GravityCoilEffect"
		GravityEffect.Parent = Torso
	end
	local TotalMass = 0
	local ConnectedParts = GetAllConnectedParts(Torso)
	for i, v in pairs(ConnectedParts) do
		if v:IsA("BasePart") then
			TotalMass = (TotalMass + v:GetMass())
		end
	end
	local TotalMass = (TotalMass * 196.20 * (1 - JumpHeightPercentage))
	GravityEffect.force = Vector3.new(0, TotalMass, 0)
end

function HandleGravityEffect(Enabled)
	if not CheckIfAlive() then
		return
	end
	for i, v in pairs(Torso:GetChildren()) do
		if v:IsA("BodyForce") then
			v:Destroy()
		end
	end
	for i, v in pairs({ToolUnequipped, DescendantAdded, DescendantRemoving}) do
		if v then
			v:disconnect()
		end
	end
	if Enabled then
		CurrentlyEquipped = true
		ToolUnequipped = Tool.Unequipped:connect(function()
			CurrentlyEquipped = false
		end)
		SetGravityEffect()
		DescendantAdded = Character.DescendantAdded:connect(function()
			wait()
			if not CurrentlyEquipped or not CheckIfAlive() then
				return
			end
			SetGravityEffect()
		end)
		DescendantRemoving = Character.DescendantRemoving:connect(function()
			wait()
			if not CurrentlyEquipped or not CheckIfAlive() then
				return
			end
			SetGravityEffect()
		end)
	end
end

function CheckIfAlive()
	return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
end

function Equipped(Mouse)
	Character = Tool.Parent
	Humanoid = Character:FindFirstChild("Humanoid")
	Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("UpperTorso")
	Player = Players:GetPlayerFromCharacter(Character)
	if not CheckIfAlive() then
		return
	end
	if HumanoidDied then
		HumanoidDied:disconnect()
	end
	HumanoidDied = Humanoid.Died:connect(function()
		if GravityEffect and GravityEffect.Parent then
			GravityEffect:Destroy()
		end
	end)
	Sounds.CoilSound:Play()
	HandleGravityEffect(true)
	ToolEquipped = true
end

function Unequipped()
	if HumanoidDied then
		HumanoidDied:disconnect()
	end
	HandleGravityEffect(false)
	ToolEquipped = false
end

Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
-- ROBLOX deviation: used to communicate with the TestEZ test runner


local JEST_TEST_CONTEXT = "__JEST_TEST_CONTEXT__"

local LuauPolyfill = require(Packages.LuauPolyfill)
local Error = LuauPolyfill.Error
local instanceof = LuauPolyfill.instanceof
local AssertionError = LuauPolyfill.AssertionError

local getType = require(Packages.JestGetType).getType
--F.brakeLights = function(Tog)
--	for i,v in pairs(script.Parent.Parent.Parent:getChildren()) do
--		if v:FindFirstChild('Brake') then
--			v.Braking.Enabled = (carSeat.Ignition.Value == 1 and Tog or false)
--			v.Lights.Enabled = (carSeat.Ignition.Value == 1 and Tog or false)
--		end
--	end
--end
--Precalculated paths


local t,f,n=true,false,{}
local r={
[58]={{66,19,20,58},t},
[49]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{66,19},t},
[59]={{66,19,20,57,56,30,41,59},t},
[63]={{66,19,63},t},
[34]={{66,19,20,57,56,30,41,39,35,34},t},
[21]={{66,19,20,21},t},
[48]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48},t},
[27]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{66,19,20,57,56,30,41,39,35,34,32,31},t},
[56]={{66,19,20,57,56},t},
[29]={{66,19,20,57,56,30,41,39,35,34,32,31,29},t},
[13]={n,f},
[47]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45},t},
[57]={{66,19,20,57},t},
[36]={{66,19,20,57,56,30,41,39,35,37,36},t},
[25]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,27,26,25},t},
[71]={{66,19,20,57,56,30,41,59,61,71},t},
[20]={{66,19,20},t},
[60]={{66,19,20,57,56,30,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{66,19,20,57,56,30,41,59,61,71,72,76,73,75},t},
[22]={{66,19,20,21,22},t},
[74]={{66,19,20,57,56,30,41,59,61,71,72,76,73,74},t},
[62]={{66,19,63,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{66,19,20,57,56,30,41,39,35,37},t},
[2]={n,f},
[35]={{66,19,20,57,56,30,41,39,35},t},
[53]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{66,19,20,57,56,30,41,59,61,71,72,76,73},t},
[72]={{66,19,20,57,56,30,41,59,61,71,72},t},
[33]={{66,19,20,57,56,30,41,39,35,37,36,33},t},
[69]={{66,19,20,57,56,30,41,60,69},t},
[65]={{66,64,65},t},
[26]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,27,26},t},
[68]={{66,64,67,68},t},
[76]={{66,19,20,57,56,30,41,59,61,71,72,76},t},
[50]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{66},t},
[10]={n,f},
[24]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,27,26,25,24},t},
[23]={{66,19,63,62,23},t},
[44]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44},t},
[39]={{66,19,20,57,56,30,41,39},t},
[32]={{66,19,20,57,56,30,41,39,35,34,32},t},
[3]={n,f},
[30]={{66,19,20,57,56,30},t},
[51]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{66,64,67},t},
[61]={{66,19,20,57,56,30,41,59,61},t},
[55]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{66,19,20,57,56,30,41,39,40,38,42},t},
[40]={{66,19,20,57,56,30,41,39,40},t},
[52]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{66,19,20,57,56,30,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]={{66,19,20,57,56,30,41},t},
[17]={n,f},
[38]={{66,19,20,57,56,30,41,39,40,38},t},
[28]={{66,19,20,57,56,30,41,39,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{66,64},t},
}
return r
--[[Instructions:
   Put this script IN A BRICK! Then in the same brick insert a ClickDetector, Follow the instructions below]]




function onClicked()

script.Parent.BodyGyro.maxTorque = Vector3.new(4e+009, 0, 4e+009)
wait(5)
script.Parent.BodyGyro.maxTorque = Vector3.new(0, 0, 0)

end 
  script.Parent.ClickDetector.MouseClick:connect(onClicked)
--[[ 
	Check out games that I'm working on:
	https://www.roblox.com/games/141084271/Rise-Of-The-Deads
	https://www.roblox.com/games/1158675493/Warritory
	https://www.roblox.com/games/54092940/Universe-Millennium
	https://www.roblox.com/games/50207032/Stranded-Alpha
	https://www.roblox.com/games/126569277/The-Games-Lobby
]]

--
--// # key, ManOff


mouse.KeyUp:connect(function(key)
	if key=="f" then 
		veh.Lightbar.middle.Man:Stop()
		veh.Lightbar.middle.Wail.Volume = 10
		veh.Lightbar.middle.Yelp.Volume = 10
		veh.Lightbar.middle.Priority.Volume = 10
		script.Parent.Parent.Sirens.Man.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		veh.Lightbar.MAN.Transparency = 1
	end
end)
--[[Mobile Support]]


local Buttons = script.Parent:WaitForChild("Buttons")
local Left = Buttons:WaitForChild("Left")
local Right = Buttons:WaitForChild("Right")
local Brake = Buttons:WaitForChild("Brake")
local Gas = Buttons:WaitForChild("Gas")
local Handbrake = Buttons:WaitForChild("Handbrake")

if UserInputService.TouchEnabled then
	Buttons.Visible = true
end
local function LeftTurn(Touch, GPE)
	if Touch.UserInputState == Enum.UserInputState.Begin then
		_GSteerT = -1
		_SteerL = true
	else
		if _SteerR then
			_GSteerT = 1
		else
			_GSteerT = 0
		end
		_SteerL = false
	end
end
Left.InputBegan:Connect(LeftTurn)
Left.InputEnded:Connect(LeftTurn)
--Creates a display Gui for the soft shutdown.



return function()
	local ScreenGui = Instance.new("ScreenGui")
	ScreenGui.Name = "SoftShutdownGui"
	ScreenGui.DisplayOrder = 100
	
	--Create background to cover behind top bar.
	local Frame = Instance.new("Frame")
	Frame.BackgroundColor3 = Color3.fromRGB(45, 202, 245)
	Frame.Position = UDim2.new(-0.5,0,-0.5,0)
	Frame.Size = UDim2.new(2,0,2,0)
	Frame.ZIndex = 10
	Frame.Parent = ScreenGui
	
	local function CreateTextLabel(Size,Position,Text)
		local TextLabel = Instance.new("TextLabel")
		TextLabel.BackgroundTransparency = 1
		TextLabel.Size = Size
		TextLabel.Position = Position
		TextLabel.Text = Text
		TextLabel.ZIndex = 10
		TextLabel.Font = "SourceSansBold"
		TextLabel.TextScaled = true
		TextLabel.TextColor3 = Color3.new(1,1,1)
		TextLabel.TextStrokeColor3 = Color3.new(0,0,0)
		TextLabel.TextStrokeTransparency = 0
		TextLabel.Parent = Frame
	end
	
	--Create text.
	CreateTextLabel(UDim2.new(0.5,0,0.1,0),UDim2.new(0.25,0,0.4,0),"ATTENTION")
	CreateTextLabel(UDim2.new(0.5,0,0.05,0),UDim2.new(0.25,0,0.475,0),"This server is being updated.")
	CreateTextLabel(UDim2.new(0.5,0,0.03,0),UDim2.new(0.25,0,0.55,0),"Please wait...")
	
	--Return the ScreenGui and the background.
	return ScreenGui,Frame		
end
--Weld stuff here


MakeWeld(misc.Shifter2.MeshPart,misc.Shifter2.Main)
MakeWeld(misc.Shifter2.MainBase,misc.Shifter2.Main)
MakeWeld(misc.Shifter2.SN2,misc.Shifter2.Main)
MakeWeld(misc.Shifter.SN,misc.Shifter.Main)
MakeWeld(car.Body.SHIFTHinge,misc.Shifter.SN,"Motor",.03)
MakeWeld(misc.Shifter.Main,misc.Shifter2.SN2)

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)
--// bolekinds



local plr = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent

script.Parent.MouseButton1Click:Connect(function()
	if plr.YouCash.Value >= 1000 and game.ServerStorage.ServerData.AutoClicker.Value == false then
		script.Parent.Parent.Parent.Ching:Play()
		plr.YouCash.Value -= 1000
		game.ServerStorage.ServerData.AutoClicker.Value = true
	end
end)
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 380		--	[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	= 4.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)
--Made by Luckymaxer




Tool = script.Parent
Main = Tool:WaitForChild("Main")
FX = Main:WaitForChild("FX")
Handle = Tool:WaitForChild("Handle")
Light = Handle:WaitForChild("Light")
Recoil = script:WaitForChild("Recoil")

Players = game:GetService("Players")
Debris = game:GetService("Debris")

CastLaser = Tool:WaitForChild("CastLaser"):Clone()

Modules = Tool:WaitForChild("Modules")
Functions = require(Modules:WaitForChild("Functions"))
BaseUrl = "http://www.roblox.com/asset/?id="

ConfigurationBin = Tool:WaitForChild("Configuration")
Configuration = {}
Configuration = Functions.CreateConfiguration(ConfigurationBin, Configuration)

ToolEquipped = false

Remotes = Tool:WaitForChild("Remotes")

Sounds = {
	Fire = Handle:WaitForChild("Fire"),
	HeadShot = Handle:WaitForChild("HeadShot"),
}

BasePart = Instance.new("Part")
BasePart.Shape = Enum.PartType.Block
BasePart.Material = Enum.Material.Plastic
BasePart.TopSurface = Enum.SurfaceType.Smooth
BasePart.BottomSurface = Enum.SurfaceType.Smooth
BasePart.FormFactor = Enum.FormFactor.Custom
BasePart.Size = Vector3.new(0.2, 0.2, 0.2)
BasePart.CanCollide = true
BasePart.Locked = true
BasePart.Anchored = false

BaseRay = BasePart:Clone()
BaseRay.Name = "Ray"
BaseRay.BrickColor = BrickColor.new("Lime green")
BaseRay.Material = Enum.Material.SmoothPlastic
BaseRay.Size = Vector3.new(0.2, 0.2, 0.2)
BaseRay.Anchored = true
BaseRay.CanCollide = false
-- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote


local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}

function configureAnimationSet(name, fileList)
if (animTable[name] ~= nil) then
for _, connection in pairs(animTable[name].connections) do
connection:Disconnect()
end
end
animTable[name] = {}
animTable[name].count = 0
animTable[name].totalWeight = 0
animTable[name].connections = {}
--[=[
	Constructs a new brio that will cleanup afer the set amount of time

	@since 3.6.0
	@param time number
	@param ... any -- Brio values
	@return Brio
]=]


function Brio.delayed(time, ...)
	local brio = Brio.new(...)
	task.delay(time, function()
		brio:Kill()
	end)
	return brio
end
--[ Get Items ]--


local Humanoid = Avatar:WaitForChild("Humanoid")
local Torso = Avatar:WaitForChild("Torso")
local RH = Torso:WaitForChild("Right Hip")
local LH = Torso:WaitForChild("Left Hip")

local RL = Avatar:WaitForChild("Right Leg")
local LL = Avatar:WaitForChild("Left Leg")

local RJ = Avatar:WaitForChild("HumanoidRootPart"):WaitForChild("RootJoint")
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]




local autoscaling	= false					--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		= 120				,
		spInc			= 20				, -- Increment between labelled notches
	},
	
	{
		units			= "KM/H"			,
		scaling			= (10/12) * 1.09728	, -- 1 stud : 10 inches | ft/s to KP/H
		maxSpeed		= 200				,
		spInc			= 20				, -- Increment between labelled notches
	},
	
	{
		units			= "SPS"				,
		scaling			= 1					, -- Roblox standard
		maxSpeed		= 240				,
		spInc			= 20				, -- Increment between labelled notches
	}
}
--[=[
	@class TableUtil

	A collection of helpful table utility functions. Many of these functions are carried over from JavaScript or
	Python that are not present in Lua.

	Tables that only work specifically with arrays or dictionaries are marked as such in the documentation.

	:::info Immutability
	All functions (_except_ `SwapRemove`, `SwapRemoveFirstValue`, and `Lock`) treat tables as immutable and will return
	copies of the given table(s) with the operations performed on the copies.
]=]


local TableUtil = {}

local HttpService = game.HttpService
local rng = Random.new()
--//Transmission//--


local AmountOfGears = 6 --{Max of 8 gears}
local TransmissionType = "Automatic" --{HPattern, Automatic, DualClutch, CVT}
local Drivetrain = "AWD" --{RWD, FWD, AWD}
local TorqueSplit = 30 --{Split to the rear wheels}
local DifferentialF = 0 --{0 = Open, 1 = locked}
local DifferentialR = 0.6 --{0 = Open, 1 = locked}

local Gear1 = 4.60
local Gear2 = 2.72
local Gear3 = 1.86
local Gear4 = 1.46
local Gear5 = 1.23
local Gear6 = 1.00
local Gear7 = 0.82
local Gear8 = 0.69

local FinalDrive = 2.937

local EngineIdle = 600
local EngineRedline = 6800
--[=[
	Invokes the function once at the given event, unless the cancel callback is called.

	@param event Signal | RBXScriptSignal
	@param func function -- Function to call
	@return function -- Call this function to cancel call
]=]


function StepUtils.onceAtEvent(event, func)
	assert(type(func) == "function", "Bad func")

	local conn
	local function cleanup()
		if conn then
			conn:Disconnect()
			conn = nil
		end
	end

	conn = event:Connect(function(...)
		cleanup()
		func(...)
	end)

	return cleanup
end

return StepUtils
-- for quick setting-back of face


local oldFace = nil
local oldFaceTexture = nil

local debounce = false
function changeFace(torso)
	if debounce then return end
	debounce = true 

	oldFace = nil
	oldFaceTexture = nil

	local char = torso.Parent
	if char then
		local charHead = char:FindFirstChild("Head")
		if charHead then
			local charFace = charHead:FindFirstChild("face")
			if charFace then
				oldFaceTexture = charFace.Texture
				charFace.Texture = "http://www.roblox.com/asset/?id="..tostring(toiletFace[math.random(1, #toiletFace)])
				oldFace = charFace
			end
		end
	end
end

function checkForNewSitter(newChild)
	if newChild:IsA("Weld") and newChild.Name == "SeatWeld" then
		if newChild.Part0 == toilet then changeFace(newChild.Part1)
		else changeFace(newChild.Part0) end
	end
end

function checkForFaceRelease(child)
	if child:IsA("Weld") and child.Name == "SeatWeld" then
		if oldFace and oldFaceTexture then
			oldFace.Texture = oldFaceTexture
			oldFace = nil
			oldFaceTexture = nil
		end

		debounce = false
	end
end

toilet.ChildAdded:connect(checkForNewSitter)
toilet.ChildRemoved:connect(checkForFaceRelease)