Roblox/luau_corpus huggingface dataset:
-- Build a list of valid configuration values up for debug messages.
local defaultConfigKeys = {}
for key in pairs(defaultConfig) do
	table.insert(defaultConfigKeys, key)
end

local Config = {}

function Config.new()
	local self = {}

	self._currentConfig = setmetatable({}, {
		__index = function(_, key)
			local message = (
				"Invalid global configuration key %q. Valid configuration keys are: %s"
			):format(
				tostring(key),
				table.concat(defaultConfigKeys, ", ")
			)

			error(message, 3)
		end
	})

	-- We manually bind these methods here so that the Config's methods can be
	-- used without passing in self, since they eventually get exposed on the
	-- root Roact object.
	self.set = function(...)
		return Config.set(self, ...)
	end

	self.get = function(...)
		return Config.get(self, ...)
	end

	self.scoped = function(...)
		return Config.scoped(self, ...)
	end

	self.set(defaultConfig)

	return self
end

function Config:set(configValues)
	-- Validate values without changing any configuration.
	-- We only want to apply this configuration if it's valid!
	for key, value in pairs(configValues) do
		if defaultConfig[key] == nil then
			local message = (
				"Invalid global configuration key %q (type %s). Valid configuration keys are: %s"
			):format(
				tostring(key),
				typeof(key),
				table.concat(defaultConfigKeys, ", ")
			)

			error(message, 3)
		end

		-- Right now, all configuration values must be boolean.
		if typeof(value) ~= "boolean" then
			local message = (
				"Invalid value %q (type %s) for global configuration key %q. Valid values are: true, false"
			):format(
				tostring(value),
				typeof(value),
				tostring(key)
			)

			error(message, 3)
		end

		self._currentConfig[key] = value
	end
end

function Config:get()
	return self._currentConfig
end

function Config:scoped(configValues, callback)
	local previousValues = {}
	for key, value in pairs(self._currentConfig) do
		previousValues[key] = value
	end

	self.set(configValues)

	local success, result = pcall(callback)

	self.set(previousValues)

	assert(success, result)
end

return Config
--[[ Script Variables ]]--
while not Players.LocalPlayer do
	wait()
end
local LocalPlayer = Players.LocalPlayer
local ThumbpadFrame = nil
local TouchObject = nil
local OnInputEnded = nil	-- is defined in Create()
local OnTouchChangedCn = nil
local OnTouchEndedCn = nil
local currentMoveVector = Vector3.new(0,0,0)
-- ALEX WAS HERE LOL

local v1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
while not v1.Loaded do
	game:GetService("RunService").Heartbeat:Wait();
end;
return function(p1, p2, ...)
	local v2, v3 = ...;
	p1.title.Text = v2;
	if v3 == "Mythical" or v3 == "Exclusive" or v3 == "Nightmare" then
		p1.title.TextColor3 = Color3.new(1, 1, 1);
		v1.Assets.UI.Raritys:FindFirstChild(v3):Clone().Parent = p1.title;
	end;
end;
----

local GEAR_NAME = script.Parent.Name

