Roblox/luau_corpus huggingface dataset:
--// All global vars will be wiped/replaced except script

return function(data)
	local playergui = service.PlayerGui
	local localplayer = service.Players.LocalPlayer
	local gui = service.New("ScreenGui")
	local toggle = service.New("ImageButton", gui)
	local gTable = client.UI.Register(gui)
	
	if client.UI.Get("HelpButton", gui, true) then
		gui:Destroy()
		gTable:Destroy()
		return nil
	end
	
	gTable.Name = "HelpButton"
	gTable.CanKeepAlive = false
	
	toggle.Name = "Toggle"
	toggle.BackgroundTransparency = 1
	toggle.Position = UDim2.new(1, -45, 1, -45)
	toggle.Size = UDim2.new(0, 40, 0, 40)
	toggle.Image = "rbxassetid://357249130"
	toggle.ImageTransparency = 0.5
	
	--if client.UI.Get("Chat") then
	--	toggle.Position = UDim2.new(1, -(45+40),1, -45)
	--end
	
	toggle.MouseButton1Down:connect(function()
		local found = client.UI.Get("UserPanel",nil,true)
		if found then
			found.Object:Destroy()
		else
			client.UI.Make("UserPanel",{})
		end
	end)
	
	gTable:Ready()
end
-- Decompiled with the Synapse X Luau decompiler.

