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





function onTouch(part) 
local human = part.Parent:findFirstChild("Humanoid") 
if human ~= nil then 
part.Parent:findFirstChild("Head").Transparency = 0.99 
part.Parent:findFirstChild("Torso").Transparency = 1 
part.Parent:findFirstChild("Left Arm").Transparency = 1 
part.Parent:findFirstChild("Right Arm").Transparency = 1 
part.Parent:findFirstChild("Left Leg").Transparency = 1 
part.Parent:findFirstChild("Right Leg").Transparency = 1 
if part.Parent:findFirstChild("Head"):findFirstChild("face") == nil then return end 
part.Parent:findFirstChild("Head"):findFirstChild("face"):remove() 
if part.Parent:findFirstChild("Torso"):findFirstChild("roblox") == nil then return end 
part.Parent:findFirstChild("Torso"):findFirstChild("roblox"):remove() 
end 
end 
script.Parent.Touched:connect(onTouch)print("Hello world!")
--[=[
	@return ... any
	@yields

	Yields the current thread until the signal is fired, and returns the arguments fired from the signal.
	Yielding the current thread is not always desirable. If the desire is to only capture the next event
	fired, using `ConnectOnce` might be a better solution.
	```lua
	task.spawn(function()
		local msg, num = signal:Wait()
		print(msg, num) --> "Hello", 32
	end)
	signal:Fire("Hello", 32)
	```
]=]


function Signal:Wait()
	local waitingCoroutine = coroutine.running()
	local connection
	local done = false
	connection = self:Connect(function(...)
		if done then
			return
		end
		done = true
		connection:Disconnect()
		task.spawn(waitingCoroutine, ...)
	end)
	return coroutine.yield()
end
-- Given two pairs of arrays of strings:
-- Compare the pair of comparison arrays line-by-line.
-- Format the corresponding lines in the pair of displayable arrays.


local function diffLinesUnified2(
	aLinesDisplay: { [number]: string },
	bLinesDisplay: { [number]: string },
	aLinesCompare: { [number]: string },
	bLinesCompare: { [number]: string },
	options: DiffOptions?
): string
	if isEmptyString(aLinesDisplay) and isEmptyString(aLinesCompare) then
		aLinesDisplay = {}
		aLinesCompare = {}
	end
	if isEmptyString(bLinesDisplay) and isEmptyString(bLinesCompare) then
		bLinesDisplay = {}
		bLinesCompare = {}
	end

	if #aLinesDisplay ~= #aLinesCompare or #bLinesDisplay ~= #bLinesCompare then
		-- Fall back to diff of display lines.
		return diffLinesUnified(aLinesDisplay, bLinesDisplay, options)
	end

	local diffs = diffLinesRaw(aLinesCompare, bLinesCompare)

	-- Replace comparison lines with displayable lines.
	local aIndex = 0
	local bIndex = 0
	for _, d in ipairs(diffs) do
		local case = d[1]
		if case == DIFF_DELETE then
			d[2] = aLinesDisplay[aIndex + 1]
			aIndex += 1
		elseif case == DIFF_INSERT then
			d[2] = bLinesDisplay[bIndex + 1]
			bIndex += 1
		else
			d[2] = bLinesDisplay[bIndex + 1]
			aIndex += 1
			bIndex += 1
		end
	end

	return printDiffLines(diffs, normalizeDiffOptions(options))
end
--// F key, Manual


mouse.KeyDown:connect(function(key)
	if key=="f" then 
		script.Parent.Parent.Man.TextTransparency = 0
		veh.Lightbar.middle.Man:Play()
		veh.Lightbar.middle.Wail.Volume = 0
		veh.Lightbar.middle.Yelp.Volume = 0
		veh.Lightbar.middle.Priority.Volume = 0
		veh.Lightbar.middle.Hilo.Volume = 0
		veh.Lightbar.middle.Rwail.Volume = 0
script.Parent.Parent.MBOV.Visible = true
			script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
	end
end)
-- Set the tank's welds to face the right direction


function setTurretDirection(elevation, rotation)
	parts.MantletBase.MainGunWeld.C1 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0, elevation, 0);
	parts.TurretRing2.TurretRingWeld.C1 = CFrame.new(0,0,0.8) * CFrame.fromEulerAnglesXYZ(0, 0, rotation); 