local function GEAR_CONTROL(gear_functions)
	local GF = gear_functions
	
	--Tool variables
	local TLV = {}
	local TConnections = {}
	
	--Tool functions
	
	--Tool object functions
	local function Start()
		--forming classical tool
		TLV["Equipped"] = false
				
		TLV["Tool"] = Instance.new("Tool")
		TLV["Tool"].CanBeDropped = false
		TLV["Tool"].Name = ""
		TLV["Tool"].TextureId = "rbxassetid://"
		--TLV["Tool"].Grip = CFrame.new(0, -0.7, 0.1, 1, 0, 0, 0, 1, 0, 0, 0, 1)
		
		TLV["Handle"] = GF.GenPart()
		TLV["Handle"].Name = "Handle"
		TLV["Handle"].Parent = TLV["Tool"]
		
		--[[
		local h_mesh = Instance.new("SpecialMesh")
		h_mesh.MeshType = "FileMesh"
		h_mesh.MeshId = "rbxassetid://"
		h_mesh.TextureId = "rbxassetid://"
		h_mesh.Scale = Vector3.new(1, 1, 1)
		h_mesh.Parent = TLV["Handle"]
		--]]
		
		--[[
		TLV["Sound"] = Instance.new("Sound")
		TLV["Sound"].Volume = 1
		TLV["Sound"].SoundId = "rbxassetid://"
		TLV["Sound"].Parent = TLV["Handle"]
		--]]
		
		--adding tool to backpack
		TLV["Tool"].Parent = GF.GetBackpack()
		
		--tool triggers
		
		--tool connections
		table.insert(TConnections, TLV["Tool"].Activated:connect(function()
			if not GF.CheckAlive() then return end
			
		end))
		table.insert(TConnections, TLV["Tool"].Equipped:connect(function()
			TLV["Equipped"] = true
		end))
		table.insert(TConnections, TLV["Tool"].Unequipped:connect(function()
			TLV["Equipped"] = false
		end))
		
	end
	
	local function Update() --"return false" to destroy gear control object
		
		return true
	end
	
	local function Stop()
		if TLV["Tool"] ~= nil then
			TLV["Tool"]:Destroy()
		end
		
		for _, conn in pairs(TConnections) do
			pcall(function()
				conn:disconnect()
			end)
		end
		
		TLV = nil
	end
	
	return {Start, Update, Stop}
end

local function GEAR_EFFECT_LOCAL(gear_functions, effect_data)
	local GF = gear_functions
	local ED = effect_data --DESCRIBE EFFECT DATA VALUES BELOW
	
	--Effect variables
	local EV = {}
	
	--Client effect functions
	
	--Client effect object functions
	local function Start()
		EV["StartTime"] = tick()
		
	end
	
	local function Update(in_game) --"return false" to destroy gear effect object
		
		return true
	end
	
	local function Stop()
		EV = nil
	end
	
	return {Start, Update, Stop}
end

return {GEAR_CONTROL, GEAR_EFFECT_LOCAL}
--[[ I wont' be using promises for TopbarPlus so we can ignore this method
function Maid:givePromise(promise)
	if (promise:getStatus() ~= Promise.Status.Started) then
		return promise
	end

	local newPromise = Promise.resolve(promise)
	local id = self:giveTask(newPromise)

	-- Ensure GC
	newPromise:finally(function()
		self[id] = nil
	end)

	return newPromise, id
end--]]

function Maid:give(taskOrPromise)
	local taskId
	if type(taskOrPromise) == "table" and taskOrPromise.isAPromise then
		_, taskId = self:givePromise(taskOrPromise)
	else
		taskId = self:giveTask(taskOrPromise)
	end
	return taskOrPromise, taskId
end
--Gear Ratios
	Tune.FinalDrive		= 3.15	-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	4.17		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		5.00		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		3.20	,
		--[[ 3 ]]		2.14		,
		--[[ 4 ]]		1.72		,
		--[[ 5 ]]		1.31		,
		--[[ 6 ]]		1.00		,
		--[[ 7 ]]		0.82		,
		--[[ 8 ]]		0.64		,
	}
	Tune.FDMult			= 1.6	-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--[[

	LOWGames Studios
	Date: 27 October 2022
	by Elder
	
]]--

local u1 = nil;
coroutine.wrap(function()
	u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
end)();
local v1 = {};
return function(p1)
	local v2 = {};
	for v3, v4 in ipairs(game.Players:GetPlayers()) do
		if p1 ~= v4 then
			local u2 = false;
			pcall(function()
				u2 = p1:IsFriendsWith(v4.UserId);
			end);
			if u2 then
				table.insert(v2, v4);
			end;
		end;
	end;
	return v2;
