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


SteeringAngle = 40 --{Steering angle in degrees}
SteerSpeed = 0.05 --{.01 being slow, 1 being almost instantly}
TiresFront = 2 --{1 = eco, 2 = road, 3 = sport}
TiresRear = 2 --{1 = eco, 2 = road, 3 = sport}
DownforceF = 0 --{[0-5] Provides downforce to the front at the cost of drag}
DownforceR = 0 --{[0-5] Provides downforce to the rear at the cost of drag}
BrakeBias = 72 --{100 = all on front || 0 = all on rear}
BrakePower = 80  --{100 = strong brakes 0 = close to no brakes}
TC = false
ABS = true
--[[Brakes]]

--
	Tune.FBrakeForce	= 300 		-- Front brake force
	Tune.RBrakeForce	= 250 		-- Rear brake force
	Tune.PBrakeForce	= 500 		-- Parking brake force
	
	Tune.LinkedBrakes	= true 		-- Links brakes up, uses both brakes while braking
	Tune.BrakesRatio	= 60 		-- The ratio of the brakes (0 = rear brake; 100 = front brake)
-- Compiled with roblox-ts v1.3.3


local function fields(defaults)
	if defaults == nil then
		defaults = {}
	end
	return function(input)
		local _object = {}
		for _k, _v in pairs(defaults) do
			_object[_k] = _v
		end
		if type(input) == "table" then
			for _k, _v in pairs(input) do
				_object[_k] = _v
			end
		end
		return _object
	end
