Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- the constructor
-- creates a new Bezier object with the given points added in order


function Bezier.new(...: Vector3 | BasePart)
	local self = setmetatable({}, Bezier)
	local args = {...}
	
	-- holds the points
	self.Points = {}
	
	-- length information
	self.LengthIterations = 1000
	self.LengthIndeces = {}
	self.Length = 0
	
	-- holds the connections from baseparts
	self._connections = {}
	
	-- iterate through given arguments
	for _, p in pairs(args) do
		if typeof(p) == "Vector3" or (typeof(p) == "Instance" and p:IsA("BasePart")) then
			self:AddBezierPoint(p)
		else
			error("The Bezier.new() constructor only takes in Vector3s and BaseParts as inputs!")
		end
	end
	
	-- returns the bezier object
	return self
end
--[=[
	Merges higher order observables together

	https://rxjs.dev/api/operators/switchAll

	Works like mergeAll, where you subscribe to an observable which is
	emitting observables. However, when another observable is emitted it
	disconnects from the other observable and subscribes to that one.

	@return (source: Observable<Observable<T>>) -> Observable<T>
]=]


function Rx.switchAll()
	return function(source)
		assert(Observable.isObservable(source), "Bad observable")

		return Observable.new(function(sub)
			local outerMaid = Maid.new()
			local topComplete = false
			local insideComplete = false
			local currentInside = nil

			outerMaid:GiveTask(function()
				-- Ensure inner subscription is disconnected first. This prevents
				-- the inner sub from firing while the outer is subscribed,
				-- throwing a warning.
				outerMaid._innerSub = nil
				outerMaid._outerSuber = nil
			end)

			outerMaid._outerSuber = source:Subscribe(
				function(observable)
					assert(Observable.isObservable(observable), "Bad observable")

					insideComplete = false
					currentInside = observable
					outerMaid._innerSub = nil

					outerMaid._innerSub = observable:Subscribe(
						function(...)
							sub:Fire(...)
						end, -- Merge each inner observable
						function(...)
							if currentInside == observable then
								sub:Fail(...)
							end
						end, -- Emit failure automatically
						function()
							if currentInside == observable then
								insideComplete = true
								if insideComplete and topComplete then
									sub:Complete()
									outerMaid:DoCleaning() -- Paranoid ensure cleanup.
								end
							end
						end)
				end,
				function(...)
					sub:Fail(...) -- Also reflect failures up to the top!
					outerMaid:DoCleaning()
				end,
				function()
					topComplete = true
					if insideComplete and topComplete then
						sub:Complete()
						outerMaid:DoCleaning() -- Paranoid ensure cleanup
					end
				end)

			return outerMaid
		end)
	end
end
-- Initialize Events


function Input:_listenForEvents ()
	local e1 = UserInputService.InputBegan:connect (function (input, gameProcessed)
	--	if (gameProcessed) then return end
		self:_checkDown (input, true);
	end)
	local e2 = UserInputService.InputEnded:connect (function (input, gameProcessed)
	--	if (gameProcessed) then return end
		self:_checkDown (input, false);
	end)
	local e3 = UserInputService.InputChanged:connect (function (input, gameProcessed)
	--	if (gameProcessed) then return end
		self:_checkMouseMoved (input);
	end);
	local e4 = UserInputService.TouchMoved:connect (function (input, gameProcessed)
	--	if (gameProcessed) then return end
		self:_checkMouseMoved (input, true);
	end)
	
	self._events = {e1, e2, e3};
end
-- Math functions/constants caching


local random = math.random
local floor = math.floor
local acos = math.acos
local rad = math.rad
local min = math.min
local max = math.max
local abs = math.abs
local twopi = math.pi * 2.0
local dot = zeroVector.Dot
local cross = zeroVector.Cross

local autoThrottleRatio = 0.5       -- Current auto-throttling rate
local throttleDistanceModifier = 60 -- Studs distance from camera at which distance-throttling will start
local segmentPerArc = 12            -- Current number of segments per arc (lower number = better performance)
-- Remove any -0 values from the Vector3 for consistent string conversion