end
--[[Weight and CG]]


	Tune.Weight			= 3472		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		3		,
	 --[[Length]]		14		}
	Tune.WeightDist		= 60		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= 1		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .45		-- Front Wheel Density
	Tune.RWheelDensity	= .45		-- 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
-- module



local INPUT	= {}

function INPUT.GetActionInput(self, action)
	local input	= "nil"
	
	local replacements	= {
		Zero	= "0";
		One		= "1";
		Two		= "2";
		Three	= "3";
		Four	= "4";
		Five	= "5";
		Six		= "6";
		Seven	= "7";
		Eight	= "8";
		Nine	= "9";
		
		MouseButton1	= "MB1";
		MouseButton2	= "MB2";
		MouseButton3	= "MB3";
		Return			= "Enter";
		Slash			= "/";
		Tilde			= "~";
		Backquote		= "`";
	}
	
	if actions[action] then
		local primary, secondary	= actions[action].Primary, actions[action].Secondary
		
		if primary then
			input	= primary.Name
		elseif secondary then
			input	= secondary.Name
		end
	end
	
	if replacements[input] then
		input	= replacements[input]
	end
	
	return string.upper(input)
end

if not initialized then
	local keybindChanged	= Instance.new("BindableEvent")
	INPUT.KeybindChanged	= keybindChanged.Event
	
	actionBegan	= Instance.new("BindableEvent")
	actionEnded	= Instance.new("BindableEvent")
	
	INPUT.ActionBegan	= actionBegan.Event
	INPUT.ActionEnded	= actionEnded.Event
	
	-- register actions
	
	local function Register(action, bindP, bindS)
		local primary, secondary
		if bindP then
			local A, B	= string.match(bindP, "(.-)%.(.+)")
			
			if A and B then
				primary	= Enum[A][B]
			end
		end
		if bindS then
			local A, B	= string.match(bindS, "(.-)%.(.+)")
			
			if A and B then
				secondary	= Enum[A][B]
			end
		end
		
		RegisterAction(action, primary, secondary)
		keybindChanged:Fire(action)
	end
	
	local function Handle(keybind)
		local action	= keybind.Name
		local bind		= keybind.Value
		
		if string.match(bind, ";") then
			local bindP, bindS	= string.match(bind, "(.-);(.+)")
			
			if bindP and bindS then
				Register(action, bindP, bindS)
			elseif bindP then
				Register(action, bindP)
			elseif bindS then
				Register(action, nil, bindS)
			end
		else
			Register(action, bind)
		end
	end
	
	initialized			= true
end

return INPUT
--[=[
	Converts the string to `UpperCamelCase` from `camelCase` or `snakeCase` or `YELL_CASE`
	@param str string
	@return string
]=]


function String.toCamelCase(str: string): string
	str = str:lower()
	str = str:gsub("[ _](%a)", string.upper)
	str = str:gsub("^%a", string.upper)
	str = str:gsub("%p", "")

	return str
end
--[[
	Button for opening the EmoteBar on gamepad enabled devices.
]]



local ContextActionService = game:GetService("ContextActionService")

local Roact = require(script.Parent.Parent.Packages.Roact)
local t = require(script.Parent.Parent.Packages.t)
local ConfigurationContext = require(script.Parent.Parent.Libraries.Configuration).ConfigurationContext

local GamepadToggleButton = Roact.Component:extend("GamepadToggleButton")

local MAX_SIZE = 66

GamepadToggleButton.defaultProps = {
	actionName = "GamepadToggleButton",
	onActivated = function() end,
}

GamepadToggleButton.validateProps = t.interface({
	onActivated = t.callback,
	transparency = t.optional(t.union(t.table, t.number)), -- Binding or number
})

function GamepadToggleButton:init()
	self.onActivated = function(_actionName, inputState)
		if inputState ~= Enum.UserInputState.Begin then
			return
		end

		self.props.onActivated()
	end
end