end
return {
	fields = fields,
}
--[[Weight Scaling]]


	--[Cubic stud : pounds ratio]
	--[STANDARDIZED: Don't touch unless needed]
	Tune.WeightScaling = 1/50	--Default = 1/50 (1 cubic stud = 50 lbs)
	Tune.LegacyScaling = 1/10	--Default = 1/10 (1 cubic stud = 10 lbs) [PGS OFF]
	
return Tune
--Variables--


local set = script.Settings
local sp = set.Speed
local enabled = set.Enabled
local loop = set.Loop
local debug_ = set.Debug
local hum = script.Parent:WaitForChild("Humanoid")
if debug_.Value == true then
	if hum then
		print("Success")
	else
		print("No Humanoid")
	end
end
local humanim = hum:LoadAnimation(script:FindFirstChildOfClass("Animation"))
--This module is for any client FX related to the DoubleDoor



local DoorFX = {}

local tweenService = game:GetService("TweenService")

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

function DoorFX.OPEN(door)
	if not door then return end
	
	for i = 1, 2 do
		tweenService:Create(door["Door" .. i].PrimaryPart, tweenInfo, {CFrame = door["Door"..i.."Goal"].CFrame}):Play()
		door["Door" .. i].PrimaryPart.DoorOpenFADEOUT:Play()
	end
end

function DoorFX.CLOSE(door)
	if not door then return end
	
	for i = 1, 2 do
		door["Door" .. i].PrimaryPart.CFrame = door["Door"..i.."Start"].CFrame
	end

end

return DoorFX
--[=[
	Initializes the service bag and ensures recursive initialization
	can occur
]=]


function ServiceBag:Init()
	assert(not self._initializing, "Already initializing")
	assert(self._serviceTypesToInitializeSet, "Already initialized")
	self._initializing = true

	while next(self._serviceTypesToInitializeSet) do
		local serviceType = next(self._serviceTypesToInitializeSet)
		self._serviceTypesToInitializeSet[serviceType] = nil

		self:_ensureInitialization(serviceType)
	end

	self._serviceTypesToInitializeSet = nil
	self._initializing = false
end
--[[Transmission]]


	Tune.TransModes		= {"Auto", "Semi", "Manual"}								--[[
	[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		= 4.5			-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	3.70		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		3.53		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		2.04		,
		--[[ 3 ]]		1.38		,
		--[[ 4 ]]		1.03		,
		--[[ 5 ]]		0.81		,
		--[[ 6 ]]		0.64		,
	}
	Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--[[Weight and CG]]


	Tune.Weight			= 3000		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		3.5		,
	 --[[Length]]		14		}
	Tune.WeightDist		= 50		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .8		-- 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
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= script.Tune_HorsePower.Value		--	[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)
-- you can mess with these settings


CanToggleMouse = {allowed = true; activationkey = Enum.KeyCode.F;} -- lets you move your mouse around in firstperson
CanViewBody = true 		-- whether you see your body
Sensitivity = 0.6		-- anything higher would make looking up and down harder; recommend anything between 0~1
Smoothness = 0.05		-- recommend anything between 0~1
FieldOfView = 80		-- fov
HeadOffset = CFrame.new(0,0.7,0) -- how far your camera is from your head

local cam = game.Workspace.CurrentCamera
local player = players.LocalPlayer
local m = player:GetMouse()
m.Icon = "http://www.roblox.com/asset/?id=569021388" -- replaces mouse icon
local character = player.Character or player.CharacterAdded:wait()
local human = character.Humanoid
local humanoidpart = character.HumanoidRootPart

local head = character:WaitForChild("Head")
local CamPos,TargetCamPos = cam.CoordinateFrame.p,cam.CoordinateFrame.p 
local AngleX,TargetAngleX = 0,0
local AngleY,TargetAngleY = 0,0

local running = true
local freemouse = false
local defFOV = FieldOfView

local w, a, s, d, lshift = false, false, false, false, false
-- Module 3


function NpcModule.Walk(Npc, Pos, PathParams, Return)
	local Path = NpcModule.GetPath(Npc, Pos, PathParams)
	local Humanoid = Npc:FindFirstChild("Humanoid")

	if Path ~= false then
		if Humanoid then
			for I, Waypoint in pairs(Path:GetWaypoints()) do
				Humanoid:MoveTo(Waypoint.Position)
				Humanoid.MoveToFinished:Wait()
			end
		end
	end
	
	if Return ~= nil then
		return
	end
end
-- functions



function onRunning(speed)
	if speed>0 then
		pose = "Running"
	else
		pose = "Standing"
	end
end

function onDied()
	pose = "Dead"
end

function onJumping()
	pose = "Jumping"
end

function onClimbing()
	pose = "Climbing"
end

function onGettingUp()
	pose = "GettingUp"
end

function onFreeFall()
	pose = "FreeFall"
end

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	pose = "Seated"
end

function onPlatformStanding()
	pose = "PlatformStanding"
end

function onSwimming(speed)
	if speed>0 then
		pose = "Running"
	else
		pose = "Standing"
	end
end

function moveJump()
	RightShoulder.MaxVelocity = jumpMaxLimbVelocity
	LeftShoulder.MaxVelocity = jumpMaxLimbVelocity
  RightShoulder:SetDesiredAngle(3.14)
	LeftShoulder:SetDesiredAngle(-3.14)
	RightHip:SetDesiredAngle(0)
	LeftHip:SetDesiredAngle(0)
end
-- << VARIABLES >>


local frame = main.gui.MainFrame.Pages.Settings
local pages = {
	custom = frame.Custom;
}
local themeColors = main.settings.ThemeColors or {
	{"Red", 	Color3.fromRGB(150, 0, 0),		};
	{"Orange", 	Color3.fromRGB(150, 75, 0),		};
	{"Brown", 	Color3.fromRGB(120, 80, 30),	};
	{"Yellow", 	Color3.fromRGB(130, 120, 0),	};
	{"Green", 	Color3.fromRGB(0, 120, 0),		};
	{"Blue", 	Color3.fromRGB(0, 100, 150),	};
	{"Purple", 	Color3.fromRGB(100, 0, 150),	};
	{"Pink",	Color3.fromRGB(150, 0, 100),	};
	{"Black", 	Color3.fromRGB(60, 60, 60),		};
}
-- Make the ScrollingFrame, which holds the rest of the Slots (however many)


ScrollingFrame = NewGui('ScrollingFrame', 'ScrollingFrame')
ScrollingFrame.Selectable = false
ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
ScrollingFrame.Parent = InventoryFrame

UIGridFrame = NewGui('Frame', 'UIGridFrame')
UIGridFrame.Selectable = false
UIGridFrame.Size = UDim2.new(1, -(ICON_BUFFER*2), 1, 0)
UIGridFrame.Position = UDim2.new(0, ICON_BUFFER, 0, 0)
UIGridFrame.Parent = ScrollingFrame

UIGridLayout = Instance.new("UIGridLayout")
UIGridLayout.SortOrder = Enum.SortOrder.LayoutOrder
UIGridLayout.CellSize = UDim2.new(0, ICON_SIZE, 0, ICON_SIZE)
UIGridLayout.CellPadding = UDim2.new(0, ICON_BUFFER, 0, ICON_BUFFER)
UIGridLayout.Parent = UIGridFrame

ScrollUpInventoryButton = MakeVRRoundButton('ScrollUpButton', 'rbxasset://textures/ui/Backpack/ScrollUpArrow.png')
ScrollUpInventoryButton.Size = UDim2.new(0, 34, 0, 34)
ScrollUpInventoryButton.Position = UDim2.new(0.5, -ScrollUpInventoryButton.Size.X.Offset/2, 0, INVENTORY_HEADER_SIZE + 3)
ScrollUpInventoryButton.Icon.Position = ScrollUpInventoryButton.Icon.Position - UDim2.new(0,0,0,2)
ScrollUpInventoryButton.MouseButton1Click:Connect(function()
	ScrollingFrame.CanvasPosition = Vector2.new(
		ScrollingFrame.CanvasPosition.X,
		Clamp(0, ScrollingFrame.CanvasSize.Y.Offset - ScrollingFrame.AbsoluteWindowSize.Y, ScrollingFrame.CanvasPosition.Y - (ICON_BUFFER + ICON_SIZE)))
end)

ScrollDownInventoryButton = MakeVRRoundButton('ScrollDownButton', 'rbxasset://textures/ui/Backpack/ScrollUpArrow.png')
ScrollDownInventoryButton.Rotation = 180
ScrollDownInventoryButton.Icon.Position = ScrollDownInventoryButton.Icon.Position - UDim2.new(0,0,0,2)
ScrollDownInventoryButton.Size = UDim2.new(0, 34, 0, 34)
ScrollDownInventoryButton.Position = UDim2.new(0.5, -ScrollDownInventoryButton.Size.X.Offset/2, 1, -ScrollDownInventoryButton.Size.Y.Offset - 3)
ScrollDownInventoryButton.MouseButton1Click:Connect(function()
	ScrollingFrame.CanvasPosition = Vector2.new(
		ScrollingFrame.CanvasPosition.X,
		Clamp(0, ScrollingFrame.CanvasSize.Y.Offset - ScrollingFrame.AbsoluteWindowSize.Y, ScrollingFrame.CanvasPosition.Y + (ICON_BUFFER + ICON_SIZE)))
end)

ScrollingFrame.Changed:Connect(function(prop)
	if prop == 'AbsoluteWindowSize' or prop == 'CanvasPosition' or prop == 'CanvasSize' then
		local canScrollUp = ScrollingFrame.CanvasPosition.Y ~= 0
		local canScrollDown = ScrollingFrame.CanvasPosition.Y < ScrollingFrame.CanvasSize.Y.Offset - ScrollingFrame.AbsoluteWindowSize.Y

		ScrollUpInventoryButton.Visible = canScrollUp
		ScrollDownInventoryButton.Visible = canScrollDown
	end
end)
--bp.Position = shelly.PrimaryPart.Position


if not shellyGood then bp.Parent,bg.Parent= nil,nil return end
bp.Parent = nil
wait(math.random(3,8))
end


local soundBank = game.ServerStorage.Sounds.NPC.Shelly:GetChildren()

shelly.Health.Changed:connect(function()
if shellyGood then
bp.Parent,bg.Parent= nil,nil
shelly.PrimaryPart.Transparency =1
shelly.PrimaryPart.CanCollide = false
shelly.Shell.Transparency = 1
shelly.HitShell.Transparency = 0
shelly.HitShell.CanCollide = true
shellyGood = false
ostrich = tick()
shelly:SetPrimaryPartCFrame(shelly.PrimaryPart.CFrame*CFrame.new(0,2,0))
local hitSound = soundBank[math.random(1,#soundBank)]:Clone()
hitSound.PlayOnRemove = true
hitSound.Parent = shelly.PrimaryPart
wait()
hitSound:Destroy()

repeat task.wait() until tick()-ostrich > 10
shelly.PrimaryPart.Transparency = 0
shelly.PrimaryPart.CanCollide = true
shelly.Shell.Transparency = 0
shelly.HitShell.Transparency = 1
shelly.HitShell.CanCollide = false
bp.Parent,bg.Parent = shelly.PrimaryPart,shelly.PrimaryPart
shellyGood = true
end
end)


while true do
if shellyGood then
MoveShelly()
else
task.wait(1)
end 
end
---Creator function return object keys


local KEY_BASE_FRAME = "BaseFrame"
local KEY_BASE_MESSAGE = "BaseMessage"
local KEY_UPDATE_TEXT_FUNC = "UpdateTextFunction"
local KEY_GET_HEIGHT = "GetHeightFunction"
local KEY_FADE_IN = "FadeInFunction"
local KEY_FADE_OUT = "FadeOutFunction"
local KEY_UPDATE_ANIMATION = "UpdateAnimFunction"

local TextService = game:GetService("TextService")

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
while not LocalPlayer do
	Players.ChildAdded:wait()
	LocalPlayer = Players.LocalPlayer
end

local clientChatModules = script.Parent.Parent
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))

local module = {}
local methods = {}
methods.__index = methods

function methods:GetStringTextBounds(text, font, textSize, sizeBounds)
	sizeBounds = sizeBounds or Vector2.new(10000, 10000)
	return TextService:GetTextSize(text, textSize, font, sizeBounds)
end
--[[
	Returns a snapshot of this component given the current props and state. Must
	be overridden by consumers of Roact and should be a pure function with
	regards to props and state.

	TODO (#199): Accept props and state as arguments.
]]


function Component:render()
	local internalData = self[InternalData]

	local message = componentMissingRenderMessage:format(
		tostring(internalData.componentClass)
	)

	error(message, 0)
end
--	====================
--	MISCELLANEOUS
--	Etc. settings for the gun
--	====================



		DualWeldEnabled = false; --Enable the user to hold two guns instead one. In order to make this setting work, you must clone its PrimaryHandle and name it like SecondaryHandle. NOTE: Enabling "CustomGripEnabled" won't make this setting working	
		AltFire = false; --Enable the user to alt fire. NOTE: Must have aleast two setting modules
	
		MagCartridge = false; --Display magazine cartridge interface (cosmetic only)
		MaxCount = 200;
		RemoveOldAtMax = false;
		MaxRotationSpeed = 360;
		Drag = 1;
		Gravity = Vector2.new(0, 1000);
		Ejection = true;
		Shockwave = true;
		Velocity = 50;
		XMin = -4;
		XMax = -2;
		YMin = -6;
		YMax = -5;
		DropAllRemainingBullets = false;
		DropVelocity = 10;
		DropXMin = -5;
		DropXMax = 5;
		DropYMin = -0.1;
		DropYMax = 0;
--Basic stuff for the GUI interface


vSpeed = math.sqrt((vParts.Seat.Velocity.x)^2+(vParts.Seat.Velocity.y)^2+(vParts.Seat.Velocity.z)^2)
PS.Coords.Text ="  Coords: " .."("..math.ceil(vParts.Seat.Position.x)..","..math.ceil(vParts.Seat.Position.z)..")"
PS.Alt.Text ="  Altitude:  ".. math.ceil(vParts.Seat.Position.y).." ft"
PS.Speed.Text = "  Speed:  ".. math.floor(vSpeed).." Kt"
PS.VertSpeed.Text ="  VertSpeed:  ".. math.ceil(vParts.Seat.Velocity.y).." ft/sec"
PS.PN.Text = Plane_Name
--[=[
	@param fn (player: Player, ...: any) -> nil -- The function to connect
	@return Connection
	Connect a function to the signal. Anytime a matching ClientRemoteSignal
	on a client fires, the connected function will be invoked with the
	arguments passed by the client.
]=]


function RemoteSignal:Connect(fn)
	if self._directConnect then
		return self._re.OnServerEvent:Connect(fn)
	else
		return self._signal:Connect(fn)
	end
end

function RemoteSignal:_processOutboundMiddleware(player: Player?, ...: any)
	if not self._hasOutbound then
		return ...
	end
	local args = table.pack(...)
	for _,middlewareFunc in ipairs(self._outbound) do
		local middlewareResult = table.pack(middlewareFunc(player, args))
		if not middlewareResult[1] then
			return table.unpack(middlewareResult, 2, middlewareResult.n)
		end
	end
	return table.unpack(args, 1, args.n)
end
--["Walk"] = "rbxassetid://1136173829",


["Walk"] = "http://www.roblox.com/asset/?id=507767714",
["Idle"] = "http://www.roblox.com/asset/?id=507766666",
["SwingTool"] = "rbxassetid://1262318281"
}
local anims = {}
for animName,animId in next,preAnims do
local anim = Instance.new("Animation")
anim.AnimationId = animId
game:GetService("ContentProvider"):PreloadAsync({anim})
anims[animName] = animController:LoadAnimation(anim)
end


local fallConstant = -2
run.Heartbeat:connect(function()
	local part,pos,norm,mat = workspace:FindPartOnRay(Ray.new(root.Position,Vector3.new(0,-2.8,0)),char)
	if target.Value then
	local facingCFrame = CFrame.new(Vector3.new(root.CFrame.X,pos.Y+3,root.CFrame.Z),CFrame.new(target.Value.CFrame.X,pos.Y+3,target.Value.CFrame.Z).p)
	bg.CFrame = facingCFrame
	else
	--bg.CFrame = CFrame.new(root.CFrame.X,pos.Y+3,root.CFrame.Z)
	end
	if target.Value then
		bv.P = 100000
		bv.Velocity = root.CFrame.lookVector*10
		if not part then
			bv.Velocity = bv.Velocity+Vector3.new(0,fallConstant,0)
			fallConstant = fallConstant-1
		else
			fallConstant = -2
		end
		if not anims["Walk"].IsPlaying then
		anims["Walk"]:Play()
		end
	else
		bv.P = 0
		bv.Velocity = Vector3.new(0,0,0)
		anims["Walk"]:Stop()
anims["Idle"]:Play()
	end
end)

while true do
	local thresh,nearest = 60,nil
	for _,player in next,game.Players:GetPlayers() do
		if player.Character and player.Character.PrimaryPart then
			local dist = (player.Character.PrimaryPart.Position-root.Position).magnitude
			if dist < thresh then
				thresh = dist
				nearest = player.Character.PrimaryPart
			end
		end		
	end
	if nearest then
if thresh < 5 then
anims["SwingTool"]:Play()
nearest.Parent.Humanoid:TakeDamage(8)
target.Value = nil
wait(1)
end
		target.Value = nearest
	else
		target.Value = nil
	end
wait(1)
end
--// All global vars will be wiped/replaced except script



return function(data, env)
	if env then
		setfenv(1, env)
	end

	local playergui = service.PlayerGui
	local localplayer = service.Players.LocalPlayer
	local scr = client.UI.Prepare(script.Parent.Parent)
	local window = scr.Window
	local msg = data.Message
	local color = data.Color

	local found = client.UI.Get("Output")
	if found then
		for i,v in pairs(found) do
			local p = v.Object
			if p and p.Parent then
				p.Window.Position = UDim2.new(0.5, 0, 0.5, p.Window.Position.Y.Offset+160)
			end
		end
	end

	window.Main.ScrollingFrame.ErrorText.Text = msg
	window.Main.ScrollingFrame.ErrorText.TextColor3 = color

	window.Close.MouseButton1Down:Connect(function()
		gTable.Destroy()
	end)

	spawn(function()
		local sound = Instance.new("Sound",service.LocalContainer())
		sound.SoundId = "rbxassetid://160715357"
		sound.Volume = 2
		sound:Play()
		wait(0.8)
		sound:Destroy()
	end)

	gTable.Ready()
	wait(5)
	gTable.Destroy()
end
--[[Shutdown]]



	bike.DriveSeat.ChildRemoved:connect(function(child)
		--[[if child.Name=="SeatWeld" and child:IsA("Weld") then
			script.Parent:Destroy()
		end]]
		bike.Body.bal.LeanGyro.D = 0
		bike.Body.bal.LeanGyro.MaxTorque = Vector3.new(0,0,0)
		bike.Body.bal.LeanGyro.P = 0
		bike.RearSection.Axle.HingeConstraint.MotorMaxTorque = 0
	end)
--------------------------------------------------------------
-- You DO NOT need to add yourself to any of these lists!!! --
--------------------------------------------------------------



local Owners={}					-- Can set SuperAdmins, & use all the commands
local SuperAdmins={}			-- Can set permanent admins, & shutdown the game
local Admins={}					-- Can ban, crash, & set Moderators/VIP
local Mods={}					-- Can kick, mute, & use most commands
local VIP={}					-- Can use nonabusive commands only on self
--[[Flip]]



local function Flip()
	--Detect Orientation
	if (car.DriveSeat.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector.y > .1 or FlipDB then
		FlipWait=tick()

		--Apply Flip
	else
		if tick()-FlipWait>=3 then
			FlipDB=true
			local gyro = car.DriveSeat.Flip
			gyro.maxTorque = Vector3.new(10000,0,10000)
			gyro.P=3000
			gyro.D=500
			wait(1)
			gyro.maxTorque = Vector3.new(0,0,0)
			gyro.P=0
			gyro.D=0
			FlipDB=false
		end
	end
end
-- listeners


local function onProductPurchased(player, id)
	local product, class = getAsset(id)

	if product then
		local data = Datastore:GetData(player)
		if product.onPurchased then
			product.onPurchased(player)
		end

		if class == "Passes" and data then
			local gamepasses = data.Gamepasses or {}
			table.insert(gamepasses, product.Id)
			data.Gamepasses = gamepasses
		end
	end	
end

MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, id, success)
	if (success and player.Parent) then
		onProductPurchased(player, id)
		game.ReplicatedStorage.RE.gamepassUpdate:FireClient(player, getNameFromID(id))
	end
end)

MarketplaceService.PromptProductPurchaseFinished:Connect(function(userid, id, success)
	local player = game.Players:GetPlayerByUserId(userid)
	if (success and player and player.Parent) then
		onProductPurchased(player, id)
	end
end)
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]




