Roblox/luau_corpus huggingface dataset:
-- создаём заготовки/клоны исходных скриптов
local scr1 = script.StageAdd:Clone()
local scr2 = script.onModelTouched:Clone()

local elements = script.Parent:GetChildren() -- взять дочек

for a,b in pairs(elements) do
	if b.ClassName == "Model" then -- проверить дочек на модель
		-- клонируем скрипты на свои места
		local s1=scr1:Clone()
		s1.Parent = b.Finish
		local s4=scr1:Clone()
		s4.Parent = b.SpawnLocation

		local s2=scr2:Clone()
		s2.Parent = b.Finish
		local s3=scr2:Clone()
		s3.Parent = b.SpawnLocation

		-- включаем скрипты
		s1.Disabled = false
		s2.Disabled = false
		s3.Disabled = false
		s4.Disabled = false
	end
end


local tmp = script.Parent:GetChildren()
local models = {}	-- пустой массив моделей
----- Loaded Modules -----

local MadworkMaid = require(Madwork.GetShared("Madwork", "MadworkMaid"))
--[=[
	A BaseObject basically just adds the :Destroy() interface, and a _maid, along with an optional object it references.
	@class BaseObject
]=]

local require = require(script.Parent.loader).load(script)

local Maid = require("Maid")

local BaseObject = {}
BaseObject.ClassName = "BaseObject"
BaseObject.__index = BaseObject
-- Join control
players.PlayerAdded:Connect(require(playerFunctions).PlayerAdded)
players.PlayerRemoving:Connect(require(playerFunctions).Save)
--[=[
	Returns the first alive Brio in a list

	@param brios {Brio<T>}
	@return Brio<T>
]=]
function BrioUtils.firstAlive(brios)
	for _, brio in pairs(brios) do
		if not brio:IsDead() then
			return brio
		end
	end
	return nil
end
--[[
	    ___      _______                _       _______
	   / _ |____/ ___/ /  ___ ____ ___ (_)__   /__  __/
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<     / /
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/	/_/   
						SecondLogic @ Inspare
						Avxnturador @ Novena
]]
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 BOVact = 0
local BOVact2 = 0

local BOV_Loudness = 0	--volume of the BOV (not exact volume so you kinda have to experiment with it)
local BOV_Pitch = 0.2	--max pitch of the BOV (not exact so might have to mess with it)
local TurboLoudness = 0 --volume of the Turbo (not exact volume so you kinda have to experiment with it also)

script:WaitForChild("Whistle")
script:WaitForChild("BOV")

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

car.DriveSeat.ChildRemoved:connect(function(child)
	if child.Name=="SeatWeld" then
		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
	end
end)

handler:FireServer("newSound","Whistle",car.DriveSeat,script.Whistle.SoundId,0,script.Whistle.Volume,true)
handler:FireServer("newSound","BOV",car.DriveSeat,script.BOV.SoundId,0,script.BOV.Volume,true)
handler:FireServer("playSound","Whistle")
car.DriveSeat:WaitForChild("Whistle")
car.DriveSeat:WaitForChild("BOV")
local ticc = tick()
local _TCount = 0
if _Tune.Aspiration == "Single" then _TCount = 1 elseif _Tune.Aspiration == "Double" then _TCount = 2 end

while wait() do
	local psi = (((script.Parent.Values.Boost.Value)/(_Tune.Boost*_TCount))*2)
	
	BOVact = math.floor(psi*20)
	WP = (psi)
	WV = (psi/4)*TurboLoudness
	
	BP = (1-(-psi/20))*BOV_Pitch
	BV = (((-0.5+((psi/2)*BOV_Loudness)))*(1 - script.Parent.Values.Throttle.Value))

	if BOVact < BOVact2 then if car.DriveSeat.BOV.IsPaused then if FE then handler:FireServer("playSound","BOV") else car.DriveSeat.BOV:Play() end end end
	if BOVact >= BOVact2 then if FE then handler:FireServer("stopSound","BOV") else car.DriveSeat.BOV:Stop() end end
	
	if FE then
		handler:FireServer("updateSound","Whistle",script.Whistle.SoundId,WP,WV)
		handler:FireServer("updateSound","BOV",script.BOV.SoundId,BP,BV)
	else
		car.DriveSeat.Whistle.Pitch = WP
		car.DriveSeat.Whistle.Volume = WV
		car.DriveSeat.BOV.Pitch = BP
		car.DriveSeat.BOV.Volume = BV
	end
	if (tick()-ticc) >= 0.1 then
		BOVact2 = math.floor(psi*20)
		ticc = tick()
	end
