Roblox/luau_corpus huggingface dataset:
-- How rare the weapon is and how hard it is to get.
if _M.DropsWeapon2 == true and DropChance == (_M.WeaponChance2) then -- If the correct value is pulled, enable the item to be dropped
	Enemy.Died:Connect(DropItem) -- Drop item if dead
end
-- Implements Javascript's `Map.prototype.forEach` as defined below
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach
function Map:forEach(callback: mapCallbackFn<any, any> | mapCallbackFnWithThisArg<any, any>, thisArg: Object?): ()
	if _G.__DEV__ then
		if typeof(callback) ~= "function" then
			error("callback is not a function")
		end
	end
	-- note: we can't turn this into a simple for-in loop, because the callbacks can modify the table and React, GQL, and Jest rely on JS behavior in that scenario
	arrayForEach(self._array, function(key)
		local value = self._map[key]

		if thisArg ~= nil then
			(callback :: mapCallbackFnWithThisArg<any, any>)(thisArg, value, key, self)
		else
			(callback :: mapCallbackFn<any, any>)(value, key, self)
		end
	end)
end

function Map:has(key): boolean
	return self._map[key] ~= nil
end

function Map:keys()
	return self._array
end

function Map:values()
	return arrayMap(self._array, function(key)
		return self._map[key]
	end)
end

function Map:entries()
	return arrayMap(self._array, function(key)
		return { key, self._map[key] }
	end)
end

function Map:ipairs()
	if _G.__DEV__ then
		warn(
			debug.traceback(
				"`for _,_ in myMap:ipairs() do` is deprecated and will be removed in a future release, please use `for _,_ in myMap do` instead\n",
				2
			)
		)
	end
	return ipairs(self:entries())
end

function Map.__iter(self)
	return next, self:entries()
end

function Map.__index(self, key)
	local mapProp = rawget(Map, key)
	if mapProp ~= nil then
		return mapProp
	end

	return Map.get(self, key)
end

function Map.__newindex(table_, key, value)
	table_:set(key, value)
end

return Map
--Script
feedbackMain.CharactersLeft.Text = maxCharacters - #feedbackMain.InputBox.Input.Text
feedbackMain.InputBox.Input.Changed:Connect(function()
	feedbackMain.CharactersLeft.Text = maxCharacters - #feedbackMain.InputBox.Input.Text
	if maxCharacters - #feedbackMain.InputBox.Input.Text < 0 then
		feedbackMain.CharactersLeft.TextColor3 = Color3.fromRGB(255,50,50)
		feedbackMain.SendButton.Style = Enum.ButtonStyle.RobloxRoundButton
	else
		feedbackMain.CharactersLeft.TextColor3 = Color3.fromRGB(255,255,255)
		feedbackMain.SendButton.Style = Enum.ButtonStyle.RobloxRoundDefaultButton
	end
end)

local db = false
feedbackMain.SendButton.MouseButton1Click:Connect(function()
	if not db and maxCharacters - #feedbackMain.InputBox.Input.Text >= 0 then
		db = true
		local msg = feedbackMain.InputBox.Input.Text
		feedbackMain.InputBox.Input.Text = "Sending Message..."
		local response = game.ReplicatedStorage.FilteringFunction:InvokeServer(msg)
		feedbackMain.InputBox.Input.Text = response
		wait(5)
		if feedbackMain.InputBox.Input.Text == response then
			feedbackMain.InputBox.Input.Text = "Type feedback/bug report here"
		end
		db = false
	end
end)

script.Parent.Button.MouseButton1Click:Connect(function()
	open = not open
	if open then
		feedbackMain:TweenPosition(UDim2.new(1,-300,1,-300),"Out","Quint",0.3,true)
	else
		feedbackMain:TweenPosition(UDim2.new(1,100,1,-300),"Out","Quint",0.3,true)
	end
end)
--//Functions
local function JumpEffect(jumpingChar)
	local platform = oriPlatform:Clone()
	platform.CFrame = (jumpingChar.PrimaryPart.CFrame-Vector3.new(0,hum.HipHeight/2,0))*CFrame.Angles(0,0,math.rad(90))
	platform.Parent = workspace

	tween:Create(platform, TweenInfo.new(0.5), {Size = Vector3.new(0.2, 10, 10)}):Play()
	tween:Create(platform, TweenInfo.new(0.5, Enum.EasingStyle.Quint, Enum.EasingDirection.In), {Transparency = 1}):Play()
	tween:Create(platform.Decal, TweenInfo.new(0.5), {Transparency = 1}):Play()
	wait(0.8)
	platform:Destroy()
