Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- public methods



function region3:castPoint(point)
	local direction = self.centroid - point;
	return gjk(self.input, {point}, self.support, support.point, direction);
end;

function region3:castPart(part)
	local against = classify(part);
	local direction = self.centroid - against.centroid;
	return gjk(self.input, against.input, self.support, against.support, direction);
end;

function region3:cast(ignore, maxParts)
	local ignore = type(ignore) == "table" and ignore or {ignore};
	local maxParts = maxParts or 1000;
	
	local min, max = {}, {};
	for _, enum in next, {Enum.NormalId.Right, Enum.NormalId.Top, Enum.NormalId.Back} do
		local direction = Vector3.FromNormalId(enum);
		insert(min, self.support(-direction, unpack(self.input)));
		insert(max, self.support(direction, unpack(self.input)));
	end;
	min, max = v3(min[1].x, min[2].y, min[3].z), v3(max[1].x, max[2].y, max[3].z);
	
	local allignedR3 = R3(min, max);
	local parts = game.Workspace:FindPartsInRegion3WithIgnoreList(allignedR3, ignore, maxParts);
	
	-- debug stuff
	--game.Workspace.CurrentCamera:ClearAllChildren();
	--draw.line(min, max, game.Workspace.CurrentCamera);
	
	local inRegion = {};
	for i = 1, #parts do
		local part = parts[i];
		if (self:castPart(part)) then
			insert(inRegion, part);
		end;
	end;
	return inRegion;
end;
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 300		--	[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)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




function AddGamepass(player, gamepassId)
	--- Variables
	local playerId = player.UserId
	local playerStats = _L.Saving.Get(player)
	local playerCache = cache["u" .. playerId]

	--- Sanity check
	if playerStats == nil then  
		return  
	end
	
	--- Create cache
	if cache["u" .. playerId] == nil then
		cache["u" .. playerId] = {}
		playerCache = cache["u" .. playerId]
	end

	--- Check if gamepass is already written
	if not _L.Functions.SearchArray(playerStats.Gamepasses, gamepassId) then
		
		--- Write gamepass to save!
		table.insert(playerStats.Gamepasses, gamepassId)
		
		--- Analytics
		pcall(function()
			_L.Analytics.Purchase("Gamepass", player, gamepassId)
		end)
	end
	
	--- Update cache
	playerCache["g" .. gamepassId] = true
end


function CheckPlayer(player)
	--- Variables
	local playerId = player.UserId
	local playerStats = _L.Saving.Get(player)
	local playerCache = cache["u" .. playerId]
	
	--- Sanity check
	if playerStats == nil then  
		return  
	end
	
	--- Create cache
	if cache["u" .. playerId] == nil then
		cache["u" .. playerId] = {}
		playerCache = cache["u" .. playerId]
	end
	
	--- Iterate through all gamepasses to check if player owns them or not (bought on website)
	for _, gamepassInfo in pairs(_L.Directory.Gamepasses) do
		local gamepassId = gamepassInfo.ID
		local gamepassOwned = playerCache["g" .. gamepassId] or false
		
		--- Gamepass not owned already?
		if gamepassOwned == false then
			--- Check if player owns gamepass (new API)
			local playerOwnsGamepass = false
			pcall(function()  playerOwnsGamepass = _L.MarketplaceService:UserOwnsGamePassAsync(playerId, gamepassId)  end)
			
			--- Player bought this gamepass and it's not added! ADD IT!
			if playerOwnsGamepass == true then
				AddGamepass(player, gamepassId)
			end
		end
	end
end


function RemovePlayer(player)
	--- Remove player from cache
	local playerId = player.UserId
	cache["u" .. playerId] = nil
end
--This module is for any client FX related to the Teleporter A's door



local DoorFX = {}

local tweenService = game:GetService("TweenService")

local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)

function DoorFX.OPEN(door)
	if not door then return end
	
	tweenService:Create(door.Door.Main, tweenInfo, {CFrame = door.Door.Goal.CFrame}):Play()

	door.Door.Main.DoorOpenFADEOUT:Play()
end

function DoorFX.CLOSE(door)
	if not door then return end

	door.Door.Main.CFrame = door.Door.Home.CFrame
end

return DoorFX
------//Low Ready Animations