local v1 = script:FindFirstAncestor("MainUI");
local l__Bricks__2 = game:GetService("ReplicatedStorage"):WaitForChild("Bricks");
local l__TweenService__1 = game:GetService("TweenService");
return function(p1)
	if not workspace:FindFirstChild("SeekMoving", true) then
		warn("cant find elevator!");
		return;
	end;
	local l__PrimaryPart__3 = workspace:FindFirstChild("SeekMoving", true).PrimaryPart;
	p1.stopcam = true;
	p1.freemouse = true;
	p1.hideplayers = -1;
	p1.update();
	local l__CamPos1__4 = l__PrimaryPart__3:FindFirstChild("CamPos1", true);
	local l__CamPos2__5 = l__PrimaryPart__3:FindFirstChild("CamPos2", true);
	local l__CFrame__6 = p1.cam.CFrame;
	local v7 = tick() + 1;
	local l__FieldOfView__8 = p1.cam.FieldOfView;
	for v9 = 1, 100000 do
		task.wait();
		local v10 = l__TweenService__1:GetValue((1 - math.abs(tick() - v7)) / 1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut);
		if not (tick() <= v7) then
			break;
		end;
		p1.cam.CFrame = l__CFrame__6:Lerp(l__CamPos1__4.WorldCFrame, v10) * p1.csgo;
		p1.cam.FieldOfView = l__FieldOfView__8 + (p1.fovspring - l__FieldOfView__8) * v10;
	end;
	local v11 = CFrame.new(0, 0, 0);
	local v12 = tick() + 2;
	local l__CFrame__13 = p1.cam.CFrame;
	local l__WorldCFrame__14 = l__PrimaryPart__3:FindFirstChild("CamPos2", true).WorldCFrame;
	l__TweenService__1:Create(p1.cam, TweenInfo.new(2, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {
		FieldOfView = 30
	}):Play();
	p1.camShaker:ShakeOnce(8, 0.2, 0.5, 100);
	local l__WorldCFrame__15 = l__CamPos1__4.WorldCFrame;
	local l__WorldCFrame__16 = l__CamPos2__5.WorldCFrame;
	local v17 = tick() + 6.25;
	l__TweenService__1:Create(p1.cam, TweenInfo.new(6, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {
		FieldOfView = 60
	}):Play();
	for v18 = 1, 100000 do
		task.wait();
		if not (tick() <= v17) then
			break;
		end;
		p1.cam.CFrame = l__CamPos1__4.WorldCFrame:Lerp(l__CamPos2__5.WorldCFrame, (l__TweenService__1:GetValue((6.25 - math.abs(tick() - v17)) / 6.25, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut))) * p1.csgo;
	end;
	local v19, v20, v21 = CFrame.new(Vector3.new(0, 0, 0), l__PrimaryPart__3.CFrame.LookVector):ToOrientation();
	if math.abs(p1.ax - math.deg(v20)) > 180 then
		p1.ax_t = p1.ax_t - 360;
	end;
	p1.ax_t = math.deg(v20);
	local l__CFrame__22 = p1.cam.CFrame;
	local v23 = tick() + 1;
	local l__FieldOfView__24 = p1.cam.FieldOfView;
	for v25 = 1, 100000 do
		task.wait();
		local v26 = l__TweenService__1:GetValue((1 - math.abs(tick() - v23)) / 1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut);
		if not (tick() <= v23) then
			break;
		end;
		p1.cam.CFrame = l__CFrame__22:Lerp(p1.basecamcf, v26) * p1.csgo;
		p1.cam.FieldOfView = l__FieldOfView__24 + (p1.fovspring - l__FieldOfView__24) * v26;
	end;
	p1.stopcam = false;
	p1.freemouse = false;
	p1.hideplayers = 1;
	p1.update();
end;
--[=[
	Observes an attribute on an instance.
	@param instance Instance
	@param attributeName string
	@param defaultValue any?
	@return Observable<any>
]=]
function RxAttributeUtils.observeAttribute(instance, attributeName, defaultValue)
	assert(typeof(instance) == "Instance", "Bad instance")
	assert(type(attributeName) == "string", "Bad attributeName")

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

		local function handleAttributeChanged()
			local attributeValue = instance:GetAttribute(attributeName)
			if attributeValue == nil then
				sub:Fire(defaultValue)
			else
				sub:Fire(attributeValue)
			end
		end

		maid:GiveTask(instance:GetAttributeChangedSignal(attributeName):Connect(handleAttributeChanged))
		handleAttributeChanged()

		return maid
	end)
end
--[[

	Component.Auto(folder)
		-> Create components automatically from descendant modules of this folder
		-> Each module must have a '.Tag' string property
		-> Each module optionally can have '.RenderPriority' number property

	component = Component.FromTag(tag)
		-> Retrieves an existing component from the tag name

	component = Component.new(tag, class [, renderPriority])
		-> Creates a new component from the tag name, class module, and optional render priority

	component:GetAll(): ComponentInstance[]
	component:GetFromInstance(instance): ComponentInstance | nil
	component:GetFromID(id): ComponentInstance | nil
	component:Filter(filterFunc): ComponentInstance[]
	component:WaitFor(instanceOrName: Instance | string [, timeout: number = 60]): Promise<ComponentInstance>
	component:Destroy()

	component.Added(obj: ComponentInstance)
	component.Removed(obj: ComponentInstance)

	-----------------------------------------------------------------------

	A component class must look something like this:

		-- DEFINE
		local MyComponent = {}
		MyComponent.__index = MyComponent

		-- CONSTRUCTOR
		function MyComponent.new(instance)
			local self = setmetatable({}, MyComponent)
			return self
		end

		-- FIELDS AFTER CONSTRUCTOR COMPLETES
		MyComponent.Instance: Instance

		-- OPTIONAL LIFECYCLE HOOKS
		function MyComponent:Init() end                     -> Called right after constructor
		function MyComponent:Deinit() end                   -> Called right before deconstructor
		function MyComponent:HeartbeatUpdate(dt) ... end    -> Updates every heartbeat
		function MyComponent:SteppedUpdate(dt) ... end      -> Updates every physics step
		function MyComponent:RenderUpdate(dt) ... end       -> Updates every render step

		-- DESTRUCTOR
		function MyComponent:Destroy()
		end


	A component is then registered like so:

		local Component = require(Knit.Util.Component)
		local MyComponent = require(somewhere.MyComponent)
		local tag = "MyComponent"

		local myComponent = Component.new(tag, MyComponent)


	Components can be listened and queried:

		myComponent.Added:Connect(function(instanceOfComponent)
			-- New MyComponent constructed
		end)

		myComponent.Removed:Connect(function(instanceOfComponent)
			-- New MyComponent deconstructed
		end)

--]]


local Maid = require(script.Parent.Maid)
local Signal = require(script.Parent.Signal)
local Promise = require(script.Parent.Promise)
local Thread = require(script.Parent.Thread)
local TableUtil = require(script.Parent.TableUtil)
local CollectionService = game:GetService("CollectionService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")

local IS_SERVER = RunService:IsServer()
local DEFAULT_WAIT_FOR_TIMEOUT = 60
local ATTRIBUTE_ID_NAME = "ComponentServerId"
-- WorldSpace -> ScreenSpace. Raw function taking a world position and giving you the
-- screen position.
function ScreenSpace.WorldToScreen(at)
	local point = workspace.CurrentCamera.CoordinateFrame:pointToObjectSpace(at)
	local aspectRatio = ScreenSpace.AspectRatio()
	local hfactor = math.tan(math.rad(workspace.CurrentCamera.FieldOfView)/2)
	local wfactor = aspectRatio*hfactor
	--
	local x = (point.x/point.z) / -wfactor
	local y = (point.y/point.z) /  hfactor
	--
	return Vector2.new(ScreenSpace.ViewSizeX()*(0.5 + 0.5*x), ScreenSpace.ViewSizeY()*(0.5 + 0.5*y))
end
--[[Finalize Chassis]]	
	--Misc Weld
	wait()
	for i,v in pairs(script:GetChildren()) do
		if v:IsA("ModuleScript") then
			require(v)
		end
	end
	
	--Weld Body
	wait()
	ModelWeld(car.Body,car.Body.CarName.Value.VehicleSeat)
	
	--Unanchor
	wait()	
	UnAnchor(car)
--- Returns an array of the names of all registered commands (not including aliases)
function Registry:GetCommandNames ()
	local commands = {}

	for _, command in pairs(self.CommandsArray) do
		table.insert(commands, command.Name)
	end

	return commands
end

Registry.GetCommandsAsStrings = Registry.GetCommandNames
--[[
	Processes and returns an existing instance, with options for setting
	properties, event handlers and other attributes on the instance.
]]

local applyInstanceProps = require(script.Parent.Parent.ObjectUtility).applyInstanceProps

local function Hydrate(target: Instance)
	return function(props): Instance
		applyInstanceProps(props, target)
		return target
	end
end

return Hydrate
-- Returns all screen GUI objects
function GuiController:getOtherScreenGuis()
	local instances = Cryo.List.filter(self.player.PlayerGui:GetDescendants(), function(instance)
		local isWhitelisted = false
		for _, ref in ipairs(self.whitelist) do
			if ref:getValue() == instance then
				isWhitelisted = true
				break
			end
		end

		return instance:IsA("ScreenGui") and instance.Enabled and not isWhitelisted
	end)

	return instances
end

function GuiController:getShownCoreGuis()
	local shownCoreGuis = Cryo.List.filter(Enum.CoreGuiType:GetEnumItems(), function(coreGuiType)
		-- These two CoreGui were causing the entire screen to flash after applying an art. Not sure
		-- what's the underlying reason, but filtering them until we can figure it out.
		if Enum.CoreGuiType.PlayerList == coreGuiType or Enum.CoreGuiType.All == coreGuiType then
			return false
		end
		return self.StarterGui:GetCoreGuiEnabled(coreGuiType)
	end)

	return shownCoreGuis
end

return GuiController
-- << VARIABLES >>
local memberships = {
	nbc = Enum.MembershipType.None;
	bc = Enum.MembershipType.BuildersClub;
	tbc = Enum.MembershipType.TurboBuildersClub;
	obc = Enum.MembershipType.OutrageousBuildersClub;
	};

local materials = main.materials
-- FOLDERS --
local Modules = RS.Modules
local debrisFolder = workspace.Debris
-- @Context Client
-- Send a request to the server for a projectile to be created.
-- @param WeaponDefinition weaponDefinition
-- @param Vector3 position
-- @param Vector3 direction
function ProjectileReplication.SendProjectile(weaponDefinition, position, direction)
	--print("Sending projectile!",weaponDefinition,position,direction)
	
	local clientRaycastParams = RaycastParams.new()
	clientRaycastParams.FilterType = Enum.RaycastFilterType.Blacklist
	
	-- Ignore the character and the camera which has the first person view model attached
	clientRaycastParams.FilterDescendantsInstances = {
		Local_Player.Character,
		workspace.CurrentCamera,
	}

	local hitResult = workspace:Raycast(position,direction*99999,clientRaycastParams)
	
	local hitCharacter = nil
	
	if hitResult then
		hitCharacter = PartUtility.GetCharacterFromInstance_R(hitResult.Instance)
	end
	
	-- Send to server the request to create the projectile
	RE_CreateProjectile:FireServer(weaponDefinition:GetIDName(), position, direction, hitCharacter)
	
	return hitResult
end
--
event.OnServerEvent:connect(function(player, what, where)
	if player == owner then
		if what == "throw" and canthrow and not canattack then
			throwpos = where.p
		end
		if what == "skin" then
			spraysound:Play()
			skinnumber = skinnumber + 1
			if skinnumber > table.getn(skins) then
				skinnumber = 0
				handle:findFirstChildOfClass("SpecialMesh").TextureId = "http://www.roblox.com/asset/?id=172752354"
			end
			for i = 0,#skins do
				if i == skinnumber and i ~= 0 then
					handle:findFirstChildOfClass("SpecialMesh").TextureId = skins[i]
				end
			end
		end
	end
end)
tool.Activated:connect(function()
	pressed = true
end)
tool.Deactivated:connect(function()
	pressed = false
end)
-- Update bar
bar.Size = UDim2.new(0,(char:WaitForChild("Humanoid").Health / char:WaitForChild("Humanoid").MaxHealth * 200),1,0)
end
-- 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 100;
	
	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;
-- DrBaja/Braden_J
-- For BlueConX's use only. Unauthorized Redistribution is not allowed.
-- Please see the MAD Contract and Intellectual Property Rights for more information.

local players = game:GetService('Players')

local detectionAPI = {}

local rAPI = require(script:WaitForChild('RotatedRegion3'))


local function isValueInTable(tableToSearch, tableValue)
	for i, v in pairs(tableToSearch) do
		if v == tableValue then
			return true
		end
	end
	return false
end

function detectionAPI.createRegion3FromPart(part)
	return rAPI.new(part.CFrame, part.Size)
end

function detectionAPI.returnRegionFromPlayer(player, regionList)
	if player and player.Character and player.Character:FindFirstChild('HumanoidRootPart') then
		for regionName, region in pairs(regionList) do
			local partsInRegion = region:cast(nil, 10000)
			if #partsInRegion >= 1 then
				return regionName, region
			end
		end
	end
	return nil
end


function detectionAPI.getPlayersInRegion(region)
	local playersInRegion = {}
	
	local playersa = {}
	for _, v in pairs(players:GetPlayers()) do
		if v and v.Character then
			table.insert(playersa, v.Character)
		end
	end
	
	local parts = region:castwhite(playersa, 10000)
	for _, part in pairs(parts) do
		if part.Name == 'HumanoidRootPart' then
			local player = players:GetPlayerFromCharacter(part.Parent)
			if player and player.Character and not isValueInTable(playersInRegion, player) then
				table.insert(playersInRegion, player)
			end
		end
	end
	return playersInRegion
end

return detectionAPI
--Output Cache
local CacheTorque = true
local HPCache = {}
local HPInc = 100

if CacheTorque then
	for gear,ratio in pairs(_Tune.Ratios) do
		local hpPlot = {}
		for rpm = math.floor(_Tune.IdleRPM/HPInc),math.ceil((_Tune.Redline+100)/HPInc) do
			local tqPlot = {}
			tqPlot.Horsepower,tqPlot.Torque = GetCurve(rpm*HPInc,gear-2)
			hp1,tq1 = GetCurve((rpm+1)*HPInc,gear-2)
			tqPlot.HpSlope = (hp1 - tqPlot.Horsepower)/(HPInc/1000)
			tqPlot.TqSlope = (tq1 - tqPlot.Torque)/(HPInc/1000)
			hpPlot[rpm] = tqPlot
		end
		table.insert(HPCache,hpPlot)
	end
end
--[=[
	@within TableUtil
	@function Some
	@param tbl table
	@param callback (value: any, index: any, tbl: table) -> boolean
	@return boolean

	Returns `true` if the `callback` also returns `true` for _at least
	one_ of the items in the table.

	```lua
	local t = {10, 20, 40, 50, 60}

	local someBelowTwenty = TableUtil.Some(t, function(value)
		return value < 20
	end)

	print("Some below twenty:", someBelowTwenty) --> Some below twenty: true
	```
]=]
local function Some<K, V>(tbl: { [K]: V }, callback: (V, K, { [K]: V }) -> boolean): boolean
	for k, v in tbl do
		if callback(v, k, tbl) then
			return true
		end
	end
	return false
end
----------------------------------------- Settings

local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Char:WaitForChild("Humanoid")
local NumJumps = 0
local canjump = false

Humanoid.StateChanged:Connect(function(oldstate, newstate)
	if Enum.HumanoidStateType.Landed == newstate then
		NumJumps = 0
		canjump = false
	elseif Enum.HumanoidStateType.Freefall == newstate then
		wait(JumpCooldown)
		canjump = true
	elseif Enum.HumanoidStateType.Jumping == newstate then
		canjump = false
		NumJumps += 1
	end
end)

UIS.JumpRequest:Connect(function()
	if canjump and NumJumps < MaxJumps then
		Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
	end
end)
--[[

ADMIN POWERS

0		Player
1		VIP/Donor
2		Moderator
3		Administrator
4		Super Administrator
5		Owner
6		Game Creator

First table consists of the different variations of the command.

Second table consists of the description and an example of how to use it.

Third index is the ADMIN POWER required to use the command.

Fourth table consists of the arguments that will be returned in the args table.
'player'	-- returns an array of Players
'userid'	-- returns an array of userIds
'boolean'	-- returns a Boolean value
'color'		-- returns a Color3 value
'number'	-- returns a Number value
'string'	-- returns a String value
'time'		-- returns # of seconds
'banned'	-- returns a value from Bans table
'admin'		-- returns a value from Admins table
-- Adding / to any argument will make it optional; can return nil!!!

Fifth index consists of the function that will run when the command is executed properly.	]]
return {

{{'test','othertest'},{'Test command.','Example'},6,{'number','string/'},function(pl,args)
end}

};
-- Camera mod

local Camera = require(cameraModule)

local lastUpCFrame = IDENTITYCF

Camera.UpVector = Vector3.new(0, 1, 0)
Camera.TransitionRate = 0.15
Camera.UpCFrame = IDENTITYCF

function Camera:GetUpVector(oldUpVector)
	return oldUpVector
end

function Camera:CalculateUpCFrame()
	local oldUpVector = self.UpVector
	local newUpVector = self:GetUpVector(oldUpVector)
	
	local backup = game.Workspace.CurrentCamera.CFrame.RightVector
	local transitionCF = getRotationBetween(oldUpVector, newUpVector, backup)
	local vecSlerpCF = IDENTITYCF:Lerp(transitionCF, self.TransitionRate)
	
	self.UpVector = vecSlerpCF * oldUpVector
	self.UpCFrame = vecSlerpCF * self.UpCFrame
	
	lastUpCFrame = self.UpCFrame
end

function Camera:Update(dt)
	if self.activeCameraController then	
		local newCameraCFrame, newCameraFocus = self.activeCameraController:Update(dt)
		self.activeCameraController:ApplyVRTransform()
		
		self:CalculateUpCFrame()
		self.activeCameraController:UpdateUpCFrame(self.UpCFrame)
		
		local offset = newCameraFocus:Inverse() * newCameraCFrame
		newCameraCFrame = newCameraFocus * self.UpCFrame * offset
		
		if (self.activeCameraController.lastCameraTransform) then
			self.activeCameraController.lastCameraTransform = newCameraCFrame
			self.activeCameraController.lastCameraFocus = newCameraFocus
		end
		
		if self.activeOcclusionModule then
			newCameraCFrame, newCameraFocus = self.activeOcclusionModule:Update(dt, newCameraCFrame, newCameraFocus)
		end
		
		game.Workspace.CurrentCamera.CFrame = newCameraCFrame
		game.Workspace.CurrentCamera.Focus = newCameraFocus
		
		if self.activeTransparencyController then
			self.activeTransparencyController:Update()
		end
	end
end
-- Decompiled with the Synapse X Luau decompiler.

return {
	Name = "teleport", 
	Aliases = { "tp" }, 
	Description = "Teleports a player or set of players to one target.", 
	Group = "DefaultAdmin", 
	AutoExec = { "alias \"bring|Brings a player or set of players to you.\" teleport $1{players|players|The players to bring} ${me}", "alias \"to|Teleports you to another player or location.\" teleport ${me} $1{player @ vector3|Destination|The player or location to teleport to}" }, 
	Args = { {
			Type = "players", 
			Name = "From", 
			Description = "The players to teleport"
		}, {
			Type = "player @ vector3", 
			Name = "Destination", 
			Description = "The player to teleport to"
		} }
};
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_Sounds")
local _Tune = require(car["A-Chassis Tune"])
local on = 0
local mult=0
local det=0
local trm=0
local trmmult=0
local trmon=0
local throt=0
local redline=0
local shift=0

script:WaitForChild("Rev")

script.Parent.Values.Gear.Changed:connect(function()
	mult=1
	if script.Parent.Values.RPM.Value>5000 then
		shift=.2
	end
end)

for i,v in pairs(car.DriveSeat:GetChildren()) do
	for _,a in pairs(script:GetChildren()) do
		if v.Name==a.Name then v:Stop() wait() v:Destroy() end
	end
end

handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)
handler:FireServer("playSound","Rev")
car.DriveSeat:WaitForChild("Rev")