end
--[[Transmission]]
	Tune.TransModes		= {"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	= "RPM"												--[[
	[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)
	Tune.ShiftTime = .3				-- The time delay in which you initiate a shift and the car changes gear
	
	--Gear Ratios
	
	Tune.FinalDrive		= 3.45		 --		[TRANSMISSION CALCULATIONS FOR NERDS]
	Tune.Ratios			= {			 --		SPEED [SPS]	 = (Wheel diameter(studs) * math.pi * RPM) / (60 * Gear Ratio * Final Drive * Multiplier)
		--[[ R ]]		3.3		    ,-- 	WHEEL TORQUE = Engine Torque * Gear Ratio * Final Drive * Multiplier
		--[[ N ]]		0			,
		--[[ 1 ]]		16.6 		,
		--[[ 2 ]]		11.2		,
		--[[ 3 ]]		6.7 		,
	    --[[ 4 ]]       4.5         ,
	    --[[ 5 ]]       3.5         ,
	} 
	Tune.FDMult			= 1			-- Ratio multiplier (keep this at 1 if car is not struggling with torque)
--\\Main//--
for Number, Instance in pairs(game.Workspace:GetChildren()) do
	if Instance:IsA("Part") and Instance.Name == "Union" or "Pipe Part" or "Pipe" then
		Instance.Touched:Connect(function(Hit)
			local Player = PlayerService:GetPlayerFromCharacter(Hit.Parent)
			if not Player then return end
			Player.Character:FindFirstChild("Humanoid").Sit = true
		end)
	end
end
--// F key, Horn

UserInputService.InputEnded:Connect(function(input,gameprocessedevent)
	if gameprocessedevent == false then
		if input.KeyCode ==  Enum.KeyCode.F then
			event:FireServer("HornOff")
		end
	end
end)
--// Positioning
	RightArmPos = CFrame.new(-0.902175903, 0.295501232, -1.32277012, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08);
	LeftArmPos = CFrame.new(0.805950999, 0.654529691, -1.92835343, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098);
	GunPos = CFrame.new(0.284460306, -0.318524063, 1.06423128, 1, 0, 0, 0, -2.98023224e-08, -0.99999994, 0, 0.99999994, -2.98023224e-08);
	
	}

return Settings
--end
end
end



function ToogleLock(status)
for i,v in pairs(Car:GetDescendants()) do
if v.ClassName == "VehicleSeat" or v.ClassName == "Seat" then
v.Disabled = status
end
end
end
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.Flies
--// F key, Horn
mouse.KeyDown:connect(function(key)
	if key=="f" then 
		veh.ELS.Sirens.AH.Transparency = 0
		veh.ELS.Siren.Airhorn:Play()
		veh.ELS.Siren2.Airhorn:Play()
		veh.ELS.Sirens.Horn.Transparency = 0
		veh.ELS.Siren.Wail.Volume = 0
		veh.ELS.Siren.Yelp.Volume = 0
		veh.ELS.Siren.Priority.Volume = 0	
		veh.ELS.Siren2.Wail.Volume = 0
		veh.ELS.Siren2.Yelp.Volume = 0
		veh.ELS.Siren2.Priority.Volume = 0
	end
end)
--// Math
local L_104_ = function(L_141_arg1, L_142_arg2, L_143_arg3)
	if L_141_arg1 > L_143_arg3 then
		return L_143_arg3
	elseif L_141_arg1 < L_142_arg2 then
		return L_142_arg2
	end
	return L_141_arg1
end

local L_105_ = L_93_.new(Vector3.new())
L_105_.s = 30
L_105_.d = 0.55
	