self.RightLowReady = CFrame.new(-1, 1.1, -0.5) * CFrame.Angles(math.rad(-30), math.rad(0), math.rad(0));
self.LeftLowReady = CFrame.new(1,1,-0.9) * CFrame.Angles(math.rad(-30),math.rad(35),math.rad(-25));

self.RightElbowLowReady = CFrame.new(0,0,0)  * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
self.LeftElbowLowReady = CFrame.new(0,0,0)  * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));

self.RightWristLowReady = CFrame.new(0,0,0)  * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
self.LeftWristLowReady = CFrame.new(0,0,0)  * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
--if hood.Velocity.magnitude < 15 then return end  -- must be going decently fast to break stuff...  can add invisible "prebumpers" in the future to make collisions smoother


if hood.CFrame:vectorToObjectSpace(hood.Velocity):Dot(direction) < 35 then return end -- must be going fast in correct direction to break stuff

	if hit and hit.Parent then
		if hit.Parent:FindFirstChild("Humanoid") then
			--hit.Parent:BreakJoints()  let's not kill 'em...  for now
			hit.Parent.Humanoid.Sit = true  -- but we do make 'em flyyyy!  XD
		elseif hit:FindFirstChild("RobloxModel") and not hit:FindFirstChild("RunOver") and isSmallerThanVehicle(hit) then
			local newModel = hit:Clone()
			local modelParent = hit.Parent
			local newRunOverTag = Instance.new("BoolValue")
			newRunOverTag.Name = "RunOver"
			newRunOverTag.Parent = hit

			hit:BreakJoints()
			debris:AddItem(hit, timeToRespawn)
			coroutine.resume(coroutine.create(respawnIt), newModel, modelParent)
		elseif hit.Parent:FindFirstChild("RobloxModel") and not hit.Parent:FindFirstChild("RunOver") and isSmallerThanVehicle(hit.Parent) then
			local newModel = hit.Parent:Clone()
			local modelParent = hit.Parent.Parent
			local newRunOverTag = Instance.new("BoolValue")
			newRunOverTag.Name = "RunOver"
			newRunOverTag.Parent = hit.Parent

			hit.Parent:BreakJoints()
			debris:AddItem(hit.Parent, timeToRespawn)
			coroutine.resume(coroutine.create(respawnIt), newModel, modelParent)
		end
	end
end
--This is in order for the ingame clock to work



local dayLength = 35 --you can adjust this (24-34 recommended)

local cycleTime = dayLength*60
local minutesInADay = 24*60

local lighting = game:GetService("Lighting")

local startTime = tick() - (lighting:getMinutesAfterMidnight() / minutesInADay)*cycleTime
local endTime = startTime + cycleTime

local timeRatio = minutesInADay / cycleTime

if dayLength == 0 then
	dayLength = 1
end

repeat
	local currentTime = tick()
	
	if currentTime > endTime then
		startTime = endTime
		endTime = startTime + cycleTime
	end
	
	lighting:setMinutesAfterMidnight((currentTime - startTime)*timeRatio)
	wait(1/15)
until false
-- declarations



local Torso = waitForChild(Figure, "Torso")
local LeftArm = waitForChild(Figure, "Left Arm")
local LeftLeg = waitForChild(Figure, "Left Leg")
local RightArm = waitForChild(Figure, "Right Arm")
local RightLeg = waitForChild(Figure, "Right Leg")

local Joints = {
{"Right Shoulder", Torso, RightArm, CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), 0.5},
{"Left Shoulder", Torso, LeftArm, CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), 0.5},
{"Right Hip", Torso, RightLeg, CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), 0.10000000149012},
{"Left Hip", Torso, LeftLeg, CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), 0.10000000149012},
{"Neck", Torso, Head, CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), 0.10000000149012}}

Torso:breakJoints()

for _, v in pairs(Joints) do
	Joint(unpack(v))
end

local RightShoulder = waitForChild(Torso, "Right Shoulder")
local LeftShoulder = waitForChild(Torso, "Left Shoulder")
local RightHip = waitForChild(Torso, "Right Hip")
local LeftHip = waitForChild(Torso, "Left Hip")
local Neck = waitForChild(Torso, "Neck")
local Humanoid = waitForChild(Figure, "Humanoid")
local pose = "Standing"