function BitOps.normalizeVec3(vec3)
	local newVec3X = vec3.X
	local newVec3Y = vec3.Y
	local newVec3Z = vec3.Z

	if newVec3X == 0 then
		newVec3X = 0
	end

	if newVec3Y == 0 then
		newVec3Y = 0
	end

	if newVec3Z == 0 then
		newVec3Z = 0
	end

	return Vector3.new(newVec3X, newVec3Y, newVec3Z)
end
--[[
local part = script.Parent
local Activator = game.ReplicatedStorage.GameFiles.Values.PopUpActive
local frame = script.Parent.Parent

local posOff = UDim2.new(0, 0, 0, 0)
local posOn = UDim2.new(0.786, 0, 0, 0)

local lighting = game.Lighting
local g = game.Workspace.AssetClean

part:TweenPosition(posOn, "In", "Sine", 0.3) -- The button is online
part.BackgroundColor3 = Color3.fromRGB(0, 255, 0)	
frame.BackgroundColor3 = Color3.fromRGB(0, 177, 0)

part.MouseButton1Click:Connect(function()
	if Activator.Value == true then
		Activator.Value = false
		part:TweenPosition(posOff, "Out", "Sine", 0.3)
		part.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
		frame.BackgroundColor3 = Color3.fromRGB(177, 0, 0)
elseif Activator.Value == false then
		Activator.Value = true
		part.BackgroundColor3 = Color3.fromRGB(0, 255, 0)	
		frame.BackgroundColor3 = Color3.fromRGB(0, 177, 0)
		part:TweenPosition(posOn, "In", "Sine", 0.3)
	end
end)

while wait() do
	if Activator.Value == true then
		part:TweenPosition(posOn, "In", "Sine", 0.3)
		part.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
		frame.BackgroundColor3 = Color3.fromRGB(0, 177, 0)
	elseif Activator.Value == false then
		part.BackgroundColor3 = Color3.fromRGB(255, 0, 0)	
		frame.BackgroundColor3 = Color3.fromRGB(177, 0, 0)
		part:TweenPosition(posOff, "Out", "Sine", 0.3)
	end
end
--]]
--[=[
	@param streamables {Streamable}
	@param handler ({[child: string]: Instance}, trove: Trove) -> nil
	@return Trove

	Creates a compound streamable around all the given streamables. The compound
	streamable's observer handler will be fired once _all_ the given streamables
	are in existence, and will be cleaned up when _any_ of the streamables
	disappear.

	```lua
	local s1 = Streamable.new(workspace, "Part1")
	local s2 = Streamable.new(workspace, "Part2")

	local compoundTrove = StreamableUtil.Compound({S1 = s1, S2 = s2}, function(streamables, trove)
		local part1 = streamables.S1.Instance
		local part2 = streamables.S2.Instance
		trove:Add(function()
			print("Cleanup")
		end)
	end)
	```
]=]


function StreamableUtil.Compound(streamables: Streamables, handler: CompoundHandler)
	local compoundTrove = Trove.new()
	local observeAllTrove = Trove.new()
	local allAvailable = false
	local function Check()
		if allAvailable then return end
		for _,streamable in pairs(streamables) do
			if not streamable.Instance then
				return
			end
		end
		allAvailable = true
		handler(streamables, observeAllTrove)
	end
	local function Cleanup()
		if not allAvailable then return end
		allAvailable = false
		observeAllTrove:Clean()
	end
	for _,streamable in pairs(streamables) do
		compoundTrove:Add(streamable:Observe(function(_child, trove)
			Check()
			trove:Add(Cleanup)
		end))
	end
	compoundTrove:Add(Cleanup)
	return compoundTrove
end