local L_106_ = CFrame.Angles(0, 0, 0)
--SHUTS OFF ALL SIGNALS
while true do
	script.Parent.Parent.SignalValues.Signal1.Value = 0
	script.Parent.Parent.SignalValues.Signal1a.Value = 0
	script.Parent.Parent.SignalValues.Signal2.Value = 0
	script.Parent.Parent.SignalValues.Signal2a.Value = 0
	script.Parent.Parent.TurnValues.TurnSignal1.Value = 0
	script.Parent.Parent.TurnValues.TurnSignal1a.Value = 0
	script.Parent.Parent.TurnValues.TurnSignal2.Value = 0
	script.Parent.Parent.TurnValues.TurnSignal2a.Value = 0
	script.Parent.Parent.PedValues.PedSignal1.Value = 0
	script.Parent.Parent.PedValues.PedSignal1a.Value = 0
	script.Parent.Parent.PedValues.PedSignal2.Value = 0
	script.Parent.Parent.PedValues.PedSignal2a.Value = 0
	wait()
end
--Code--
local function PlayerTouched(Part)
	local Parent = Part.Parent
	if game.Players:GetPlayerFromCharacter(Parent) then
		wait(1)
		Parent.Humanoid.Health = 0
	end
end

Brick.Touched:connect(PlayerTouched)
--------END RIGHT DOOR --------

game.Workspace.doorleft.l11.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l12.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l11.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l12.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l13.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l41.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l42.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l43.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l71.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l72.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l73.BrickColor = BrickColor.new(106)
wait(0.1)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l21.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l22.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l23.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l52.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l53.BrickColor = BrickColor.new(106)
wait(0.1)
game.Workspace.doorleft.l31.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l31.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l32.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l33.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l61.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l62.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l63.BrickColor = BrickColor.new(21)
-- you can mess with these settings
local easingtime = 0.1 --0~1
local walkspeeds = {
	enabled =		  true;
	walkingspeed =		35;
	backwardsspeed =	25;
	sidewaysspeed =		34;
	diagonalspeed =		38;
	runningspeed =		50;
	runningFOV=			120;
}
-- Customization
	AntiTK = false;
	
	MouseSense = 0.5;

	CanAim = true;	
	CanBolt = true;
	
	LaserAttached = false;
	LightAttached = false;
	TracerEnabled = false;
--// Beam flag wavy thing
--// Written by Informable/Autumn
--// Do not distribute without this header

local beam = script.Parent.Beam
local p1 = script.Parent.End
local p2 = script.Parent.Start
local cf1 = p1.CFrame
local cf2 = p2.CFrame
local cos = 0
local noise = 0
local noise2 = 0

math.randomseed(tick())
local seed1 = math.random()*3+2
local seed2 = math.random()*3+2
local seed3 = math.random()*3+2

game:GetService("RunService").Stepped:connect(function()
	cos = cos + .05
	noise = noise + .1
	noise2 = noise2 + .2
	local noiser1 = math.noise(seed1,noise/35,noise/35)*3
	local noiser2 = math.noise(seed2*3+2,noise2/42,noise2/42)*3
	local noiser3 =math.noise(seed3*3+2,noise2/27,noise2/27)*3
	p1.CFrame = cf1*CFrame.new(noiser1,0,0)*CFrame.Angles(0,math.cos(cos/2)*noiser3/3.5-1.5,0)
	p2.CFrame = cf2*CFrame.Angles(0,math.sin(cos/3.5)/2+noiser2/3.5-1.5,0)
end)
--------------------------------------------------
if _Tune.Aspiration ~= "Natural" then 
	if _Tune.Aspiration == "Single" then 
		_TCount = 1 
	elseif _Tune.Aspiration == "Double" then 
		_TCount = 2 
	end
	values.Boost.Changed:connect(function()
		local boost = (math.floor(values.Boost.Value)*1.2)-((_Tune.Boost*_TCount)/5)
		inboost.Rotation = -110 + 210 * math.min(1,(values.Boost.Value/(_Tune.Boost)/_TCount))
		boostguage.Text = tostring(math.floor(boost))
	end)