local toolAnim = "None"
local toolAnimTime = 0
-- Converts a Vector3 in CIELAB space to a Color3 in RGB space.
-- The Color3 will be clamped by default unless specified otherwise.


function Oklab.from(lab: Vector3, unclamped: boolean?): Color3
	local lRoot = lab.X + lab.Y * 0.3963377774 + lab.Z * 0.2158037573
    local mRoot = lab.X - lab.Y * 0.1055613458 - lab.Z * 0.0638541728
    local sRoot = lab.X - lab.Y * 0.0894841775 - lab.Z * 1.2914855480

    local l = lRoot ^ 3
    local m = mRoot ^ 3
    local s = sRoot ^ 3

	local red = l * 4.0767416621 - m * 3.3077115913 + s * 0.2309699292
	local green = l * -1.2684380046 + m * 2.6097574011 - s * 0.3413193965
	local blue = l * -0.0041960863 - m * 0.7034186147 + s * 1.7076147010

	if not unclamped then
		red = math.clamp(red, 0, 1)
		green = math.clamp(green, 0, 1)
		blue = math.clamp(blue, 0, 1)
	end

	return Color3.new(red, green, blue)
end

return Oklab
-----------------
--| Variables |--
-----------------



local DebrisService = game:GetService('Debris')
local PlayersService = game:GetService('Players')

local MyPlayer = script:FindFirstAncestorOfClass("Player")

local Tool = MyPlayer.Backpack:FindFirstChild("RocketLauncher")or MyPlayer.Character:FindFirstChild("RocketLauncher")
local ToolHandle = Tool:WaitForChild("Handle")

local MouseLoc = script.Parent:WaitForChild("MouseLoc",10)

local RocketScript = script:WaitForChild('Rocket')
local SwooshSound = script:WaitForChild('Swoosh')
local BoomSound = script:WaitForChild('Boom')
--[[
	Assert that our functoid expectation value throws an error when called.
	An optional error message can be passed to assert that the error message
	contains the given value.
]]


function Expectation:throw(messageSubstring)
	local ok, err = pcall(self.value)
	local result = ok ~= self.successCondition

	if messageSubstring and not ok then
		if self.successCondition then
			result = err:find(messageSubstring, 1, true) ~= nil
		else
			result = err:find(messageSubstring, 1, true) == nil
		end
	end

	local message

	if messageSubstring then
		message = formatMessage(self.successCondition,
			("Expected function to throw an error containing %q, but it %s"):format(
				messageSubstring,
				err and ("threw: %s"):format(err) or "did not throw."
			),
			("Expected function to never throw an error containing %q, but it threw: %s"):format(
				messageSubstring,
				tostring(err)
			)
		)
	else
		message = formatMessage(self.successCondition,
			"Expected function to throw an error, but it did not throw.",
			("Expected function to succeed, but it threw an error: %s"):format(
				tostring(err)
			)
		)
	end

	assertLevel(result, message, 3)
	self:_resetModifiers()

	return self
end

return Expectation
--	


	script.Parent.Handle3.Hinge1.Transparency = 0
	script.Parent.Handle3.Interactive1.Transparency = 0
	script.Parent.Handle3.Part1.Transparency = 0
	script.Parent.Parent.Parent.Flushoo.FlushScript.Disabled = false
	wait(0.06)
	script.Parent.Handle1.Hinge1.Transparency = 1
	script.Parent.Handle1.Interactive1.Transparency = 1
	script.Parent.Handle1.Part1.Transparency = 1
-- FUNCTIONS --


return function(Action, ...)
	local Args = {...}
	
	if Action == "Splash" then
		local TargetPosition = Args[1]
		local WaterPart = Args[2]
		
		local splashAttachment = Instance.new("Attachment")
		splashAttachment.Parent = WaterPart
		splashAttachment.WorldPosition = TargetPosition
		game.Debris:AddItem(splashAttachment, 5)
		
		coroutine.wrap(function()
			for i, v in pairs(script.Splash:GetChildren()) do
				if v:IsA("ParticleEmitter") then
					local fx = v:Clone()
					fx.Parent = splashAttachment
					fx:Emit(fx:GetAttribute("EmitCount"))
				end
			end
		end)()
	end
end
--///////////////////////// Constructors
--//////////////////////////////////////