return StreamableUtil
--[[
	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

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()
--!strict
-- https://programming-idioms.org/idiom/19/reverse-a-list/1314/lua


local LuauPolyfill = script.Parent.Parent
local types = require(LuauPolyfill.types)
type Array<T> = types.Array<T>

return function<T>(t: Array<T>): Array<T>
	local n = #t
	local i = 1
	while i < n do
		t[i], t[n] = t[n], t[i]
		i = i + 1
		n = n - 1
	end
	return t
end
--		child.C0 = CFrame.new(0,-0.6,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0) --// Reposition player


		if child.Part1.Name == "HumanoidRootPart" then
			player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
			if player and (not player.PlayerGui:FindFirstChild("Screen")) then --// The part after the "and" prevents multiple GUI's to be copied over.
				GUI.CarSeat.Value = script.Parent --// Puts a reference of the seat in this ObjectValue, now you can use this ObjectValue's value to find the car directly.
				GUI:Clone().Parent = player.PlayerGui --// Compact version
				if script.Parent.L.Value == true then --because you can't get in a locked car
					wait()
					script.Parent.Disabled = true
					wait()
					script.Parent.Disabled = false
				else
					script.Parent.Occupied.Value = true
					script.Parent.Occupied.Value = true
				end
			end
		end
	end
end)

script.Parent.ChildRemoved:connect(function(child)
	if child:IsA("Weld") then
		if child.Part1.Name == "HumanoidRootPart" then
			game.Workspace.CurrentCamera.FieldOfView = 70
			player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
			if player and player.PlayerGui:FindFirstChild("SS3") then
				player.PlayerGui:FindFirstChild("SS3"):Destroy()
				script.Parent.Occupied.Value = false
			end
		end
	end	
end)
-- Styles



local Styles = {
	Font = Enum.Font.Arial,
	Margin = 5,
	Black = Color3_fromRGB(0,0,5),
	Black2 = Color3_fromRGB(24,24,29),
	White = Color3_fromRGB(244,244,249),
	White2 = Color3_fromRGB(200,200,205),
	Hover = Color3_fromRGB(2,128,149),
	Hover2 = Color3_fromRGB(5,102,146)
}

local Row = {
	Font = Styles.Font,
	FontSize = Enum.FontSize.Size12,
	TextXAlignment = Enum.TextXAlignment.Left,
	TextColor = Styles.White,
	TextColorOver = Styles.White2,
	TextLockedColor = Color3_fromRGB(155, 155, 160),
	Height = 24,
	BorderColor = Color3_fromRGB(54, 54, 55),
	BackgroundColor = Styles.Black2,
	BackgroundColorAlternate = Color3_fromRGB(32, 32, 37),
	BackgroundColorMouseover = Color3_fromRGB(40, 40, 45),
	TitleMarginLeft = 15
}

local DropDown = {
	Font = Styles.Font,
	FontSize = Enum.FontSize.Size14,
	TextColor = Color3_fromRGB(255, 255, 255),
	TextColorOver = Styles.White2,
	TextXAlignment = Enum.TextXAlignment.Left,
	Height = 16,
	BackColor = Styles.Black2,
	BackColorOver = Styles.Hover2,
	BorderColor = Color3_fromRGB(45, 45, 50),
	BorderSizePixel = 2,
	ArrowColor = Color3_fromRGB(80, 80, 83),
	ArrowColorOver = Styles.Hover
}

local BrickColors = {
	BoxSize = 13,
	BorderSizePixel = 1,
	BorderColor = Color3_fromRGB(53, 53, 55),
	FrameColor = Color3_fromRGB(53, 53, 55),
	Size = 20,
	Padding = 4,
	ColorsPerRow = 8,
	OuterBorder = 1,
	OuterBorderColor = Styles.Black
}

wait(1)

local bindGetSelection = ExplorerFrame.GetSelection
local bindSelectionChanged = ExplorerFrame.SelectionChanged
local bindGetApi = PropertiesFrame.GetApi
local bindGetAwait = PropertiesFrame.GetAwaiting
local bindSetAwait = PropertiesFrame.SetAwaiting

local ContentUrl = ContentProvider.BaseUrl .. "asset/?id="

local SettingsRemote = Gui:WaitForChild("SettingsPanel"):WaitForChild("GetSetting")

local propertiesSearch = PropertiesFrame.Header.TextBox

local AwaitingObjectValue = false
local AwaitingObjectObj
local AwaitingObjectProp

function searchingProperties()
	if propertiesSearch.Text ~= "" then
		return true
	end
	return false
end

local function GetSelection()
	local selection = bindGetSelection:Invoke()
	if #selection == 0 then
		return nil
	else
		return selection
	end
end
--[[
@param Vector2 size
]]


function Grid.New(size)
	local newGrid = {}
	newGrid.Cells = {}
	newGrid.Folder = Instance.new("Folder", workspace)
	newGrid.Folder.Name = "Grid"
	newGrid.SizeX = size.X
	newGrid.SizeY = size.Y
	setmetatable(newGrid, Grid)
	return newGrid
end
-- when activated, either bring gui up or down, depending on current state




function removeGUIPlayers()

	local guiPlayers = gui.Frame.Players:GetChildren()
	for i = 1, #guiPlayers do
		guiPlayers[i]:remove()
	end

end

function incrementZIndex()

	zIndex = zIndex + 1
	if zIndex > 10000 then
		zIndex = 2
	end

end

function createPlayerGUINode(pos, playerText)

	local playerIcon = Instance.new("ImageLabel")
	playerIcon.Image = "http://www.roblox.com/asset/?id=28625552"
	playerIcon.BackgroundTransparency = 1
	playerIcon.BorderSizePixel = 0
	playerIcon.Size = UDim2.new(0,22.5,0,40.5)
	playerIcon.Position = UDim2.new(0,pos.x,0,pos.y)
	playerIcon.Parent = gui.Frame.Players
	playerIcon.ZIndex = zIndex
	incrementZIndex()
	
	local playerName = Instance.new("TextLabel")
	playerName.BackgroundTransparency = 1
	playerName.BorderSizePixel = 1

	playerName.Text = tostring(playerText)
	playerName.Size = UDim2.new(0,150,0,25)
	playerName.Parent = playerIcon
	playerName.Position = UDim2.new(0,-65,0,0)
	playerName.TextColor3 =  Color3.new(1,0,0.4)
	playerName.ZIndex = zIndex
	incrementZIndex()
end


function updateGUI()

	removeGUIPlayers()
	

	local players = game.Players:GetChildren()

	for i = 1, #players do

		local playerTorso = players[i].Character:FindFirstChild("Torso")

		if playerTorso ~= nil then

			local posDiff = Vector3.new(torso.Position.x - playerTorso.Position.x,0,torso.Position.z - playerTorso.Position.z)

			if posDiff.magnitude < range and playerTorso.Parent.Name ~= torso.Parent.Name then

				-- translate coordinates to radar coordinates
				posDiff = Vector2.new((posDiff.x + range) * 0.5,(posDiff.z + range) * 0.5)

				local rotationVector = Tool.Angle.Value
				local denom = math.abs(rotationVector.x) + math.abs(rotationVector.z)

				local xDirect = (rotationVector.x/denom)
				local zDirect =  (rotationVector.z/denom)
				
				local angle = math.atan2(1,0) - math.atan2(zDirect,xDirect)

				local point = Vector2.new(((posDiff.x - radarCenter.x) * math.cos(angle)) - ((posDiff.y - radarCenter.y) * math.sin(angle))  + radarCenter.x,
				((posDiff.x - radarCenter.x) * math.sin(angle)) + ((posDiff.y - radarCenter.y) * math.cos(angle)) + radarCenter.y)

				createPlayerGUINode(point, playerTorso.Parent)

			elseif playerTorso.Parent.Name == torso.Parent.Name then

				createPlayerGUINode(radarCenter,playerTorso.Parent)

			end
		end

	end

end


while true do
	
	if guiEnabled then
		updateGUI()
	end
	wait()

end
-----------------------------------------------------------------------------------------
--[[
Thanks for using Zed's Mesh Giver 2.0!

Instructions:
1) Find the mesh in you weapon. Generally it should be inside a brick called "Handle"
2) Copy and Paste that mesh into the scenebrick, remove the mesh currently in the scenebrick first.
3) Open up the settings folder in thsi model and edit the following settings:
	- Regen Time: Time it takes for a person to be able to use the giver again.
	- StartColor: Color of the bricks that are currently blue.
	- RegenColor: Color of the current blue bricks will be turned to a different color meaning its currently regenrating.
	- WeaponName: Copy and past the exact name of the weapon into the value of the WeaponName value.	