end;
--[[
	Input: Player a, Player b
	Output: Bool isTeammate
	
	Returns true if the players are on the same team
--]]

return function(a, b)
	if not a or not b then return nil end
	return a and b and a:IsA'Player' and b:IsA'Player' and a.Neutral==false and b.Neutral==false and a.TeamColor==b.TeamColor
end
--[[
	Assert that our expectation value is truthy
]]
function Expectation:ok()
	local result = (self.value ~= nil) == self.successCondition

	local message = formatMessage(
		self.successCondition,
		("Expected value %q to be non-nil"):format(tostring(self.value)),
		("Expected value %q to be nil"):format(tostring(self.value))
	)

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

	return self
end
--------------------- TEMPLATE ASSAULT RIFLE WEAPON ---------------------------
-- Waits for the child of the specified parent
local function WaitForChild(parent, childName)
	while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
	return parent[childName]
end
local GLib = require(206209239)
------------------------------------------------------------------------------
--------------------[ MAIN PROGRAM ]------------------------------------------
------------------------------------------------------------------------------

function DetonateExplosive()
	local GrenadePos = Main.Position
	
	CreateShockwave(Main.Position, S.GrenadeBlastRadius)
	
	Sound:Play()
	
	local E = Instance.new("Explosion")
	E.BlastPressure = S.GrenadeBlastPressure
	E.BlastRadius = S.GrenadeBlastRadius
	E.DestroyJointRadiusPercent = (S.GrenadeRangeBasedDamage and 0 or 1)
	E.ExplosionType = S.GrenadeExplosionType
	E.Position = GrenadePos
	E.Hit:connect(function(HObj, HDist)
		if (not IsIgnored(HObj)) and HObj.Name == "Torso" then
			if S.GrenadeRangeBasedDamage then
				local ClosestPart = nil
				local ClosestDist = math.huge
				
				for _, P in pairs(HObj.Parent:GetChildren()) do
					if P:IsA("BasePart") then
						local Dist = (GrenadePos - P.Position).magnitude
						if Dist < ClosestDist then
							ClosestPart = P
							ClosestDist = Dist
						end
					end
				end
				
				local Dir = (ClosestPart.Position - GrenadePos).unit
				local H, P = AdvRayCast(GrenadePos, Dir, 999)
				local RayHitHuman = H:IsDescendantOf(HObj.Parent)
				if (S.GrenadeRayCastExplosions and RayHitHuman) or (not S.GrenadeRayCastExplosions) then
					local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
					if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
						local DistFactor = ClosestDist / S.GrenadeBlastRadius
						local DistInvert = math.max(1 - DistFactor, 0)
						local NewDamage = DistInvert * S.LethalGrenadeDamage
						
						local CreatorTag = Instance.new("ObjectValue")
						CreatorTag.Value = Plyr
						CreatorTag.Name = "creator"
						CreatorTag.Parent = HitHumanoid
						HitHumanoid:TakeDamage(NewDamage)
						MarkHit()
					end
				end
			else
				local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
				if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
					local CreatorTag = Instance.new("ObjectValue")
					CreatorTag.Value = Plyr
					CreatorTag.Name = "creator"
					CreatorTag.Parent = HitHumanoid
					MarkHit()
				end
			end
		end
	end)
	E.Parent = game.Workspace
	
	Main.Transparency = 1
	Main.Anchored = true
	Main.CanCollide = false
	
	wait(1)
	
	Main:Destroy()
end

if S.TimerStartOnHit then
	local Detonated = false
	Main.Touched:connect(function(Obj)
		if IsIgnored(Obj) or Detonated then return end
		Main.Velocity = Main.Velocity / 4
		Detonated = true
		
		wait(S.DetonationTime)
		
		DetonateExplosive()
	end)