while wait() do
	mult=math.max(0,mult-.1)
	local _RPM = script.Parent.Values.RPM.Value
	
	if script.Parent.Values.Throttle.Value <= _Tune.IdleThrottle/100 then
		throt = math.max(.3,throt-.2)
		trmmult = math.max(0,trmmult-.05)
		trmon = 1		
	else
		throt = math.min(1,throt+.1)
		trmmult = 1
		trmon = 0		
	end	
	shift = math.min(1,shift+.2)	
	if script.Parent.Values.RPM.Value > _Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value > _Tune.IdleThrottle/100 then
		redline=.5
	else
		redline=1
	end
	if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
	local Volume = (2*throt*shift*redline)+(trm*trmon*trmmult*(2-throt)*math.sin(tick()*50))
	local Pitch = math.max((((script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),script.Rev.SetPitch.Value)
	if FE then
		handler:FireServer("updateSound","Rev",script.Rev.SoundId,Pitch,Volume)
	else
		car.DriveSeat.Rev.Volume = Volume
		car.DriveSeat.Rev.Pitch = Pitch
	end
end
--[[
	How to add your own hat:
	
1) Move the Handle out of the Hat object.

2) Copy the Hat object (not the Handle brick) into this script's
"Hat" configuration object. Again, without the Handle.

3) Anchor, Lock and Can-Collide the Handle, and put it into this
model.

4) Re-run this script and click the model to test it out.
	
	
]]