end
-----------------
--| Constants |--
-----------------
local BLAST_RADIUS = script.Parent.Parent.Configurations.BlastRadius.Value -- Blast radius of the explosion
local BLAST_DAMAGE = script.Parent.Parent.Configurations.Damage.Value -- Amount of damage done to players
local BLAST_FORCE = script.Parent.Parent.Configurations.BlastForce.Value -- Amount of force applied to parts

local IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} -- Rocket will fly through things named these
--Power Rear Wheels
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then for i,v in pairs(car.Wheels:GetChildren()) do if v.Name=="RL" or v.Name=="RR" or v.Name=="R" then table.insert(Drive,v) end end end
-- maps a value from one range to another, clamping to the output range. order does not matter
function CameraUtils.mapClamp(x: number, inMin: number, inMax: number, outMin: number, outMax: number): number
	return math.clamp(
		(x - inMin)*(outMax - outMin)/(inMax - inMin) + outMin,
		math.min(outMin, outMax),
		math.max(outMin, outMax)
	)
end
--[[**
	Calls `:Cleanup()` and renders the Janitor unusable.
	@returns [t:void]
**--]]
function Janitor.__index:Destroy()
	self:Cleanup()
	table.clear(self)
	setmetatable(self, nil)
end

Janitor.__call = Janitor.__index.Cleanup
--	BindableEvent_OnFailStateChanged = MasterControl:GetClickToMoveFailStateChanged()
end
--[[
	TYPES:
	Crater
	Orbit
	Path
	Rounded Path
	Closed Path
	Wall Break
	Expanding Crater
	Expanding Orbit
	
	------------------------------
	PROPERTIES:
	
	PartCount -- INTEGER NUMBER TO DICTATE THE AMOUNT OF PARTS IN AN ORBIT/CRATER ATTACK 
	Radius -- SIZE OF A CRATER/ORBIT // For expanding you must put it in list like so: {3,10}. The first value is the staring radius, and the second being the ending radius.
	Range -- RAYCAST MAX DISTANCE DOWNWARDS
	Size -- VECTOR3 VALUE DICTATING PART SIZE
	AnimationSpeed -- HOW FAST THE PARTS SPAWN UPWARDS
	BlockSize -- THE SIZE OF A BLOCK IN A PATH (NOTE: RUN THIS VIA A LIST VALUE: {3,4} THE FIRST BEING THE INITIAL SIZE AND THE SECOND BEING THE FINAL SIZE)
	Width -- THE WIDTH OF A PATH (NOTE: RUN THIS VIA A LIST VALUE: {3,4} THE FIRST BEING THE INITIAL WIDTH AND THE SECOND BEING THE FINAL WIDTH)
	Distance -- THIS IS A PATH TRAVELS
	stepSize -- DISTANCE BETWEEN THE PATH PARTS
	HoldTime -- TIME IN SECONDS BEFORE AN EFFECT DISAPPEARS
	delayTime -- TIME BETWEEN NEXT PART IN PATH (NOTE: PUTTING THIS TO "Stepped" MAKES THE DELAY TIME RUN IN A RUNSERVICE HEARTBEAT)
	Angle -- CRATER ANGLE
	Height -- HEIGHT OF AN EXPLOSION
	Collidable -- PART COLLIDABLILITY FOR WALLBREAK AND FOR EXPLOSION
	IncreaseSpeed -- THIS IS TO CHANGE THE ANIMATION SPEED FOR EXPANDING ORBITS OR EXPANDING CRATERS
	
	
	SET UP:
	[[		NEW		]]
--[[
	local craterEffects = require(craterModule)

	craterEffects.new(Type, AnchorPoint, Properties)

	-- Lets try using orbit with a 5 radius and 8 part count at a tween speed of 0.2
	
	
	craterEffects.new(
	'Orbit', -- This is the type of effect you want
	Character.HumanoidRootPart.CFrame, -- This is the start/center point (depending on the effect)
	{
	['AnimationSpeed'] = 0.2;
	['PartCount'] = 8;
	['Radius'] = 5
	}
	)
]]
--[[		PRESETS		]]
--[[
	local craterEffects = require(craterModule)

	craterEffects.presets(Presets, AnchorPoint, Extras)

	-- This allows you to save presets using the instructions within the 'Presets' script.
	
	
	craterEffects.presets(
	'OFA', -- This is the type of effect you want
	Character.HumanoidRootPart.CFrame, -- This is the start/center point (depending on the effect)
	{
	['AnimationSpeed'] = 0.2;
	['PartCount'] = 8;
	['Radius'] = 5
	}
	)
]]


local Presets = require(script:WaitForChild('Presets'))
local Functions = require(script:WaitForChild('Styles'))

callback = function(called, ErrorType)
	return warn('CRATER MODULE ERROR:\n					'..called..' does not exist as a '..ErrorType)
end
return {
	['new'] = function(Type : string, AnchorPoint : CFrame, ... : dict)
		if Functions[Type] then
			Functions[Type](AnchorPoint, ...)
		else callback(Type, 'type')
		end
		
	end,
	['presets'] = function(Preset : string, AnchorPoint : CFrame, ... : dict)
		if Presets[Presets] then
			local Type, Settings = Presets[Preset](...)
			Functions[Type](AnchorPoint, Settings)
		else callback(Preset, 'preset')
		end
	end,
	
}
--[=[
	@within TableUtil
	@function Truncate
	@param tbl table
	@param length number
	@return table

	Returns a new table truncated to the length of `length`.

	```lua
	local t = {10, 20, 30, 40, 50, 60, 70, 80}
	local tTruncated = TableUtil.Truncate(t, 3)
	print(tTruncated) --> {10, 20, 30}
	```
]=]
local function Truncate(tbl: Table, len: number): Table
	return table.move(tbl, 1, len, 1, table.create(len))
end
-- 5.) Put this in MiscWeld under Weld stuff here:

MakeWeld(car.Misc.Speedo.N,car.DriveSeat,"Motor").Name="N"
ModelWeld(misc.Speedo.Parts,misc.Speedo.N)
-- Initialize the tool
local TextureTool = {
	Name = 'Texture Tool';
	Color = BrickColor.new 'Bright violet';

	-- Default options
	Type = 'Decal';
	Face = Enum.NormalId.Front;

	-- Signals
	OnFaceChanged = Signal.new();
}

TextureTool.ManualText = [[<font face="GothamBlack" size="16">Texture Tool  🛠</font>
Lets you add decals and textures to parts.<font size="6"><br /></font>

<b>TIP: </b>Click on any part's surface to quickly change a decal/texture's side.<font size="6"><br /></font>

<b>TIP: </b>You can paste the link to any decal and it'll automatically get the right image ID.<font size="6"><br /></font>

<b>NOTE: </b>If HttpService isn't enabled, you must manually type an image's ID.]]
-- / UIs / --
local MainGui = script.Parent.Parent

local StatsHolder = MainGui.StatsHolder

local Health = StatsHolder.Health
local HealthDisplayBar = Health.DisplayBar

local Oxygen = StatsHolder.Oxygen
local OxygenDisplayBar = Oxygen.DisplayBar
--s.Pitch = 0.7
while s.Pitch<1.21 do
s.Pitch=s.Pitch+0.010
s:Play()
if s.Pitch>1.21 then
	s.Pitch=1.21
end
wait(0.001)
end
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------

function reverseGlobalMarket(player)
	
	local save = _L.Saving.Get(player)
	if not save then
		return
	end	
	
	if save.HasReversedGlobalMarket then
		return
	end
	
	wait(2)
	
	-- add all auction postings back into the player's inventory
	local liveAuctions = _L.Functions.CloneTable(save.Auctions)
	save.Auctions = {}
	for _, auctionListing in ipairs(liveAuctions) do
		local quantity  = auctionListing.quantity
		local itemID    = auctionListing.itemID
		local className = auctionListing.className
		local payload = {
			quantity = quantity,
			itemID = itemID,
			className = className
		}
		table.insert(save.ReversedAuctionPostings, payload)
		_L.Inventory.AddItem(player, className, itemID, quantity)
	end
	
	save.HasReversedGlobalMarket = true
	
end
-- Decompiled with the Synapse X Luau decompiler.

local u1 = math.pi * 2;
return function(p1)
	if p1 < 0 then
		p1 = p1 + (math.floor(-p1 / u1) + 1) * u1;
	end;
	return p1 % u1;
end;
--[=[
	Destroy the Shake instance. Will call `Stop()`.
]=]
function Shake:Destroy()
	self:Stop()
end


return Shake
-- ScreenSpace -> WorldSpace. Taking a screen width, and a depth to put an object 
-- at, and returning a size of how big that object has to be to appear that size
-- at that depth.
function ScreenSpace.ScreenToWorldByWidthDepth(x, y, screenWidth, depth)
	local aspectRatio = ScreenSpace.AspectRatio()
	local hfactor = math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)
	local wfactor = aspectRatio*hfactor
	local sx, sy = ScreenSpace.ViewSizeX(), ScreenSpace.ViewSizeY()
	--
	local worldWidth = (screenWidth/sx) * 2 * -wfactor * depth
	--
	local xf, yf = x/sx*2 - 1, y/sy*2 - 1
	local xpos = xf * -wfactor * depth
	local ypos = yf *  hfactor * depth
	--
	return Vector3.new(xpos, ypos, depth), worldWidth