else
	spawn(function()
		local Touched = false
		Main.Touched:connect(function(Obj)
			if IsIgnored(Obj) or Touched then return end
			Touched = true
			Main.Velocity = Main.Velocity / 4
		end)
	end)
	wait(S.DetonationTime)
	DetonateExplosive()
end
-- Mimic roblox menu when opened and closed
guiService.MenuClosed:Connect(function()
	if VRService.VREnabled then
		return
	end
	menuOpen = false
	if not IconController.controllerModeEnabled then
		IconController.setTopbarEnabled(IconController.topbarEnabled,false)
	end
end)
guiService.MenuOpened:Connect(function()
	if VRService.VREnabled then
		return
	end
	menuOpen = true
	IconController.setTopbarEnabled(false,false)
end)

bindCamera()
-- Functional Services
uis = game:GetService("UserInputService")
tween = game:GetService("TweenService")
--[[
	Stores common type information used internally.

	These types may be used internally so Fusion code can type-check, but
	should never be exposed to public users, as these definitions are fair game
	for breaking changes.
]]

local Package = script.Parent
local PubTypes = require(Package.PubTypes)

type Set<T> = {[T]: any}
--[[ss1.Touched:connect(function()
	if IsOpen.Value == false then
		OtherDir.Value = false
		opendoor()
		wait(TimeDelay)
		closedoor()
	end
end)]]

handle.ClickDetector.MouseClick:connect(function()
	if IsOpen.Value == false then
		OtherDir.Value = false
		opendoor()
		wait(TimeDelay)
		closedoor()
	end
end)
-- A state object which follows another state object using tweens.
export type Tween<T> = PubTypes.Tween<T> & {
	_goalState: State<T>,
	_tweenInfo: TweenInfo,
	_prevValue: T,
	_nextValue: T,
	_currentValue: T,
	_currentTweenInfo: TweenInfo,
	_currentTweenDuration: number,
	_currentTweenStartTime: number,
	_currentlyAnimating: boolean
}
-- Using the desired target rotation and elevation, determine where the gun should point right now (smoothly turn)
function getSmoothRotation(rotations)
	
	local targElev = rotations[1];
	local targRot = rotations[2];	
	
	local maxGunDepression = tankStats.GunDepression.Value;
	
	-- Restrict the height of travel of the gun
	if math.abs(targElev) > maxGunDepression then
		targElev = maxGunDepression*sign(targElev);
	end
	
	-- Once target angles are set, slowly turn turret towards them
	-- Elevation
	local elevDiff = targElev - currentElev;
	if math.abs(elevDiff) < 0.01 then -- If they're close
		currentElev = targElev;
	else -- Move towards it
		currentElev = currentElev + 0.01*sign(elevDiff);
	end
	
	-- Rotation
	local rotDiff = targRot - currentRot;
	
	if rotDiff > math.pi then
		rotDiff = rotDiff - 2*math.pi;
	elseif rotDiff < -math.pi then
		rotDiff = rotDiff + 2*math.pi;
	end
	
	local turretSpeed = tankStats.TurretSpeed.Value;
	
	if math.abs(rotDiff) < turretSpeed then -- If they're close
		currentRot = targRot;
	else -- Move towards it
		currentRot = currentRot + turretSpeed*sign(rotDiff);
	end
	
	-- Put rotation and elevation into an array
	local rotations = {};
	rotations[1] = targElev;
	rotations[2] = targRot;
	
	return rotations;
end
-- Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
-- Decompiled with the Synapse X Luau decompiler.

print(game.ReplicatedStorage.isBuilder:InvokeServer(), game.ReplicatedStorage.isAdmin:InvokeServer());
script.Parent.Enabled = game.ReplicatedStorage.isBuilder:InvokeServer() or game.ReplicatedStorage.isAdmin:InvokeServer();
local u1 = false;
script.Parent.TextButton.Activated:Connect(function()
	u1 = not u1;
	game.Players.LocalPlayer.Character.HumanoidRootPart.badge.toggle:InvokeServer(u1);
	script.Parent.TextButton.BackgroundColor3 = u1 and Color3.new(1, 1, 1) or Color3.new(0, 0, 0);
end);
--[[
	Contains deprecated methods from Reconciler. Broken out so that removing
	this shim is easy -- just delete this file and remove it from init.
]]