4) Cut and paste the weapon into ServerStorage
5) Done!	
----------------Don't edit below unless you know what you're doing--------------------------
--]]


SColor = script.Parent.Settings:FindFirstChild("StartColor")
RColor = script.Parent.Settings:FindFirstChild("RegenColor")
RTime = script.Parent.Settings:FindFirstChild("RegenTime")
Weapon = script.Parent.Settings:FindFirstChild("WeaponName")
Center = script.Parent:FindFirstChild("TouchMe")
deb = false


Center.Touched:connect(function(part)
	if part.Parent:FindFirstChild("Humanoid") then
		if part.Parent.Humanoid.Health > 0 then
			if game.Players:FindFirstChild(part.Parent.Name) then
				if game.ServerStorage:FindFirstChild(Weapon.Value) then
					if deb == false then
						deb = true
						local wep = game.ServerStorage:FindFirstChild(Weapon.Value)
						wep:Clone().Parent = game.Players:FindFirstChild(part.Parent.Name).Backpack
						wait(RTime.Value)
						deb = false
					end
				else
					print("Error: "..Weapon.Value.." not found in 'ServerStorage'.")
				end
			end
		end
	end
end)
--


local Info2 = TweenInfo.new(
	1, -- Length
	Enum.EasingStyle.Bounce, -- Easing Style
	Enum.EasingDirection.Out, -- Easing Direction
	0, -- Times repeated
	false, -- Reverse
	0 -- Delay
)
local Goals2 =
	{
		Transparency = 1;
		Size = Vector3.new(0,0,0);
	}