function module.new(vChatService, name)
	local obj = setmetatable({}, methods)

	obj.ChatService = vChatService

	obj.PlayerObj = nil

	obj.Name = name
	obj.ExtraData = {}

	obj.Channels = {}
	obj.MutedSpeakers = {}

	-- Make sure to destroy added binadable events in the InternalDestroy method.
	obj.eDestroyed = Instance.new("BindableEvent")
	obj.eSaidMessage = Instance.new("BindableEvent")
	obj.eReceivedMessage = Instance.new("BindableEvent")
	obj.eReceivedUnfilteredMessage = Instance.new("BindableEvent")
	obj.eMessageDoneFiltering = Instance.new("BindableEvent")
	obj.eReceivedSystemMessage = Instance.new("BindableEvent")
	obj.eChannelJoined = Instance.new("BindableEvent")
	obj.eChannelLeft = Instance.new("BindableEvent")
	obj.eMuted = Instance.new("BindableEvent")
	obj.eUnmuted = Instance.new("BindableEvent")
	obj.eExtraDataUpdated = Instance.new("BindableEvent")
	obj.eMainChannelSet = Instance.new("BindableEvent")
	obj.eChannelNameColorUpdated = Instance.new("BindableEvent")

	obj.Destroyed = obj.eDestroyed.Event
	obj.SaidMessage = obj.eSaidMessage.Event
	obj.ReceivedMessage = obj.eReceivedMessage.Event
	obj.ReceivedUnfilteredMessage = obj.eReceivedUnfilteredMessage.Event
	obj.MessageDoneFiltering = obj.eMessageDoneFiltering.Event
	obj.ReceivedSystemMessage = obj.eReceivedSystemMessage.Event
	obj.ChannelJoined = obj.eChannelJoined.Event
	obj.ChannelLeft = obj.eChannelLeft.Event
	obj.Muted = obj.eMuted.Event
	obj.Unmuted = obj.eUnmuted.Event
	obj.ExtraDataUpdated = obj.eExtraDataUpdated.Event
	obj.MainChannelSet = obj.eMainChannelSet.Event
	obj.ChannelNameColorUpdated = obj.eChannelNameColorUpdated.Event

	--- DEPRECATED:
	--- Mispelled version of ReceivedUnfilteredMessage, retained for compatibility with legacy versions.
	obj.RecievedUnfilteredMessage = obj.eReceivedUnfilteredMessage.Event

	return obj
end

return module
--{HPattern, Automatic, DualClutch, CVT}


tri = script.Trigger

if script.Parent.Functions.ShiftUpRequested.Value == true then
	script.RPMManagement.Disabled = false
	FL.MotorMaxTorque = 0
	FR.MotorMaxTorque = 0
	RL.MotorMaxTorque = 0
	RR.MotorMaxTorque = 0
		
	if script.Parent.Storage.TransmissionType.Value == "HPattern" then
			
	end
	
	if script.Parent.Storage.TransmissionType.Value == "Automatic" then
		rpm.Value = ((trans.Value*xxx)*(1-tri.Value)) + ((trans.Value*xx1)*(tri.Value))
	end
	
	if script.Parent.Storage.TransmissionType.Value == "DualClutch" then
		rpm.Value = ((trans.Value*xxx)*(1-tri.Value)) + ((trans.Value*xx1)*(tri.Value)) 
	end
	
	if script.Parent.Storage.TransmissionType.Value == "CVT" then
		
	end
end


if currentgear.Value == 1 then
	FL.MotorMaxTorque = (10000)*(carSeat.Storage.BrakeBias.Value/100)
		FR.MotorMaxTorque = (10000)*(carSeat.Storage.BrakeBias.Value/100)
		RL.MotorMaxTorque = (10000)*(1-(carSeat.Storage.BrakeBias.Value/100))
		RR.MotorMaxTorque = (10000)*(1-(carSeat.Storage.BrakeBias.Value/100))
		FL.AngularVelocity = 0
		FR.AngularVelocity = 0
		RL.AngularVelocity = 0
		RR.AngularVelocity = 0
		FL.MotorMaxAcceleration = 30
		FR.MotorMaxAcceleration = 30
		RL.MotorMaxAcceleration = 30
		RR.MotorMaxAcceleration = 30