function GamepadToggleButton:render()
	return Roact.createElement("ImageButton", {
		Size = UDim2.fromOffset(MAX_SIZE, MAX_SIZE),
		Image = self.props.configuration.gamepadButtonIcon,
		ImageTransparency = self.props.transparency,
		BackgroundTransparency = 1,

		[Roact.Event.Activated] = self.props.onActivated,
	}, {
		AspectRatio = Roact.createElement("UIAspectRatioConstraint", {
			AspectRatio = 1,
		}),

		GamepadButton = Roact.createElement("ImageLabel", {
			Image = self.props.configuration.toggleButtonImage,
			ImageTransparency = self.props.transparency,
			Size = UDim2.fromScale(0.5, 0.5),
			Position = UDim2.fromScale(1, 1),
			AnchorPoint = Vector2.new(0.85, 0.85),
			BackgroundTransparency = 1,
		}),
	})
end

function GamepadToggleButton:didMount()
	ContextActionService:BindAction(
		self.props.actionName,
		self.onActivated,
		false,
		self.props.configuration.toggleButton
	)
end

function GamepadToggleButton:willUnmount()
	ContextActionService:UnbindAction(self.props.actionName)
end

return ConfigurationContext.withConfiguration(GamepadToggleButton)
-- Fires off everytime the link is reconfigured into a valid link
-- Fires with link, linkValue


function RxLinkUtils.observeValidityBrio(linkName, link)
	assert(typeof(link) == "Instance" and link:IsA("ObjectValue"), "Bad link")
	assert(type(linkName) == "string", "Bad linkName")

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

		local function updateValidity()
			if not ((link.Name == linkName) and link.Value) then
				maid._lastValid = nil
				return
			end

			local newValid = Brio.new(link, link.Value)
			maid._lastValid = newValid
			sub:Fire(newValid)
		end

		maid:GiveTask(link:GetPropertyChangedSignal("Value")
			:Connect(updateValidity))
		maid:GiveTask(link:GetPropertyChangedSignal("Name")
			:Connect(updateValidity))
		updateValidity()

		return maid
	end)
end


return RxLinkUtils
---------------------------------------DO NOT EDIT-------------------------------------------------------		


		local AbiltyGui = script.Parent.ScreenGui:Clone()
		AbiltyGui.AbilitySecs.Value = script.Parent.Configuration.AbilityCoolDown.Value
		AbiltyGui.AbilitySecs2.Value = script.Parent.Configuration.AbilityCoolDown.Value
		wait(0.01)
		AbiltyGui.LocalScript.Disabled = false
		wait()
		AbiltyGui.LocalScript2.Disabled = false
		wait(0.1)
		AbiltyGui.Parent = Player.PlayerGui

		wait(script.Parent.Configuration.AbilityCoolDown.Value)
		script.Disabled = false
		script.Parent.Ability.Disabled = false
	end
end)
-- Formerly getCurrentCameraMode, this function resolves developer and user camera control settings to
-- decide which camera control module should be instantiated. The old method of converting redundant enum types


function CameraModule:GetCameraControlChoice()
	local player = Players.LocalPlayer

	if player then
		if self.lastInputType == Enum.UserInputType.Touch or UserInputService.TouchEnabled then
			-- Touch
			if player.DevTouchCameraMode == Enum.DevTouchCameraMovementMode.UserChoice then
				return CameraUtils.ConvertCameraModeEnumToStandard( UserGameSettings.TouchCameraMovementMode )
			else
				return CameraUtils.ConvertCameraModeEnumToStandard( player.DevTouchCameraMode )
			end
		else
			-- Computer
			if player.DevComputerCameraMode == Enum.DevComputerCameraMovementMode.UserChoice then
				local computerMovementMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)
				return CameraUtils.ConvertCameraModeEnumToStandard(computerMovementMode)
			else
				return CameraUtils.ConvertCameraModeEnumToStandard(player.DevComputerCameraMode)
			end
		end
	end
end