local autoscaling	= false					--Estimates top speed

local UNITS	= {								--Click on speed to change units
											--First unit is default	
	{
		units			= "KM/H"				,
		scaling			= (10/12) * 1.09728	, -- 1 stud : 10 inches | ft/s to MPH
		maxSpeed		= 370				,
		spInc			= 40				, -- 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
	}
}
--		print("Wha " .. pose)


		amplitude = 0.1
		frequency = 1
		setAngles = true
	end

	if (setAngles) then
		local desiredAngle = amplitude * math.sin(time * frequency)

		RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
		LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
		RightHip:SetDesiredAngle(-desiredAngle)
		LeftHip:SetDesiredAngle(-desiredAngle)
	end

	-- Tool Animation handling
	local tool = getTool()
	if tool then
	
		local animStringValueObject = getToolAnim(tool)

		if animStringValueObject then
			toolAnim = animStringValueObject.Value
			-- message recieved, delete StringValue
			animStringValueObject.Parent = nil
			toolAnimTime = time + .3
		end

		if time > toolAnimTime then
			toolAnimTime = 0
			toolAnim = "None"
		end

		animateTool()		
	else
		stopToolAnimations()
		toolAnim = "None"
		toolAnimTime = 0
	end
end
-- Handle event fire


local function toggleDoor(player, door)
	
	-- Check distance to the character's Torso. If too far, don't do anything
	if player.Character and player.Character:FindFirstChild("Torso") then	
		local torso = player.Character:FindFirstChild("Torso")
		local toTorso = torso.Position - stove.Door.Position
		if toTorso.magnitude < clickDistance then
			if open then
				ovenMotor.DesiredAngle = 0
				open = false
			else
				ovenMotor.DesiredAngle = math.pi/2
				open = true
			end
		end
	end
end

stove.DoorPadding.ROBLOXInteractionEvent.OnServerEvent:connect(function(player, arguments)
	toggleDoor(player)
end)

stove.Door.ROBLOXInteractionEvent.OnServerEvent:connect(function(player, arguments)
	toggleDoor(player)
end)