end
if script.Parent.Functions.ShiftDownRequested.Value == true then
	script.RPMManagement.Disabled = false
	if carSeat.Throttle ~= -1 and carSeat.Storage.Handbrake.Value ~= true then
	FL.MotorMaxTorque = 0
	FR.MotorMaxTorque = 0
	RL.MotorMaxTorque = 0
	RR.MotorMaxTorque = 0
	end
	if script.Parent.Storage.TransmissionType.Value == "HPattern" then
		
	end
	
	if script.Parent.Storage.TransmissionType.Value == "Automatic" then
		rpm.Value = ((trans.Value*xxx)*(1-tri.Value)) + ((trans.Value*x1x)*(tri.Value)) 
	end
	
	if script.Parent.Storage.TransmissionType.Value == "DualClutch" then
		rpm.Value = ((trans.Value*xxx)*(1-tri.Value)) + ((trans.Value*x1x)*(tri.Value)) 
	end
	
	if script.Parent.Storage.TransmissionType.Value == "CVT" then
		
	end
	
end

if speed < 2 then
	coast = 0
else
	coast = 5
end
m = (hp.Value / 2155)

if rpm.Value < 950/(four/2) then
	ch = 4
else
	ch = 1
end

if carSeat.Storage.Mode.Value == "City" then
	mode = 0.81
elseif carSeat.Storage.Mode.Value == "Sport" then
	mode = 0.98
elseif carSeat.Storage.Mode.Value == "Snow" then
	mode = 0.6
end


carSeat.Parent.Engine.Intake.Pitch = 1
--[[
	deviation: the toStrictEqual matcher in Jest adds three features beyond
	that of the toEqual matcher:
		1) Checking for undefined properties
		2) Checking array sparseness
		3) Type checking

	Of these, Jest-Roblox's version of the toStrictEqual matcher only
	applies type checking
]]


local function toStrictEqual(
	-- ROBLOX deviation: self param in Lua needs to be explicitely defined
	self: MatcherState,
	received: any,
	expected: any
)
	local matcherName = "toStrictEqual"
	local options: MatcherHintOptions = {
		comment = "deep equality",
		isNot = self.isNot,
		promise = self.promise,
	}

	local pass = equals(received, expected, toStrictEqualTesters, true)

	local message
	if pass then
		message = function()
			local retval = matcherHint(matcherName, nil, nil, options)
				.. "\n\n"
				.. string.format("Expected: not %s\n", printExpected(expected))

			if stringify(expected) ~= stringify(received) then
				retval = retval .. string.format("Received:     %s", printReceived(received))
			end

			return retval
		end
	else
		message = function()
			return matcherHint(matcherName, nil, nil, options)
				.. "\n\n"
				.. printDiffOrStringify(expected, received, EXPECTED_LABEL, RECEIVED_LABEL, isExpand(self.expand))
		end
	end
	-- Passing the actual and expected objects so that a custom reporter
	-- could access them, for example in order to display a custom visual diff,
	-- or create a different error message
	return { actual = received, expected = expected, message = message, name = matcherName, pass = pass }
end
--Internal Settings--



local fullMag = 30

local spread = 1.1 -- in degrees

local fullauto = false -- shoots all bullets as long as the player is visible. turning this off reverts shooting mechanic back to the original marine mechanics (boolean)

local burstamount = 3 -- (only works if full auto is off) amount of times gun fires in burst fire mode

local firerate = 0.06 -- wait between shooting in seconds

local shotgunpellets = 1 -- setting this above 1 turns the gun into a shotgun (MIGHT LAG WITH FULL AUTO ON)

local delaybeforereloading = 0.3 -- to delay reload (prevents the marine from shooting the last shot of the mag at the ground)

local MinimumDamage,MaximumDamage = 9, 13 -- the amount of damage each bullet does (RANDOMIZED) first value is minimum, second value is maximum

local SemiAtLongRange = false -- restores the behaviour of the marine shooting in semi at long distances (i made this toggleable because i didnt like it)

local headshotmultiplier = 2 -- self explanitory (set this value to 1 if you dont want a multiplier)

local HitWallSounds = {"rbxassetid://6962153997","rbxassetid://6962154328","rbxassetid://6962154691","rbxassetid://6962155018","rbxassetid://6962155378"} -- basically sounds for hitting walls