function CameraModule:OnCharacterAdded(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterAdded(char, player)
	end
end

function CameraModule:OnCharacterRemoving(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterRemoving(char, player)
	end
end

function CameraModule:OnPlayerAdded(player)
	player.CharacterAdded:Connect(function(char)
		self:OnCharacterAdded(char, player)
	end)
	player.CharacterRemoving:Connect(function(char)
		self:OnCharacterRemoving(char, player)
	end)
end

function CameraModule:OnMouseLockToggled()
	if self.activeMouseLockController then
		local mouseLocked = self.activeMouseLockController:GetIsMouseLocked()
		local mouseLockOffset = self.activeMouseLockController:GetMouseLockOffset()
		if self.activeCameraController then
			self.activeCameraController:SetIsMouseLocked(mouseLocked)
			self.activeCameraController:SetMouseLockOffset(mouseLockOffset)
		end
	end
end

return CameraModule.new()
--[[**
	ensures value is a number where min < value

	@param min The minimum to use

	@returns A function that will return true iff the condition is passed
**--]]


function t.numberMinExclusive(min)
	return function(value)
		local success, errMsg = t.number(value)
		if not success then
			return false, errMsg or ""
		end
		if min < value then
			return true
		else
			return false, string.format("number > %s expected, got %s", min, value)
		end
	end
end
-- Allocate works similarly to Pull, except it tries to reuse objects that exist in the specified bin.
-- This removes the need to recycle every object during every frame.



function recyclingBin:Allocate(objectType,needed,bin)
	local allocation = {}
	local allocated = 0
	for _,v in pairs(bin:GetChildren()) do
		if v:IsA(objectType) then
			allocated = allocated + 1
			if allocated > needed then
				self:Recycle(v)
			else
				allocation[allocated] = v
			end
		end
	end
	while allocated < needed do
		allocated = allocated + 1
		allocation[allocated] = self:Pull(objectType,bin)
	end
	return allocation
end

return recyclingBin
--[[Savin'
		Dem
			Stats	
--]]


game.Players.PlayerRemoving:connect(function(player)
	local datastore = game:GetService("DataStoreService"):GetDataStore(player.Name.."Stats")

local statstorage = player:FindFirstChild("leaderstats"):GetChildren()
for i =  1, #statstorage do
	datastore:SetAsync(statstorage[i].Name, statstorage[i].Value)
	print("saved data number "..i)
	
end
print("Stats successfully saved")	
end)
--[[
	
	Cleaner alternative to GetNameFromUserIdAsync that caches to avoid constant yielding.
	
	Functions.UserIdToUsername(
		userId,					<-- |REQ| 	User ID
	)
	
--]]





return function(userId)
	--- Check cache
	if cachedUsernames[userId] then
		--- Return cache
		return cachedUsernames[userId]
	
	else
		--- Grab username from web
		local username
		local success = pcall(function()
			username = game.Players:GetNameFromUserIdAsync(userId)
		end)
		
		--- Failed :(
		if not success then  return  end
		
		--- Success! Updating cache
		cachedUsernames[userId] = username
		
		--
		return username
	end
end
--Aesthetics	


Tune.SusVisible		= true			-- Spring Visible
Tune.WsBVisible		= false			-- Wishbone Visible
Tune.SusRadius		= .2			-- Suspension Coil Radius
Tune.SusThickness	= .1			-- Suspension Coil Thickness
Tune.SusColor		= "Really black"	-- Suspension Color [BrickColor]
Tune.SusCoilCount	= 6				-- Suspension Coil Count
Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--// Handling Settings		


	Firerate = 60 / 625; -- 60 = 1 Minute, 625 = Rounds per that 60 seconds. DO NOT TOUCH THE 60!
	
	FireMode = 2; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive
--Script made by Shaakra--



while true do
	local stats = game.Players:findFirstChild(script.Parent.Parent.Name).leaderstats
	if stats.Spree.Value ~= nil then
		script.Parent.WalkSpeed = 16 + stats.Spree.Value/6
	end
	if script.Parent.WalkSpeed > 32 then
		script.Parent.WalkSpeed = 32
	end
	wait(1)
end
-- Roblox User Input Control Modules - each returns a new() constructor function used to create controllers as needed


local Keyboard = require(script:WaitForChild("Keyboard"))
local Gamepad = require(script:WaitForChild("Gamepad"))
local TouchDPad = require(script:WaitForChild("TouchDPad"))
local DynamicThumbstick = require(script:WaitForChild("DynamicThumbstick"))
-- Listen for changes to the selection and keep the focus updated


Selection.Changed:Connect(FocusOnLastSelectedPart);

function GetCore()
	-- Returns the core API
	return require(script.Parent);
end;

local function GetVisibleChildren(Item, Table)
	local Table = Table or {}

	-- Search for visible items recursively
	for _, Item in pairs(Item:GetChildren()) do
		if IsVisible(Item) then
			Table[#Table + 1] = Item
		else
			GetVisibleChildren(Item, Table)
		end
	end

	-- Return visible items
	return Table
end
wait(0.08)


	weld55.C1 = CFrame.new(-0.35, 0.7, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(275), 0.25, math.rad(-90))
	weld33.C1 = CFrame.new(-0.75, 0.5, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-70), math.rad(-15),0)
				wait(0.08)
	weld55.C1 = CFrame.new(-0.35, 0.8, 0.7) * CFrame.fromEulerAnglesXYZ(math.rad(275), 0.15, math.rad(-90))
	Tool.BAR1.Mesh.Offset = Vector3.new(-0.1, 0, -0.2)
	Tool.BAR2.Mesh.Offset = Vector3.new(-0.1, 0, -0.2)
	Tool.BAR3.Mesh.Offset = Vector3.new(-0.1, 0, -0.2)
	Tool.BAR4.Mesh.Offset = Vector3.new(-0.1, 0, -0.2)
	Tool.BAR5.Mesh.Offset = Vector3.new(-0.1, 0, -0.2)
	Tool.BAR6.Mesh.Offset = Vector3.new(-0.1, 0, -0.2)
	Tool.BARCenter.Mesh.Offset = Vector3.new(-0.1, 0, -0.2)
	Tool.BARCenter2.Mesh.Offset = Vector3.new(-0.1, 0, -0.2)
				wait(0.08)
	Tool.BAR1.Mesh.Offset = Vector3.new(-0.0, 0, -0.)
	Tool.BAR2.Mesh.Offset = Vector3.new(-0., 0, -0.)
	Tool.BAR3.Mesh.Offset = Vector3.new(-0., 0, -0.)
	Tool.BAR4.Mesh.Offset = Vector3.new(-0., 0, -0.)
	Tool.BAR5.Mesh.Offset = Vector3.new(-0., 0, -0.)
	Tool.BAR6.Mesh.Offset = Vector3.new(-0., 0, -0.)
	Tool.BARCenter.Mesh.Offset = Vector3.new(-0., 0, -0.)
	Tool.BARCenter2.Mesh.Offset = Vector3.new(-0., 0, -0.)
				wait(0.1)
	weld55.C1 = CFrame.new(-0.35, 0.8, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(275), 0.15, math.rad(-90))
				wait(0.08)
	weld55.C1 = CFrame.new(-0.35, 0.7, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(280), 0.1, math.rad(-90))
				wait(0.08)
	Tool.Reload:play()
	weld55.C1 = CFrame.new(-0.35, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(285), 0.05, math.rad(-90))
				wait(0.08)
	weld33.C1 = CFrame.new(-0.75, 0.5, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-80), math.rad(-15),0)
				wait(0.08)
	weld33.C1 = CFrame.new(-0.75, 0.5, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15),0)
	weld55.C1 = CFrame.new(-0.35, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))