local Logging = require(script.Parent.Logging)

local reifyMessage = [[
Roact.reify has been renamed to Roact.mount and will be removed in a future release.
Check the call to Roact.reify at:
]]

local teardownMessage = [[
Roact.teardown has been renamed to Roact.unmount and will be removed in a future release.
Check the call to Roact.teardown at:
]]

local reconcileMessage = [[
Roact.reconcile has been renamed to Roact.update and will be removed in a future release.
Check the call to Roact.reconcile at:
]]

local function createReconcilerCompat(reconciler)
	local compat = {}

	function compat.reify(...)
		Logging.warnOnce(reifyMessage)

		return reconciler.mountVirtualTree(...)
	end

	function compat.teardown(...)
		Logging.warnOnce(teardownMessage)

		return reconciler.unmountVirtualTree(...)
	end

	function compat.reconcile(...)
		Logging.warnOnce(reconcileMessage)

		return reconciler.updateVirtualTree(...)
	end

	return compat
end

return createReconcilerCompat
--Interface
function draw_invincibility:Enable()
	--Enable trails
	for _,v in pairs(self.particles) do
		v.Enabled = true
	end
	self.en_time = self.part_time
	self.enabled = true
end

function draw_invincibility:Disable()
	--Disable trails
	for _,v in pairs(self.particles) do
		v.Enabled = false
	end
	self.enabled = false
end

function draw_invincibility:Draw(dt, hrp_cf)
	if not self.enabled then
		self.en_time -= dt
	end
	if self.en_time > 0 and hrp_cf ~= self.hrp_cf then
		--Set invincibility CFrame
		self.invincibility:SetPrimaryPartCFrame(hrp_cf)
		self.hrp_cf = hrp_cf
	end
end

function draw_invincibility:LazyDraw(dt, hrp_cf)
	if not self.enabled then
		self.en_time -= dt
	end
	if self.en_time > 0 and hrp_cf ~= self.hrp_cf then
		--Set invincibility CFrame
		self.invincibility:SetPrimaryPartCFrame(hrp_cf)
		self.hrp_cf = hrp_cf
	end
end

return draw_invincibility
--player.CharacterAdded:Wait()
--player.Character:WaitForChild("Humanoid")
--player.Character:WaitForChild("HumanoidRootPart")
--camera.CameraSubject = player.Character.HumanoidRootPart

local function onCharacterAdded(character)
	character:WaitForChild("HumanoidRootPart")
	camera.CameraSubject = player.Character.HumanoidRootPart
end

game.Players.LocalPlayer.CharacterAdded:Connect(onCharacterAdded)

game:GetService("RunService").Stepped:connect(function(currTime,dt)
	if(isPlayerRevive and player.Character ~= nil) then
		local character = player.Character
		if(character:FindFirstChild("HumanoidRootPart") == nil) then
			return
		end
		local torso = character.HumanoidRootPart
		local newFrame  = 	CFrame.new(Vector3.new(torso.Position.X , torso.Position.Y + 10, torso.Position.Z - 10) + currentPosition,
			Vector3.new(torso.Position.X,  torso.Position.Y, torso.Position.Z - 10) + currentTarget)
		camera.CFrame = camera.CFrame:Lerp(newFrame, cameraSpeed * dt)
	end
	
end)
--[[
    Returns true if the given value is not automatically memory managed, and
    requires manual cleanup.
]]

local function needsDestruction(x: any): boolean
    return typeof(x) == "Instance"
end