local HitFleshSound = "rbxassetid://4988621968" -- plays when a creature gets shot

local bulletacceleration = Vector3.new(0,-12,0) -- very similar to how acceleration works in particle emitters (setting the y value to a negative number will give the bullet bulletdrop)

local maxdistance = 300

local bulletspeed = 400
--[[Vehicle Weight]]

	
	--Determine Current Mass
	local mass=0
	
	function getMass(p)
		for i,v in pairs(p:GetChildren())do
			if v:IsA("BasePart") then
				mass=mass+v:GetMass()
			end
			getMass(v)
		end	
	end
	getMass(car)
	
	--Apply Vehicle Weight
	if mass<_Tune.Weight*weightScaling then
		--Calculate Weight Distribution
		local centerF = Vector3.new()
		local centerR = Vector3.new()
		local countF = 0
		local countR = 0
		
		for i,v in pairs(Drive) do
			if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
				centerF = centerF+v.CFrame.p
				countF = countF+1
			else
				centerR = centerR+v.CFrame.p
				countR = countR+1
			end
		end
		centerF = centerF/countF
		centerR = centerR/countR
		local center = centerR:Lerp(centerF, _Tune.WeightDist/100)  
		
		--Create Weight Brick
		local weightB = Instance.new("Part",car.Body)
		weightB.Name = "#Weight"
		weightB.Anchored = true
		weightB.CanCollide = false
		weightB.BrickColor = BrickColor.new("Really black")
		weightB.TopSurface = Enum.SurfaceType.Smooth
		weightB.BottomSurface = Enum.SurfaceType.Smooth
		if _Tune.WBVisible then
			weightB.Transparency = .75			
		else
			weightB.Transparency = 1			
		end
		weightB.Size = Vector3.new(_Tune.WeightBSize[1],_Tune.WeightBSize[2],_Tune.WeightBSize[3])
		weightB.CustomPhysicalProperties = PhysicalProperties.new(((_Tune.Weight*weightScaling)-mass)/(weightB.Size.x*weightB.Size.y*weightB.Size.z),0,0,0,0)
		weightB.CFrame=(car.DriveSeat.CFrame-car.DriveSeat.Position+center)*CFrame.new(0,_Tune.CGHeight,0)
	else
		--Existing Weight Is Too Massive
	end
	
	local flipG = Instance.new("BodyGyro",car.DriveSeat)
	flipG.Name = "Flip"
	flipG.D = 0
	flipG.MaxTorque = Vector3.new(0,0,0)
	flipG.P = 0
------------------------------------------------------------------------
-- parses an expression in parentheses or a single variable
-- * used in primaryexp()
------------------------------------------------------------------------


function luaY:prefixexp(ls, v)
  -- prefixexp -> NAME | '(' expr ')'
  local c = ls.t.token
  if c == "(" then
    local line = ls.linenumber
    luaX:next(ls)
    self:expr(ls, v)
    self:check_match(ls, ")", "(", line)
    luaK:dischargevars(ls.fs, v)
  elseif c == "TK_NAME" then
    self:singlevar(ls, v)
  else
    luaX:syntaxerror(ls, "unexpected symbol")
  end--if c
  return
end
-- Calcule a velocidade linear média do carro com base na taxa em que todas as rodas estão girando


local function getAverageVelocity()
	local vFR = -motorFR.Attachment1.WorldAxis:Dot(motorFR.Attachment1.Parent.RotVelocity)
	local vRR = -motorBR.Attachment1.WorldAxis:Dot(motorBR.Attachment1.Parent.RotVelocity)
	local vFL = motorFL.Attachment1.WorldAxis:Dot(motorFL.Attachment1.Parent.RotVelocity)
	local vRL = motorBL.Attachment1.WorldAxis:Dot(motorBL.Attachment1.Parent.RotVelocity)
	return 0.25 * ( vFR + vFL + vRR + vRL )
end
--PlayerClick


ClickDetector.MouseClick:Connect(function()
	if Ready == true then
		if Open == false then
			Ready = false
			Open = true
			OpenSound:Play()
			OpenTween:Play()
			wait(.5)
			Ready = true
		elseif Open == true then
			Ready = false
			Open = false
			CloseSound:Play()
			CloseTween:Play()
			wait(.5)
			Ready = true
		end
	end
end)