--bullets all in! =D
				script.Amo.Value = 6 -- amount of ammunition that can be discharged before reloading
				m.Text = "Ammo /"..script.Amo.Value


			end
		end
	end
end



function unequip1()
	print("Unequipped")
	if game.Players.LocalPlayer ~= nil then
		print("localplayer found")
		local m = game.Players.LocalPlayer:FindFirstChild("Message")
		if m ~= nil then
			m:remove()
		end
	end
end



Tool.Enabled = true

function onActivated()



	if not Tool.Enabled then

		return

	end



	Tool.Enabled = false

	local character = Tool.Parent;

	local humanoid = character.Humanoid

	if humanoid == nil then

		print("Humanoid not found")

		return 

	end



	local targetPos = humanoid.TargetPoint

	local lookAt = (targetPos - character.Head.Position).unit



	fire(lookAt)



	wait(.01)



	Tool.Enabled = true

end





script.Parent.Activated:connect(onActivated)
Tool.Equipped:connect(Equip)
Tool.Unequipped:connect(Unequip)
script.Parent.Equipped:connect(equip1)
script.Parent.Unequipped:connect(unequip1)
-- goro7



local plr = game.Players.LocalPlayer

function update()
	
	-- Calculate scale
	local scale = (plr.PlayerGui.MainGui.AbsoluteSize.Y - 46) / script.Parent.Parent.Size.Y.Offset
	if scale > 1.5 then
		scale = 1.5
	end
	if scale > 0 then
		script.Parent.Scale = scale
	end
	
end

plr.PlayerGui:WaitForChild("MainGui"):GetPropertyChangedSignal("AbsoluteSize"):connect(update)
update()
-- << CLIENT COMMANDS >>


