Pinkstack/roblox-luau-corpus-text huggingface dataset:
--F.updateSound = function(Sound, Pitch, Volume)
--	if Sound then
--		if Pitch then
--			Sound.Pitch = Pitch
--		end
--		if Volume then
--			Sound.Volume = Volume
--		end
--	end
--end



F.updateWindows = function(Window, Toggle)
	if script.Parent.Parent.Windows:findFirstChild(Window) then
		script.Parent.Parent.Windows:findFirstChild(Window).Value = Toggle
	end	
end

F.volumedown = function(VolDown)
	carSeat.Parent.Body.MP.Sound.Volume = carSeat.Parent.Body.MP.Sound.Volume - 1
end

F.volumeup = function(VolUp)
	carSeat.Parent.Body.MP.Sound.Volume = carSeat.Parent.Body.MP.Sound.Volume + 1
end

F.fm = function(ok)
	carSeat.Parent.Body.MP.Sound:Stop()
	carSeat.Stations.mood.Value = ok
end

F.updateSong = function(id)
	carSeat.Stations.mood.Value = 5
	carSeat.Parent.Body.MP.Sound:Stop()
	wait()
	carSeat.Parent.Body.MP.Sound.SoundId = "rbxassetid://"..id
	wait()
	carSeat.Parent.Body.MP.Sound:Play()
end

F.pauseSong = function()
	carSeat.Stations.mood.Value = 5
	carSeat.Parent.Body.MP.Sound:Stop()
end

F.updateVolume = function(Vol)
	carSeat.Parent.Body.MP.Sound.Volume = carSeat.Parent.Body.MP.Sound.Volume + Vol/5
end

F.updateValue = function(Val, Value)
	if Val then
		Val.Value = Value
	end
end

F.Eco = function()
	carSeat.Mode.Value = "Eco"
	carSeat.Parent.Wheels.FL.Spring.FreeLength = 2.2
	carSeat.Parent.Wheels.FR.Spring.FreeLength = 2.2
	carSeat.Parent.Wheels.RL.Spring.FreeLength = 2.2
	carSeat.Parent.Wheels.RR.Spring.FreeLength = 2.2
	carSeat.EcoIdle.Value = 0
end

F.Comfort = function()
	carSeat.Mode.Value = "Comfort"
	carSeat.Parent.Wheels.FL.Spring.FreeLength = 2.2
	carSeat.Parent.Wheels.FR.Spring.FreeLength = 2.2
	carSeat.Parent.Wheels.RL.Spring.FreeLength = 2.2
	carSeat.Parent.Wheels.RR.Spring.FreeLength = 2.2
	carSeat.EcoIdle.Value = 1
end

F.Sport = function()
	carSeat.Mode.Value = "Sport"
	carSeat.Parent.Wheels.FL.Spring.FreeLength = 2.1
	carSeat.Parent.Wheels.FR.Spring.FreeLength = 2.1
	carSeat.Parent.Wheels.RL.Spring.FreeLength = 2.1
	carSeat.Parent.Wheels.RR.Spring.FreeLength = 2.1
	carSeat.EcoIdle.Value = 1
end

F.MirrorsFOLD = function()
car.Misc.FL.Mirror.SS.Motor.DesiredAngle = 0.9 
	   car.Misc.FR.Mirror.SS.Motor.DesiredAngle = 0.9	
end

F.MirrorsUNFOLD = function()
car.Misc.FL.Mirror.SS.Motor.DesiredAngle = 0 
	  car.Misc.FR.Mirror.SS.Motor.DesiredAngle = 0
	end

script.Parent.OnServerEvent:connect(function(Player, Func, ...)
	if F[Func] then
		F[Func](...)
	end
end)
-- (Hat Giver Script - Loaded.)



debounce = true

function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Hat")
		p = Instance.new("Part")
		h.Name = "Nightvision"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = 0
		p.Size = Vector3.new(1,1,2) 
		p.BottomSurface = 0 
		p.TopSurface = 0 
		p.Locked = true 
		script.Parent.Mesh:clone().Parent = p
		h.Parent = hit.Parent
		h.AttachmentForward = Vector3.new(-0, -0, -1)
		h.AttachmentPos = Vector3.new(0, 0.23, 0.35)
		h.AttachmentRight = Vector3.new(1, 0, 0)
		h.AttachmentUp = Vector3.new(0, 1, 0)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