end
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------

local function Create(ty,data)
	local obj
	if type(ty) == 'string' then
		obj = Instance_new(ty)
	else
		obj = ty
	end
	for k, v in pairs(data) do
		if type(k) == 'number' then
			v.Parent = obj
		else
			obj[k] = v
		end
	end
	return obj
end

local barActive = false
local activeOptions = {}

function createDDown(dBut, callback,...)
	if barActive then
		for i,v in pairs(activeOptions) do
			v:Destroy()
		end
		activeOptions = {}
		barActive = false
		return
	else
		barActive = true
	end
	local slots = table.pack(...)
	local base = dBut
	for i,v in ipairs(slots) do
		local newOption = base:Clone()
		newOption.ZIndex = 5
		newOption.Name = "Option "..tostring(i)
		newOption.Parent = base.Parent.Parent.Parent
		newOption.BackgroundTransparency = 0
		newOption.BackgroundColor3 = Color3.fromRGB(24, 24, 29)
		newOption.BorderSizePixel = 0
		newOption.ZIndex = 2
		table.insert(activeOptions,newOption)
		newOption.Position = UDim2_new(-0.4, dBut.Position.X.Offset, dBut.Position.Y.Scale, dBut.Position.Y.Offset + (#activeOptions * dBut.Size.Y.Offset))
		newOption.Text = slots[i]
		newOption.MouseButton1Down:connect(function()
			dBut.Text = slots[i]
			callback(slots[i])
			for i,v in pairs(activeOptions) do
				v:Destroy()
			end
			activeOptions = {}
			barActive = false
		end)
	end
end
-- ClientRemoteSignal
-- Stephen Leitnick
-- December 20, 2021


local Signal = require(script.Parent.Parent.Parent.Signal)
local Types = require(script.Parent.Parent.Types)
--[[
	Updates the height of a ScrollingFrame canvas to match the
	AbsoluteContentSize of a UIListLayout whenever it changes.

	This shouldn't be necessary if AutomaticCanvasSize worked
	properly, but it doesn't seem to in all cases, especially
	if a UIAspectRatio exists in a list item in the scrolling frame.
--]]

local function autoSizeCanvasHeight(scrollingFrame: ScrollingFrame)
	local listLayout = scrollingFrame:FindFirstChildOfClass("UIListLayout")
	assert(
		listLayout,
		string.format("Unable to find a UIListLayout inside scrollingFrame %s", scrollingFrame:GetFullName())
	)

	local connection = listLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
		scrollingFrame.CanvasSize = UDim2.new(1, 0, 0, listLayout.AbsoluteContentSize.Y)
	end)

	scrollingFrame.CanvasSize = UDim2.new(1, 0, 0, listLayout.AbsoluteContentSize.Y)

	return connection
end

return autoSizeCanvasHeight
--[[Engine]]
	--Torque Curve
	Tune.Horsepower		= 158		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6500		--		Use sliders to manipulate values
	Tune.Redline		= 7000.01		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 6500
	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)