local tween = TweenService:Create(part,Info,Goals)
local tween2 = TweenService:Create(part,Info2,Goals2)
wait(2)
tween:Play()
wait(2)
tween2:Play()
-- Visualizes an impact. This will not run if FastCast.VisualizeCasts is false.


function DbgVisualizeHit(atCF: CFrame, wasPierce: boolean): SphereHandleAdornment
	if FastCast.VisualizeCasts ~= true then return end
	local adornment = Instance.new("SphereHandleAdornment")
	adornment.Adornee = workspace.Terrain
	adornment.CFrame = atCF
	adornment.Radius = 0.4
	adornment.Transparency = 0.25
	adornment.Color3 = (wasPierce == false) and Color3.new(0.2, 1, 0.5) or Color3.new(1, 0.2, 0.2)
	adornment.Parent = GetFastCastVisualizationContainer()
	return adornment
end
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 450		--	[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)
--- Searches for attachments for the given instance (if applicable)


function Hitbox:Recalibrate()
	local descendants: {[number]: Instance} = self.HitboxObject:GetDescendants()
	local attachmentCount: number = 0

	--- Remove all previous attachments
	for i = #self.HitboxRaycastPoints, 1, -1 do
		if self.HitboxRaycastPoints[i].CastMode == Hitbox.CastModes.Attachment then
			table.remove(self.HitboxRaycastPoints, i)
		end
	end

	for _, attachment: any in ipairs(descendants) do
		if not attachment:IsA("Attachment") or attachment.Name ~= DEFAULT_ATTACHMENT_INSTANCE then
			continue
		end

		local group: string? = attachment:GetAttribute(DEFAULT_GROUP_NAME_INSTANCE)
		local point: Point = self:_CreatePoint(group, Hitbox.CastModes.Attachment, attachment.WorldPosition)

		table.insert(point.Instances, attachment)
		table.insert(self.HitboxRaycastPoints, point)

		attachmentCount += 1
	end

	if self.DebugLog then
		print(string.format("%s%s", DEFAULT_DEBUG_LOGGER_PREFIX,
			attachmentCount > 0 and string.format(DEFAULT_ATTACH_COUNT_NOTICE, attachmentCount, self.HitboxObject.Name) or
				string.format(DEFAULT_MISSING_ATTACHMENTS, self.HitboxObject.Name))
		)
	end
end
--[=[
	Start the shake effect.

	:::note
	This **must** be called before calling `Update`. As such, it should also be
	called once before or after calling `OnSignal` or `BindToRenderStep` methods.
	:::
]=]


function Shake:Start()
	self._startTime = self.TimeFunction()
	self._running = true
	self._trove:Add(function()
		self._running = false
	end)
end
--use this to determine if you want this human to be harmed or not, returns boolean


function checkTeams(otherHuman)
	return not (sameTeam(otherHuman) and not FriendlyFire)
end