return needsDestruction
--//INSPARE//--
local player = game.Players.LocalPlayer
local lightOn = false
local car = script.Parent.Car.Value
--[[Engine]]
	--Torque Curve
	Tune.Horsepower		= 600		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 7000		--		Use sliders to manipulate values
	Tune.Redline		= 7500		--		Copy and paste slider values into the respective tune values
	Tune.ComfortShift   = 3500
	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)
--	====================
--	BULLET VISUALIZER
--	Enabled the gun to display a fake travelling bullet
--	====================

		VisualizerEnabled = true;
		BulletSpeed = 25;
		BulletSize = Vector3.new(0.25,0.25,100);
		BulletColor = BrickColor.new("White");
		BulletTransparency = 0.25;
		BulletMaterial = Enum.Material.Neon;
		FadeTime = 0.25; --Only work when bullet travel instantly. For this, you have to set BulletSpeed to "math.huge"
-- Includes all waypoints arranged in order in which player will move through them.
local waypoints = {
	waypointFolder.Start,
	waypointFolder.Point1,
	waypointFolder.Point2,
}
--[[ Roblox Services ]]--
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Workspace = game:GetService("Workspace")
local UserGameSettings = UserSettings():GetService("UserGameSettings")
local VRService = game:GetService("VRService")
--[[
	Flush all pending actions since the last change event was dispatched.
]]
function Store:flush()
	if not self._mutatedSinceFlush then
		return
	end

	self._mutatedSinceFlush = false

	-- On self.changed:fire(), further actions may be immediately dispatched, in
	-- which case self._lastState will be set to the most recent self._state,
	-- unless we cache this value first
	local state = self._state

	local ok, errorResult = xpcall(function()
		-- If a changed listener yields, *very* surprising bugs can ensue.
		-- Because of that, changed listeners cannot yield.
		NoYield(function()
			self.changed:fire(state, self._lastState)
		end)
	end, tracebackReporter)

	if not ok then
		self._errorReporter.reportUpdateError(
			self._lastState,
			state,
			self._actionLog,
			{
				message = "Caught error flushing store updates",
				thrownValue = errorResult,
			}
		)
	end

	self._lastState = state
end

return Store
--[[
	Disconnects existing connections
]]
local function disconnectOldConnections()
	for _, connection in ipairs(connections) do
		if connection then
			connection:Disconnect()
		end
	end

	connections = {}
end
-- Frame that contains the game mode selection
local MainFrame = InteractionGui:WaitForChild("MainFrame")
-- Other
local CurrentOccupant = nil
local Vector3New,CFrameNew,CFrameAngles,MathRad,MathAbs = Vector3.new,CFrame.new,CFrame.Angles,math.rad,math.abs
--!strict

local Cart = script.Parent.Parent
local Base = Cart:WaitForChild("Base")

local BreakSound = Base:WaitForChild("Break")

local Seat = Cart:WaitForChild("Seat")

return function()
	local occupant = Seat.Occupant
	if occupant then
		occupant.Sit = false
	end
	Seat.Disabled = true
	BreakSound:Play()
	if Base.AssemblyRootPart then
		Base.AssemblyRootPart:SetNetworkOwner(nil)
	end
	local descendants = Cart:GetDescendants()
	for _, descendant in ipairs(descendants) do
		if descendant:IsA("WeldConstraint") or descendant:IsA("Constraint") then
			descendant.Enabled = false
		end
	end
	for _, descendant in ipairs(descendants) do
		if descendant:IsA("BasePart") then
			descendant:ApplyImpulse(Vector3.new(0, math.random(70, 70), 0) * 0.5 * descendant.AssemblyMass)
			descendant:ApplyAngularImpulse(Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10)) * 1 * descendant.AssemblyMass)
		end
	end
	task.spawn(function()
		for _, ch in ipairs(Cart:GetDescendants()) do
			if ch:IsA("BasePart") then
				task.delay(math.random() * 4, ch.Destroy, ch)
			end
		end
		task.wait(4)
		Cart:Destroy()
	end)
end