end
-------------------------
function onClicked()
Car.BodyVelocity.velocity = Vector3.new(0, 5, 0)
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
--[=[
	@param predicate (value: any) -> boolean
	@return Option
	Returns `self` if this option has a value and the predicate returns `true.
	Otherwise, returns None.
]=]
function Option:Filter(predicate)
	if self:IsNone() or not predicate(self._v) then
		return Option.None
	else
		return self
	end
end
--//EVENTS\\--
game:GetService("RunService").RenderStepped:Connect(function()--This part gets the renderization service
	--//VISIBLE\\--
	for i, part in pairs(character:GetChildren()) do
		if string.match(part.Name, "Arm") or string.match(part.Name, "Hand") or string.match(part.Name, "Leg") or string.match(part.Name, "Torso") or string.match(part.Name, "Foot") then--This part of the script will detect the names of the items listed then it's going to be used later on
			part.LocalTransparencyModifier = 0--disables the ability of your bodyparts to be transparent
		end
	end
end)
-- find player's head pos

	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)

	local head = vCharacter:findFirstChild("Head")
	if head == nil then return end


	local launch = head.Position + 10 * v

	local missile = Pellet:clone()
    
	missile.Position = launch
	missile.Velocity = v * 80


	local force = Instance.new("BodyForce")
	force.force = Vector3.new(0,40,0)
	force.Parent = missile

	if (turbo) then
		missile.Velocity = v * 100
		force.force = Vector3.new(0,45,0)
	end

	missile.SnowballScript.Disabled = false

	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = vCharacter
	creator_tag.Name = "creator"
	creator_tag.Parent = missile
	
	missile.Parent = game.Workspace

end



function rndDir()
	return Vector3.new(math.random() - .5, math.random() - .5, math.random() - .5).unit
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
if loaded==true then
	loaded=false

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

	fire(lookAt, isTurbo(character) )

	if (isTurbo(character) == true) then
		wait(.1)
		Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 0.6
		Tool.Parent.Torso["Right Shoulder"].DesiredAngle = -3.6
		wait(.1)
		fire(lookAt * .9 + rndDir() * .1, isTurbo(character) )
		Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 0.6
		Tool.Parent.Torso["Right Shoulder"].DesiredAngle = -3.6
		wait(.1)
		fire(lookAt * .8 + rndDir() * .2, isTurbo(character) )
		wait(.1)
	else
		wait(.3)
	end

	Tool.Enabled = true
elseif loaded==false then
Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 0.6
Tool.Parent.Torso["Right Shoulder"].DesiredAngle = -3.6
	wait(.1)
Tool.Handle.Transparency=0
wait(.1)
	loaded=true
	end
	Tool.Enabled = true
end

script.Parent.Activated:connect(onActivated)
-- Left Arms
character.Constraint.ConstraintLeftUpperArm.Attachment0 = LUA
character.Constraint.ConstraintLeftUpperArm.Attachment1 = LUARig
character.Constraint.ConstraintLeftLowerArm.Attachment0 = LLA
character.Constraint.ConstraintLeftLowerArm.Attachment1 = LLARig
character.Constraint.ConstraintLeftHand.Attachment0 = LH
character.Constraint.ConstraintLeftHand.Attachment1 = LHRig
-- Legacy implementation renamed
function CameraUtils.GetAngleBetweenXZVectors(v1: Vector3, v2: Vector3): number
	return math.atan2(v2.X*v1.Z-v2.Z*v1.X, v2.X*v1.X+v2.Z*v1.Z)
end

function CameraUtils.RotateVectorByAngleAndRound(camLook: Vector3, rotateAngle: number, roundAmount: number): number
	if camLook.Magnitude > 0 then
		camLook = camLook.Unit
		local currAngle = math.atan2(camLook.Z, camLook.X)
		local newAngle = round((math.atan2(camLook.Z, camLook.X) + rotateAngle) / roundAmount) * roundAmount
		return newAngle - currAngle
	end
	return 0
end
--// Hash: 4ff11c83b72d76d1d1d67ed38db378bb76fe93bad84f73c50a81f60a561bca442213063368847fe595aea47ea94b3b28
-- Decompiled with the Synapse X Luau decompiler.

wait(3);
if game:GetService("VRService").VREnabled then
	game:GetService("Players").LocalPlayer:Kick("VR isn't supported, sorry!");
end;
-- Mapping from movement mode and lastInputType enum values to control modules to avoid huge if elseif switching
local movementEnumToModuleMap = {
	[Enum.TouchMovementMode.DPad] = TouchDPad,
	[Enum.DevTouchMovementMode.DPad] = TouchDPad,
	[Enum.TouchMovementMode.Thumbpad] = TouchThumbpad,
	[Enum.DevTouchMovementMode.Thumbpad] = TouchThumbpad,
	[Enum.TouchMovementMode.Thumbstick] = TouchThumbstick,
	[Enum.DevTouchMovementMode.Thumbstick] = TouchThumbstick,
	[Enum.TouchMovementMode.DynamicThumbstick] = DynamicThumbstick,
	[Enum.DevTouchMovementMode.DynamicThumbstick] = DynamicThumbstick,
	[Enum.TouchMovementMode.ClickToMove] = ClickToMove,
	[Enum.DevTouchMovementMode.ClickToMove] = ClickToMove,

	-- Current default
	[Enum.TouchMovementMode.Default] = DynamicThumbstick,

	[Enum.ComputerMovementMode.Default] = Keyboard,
	[Enum.ComputerMovementMode.KeyboardMouse] = Keyboard,
	[Enum.DevComputerMovementMode.KeyboardMouse] = Keyboard,
	[Enum.DevComputerMovementMode.Scriptable] = nil,
	[Enum.ComputerMovementMode.ClickToMove] = ClickToMove,
	[Enum.DevComputerMovementMode.ClickToMove] = ClickToMove,
}
--- Cleans up all tasks.
-- @alias Destroy
function Maid:doCleaning()
	local tasks = self._tasks

	-- Disconnect all events first as we know this is safe
	for index, task in pairs(tasks) do
		if typeof(task) == "RBXScriptConnection" then
			tasks[index] = nil
			task:Disconnect()
		end
	end

	-- Clear out tasks table completely, even if clean up tasks add more tasks to the maid
	local index, task = next(tasks)
	while task ~= nil do
		tasks[index] = nil
		if type(task) == "function" then
			task()
		elseif typeof(task) == "RBXScriptConnection" then
			task:Disconnect()
		elseif task.Destroy then
			task:Destroy()
		elseif task.destroy then
			task:destroy()
		end
		index, task = next(tasks)
	end
end
-- Code --
setUp()

getProximityPrompts()
for index, prompt in ipairs(proximityPrompts) do
	local connection = prompt.Triggered:Connect(onTriggered)
	table.insert(connections, connection)
end
--[[
class Maid

Description:
	Manages the cleaning of events and other things. Needed to encapsulate state
	and make deconstructors easy
 
API:
	Maid.new()                        Returns a new Maid object.
 
	Maid[key] = (function)            Adds a task to perform when cleaning up.
	Maid[key] = (event connection)    Manages an event connection. Anything that isn"t a function is assumed to be this.
	Maid[key] = (Maid)                Maids can act as an event connection, allowing a Maid to have other maids to clean up.
	Maid[key] = (Object)              Maids can cleanup objects with a `Destroy` method
	Maid[key] = nil                   Removes a named task. If the task is an event, it is disconnected. If it is an object, it is destroyed.
 
	Maid:GiveTask(task)               Same as above, but uses an incremented number as a key.
	Maid:DoCleaning()                 Disconnects all managed events and performs all clean-up tasks.
	Maid:IsCleaning()				  Returns true is in cleaning process.
	Maid:Destroy()                    Alias for DoCleaning()
]]

local Maid = {}
--edit the below function to execute code when this response is chosen OR this prompt is shown
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder)
	game.ReplicatedStorage.Events.Character.BuyWeapon:Fire(player,dialogueFolder.Parent.Name)
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.KeroppiKnife-- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage

hitPart.Touched:Connect(function(hit)
	if debounce == true then
		if hit.Parent:FindFirstChild("Humanoid") then
			local plr = game.Players:FindFirstChild(hit.Parent.Name)
			if plr then
				debounce = false
				hitPart.BrickColor = BrickColor.new("Bright red")
				tool:Clone().Parent = plr.Backpack
				wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again
				debounce = true
				hitPart.BrickColor = BrickColor.new("Bright green")
			end
		end
	end
end)
--[[[Default Controls]]
	--Peripheral Deadzones
	Tune.Peripherals = {
		MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
		MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)
		
		ControlLDZone			= 5			,	-- Controller steering L-deadzone (0 - 100%)
		ControlRDZone			= 5			,	-- Controller steering R-deadzone (0 - 100%)
	}
	
	--Control Mapping
	Tune.Controls = {
		
	--Keyboard Controls
		--Mode Toggles
		ToggleTCS				= Enum.KeyCode.T				    ,
		ToggleABS				= nil					            ,
		ToggleTransMode			= Enum.KeyCode.M		 			,
		ToggleMouseDrive		= nil					            ,
		
		--Primary Controls
		Throttle				= Enum.KeyCode.Up					,
		Brake					= Enum.KeyCode.Down					,
		SteerLeft				= Enum.KeyCode.Left					,
		SteerRight				= Enum.KeyCode.Right				,
		
		--Secondary Controls
		Throttle2				= Enum.KeyCode.W					,
		Brake2					= Enum.KeyCode.S					,
		SteerLeft2				= Enum.KeyCode.A					,
		SteerRight2				= Enum.KeyCode.D					,
		
		--Manual Transmission
		ShiftUp					= Enum.KeyCode.E					,
		ShiftDown				= Enum.KeyCode.Q					,
		Clutch					= Enum.KeyCode.P		        	,
		
		--Handbrake
		PBrake					= Enum.KeyCode.LeftShift			,
		
	--Mouse Controls
		MouseThrottle			= Enum.UserInputType.MouseButton1	,
		MouseBrake				= Enum.UserInputType.MouseButton2	,
		MouseClutch				= Enum.KeyCode.W					,
		MouseShiftUp			= Enum.KeyCode.E					,
		MouseShiftDown			= Enum.KeyCode.Q					,
		MousePBrake				= Enum.KeyCode.LeftShift			,
		
	--Controller Mapping
		ContlrThrottle			= Enum.KeyCode.ButtonR2				,
		ContlrBrake				= Enum.KeyCode.ButtonL2				,
		ContlrSteer				= Enum.KeyCode.Thumbstick1			,
		ContlrShiftUp			= Enum.KeyCode.ButtonY				,
		ContlrShiftDown			= Enum.KeyCode.ButtonX				,
		ContlrClutch			= Enum.KeyCode.ButtonR1				,
		ContlrPBrake			= Enum.KeyCode.ButtonL1				,
		ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
		ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
		ContlrToggleABS			= Enum.KeyCode.DPadRight			,
	}
-- Gradually regenerates the Humanoid's Health over time.

local REGEN_RATE = 1/300 -- Regenerate this fraction of MaxHealth per second.
local REGEN_STEP = 5 -- Wait this long between each regeneration step.
--[=[
	@private
	@class Utils
]=]

local Utils = {}

local function errorOnIndex(_, index)
	error(("Bad index %q"):format(tostring(index)), 2)
end

local READ_ONLY_METATABLE = {
	__index = errorOnIndex;
	__newindex = errorOnIndex;
}

function Utils.readonly(_table)
	return setmetatable(_table, READ_ONLY_METATABLE)
end

function Utils.count(_table)
	local count = 0
	for _, _ in pairs(_table) do
		count = count + 1
	end
	return count
end

function Utils.getOrCreateValue(parent, instanceType, name, defaultValue)
	assert(typeof(parent) == "Instance", "Bad argument 'parent'")
	assert(type(instanceType) == "string", "Bad argument 'instanceType'")
	assert(type(name) == "string", "Bad argument 'name'")

	local foundChild = parent:FindFirstChild(name)
	if foundChild then
		if not foundChild:IsA(instanceType) then
			warn(("[Utils.getOrCreateValue] - Value of type %q of name %q is of type %q in %s instead")
				:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
		end

		return foundChild
	else
		local newChild = Instance.new(instanceType)
		newChild.Name = name
		newChild.Value = defaultValue
		newChild.Parent = parent

		return newChild
	end
end

function Utils.getValue(parent, instanceType, name, default)
	assert(typeof(parent) == "Instance", "Bad argument 'parent'")
	assert(type(instanceType) == "string", "Bad argument 'instanceType'")
	assert(type(name) == "string", "Bad argument 'name'")

	local foundChild = parent:FindFirstChild(name)
	if foundChild then
		if foundChild:IsA(instanceType) then
			return foundChild.Value
		else
			warn(("[Utils.getValue] - Value of type %q of name %q is of type %q in %s instead")
				:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
			return nil
		end
	else
		return default
	end
end

function Utils.setValue(parent, instanceType, name, value)
	assert(typeof(parent) == "Instance", "Bad argument 'parent'")
	assert(type(instanceType) == "string", "Bad argument 'instanceType'")
	assert(type(name) == "string", "Bad argument 'name'")

	local foundChild = parent:FindFirstChild(name)
	if foundChild then
		if not foundChild:IsA(instanceType) then
			warn(("[Utils.setValue] - Value of type %q of name %q is of type %q in %s instead")
				:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
		end

		foundChild.Value = value
	else
		local newChild = Instance.new(instanceType)
		newChild.Name = name
		newChild.Value = value
		newChild.Parent = parent
	end
end


function Utils.getOrCreateFolder(parent, folderName)
	local found = parent:FindFirstChild(folderName)
	if found then
		return found
	else
		local folder = Instance.new("Folder")
		folder.Name = folderName
		folder.Parent = parent
		return folder
	end
end


return Utils
-- The Symbol used to tag the ReactElement-like types. If there is no native Symbol
-- nor polyfill, then a plain number is used for performance.
exports.REACT_ELEMENT_TYPE = 0xeac7
exports.REACT_PORTAL_TYPE = 0xeaca
exports.REACT_FRAGMENT_TYPE = 0xeacb
exports.REACT_STRICT_MODE_TYPE = 0xeacc
exports.REACT_PROFILER_TYPE = 0xead2
exports.REACT_PROVIDER_TYPE = 0xeacd
exports.REACT_CONTEXT_TYPE = 0xeace
exports.REACT_FORWARD_REF_TYPE = 0xead0
exports.REACT_SUSPENSE_TYPE = 0xead1
exports.REACT_SUSPENSE_LIST_TYPE = 0xead8
exports.REACT_MEMO_TYPE = 0xead3
exports.REACT_LAZY_TYPE = 0xead4
exports.REACT_BLOCK_TYPE = 0xead9
exports.REACT_SERVER_BLOCK_TYPE = 0xeada
exports.REACT_FUNDAMENTAL_TYPE = 0xead5
exports.REACT_SCOPE_TYPE = 0xead7
exports.REACT_OPAQUE_ID_TYPE = 0xeae0
exports.REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1
exports.REACT_OFFSCREEN_TYPE = 0xeae2
exports.REACT_LEGACY_HIDDEN_TYPE = 0xeae3
exports.REACT_BINDING_TYPE = 0xeae4
--equip tools
if pickUpTools then
	for _,v in pairs(GetSpecificInstances(AI,"Part")) do
		v.Touched:connect(function(part)
			if part.Name=="Handle" and part.Parent:IsA("Tool") then
				if (#GetSpecificInstances(part.Parent.Parent,"Humanoid")==0 or part.Parent.Parent==workspace) and #GetSpecificInstances(AI,"Tool")==0 then
					part.Parent.Parent=AI;
			end end
		end
		);
	end
end
--[=[
	@within TableUtil
	@function Map
	@param tbl table
	@param predicate (value: any, key: any, tbl: table) -> newValue: any
	@return table

	Performs a map operation against the given table, which can be used to
	map new values based on the old values at given keys/indices.

	For example:

	```lua
	local t = {A = 10, B = 20, C = 30}
	local t2 = TableUtil.Map(t, function(value)
		return value * 2
	end)
	print(t2) --> {A = 20, B = 40, C = 60}
	```
]=]
local function Map<T, M>(t: { T }, f: (T, number, { T }) -> M): { M }
	assert(type(t) == "table", "First argument must be a table")
	assert(type(f) == "function", "Second argument must be a function")
	local newT = table.create(#t)
	
	for k, v in t do
		newT[k] = f(v, k, t)
	end
	
	return newT
end
-- LIGHT SETTINGS
--[[
	LIGHT TYPES:
		- Halogen
		- LED
]]--

local Low_Beam_Brightness = 1.25

local High_Beam_Brightness = 1.15

local Fog_Light_Brightness = 0.7

local Rear_Light_Brightness = 1.5

local Brake_Light_Brightness = 1.5

local Reverse_Light_Brightness = 1

local Headlight_Type = "Halogen"

local Indicator_Type = "Halogen"

local Fog_Light_Type = "Halogen"

local Plate_Light_Type = "Halogen"

local Rear_Light_Type = "Halogen"

local Reverse_Light_Type = "Halogen"

local Running_Light_Location = "Custom DRL" -- Where your running lights will luminate. ("Low Beam / Indicators" and "Low Beam".  LED DRLS or any DRL in a differnet position go in the Running model, change the string to "Custom DRL")

local CustomDRL_Type = "LED"

local Fade_Time = 0.35 -- How long it takes for the light to fully turn on. (works only with Halogen, default is 0.35 seconds)

local Indicator_Flash_Rate = 0.3 -- Rate of change between each indicator state. (in seconds)

local Popup_Hinge_Angle = -0.75 -- Changes the angle of your popup headlights. (only use if your car has popups)
--[[Steering]]
Tune.SteerInner		= 70		-- Inner wheel steering angle (in degrees)
Tune.SteerOuter		= 70	-- Outer wheel steering angle (in degrees)
Tune.SteerSpeed		= .5		-- Steering increment per tick (in degrees)
Tune.ReturnSpeed	= .5		-- Steering increment per tick (in degrees)
Tune.SteerDecay		= 320		-- Speed of gradient cutoff (in SPS)
Tune.MinSteer		= 10		-- Minimum steering at max steer decay (in percent)
Tune.MSteerExp		= 1			-- Mouse steering exponential degree
-- Remove this after you've become acquainted with EventSequencer
if RunService:IsStudio() then
	-- Best practice is to configure this ahead of time and don't use this
	-- This is for demo purposes so that it works out of the box
	Players.PlayerAdded:Connect(function(player)
		table.insert(playerIDs, player.UserId)
		EventSequencer.setSeekingPermissions({
			-- Replace this with non-production PlaceIds 
			placeIDs = {game.PlaceId},
			groups = {
				-- Replace this if you want certain groups allowed
				-- The following is an example of one group permissions
				{GroupID = 7384468, MinimumRankID = 5}
			},
			-- Replace this with known player IDs in a table
			playerIDs = playerIDs
		})
	end)
	
	local playersService = game:GetService("Players")
	local playerAdded = function(player)
		if not table.find(playerIDs, player.UserId) then
			table.insert(playerIDs, player.UserId)
		end
	end
	playersService.PlayerAdded:connect(playerAdded)
	for _, player in ipairs(playersService:GetPlayers()) do
		playerAdded(player)
	end
	
	EventSequencer.setSeekingPermissions({
		-- Replace this with non production PlaceIds 
		placeIDs = {game.PlaceId},
		groups = {
			-- Replace this if you want certain groups allowed
			-- The following is an example of one group permission
			{GroupID = 7384468, MinimumRankID = 5}
		},
		-- Replace this with known player IDs in a table
		playerIDs = playerIDs
	})
end
-- Implements Javascript's `Array.prototype.filter` as defined below
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
return function<T, U>(t: Array<T>, callback: callbackFn<T> | callbackFnWithThisArg<T, U>, thisArg: U?): Array<T>
	if _G.__DEV__ then
		if typeof(t) ~= "table" then
			error(string.format("Array.filter called on %s", typeof(t)))
		end
		if typeof(callback) ~= "function" then
			error("callback is not a function")
		end
	end

	local len = #t
	local res = {}
	local index = 1

	if thisArg == nil then
		for i = 1, len do
			local kValue = t[i]
			if kValue ~= nil then
				if (callback :: callbackFn<T>)(kValue, i, t) then
					res[index] = kValue
					index += 1
				end
			end
		end
	else
		for i = 1, len do
			local kValue = t[i]
			if kValue ~= nil then
				if (callback :: callbackFnWithThisArg<T, U>)(thisArg, kValue, i, t) then
					res[index] = kValue
					index += 1
				end
			end
		end
	end

	return res
end