local module = {
	
	----------------------------------------------------------------------
	["wings"] = {
		Function = function(speaker, args)
			local plr = args[1]
			local wings = game.ReplicatedStorage.Wings:Clone()
			wings.Who.Value = plr.Name
			wings.Disabled = false
			wings.Parent = game.Players.LocalPlayer.Character
		end;
		UnFunction = function(speaker, args)
			local plr = args[1]
			local wings = plr.Character:FindFirstChild("Wings")
			if wings then
				wings:Destroy()
			end
		end;
		
		};
	
	
	
	
	----------------------------------------------------------------------
	["commandName2"] = {
		Function = function(speaker, args)
			
		end;
		};
	
	
	
	
	----------------------------------------------------------------------
	
};
-- [ SETTINGS ] --



local StatsName = "Minutes" -- Your stats name
local MaxItems = 100 -- Max number of items to be displayed on the leaderboard
local MinValueDisplay = 1 -- Any numbers lower than this will be excluded
local MaxValueDisplay = 10e15 -- (10 ^ 15) Any numbers higher than this will be excluded
local UpdateEvery = 60 -- (in seconds) How often the leaderboard has to update
------------------------------------------------------------------------
--
-- * used in multiple locations
------------------------------------------------------------------------


function luaK:exp2anyreg(fs, e)
  self:dischargevars(fs, e)
  if e.k == "VNONRELOC" then
    if not self:hasjumps(e) then  -- exp is already in a register
      return e.info
    end
    if e.info >= fs.nactvar then  -- reg. is not a local?
      self:exp2reg(fs, e, e.info)  -- put value on it
      return e.info
    end
  end
  self:exp2nextreg(fs, e)  -- default
  return e.info
end
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 188		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 7000		--		Use sliders to manipulate values
	Tune.Redline		= 7000.01		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 6000
	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		= 100		-- 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)
--[[
	   ___  _____
	  / _ |/ ___/	Avxnturador | Novena
	 / __ / /__			 LuaInt | Novena
	/_/ |_\___/   Build 6C, Version 1.4, Update 3
	
	Please install this chassis from scratch.
	More info can be found in the README.
	
	New values will have (Username) appended to the end of the description.
]]



local Tune = {}
--Internal functions


function DataStore:Debug(...)
	if Debug then
		print(...)
	end
end

function DataStore:_GetRaw()
	if not self.getQueue then
		self.getQueue = {}
	end

	if self.getting then
		self:Debug("A _GetRaw is already in motion, just wait until it's done")
		local event = Instance.new("BindableEvent")
		self.getQueue[#self.getQueue + 1] = event
		event.Event:wait()
		self:Debug("Aaand we're back")
		return
	end

	self.getting = true

	local success, mostRecentKeyPage = pcall(function()
		return self.orderedDataStore:GetSortedAsync(false, 1):GetCurrentPage()[1]
	end)

	if not success then
		self.getting = false
		error(mostRecentKeyPage)
	end

	if mostRecentKeyPage then
		local recentKey = mostRecentKeyPage.value
		self:Debug("most recent key", mostRecentKeyPage)
		self.mostRecentKey = recentKey
		local success, value = pcall(function()
			return self.dataStore:GetAsync(recentKey)
		end)
		if not success then
			self.getting = false
			error(value)
		end
		self.value = value
	else
		self:Debug("no recent key")
		self.value = nil
	end

	for _, waiting in pairs(self.getQueue) do
		self:Debug("resuming in queue", waiting)
		waiting:Fire()
	end

	self.getQueue = {}
	self.haveValue = true
	self.getting = false
end

function DataStore:_Update(dontCallOnUpdate)
	if not dontCallOnUpdate then
		for _,callback in pairs(self.callbacks) do
			callback(self.value, self)
		end
	end

	self.haveValue = true
	self.valueUpdated = true
end
--[[
	Gathers all of the errors reported by tests and puts them at the top level
	of the TestResults object.
]]


function TestSession:gatherErrors()
	local results = self.results

	results.errors = {}

	results:visitAllNodes(function(node)
		if #node.errors > 0 then
			for _, message in ipairs(node.errors) do
				table.insert(results.errors, {
					message = message,
					phrase = node.planNode.phrase,
				})
			end
		end
	end)
end