function onTouched(part)
	if part:IsDescendantOf(Tool.Parent) then return end
	if not HitAble then return end
	
	if part.Parent and part.Parent:FindFirstChild("Humanoid") then
		local human = part.Parent.Humanoid
		
		if contains(HitVictims, human) then return end
		
		local root = part.Parent:FindFirstChild("HumanoidRootPart")
		if root and not root.Anchored then
			local myRoot = Tool.Parent:FindFirstChild("HumanoidRootPart")
			if myRoot and checkTeams(human) then
				local delta = root.Position - myRoot.Position
				
				human.Sit = true
				tagHuman(human)
				human:TakeDamage(HitDamage)
				table.insert(HitVictims, human)
				
				local bv = Instance.new("BodyVelocity")
				bv.maxForce = Vector3.new(math.huge, math.huge, math.huge)
				bv.velocity = delta.unit * math.huge
				bv.Parent = root
				game:GetService("Debris"):AddItem(bv, 0.05)
				
				Handle.Smack.Pitch = math.random(90, 110)/100
				Handle.Smack.TimePosition = 0.15
				Handle.Smack:Play()
			end
		end
	end
end

function onEquip()
	--put in our right arm
	local char = Tool.Parent
	local arm = Tool.ArmMesh:Clone()
	arm.Parent = char:FindFirstChild("Right Arm")
	ArmMesh = arm
end

function onUnequip()
	if ArmMesh then
		ArmMesh:Destroy()
		ArmMesh = nil
	end
end

function onLeftDown()
	if not SwingAble then return end
	
	SwingAble = false
	delay(SwingRestTime, function()
		SwingAble = true
	end)
	
	delay(HitWindup, function()
		HitAble = true
		delay(HitWindow, function()
			HitAble = false
		end)
	end)
	
	HitVictims = {}
	
	Remote:FireClient(getPlayer(), "PlayAnimation", "Swing")
	
	wait(0.25)
	Handle.Boom.Pitch = math.random(80, 100)/100
	Handle.Boom:Play()
	if Handle.Touched:connect(onTouched) then
		Handle.Scream:Play()
end	
	end

function onRemote(player, func, ...)
	if player ~= getPlayer() then return end
	
	if func == "LeftDown" then
		onLeftDown(...)
	end
end

Tool.Equipped:connect(onEquip)
Tool.Unequipped:connect(onUnequip)
Handle.Touched:connect(onTouched)
Remote.OnServerEvent:connect(onRemote)
-- ~15 c/s


while wait(.0667) do

	-- Reset Throt if accelrating/not
	if _ThrotActive == true then
		_GThrot = 1;
	else
		_GThrot = _Tune.IdleThrottle/100;
	end

	-- Throt Cap
	if (car.DriveSeat.Velocity.Magnitude > car.DriveSeat.MaxSpeed) then
		_GThrot = _Tune.IdleThrottle/100
	end

	-- Reste brake is braking/not
	if _BrakeActive == true then
		_GBrake = 1;
	else
		_GBrake = 0;
	end

	-- Brake Cap
	if (car.DriveSeat.Velocity.Magnitude > car.DriveSeat.MaxSpeed) then
		if(_CGear > -1) then
			_GBrake = 1;
		else
			_GBrake = 0;
		end
	end

	--Power
	Engine()

	--Flip
	if _Tune.AutoFlip then Flip() end
end
--[=[
	@interface ServiceDef
	.Name string
	.Client table?
	.Middleware Middleware?
	.[any] any
	@within KnitServer
	Used to define a service when creating it in `CreateService`.

	The middleware tables provided will be used instead of the Knit-level
	middleware (if any). This allows fine-tuning each service's middleware.
	These can also be left out or `nil` to not include middleware.
]=]


type ServiceDef = {
	Name: string,
	Client: {[any]: any}?,
	Middleware: Middleware?,
	[any]: any,
}
--[[Transmission]]


	Tune.TransModes		= {"Semi"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
		>First mode is default mode													]]
	
	--Automatic Settings
	Tune.AutoShiftMode	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
	Tune.AutoUpThresh	= -200		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)

	--Gear Ratios
	Tune.FinalDrive		= 1.0			-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	10		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		4.6		,	-- Reverse, Neutral, and 1st gear are required
	}
	Tune.FDMult			= 1.15			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)