--Camera bobbing
-- Shakes the camera when the player is walking



local runService = game:GetService("RunService")

local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")

function updateBobbleEffect()
	local currentTime = tick()
	if humanoid.MoveDirection.Magnitude > 0 then
		local bobbleX = math.cos(currentTime * 10) * .25
		local bobbleY = math.abs(math.sin(currentTime * 10)) * .25        

		local bobble = Vector3.new(bobbleX, bobbleY, 0)

		humanoid.CameraOffset = humanoid.CameraOffset:lerp(bobble, .25)
	else 
		humanoid.CameraOffset = humanoid.CameraOffset * .75
	end
end

runService.RenderStepped:Connect(updateBobbleEffect)
---------------------------
--[[
	--Main anchor point is the DriveSeat <car.DriveSeat>	
	
	Usage:
		MakeWeld(Part1,Part2,WeldType*,MotorVelocity**) *default is "Weld"  **Applies to Motor welds only
		ModelWeld(Model,MainPart)
	Example:
		MakeWeld(car.DriveSeat,misc.PassengerSeat)
		MakeWeld(car.DriveSeat,misc.SteeringWheel,"Motor",.2)
		ModelWeld(car.DriveSeat,misc.Door)
]]
--Weld stuff here


MakeWeld(car.DriveSeat,misc:WaitForChild('Aero'))

car.DriveSeat.ChildAdded:connect(function(child)
	if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(13),0,0)
	end
end)

MakeWeld(car.Misc.Wheel.W,car.DriveSeat,"Motor").Name="W"
ModelWeld(car.Misc.Wheel.Parts,car.Misc.Wheel.W)
--[=[
	Transforms the brio into an observable that emits the initial value of the brio, and then another value on death
	@param brio Brio<T> | T
	@param emitOnDeathValue U
	@return Observable<T | U>
]=]


function RxBrioUtils.toEmitOnDeathObservable(brio, emitOnDeathValue)
	if not Brio.isBrio(brio) then
		return Rx.of(brio)
	else
		return Observable.new(function(sub)
			if brio:IsDead() then
				sub:Fire(emitOnDeathValue)
				sub:Complete()
			else
				sub:Fire(brio:GetValue())
				return brio:GetDiedSignal():Connect(function()
					sub:Fire(emitOnDeathValue)
					sub:Complete()
				end)
			end
		end)
	end
end
-- вертикальный вектор


function module.lookAtY(target, eye)
    local forwardVector = (eye - target)
    local upVector = Vector3.new(0, 1, 0)
    -- You have to remember the right hand rule or google search to get this right
    local rightVector = forwardVector:Cross(upVector)
    local upVector2 = rightVector:Cross(forwardVector)
    return CFrame.fromMatrix(eye, -rightVector, upVector2) -- upVector2 - для вертикали
end

function computeDirection(vec)
	local lenSquared = vec.magnitude * vec.magnitude
	local invSqrt = 1 / math.sqrt(lenSquared)
	return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end

local Rocket = Instance.new("Part")
Rocket.Locked = true
Rocket.Size = Vector3.new(1,1,1)
Rocket.Shape = Enum.PartType.Ball
Rocket.Color = Color3.fromRGB(0,0,0)
Rocket.CanCollide=false
--[[
	Gets the Context object for the current node.
]]