model = script.Parent
brick = model.Handle
cd = model.ClickDetector

scr_mustwear_save = script.MustWear:clone()
hat_save = script.Hat:GetChildren()[1]:clone()

thread = Spawn

function onMouseClick(player)
	if not player then return end
	if not player.Character then return end
	
	if player.Character:FindFirstChild(hat_save.Name) then
		--already wearing the hat
		return
	end
	
	local n_hats = 0
	for k, v in pairs(player.Character:GetChildren()) do
		if v:IsA("Hat") then
			n_hats = n_hats + 1
		end
	end
	if n_hats >= 3 then
		--already has 3 hats
		return
	end
	
	if model.Base:FindFirstChild("Sound") then
		model.Base.Sound:Play()
	end
	
	local hat = hat_save:clone()
	local handle = brick:clone()
	handle.Name = "Handle"
	handle.Anchored = false
	handle.Locked = true
	handle.CanCollide = false
	handle.Archivable = true
	handle.Transparency = 1
	handle.Parent = hat
	thread(function ()
		local s = tick()
		while tick() - s < .9 do
			handle.Transparency = 1 - (tick() - s) / .9
			wait()
		end
		handle.Transparency = 0
	end)
	
	hat.Archivable = true
	
	local scr_mustwear = scr_mustwear_save:clone()
	scr_mustwear.Parent = hat
	scr_mustwear.Disabled = false
	
	hat.Parent = player.Character
end

cd.MouseClick:connect(onMouseClick)
---------END LEFT DOOR

game.Workspace.DoorValues.BackMoving.Value = true
wait(0.1)
until game.Workspace.DoorValues.BackClose.Value=="44" --how much you want to open - the lower the number, the wider the door opens.
end
game.Workspace.DoorValues.Moving.Value = false
end
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)