function TestSession:getContext()
	assert(#self.contextStack > 0, "Tried to get context from an empty stack!")
	return self.contextStack[#self.contextStack]
end

function TestSession:getExpectationContext()
	assert(#self.expectationContextStack > 0, "Tried to get expectationContext from an empty stack!")
	return self.expectationContextStack[#self.expectationContextStack]
end
-- If using VR


if UserInputService.VREnabled and VRUseHeadsetControls.Value == true then
	VRService.UserCFrameChanged:connect(function(CFrametype,VRSpot)
		local x,y = VRSpot:toEulerAnglesXYZ()
		local Sensitivity = 1.2
		
		if CFrametype == Enum.UserCFrame.Head then
			-- Direction
			if -x*Sensitivity > -1 and -x*Sensitivity < 1 then -- Makes sure the headset isn't tilted too much
				Direction = -x*Sensitivity
			elseif -x*Sensitivity > 0 then -- Otherwise we'll go to the max speed
				Direction = 1
			elseif -x*Sensitivity < 0 then -- Otherwise we'll go to the max speed
				Direction = -1
			end
				
			-- Steering
			if -y > -1 and -y < 1 then -- Makes sure the headset isn't tilted too much
				Steer = -y
			elseif -y > 0 then -- Otherwise we'll go to the max speed
				Steer = 1
			elseif -y < 0 then -- Otherwise we'll go to the max speed
				Steer = -1
			end
		end
	end)
end
-- Create component


local Component = Cheer.CreateComponent('BTDropdown', View);

function Component.Start(Options, CurrentOption, Callback)

	-- Toggle options when clicked
	Cheer.Bind(View, Component.Toggle);

	-- Draw the component with the given options
	Component.Draw(Options, CurrentOption, Callback);

	-- Return component for chaining
	return Component;

end;

function Component.Toggle()
	-- Toggles the visibility of the dropdown options

	-- Show each option button open or closed
	local Buttons = View.Options:GetChildren();
	for _, Button in pairs(Buttons) do
		Button.Visible = not Button.Visible;
	end;

end;

function Component.SetOption(Option)
	-- Draws the current option into the dropdown

	-- Set the label
	View.CurrentOption.Text = Option:upper();

end;

function Component.Draw(Options, CurrentOption, Callback)
	-- Draws the dropdown with the given data

	-- Clear existing buttons
	View.Options:ClearAllChildren();

	-- Create a button for each option
	for Index, Option in ipairs(Options) do

		-- Create the button
		local Button = View.OptionButton:Clone();
		Button.Parent = View.Options;
		Button.OptionLabel.Text = Option:upper();
		Button.MouseButton1Click:Connect(function ()
			Callback(Option);
			Component.SetOption(Option);
			Component.Toggle();
		end);

		-- Position the button
		Button.Position = UDim2.new(
			math.ceil(Index / 9) - 1, Button.Position.X.Offset + (math.ceil(Index / 9) * -1) + 1,
			(Index % 9 == 0 and 9 or Index % 9) * Button.Size.Y.Scale, Button.Position.Y.Offset
		);

	end;

	-- Show the view
	View.Visible = true;

end;

return Component;
--[[Read line 24 of the script. Just edit the word "D4Tide" to whatever the gun name you want. The gun must be in the lighting for this to work. I'd reccomend you add a regen.]]



local debounce = false

function getPlayer(humanoid) 
local players = game.Players:children() 
for i = 1, #players do 
if players[i].Character.Humanoid == humanoid then return players[i] end 
end 
return nil 
end 

function onTouch(part) 

local human = part.Parent:findFirstChild("Humanoid") 
if (human ~= nil) and debounce == false then

debounce = true

local player = getPlayer(human) 

if (player == nil) then return end 

game.Lighting.Rifle:clone().Parent = player.Backpack

wait(5)
debounce = false
end
end


script.Parent.Touched:connect(onTouch)
-- See if I have a tool


local spawner = script.Parent
local tool = script.Parent.Pizza
local region = Region3.new(Vector3.new(spawner.Position.X - spawner.Size.X/2, spawner.Position.Y + spawner.Size.Y/2, spawner.Position.Z - spawner.Size.Z/2),
   Vector3.new(spawner.Position.X + spawner.Size.X/2, spawner.Position.Y + 4, spawner.Position.Z + spawner.Size.Z/2))
local parts = game.Workspace:FindPartsInRegion3(region)
for _, part in pairs(parts) do
	if part and part.Parent and part.Parent:IsA("Tool") then
		tool = part.Parent
		break
	end
end

local configTable = spawner.Configurations
local configs = {}
local function loadConfig(configName, defaultValue)
	if configTable:FindFirstChild(configName) then
		configs[configName] = configTable:FindFirstChild(configName).Value
	else
		configs[configName] = defaultValue
	end
end

loadConfig("SpawnCooldown", 5)

if tool then
	tool.Parent = game.ServerStorage
	
	while true do
		-- put tool on pad
		local toolCopy = tool:Clone()
		local handle = toolCopy:FindFirstChild("Handle")
		toolCopy.Parent = game.Workspace
		local toolOnPad = true
		local parentConnection
		parentConnection = toolCopy.AncestryChanged:connect(function()
			if handle then handle.Anchored = false end
			toolOnPad = false
			parentConnection:disconnect()
		end)
		if handle then
			handle.CFrame = (spawner.CFrame + Vector3.new(0,handle.Size.Z/2 + 1,0)) * CFrame.Angles(-math.pi/2,0,0)
			handle.Anchored = true
		end
		-- wait for tool to be removed
		while toolOnPad do 
			if handle then
				handle.CFrame = handle.CFrame * CFrame.Angles(0,0,math.pi/60)
			end
			wait() 
		end
		
		-- wait for cooldown
		wait(configs["SpawnCooldown"])		
	end
	
end
-- Generates a heartbeat connection for every audio visual / tween in the given schema file


function SchemaProcessor:Process()
	print("Processing")

	local success, err = pcall(function()
		self.schema:Run()
		-- this call only caches properties the first time, subsequent calls will not overwrite
		-- TODO: these are called every time seek is called, which they only need to be called 1x per scene
		self.schema:cacheInitialTweenProperties()
		self.schema:resetTweenObjects()
		self.schema.OrderedConfigs = self.schema:orderConfigs()

		self.connection = self.RunService.Heartbeat:Connect(function()
			for _, data in pairs(self.schema.OrderedConfigs) do
				local config = data.config
				local startTime = data.startTime

				if self.timePosition.Value >= startTime and config.Processed[startTime] == false then
					config.Processed[startTime] = true
					coroutine.wrap(function()
						config:Process(self, startTime)
					end)()
				end
			end
		end)

		self.Maid:add(self.connection)
		self.Maid:add(self.schema.Maid, "clean")
	end)

	if not success then
		warn("Run errored for your scene!")
		warn(err)
	end
	return success, err
end

function SchemaProcessor:EndScene()
	print("End of scene. Running OnEndScene for Schema")
	local success, err = pcall(function()
		self.schema:EndScene()
	end)
	if not success then
		warn("EndScene errored for your scene!")
		warn(err)
	end
	return success, err
end

function SchemaProcessor.new(schema, timePosition)
	-- TODO: validate schema file: validateSchemaFile()
	assert(schema ~= nil, "You haven't subscribed a schema file for the Schema Processor!")
	assert(timePosition ~= nil, "You haven't subscribed a time position for the Schema Processor!")

	local self = {
		Maid = Maid.new(),
		schema = schema,
		timePosition = timePosition,
		processingPool = {},
	}

	setmetatable(self, SchemaProcessor)

	self.Maid:add(self.schema.Maid, "clean")

	return self
end

function SchemaProcessor:CleanUp()
	self.Maid:clean()
end

return SchemaProcessor
--			game.Workspace.Points:ClearAllChildren()
--			local ps = path:GetPointCoordinates()
--			for _, point in pairs(ps) do
--				local part = Instance.new("Part", game.Workspace.Points)
--				part.CanCollide = false
--				part.Anchored = true
--				part.FormFactor = Enum.FormFactor.Custom
--				part.Size = Vector3.new(1,1,1)
--				part.Position = point
--			end			


			
			currentPointIndex = 1
			lastTargetPos = target
		end
		
		if path then
			local points = path:GetPointCoordinates()
			if currentPointIndex < #points then
				local currentPoint = points[currentPointIndex]
				local distance = (character.Torso.Position - currentPoint).magnitude
				if distance < NextPointThreshold then
					currentPointIndex = currentPointIndex + 1
				end
				
				character.Humanoid:MoveTo(points[currentPointIndex])
				if points[currentPointIndex].Y - character.Torso.Position.Y > JumpThreshold then
					character.Humanoid.Jump = true
				end
			else
				character.Humanoid:MoveTo(target)
			end
		end
	end
	
	return this
end
return PathfindingUtility
-- Helper function to throttle based on player Id:


function FlagSettings.ThrottleUserId(throttle, userId)
	assert(type(throttle) == "number")
	assert(type(userId) == "number")

	-- Determine userRollout using last two digits of user ID:
	-- (+1 to change range from 0-99 to 1-100 as 0 is off, 100 is full on):
	local userRollout = (userId % 100) + 1
	return userRollout <= throttle
end

function FlagSettings.IsShareGamePageEnabledByPlatform(platform)
	if not FFlagSettingsHubBarsRefactor then
		return false
	end

	local throttle
	if platform == Enum.Platform.Windows then
		throttle = FFlagSettingsHubInviteToGameWindows
	elseif platform == Enum.Platform.OSX then
		throttle = FFlagSettingsHubInviteToGameOSX
	elseif platform == Enum.Platform.IOS then
		throttle = FFlagSettingsHubInviteToGameIOS
	elseif platform == Enum.Platform.Android then
		throttle = FFlagSettingsHubInviteToGameAndroid
	elseif platform == Enum.Platform.UWP then
		throttle = FFlagSettingsHubInviteToGameUWP
	end

	local throttleNumber = tonumber(throttle)
	if not throttleNumber then
		return false
	end

	local userId = Players.LocalPlayer.UserId
	return FlagSettings.ThrottleUserId(throttleNumber, userId)
end

return FlagSettings
--FLASH MODE-- 
--Signal1: Flashing Yellow
--Signal2: Flashing Red


while true do
	script.Parent.Parent.SignalValues.Signal1.Value = 2
	script.Parent.Parent.SignalValues.Signal1a.Value = 2
	script.Parent.Parent.SignalValues.Signal2.Value = 0
	script.Parent.Parent.SignalValues.Signal2a.Value = 0
	script.Parent.Parent.TurnValues.TurnSignal1.Value = 2
	script.Parent.Parent.TurnValues.TurnSignal1a.Value = 2
	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(.5)
	script.Parent.Parent.SignalValues.Signal1.Value = 0
	script.Parent.Parent.SignalValues.Signal1a.Value = 0
	script.Parent.Parent.SignalValues.Signal2.Value = 3
	script.Parent.Parent.SignalValues.Signal2a.Value = 3
	script.Parent.Parent.TurnValues.TurnSignal1.Value = 0
	script.Parent.Parent.TurnValues.TurnSignal1a.Value = 0
	script.Parent.Parent.TurnValues.TurnSignal2.Value = 3
	script.Parent.Parent.TurnValues.TurnSignal2a.Value = 3
	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(.5)
end
--[[ REQUIRED FOR RTRA RP SESSIONS!!! not having this script will cause your car to phase through the ground :^)
Drop in the main model where caradmin and anticollide is
obviously don't go fiddling with any of the script
--]]



script.Parent:WaitForChild("Wheels")
fronts = script.Parent.Wheels.FL.Size.Y
rears = script.Parent.Wheels.RR.Size.Y

function TireSetups(wheelname, wheel, which)
local tire = Instance.new("Part")
tire.Parent = script.Parent.Wheels:FindFirstChild(wheelname).Parts
tire.Name = "Rep"
tire.Shape = 0
tire.Anchored = true
tire.Size = wheel.Size - Vector3.new(0.4, 0.4, 0.4)
tire.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0.2, 0.5, 100, 1)
tire.CFrame = CFrame.new(wheel.Position)
tire.CanCollide = true
tire.Transparency = 1

end

TireSetups(script.Parent.Wheels.FL.Name, script.Parent.Wheels.FL, fronts)
TireSetups(script.Parent.Wheels.FR.Name, script.Parent.Wheels.FR, fronts)
TireSetups(script.Parent.Wheels.RL.Name, script.Parent.Wheels.RL, rears)
TireSetups(script.Parent.Wheels.RR.Name, script.Parent.Wheels.RR, rears)
-- Create the player input event handler


Players.PlayerInputBegan:Connect(function(player, input)
	-- Check if the player is pressing the fire button
	if input.KeyCode == Enum.KeyCode.E then
		-- Shoot at the nearest enemy
		local nearestEnemy = nil
		local nearestDistance = math.huge
		for _, enemy in pairs(gameState.enemies) do
			local distance = (enemy.Position - player.Character.HumanoidRootPart.Position).Magnitude
			if distance < nearestDistance then
				nearestEnemy = enemy
				nearestDistance = distance
			end
		end

		if nearestEnemy ~= nil then
			-- Shoot at the enemy
			nearestEnemy:TakeDamage(10)
		end
	end
end)
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------


	,VRecoil = {16,20}				--- Vertical Recoil
	,HRecoil = {8,12}				--- Horizontal Recoil
	,AimRecover = .65				---- Between 0 & 1
	
	,RecoilPunch = .25
	,VPunchBase = 3.75				--- Vertical Punch
	,HPunchBase = 1.5				--- Horizontal Punch
	,DPunchBase = 1 				--- Tilt Punch | useless
	
	,AimRecoilReduction = 5 		--- Recoil Reduction Factor While Aiming (Do not set to 0)
	,PunchRecover = 0.2
	,MinRecoilPower = .75
	,MaxRecoilPower = 3
	,RecoilPowerStepAmount = .25
	
	,MinSpread = 0.12				--- Min bullet spread value | Studs
	,MaxSpread = 47					--- Max bullet spread value | Studs
	,AimInaccuracyStepAmount = 1
	,WalkMultiplier = 0				--- Bullet spread based on player speed

	,SwayBase = 0.25				--- Weapon Base Sway | Studs
	,MaxSway =	2					--- Max sway value based on player stamina | Studs
--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.Cupcake -- 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)
--!strict
--[=[
	@function splice
	@within Array

	@param array {T} -- The array to splice.
	@param start? number -- The index to start splicing at (can be negative).
	@param end? number -- The index to end splicing at (can be negative).
	@param ... ...T -- The values to insert.
	@return {T} -- The spliced array.

	Splices an array.

	```lua
	local array = { 1, 2, 3, 4, 5 }

	local new = Splice(array, 3, 4, 6, 7) -- { 1, 2, 6, 7, 4, 5 }
	local new = Splice(array, -1, 0, 6, 7) -- { 1, 2, 3, 4, 6, 7 }
	local new = Splice(array, 4, -1, 6, 7) -- { 1, 2, 3, 6, 7, 5 }
	```
]=]


local function splice<T>(array: { T }, from: number?, to: number?, ...: T?): { T }
	local length = #array
	local result = {}

	from = if type(from) == "number" then from else 1
	to = if type(to) == "number" then to else length

	if from < 1 then
		from += length
	end

	if to < 1 then
		to += length
	end

	for index = 1, from - 1 do
		table.insert(result, array[index])
	end

	for _, value in ipairs({ ... }) do
		table.insert(result, value)
	end

	for index = to + 1, length do
		table.insert(result, array[index])
	end

	return result
end

return splice
-- Update engine forces base on control input


function Engine:Update()	
	local c = self.Main.CFrame
	local vel = self.Main.Velocity
	
	local bz = c.lookVector
	local by = c.upVector
	local bx = c.rightVector
	local speed = math.abs(vel:Dot(bz))
	
	local stick_pitch = self.PitchInput
	local stick_yaw = self.YawInput

	local throttle = 1
	local rev = EngineRate(throttle + minThrottle*(1 - throttle))
	
	self.speed = self.Main.Velocity.magnitude
	
	if self.BoostInput == -1 then
		return
	end
	
	MotorSound.Volume = rev^(1/3)*0.4
	MotorSound.PlaybackSpeed = rev
	pitchFx.Octave = 1/(rev < 1e-4 and 1e-4 or rev)
	
	local targetSpeed = ((self.BoostInput == 1 and self._BOOSTSPEED) or (self.BoostInput == 0 and self._SPEED) or 0)
	self.Thruster.Velocity = c.lookVector*(targetSpeed*rev)*v3(1, 0.8, 1)
	self.Steering.CFrame = cf(v3null, c.lookVector)*(EulerXYZ(0, stick_yaw*self._YAW, 0)*EulerXYZ(self._PITCH*stick_pitch, 0, stick_yaw*self._ROLL))
	self.Steering.MaxTorque = v3(25, 25*abs(by.y), 25)*(speed/targetSpeed)^2
	self.Steering.P = 3000*Clamp((speed/targetSpeed)^2/2 + 0.5, 0, 1)
	self.Thruster.MaxForce = v3(100000, math.huge, 100000)
end -- Engine:Update()
-- LOCAL


local starterGui = game:GetService("StarterGui")
local guiService = game:GetService("GuiService")
local hapticService = game:GetService("HapticService")
local runService = game:GetService("RunService")
local userInputService = game:GetService("UserInputService")
local tweenService = game:GetService("TweenService")
local players = game:GetService("Players")
local voiceChatService = game:GetService("VoiceChatService")
local localPlayer = players.LocalPlayer
local IconController = {}
local replicatedStorage = game:GetService("ReplicatedStorage")
local Signal = require(script.Parent.Signal)
local TopbarPlusGui = require(script.Parent.TopbarPlusGui)
local topbarIcons = {}
local fakeChatName = "_FakeChat"
local forceTopbarDisabled = false
local menuOpen
local topbarUpdating = false
local cameraConnection
local controllerMenuOverride
local isStudio = runService:IsStudio()
local isVoiceChatEnabled = false
local STUPID_CONTROLLER_OFFSET = 32