Prompt: --[[Engine]]

Response:
	local fFD = _Tune.FinalDrive*_Tune.FDMult
	local fFDr = fFD*30/math.pi
	local cGrav = workspace.Gravity*_Tune.InclineComp/32.2
	local wDRatio = wDia*math.pi/60
	local cfWRot = CFrame.Angles(math.pi/2,-math.pi/2,0)
	local cfYRot = CFrame.Angles(0,math.pi,0)
	local rtTwo = (2^.5)/2

	--Horsepower Curve
	local fgc_h=_Tune.Horsepower/100
	local fgc_n=_Tune.PeakRPM/1000
	local fgc_a=_Tune.PeakSharpness
	local fgc_c=_Tune.CurveMult

	function FGC(x)
		x=x/1000
		return (((-(x-fgc_n)^2)*math.min(fgc_h/(fgc_n^2),fgc_c^(fgc_n/fgc_h)))+fgc_h)*(x-((x^fgc_a)/((fgc_a*fgc_n)^(fgc_a-1))))
	end
	local PeakFGC = FGC(_Tune.PeakRPM)

	--Plot Current Horsepower
	function GetCurve(x,gear)
		local hp=math.max((FGC(x)*_Tune.Horsepower)/PeakFGC,0)
		return hp,hp*(_Tune.EqPoint/x)*_Tune.Ratios[gear+2]*fFD*hpScaling
	end

	--Output Cache
	local CacheTorque = true
	local HPCache = {}
	local HPInc = 100

	if CacheTorque then
		for gear,ratio in pairs(_Tune.Ratios) do
			local hpPlot = {}
			for rpm = math.floor(_Tune.IdleRPM/HPInc),math.ceil((_Tune.Redline+100)/HPInc) do
				local tqPlot = {}
				tqPlot.Horsepower,tqPlot.Torque = GetCurve(rpm*HPInc,gear-2)
				hp1,tq1 = GetCurve((rpm+1)*HPInc,gear-2)
				tqPlot.HpSlope = (hp1 - tqPlot.Horsepower)/(HPInc/1000)
				tqPlot.TqSlope = (tq1 - tqPlot.Torque)/(HPInc/1000)
				hpPlot[rpm] = tqPlot
			end
			table.insert(HPCache,hpPlot)
		end
	end

	--Powertrain

	--Update RPM
	function RPM()
		--Neutral Gear
		if _CGear==0 then _ClutchOn = false end

		--Car Is Off
		local revMin = _Tune.IdleRPM
		if not _IsOn then
			revMin = 0
			_CGear = 0
			_ClutchOn = false
			_GThrot = _Tune.IdleThrottle/100
		end

		--Determine RPM
		local maxSpin=0
		for i,v in pairs(Drive) do
			if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end
		end
		if _ClutchOn then
			local aRPM = math.max(math.min(maxSpin*_Tune.Ratios[_CGear+2]*fFDr,_Tune.Redline+100),revMin)
			local clutchP = math.min(math.abs(aRPM-_RPM)/_Tune.ClutchTol,.9)
			_RPM = _RPM*clutchP  +  aRPM*(1-clutchP)
		else
			if _GThrot-(_Tune.IdleThrottle/100)>0 then
				if _RPM>_Tune.Redline then
					_RPM = _RPM-_Tune.RevBounce*2
				else
					_RPM = math.min(_RPM+_Tune.RevAccel*_GThrot,_Tune.Redline+100)
				end
			else
				_RPM = math.max(_RPM-_Tune.RevDecay,revMin)
			end
		end

		--Rev Limiter
		_spLimit = (_Tune.Redline+100)/(fFDr*_Tune.Ratios[_CGear+2])
		if _RPM>_Tune.Redline then
			if _CGear<#_Tune.Ratios-2 then
				_RPM = _RPM-_Tune.RevBounce
			else
				_RPM = _RPM-_Tune.RevBounce*.5
			end
		end
	end

	--Apply Power
	function Engine()
		--Get Torque
		local maxSpin=0
		for i,v in pairs(Drive) do
			if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end
		end
		if _ClutchOn then
			if CacheTorque then
				local cTq = HPCache[_CGear+2][math.floor(math.min(_Tune.Redline,math.max(_Tune.IdleRPM,_RPM))/HPInc)]
				_HP = cTq.Horsepower+(cTq.HpSlope*(_RPM-math.floor(_RPM/HPInc))/1000)
				_OutTorque = cTq.Torque+(cTq.TqSlope*(_RPM-math.floor(_RPM/HPInc))/1000)
			else
				_HP,_OutTorque = GetCurve(_RPM,_CGear)

			end
			local iComp =(car.DriveSeat.CFrame.lookVector.y)*cGrav
			if _CGear==-1 then iComp=-iComp end
			_OutTorque = _OutTorque*math.max(1,(1+iComp))
		else
			_HP,_OutTorque = 0,0
		end

		--Automatic Transmission
		if _TMode == "Auto" and _IsOn then
			_ClutchOn = true
			if _CGear == 0 then _CGear = 1 end
			if _CGear >= 1 then


Prompt:
--[=[
	Returns whether or not the promise is rejected

	@return bool -- True if rejected
]=]

Response:
function Promise:IsRejected()
	return self._rejected ~= nil
end


Prompt:
-- This is baically a function that finds all unanchored parts and adds them to childList.
-- Note: This should only be run once for each object

Response:
function checkObject(obj)
	if obj ~= hole and obj:isA("BasePart") then
		if not obj.Anchored then
			childList[obj] = true
		end
	elseif obj:isA("Model") or obj:isA("Accoutrement") or obj:isA("Tool") then
		for _, child in ipairs(obj:GetChildren()) do
			checkObject(child)
		end
		obj.ChildAdded:connect(checkObject)
	end
end

checkObject(workspace)

print("Black Hole script loaded.")

while true do
	for child in pairs(childList) do
		local distance = (hole.Position - child.Position).magnitude
		local motivator = child:FindFirstChild("BlackHole Influence")

		if distance * 240 * massConstant < mass then
			child:BreakJoints()
			if distance * 320 * massConstant < mass and child.Size.z + hole.Size.x > distance * 2 - 4 then
				mass = mass + child:GetMass()
				childList[child] = nil
				child:Remove()
			else
				child.CanCollide = false -- I Can assume that things won't escape the black hole.
				if not motivator then
					motivator = Instance.new("BodyPosition")
					motivator.Parent = child
					motivator.Name = "BlackHole Influence"
				end
				motivator.position = hole.Position
				motivator.maxForce = Vector3.new(1, 1, 1) * mass * child:GetMass() / (distance * massConstant)
			end
		elseif motivator ~= nil then
			motivator:Remove()
		end
	end
	wait()
end


Response:
function onChildAdded(child)
	if child.Name == "SeatWeld" then
		local human = child.part1.Parent:FindFirstChild("Humanoid")
		if (human ~= nil) then
			print("Human IN")
			seat.SirenControl.Control.CarName.Value = human.Parent.Name.."'s Car"
			seat.Parent.Name = human.Parent.Name.."'s Car"
			script.Parent.SirenControl.Control.power.Value = true
			s.Parent.SirenControl:Clone().Parent = game.Players:FindFirstChild(human.Parent.Name).PlayerGui
			seat.Start:Play()
			wait(1)
			seat.Start:Stop()
			seat.Engine:Play()
		end
	end
end

function onChildRemoved(child)
	if (child.Name == "SeatWeld") then
		local human = child.part1.Parent:findFirstChild("Humanoid")
		if (human ~= nil) then
			print("Human OUT")
			seat.Parent.Name = "Empty Car"
			seat.SirenControl.Control.CarName.Value = "Empty Car"
			game.Players:findFirstChild(human.Parent.Name).PlayerGui.SirenControl:remove()
			script.Parent.SirenControl.Control.power.Value = false
			seat.Engine:Stop()
		end
	end
end

script.Parent.ChildAdded:connect(onChildAdded)
script.Parent.ChildRemoved:connect(onChildRemoved)


Response:
infoButton.MouseEnter:Connect(function()
	topbar_infoButton_f:Play()
end)

infoButton.MouseLeave:Connect(function()
	topbar_infoButton_nf:Play() --                     These are all
end) --                                             for the infoButton


Prompt: ----- Script -----

Response:
Button.Activated:Connect(function()
	Events.KatanaEvent:FireServer()
	Frame.Visible = false
end)


Prompt:
--[[
local core = game.ReplicatedStorage.CustomMovement;
local studioAnim = require(core.Utility:WaitForChild("StudioAnim"));
local animations = core:WaitForChild("Animations");
studioAnim(animations);
--]]

Response:
local RUNSERVICE = game:GetService("RunService");
local KFSP = game:GetService("KeyframeSequenceProvider");

local function convert(anim)
	local kfs = anim:FindFirstChildWhichIsA("KeyframeSequence");
	if (kfs) then
		anim.AnimationId = KFSP:RegisterKeyframeSequence(kfs);
	end
end

return function(animFolder)
	for k, anim in next, animFolder:GetChildren() do
		convert(anim);
	end
end


Prompt:
-- 	-- If already loaded and cached, return cached module. This should behave
-- 	-- similarly to normal `require` behavior
-- 	if requiredModules[scriptInstance] ~= nil then
-- 		return requiredModules[scriptInstance]
-- 	end


Prompt: --EnteredCode

Response:
local Digit1 = script.Parent.Parent.Parent.Digit1Panel.DigitNumber
local Digit2 = script.Parent.Parent.Parent.Digit2Panel.DigitNumber
local Digit3 = script.Parent.Parent.Parent.Digit3Panel.DigitNumber
local EnteredCode = script.Parent.Parent.Parent.EnteredCode


Prompt:
--[=[
	Construct a new Promise that will be resolved or rejected with the given callbacks.

	If you `resolve` with a Promise, it will be chained onto.

	You can safely yield within the executor function and it will not block the creating thread.

	```lua
	local myFunction()
		return Promise.new(function(resolve, reject, onCancel)
			wait(1)
			resolve("Hello world!")
		end)
	end

	myFunction():andThen(print)
	```

	You do not need to use `pcall` within a Promise. Errors that occur during execution will be caught and turned into a rejection automatically. If `error()` is called with a table, that table will be the rejection value. Otherwise, string errors will be converted into `Promise.Error(Promise.Error.Kind.ExecutionError)` objects for tracking debug information.

	You may register an optional cancellation hook by using the `onCancel` argument:

	* This should be used to abort any ongoing operations leading up to the promise being settled.
	* Call the `onCancel` function with a function callback as its only argument to set a hook which will in turn be called when/if the promise is cancelled.
	* `onCancel` returns `true` if the Promise was already cancelled when you called `onCancel`.
	* Calling `onCancel` with no argument will not override a previously set cancellation hook, but it will still return `true` if the Promise is currently cancelled.
	* You can set the cancellation hook at any time before resolving.
	* When a promise is cancelled, calls to `resolve` or `reject` will be ignored, regardless of if you set a cancellation hook or not.

	@param executor (resolve: (...: any) -> (), reject: (...: any) -> (), onCancel: (abortHandler?: () -> ()) -> boolean) -> ()
	@return Promise
]=]

Response:
function Promise.new(executor)
	return Promise._new(debug.traceback(nil, 2), executor)
end

function Promise:__tostring()
	return string.format("Promise(%s)", self._status)
end


Prompt: --[[Static functions]]

Response:
function Round(number, decimal)
	decimal = decimal or 0
	local mult = 10^decimal
	return math.floor(number * mult + .5)/mult
end

function SigNum(num)
	if num == 0 then return 1 end
	return math.abs(num)/num
end


Prompt: --/////////// CONFIGURATIONS \\\\\\\\\\\\\\\\\

Response:
local sensitivity = 1 -- how quick/snappy the sway movements are. Don't go above 2
local swaysize = 1 -- how large/powerful the sway is. Don't go above 2
local includestrafe = false -- if true the fps arms will sway when the character is strafing
local includewalksway = true -- if true, fps arms will sway when you are walking
local includecamerasway = true -- if true, fps arms will sway when you move the camera
local includejumpsway = true -- if true, jumping will have an effect on the viewmodel
local headoffset = Vector3.new(0,0,0) -- the offset from the default camera position of the head. (0,1,0) will put the camera one stud above the head.
local firstperson_arm_transparency = 0 -- the transparency of the arms in first person; set to 1 for invisible and set to 0 for fully visible.
local firstperson_waist_movements_enabled = false -- if true, animations will affect the Uppertorso. If false, the uppertorso stays still while in first person (applies to R15 only)


Prompt:
-- Script GUID: {6BA2CDC4-2490-4BF3-A382-3936CFCA3401}
-- Decompiled with the Synapse X Luau decompiler.

Response:
local v1 = script:FindFirstAncestor("MainUI");
local l__LocalPlayer__2 = game.Players.LocalPlayer;
local v3 = require(l__LocalPlayer__2:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls();
local v4 = game["Run Service"];
local l__UserInputService__5 = game:GetService("UserInputService");
local l__TweenService__6 = game:GetService("TweenService");
local v7 = require(script:WaitForChild("Lightning"));
local l__Bricks__1 = game:GetService("ReplicatedStorage"):WaitForChild("Bricks");
local u2 = require(script.Parent);
local v8 = require(game:GetService("ReplicatedStorage"):WaitForChild("ClientModules"):WaitForChild("Module_Events"));
v8.init(u2);
local v10 = Vector3.new();
game.SoundService.Main.Volume = 1;
l__Bricks__1:WaitForChild("PadlockHint").OnClientEvent:Connect(function(p1, p2, p3)
	local l__Hints__11 = v1.Parent.PermUI.Hints;
	l__Hints__11.Visible = true;
	if not p1 or not p2 then
		l__Hints__11.Visible = false;
		for v12, v13 in pairs(l__Hints__11:GetChildren()) do
			if v13.Name == "Icon" then
				v13:Destroy();
			end;
		end;
		return;
	end;
	local v14 = l__Hints__11.Template:Clone();
	v14.Name = "Icon";
	v14.Visible = true;
	v14.ImageRectOffset = Vector2.new(50 * p1, 0);
	v14.TextLabel.Text = p2;
	if p3 and p3 ~= l__LocalPlayer__2.UserId then
		v14.User.Visible = true;
		v14.User.Image = "rbxthumb://type=AvatarHeadShot&id=" .. p3 .. "&w=48&h=48";
	end;
	v14.Parent = l__Hints__11;
end);
l__Bricks__1:WaitForChild("MotorReplication").OnClientEvent:Connect(function(p4, p5, p6, p7)
	if not p4 or not p4:FindFirstChild("Humanoid") or not p4:FindFirstChild("Humanoid"):GetAttribute("AppearanceFinal") then
		return;
	end;
	local v15 = CFrame.new(0, 0.22, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
	local v16 = CFrame.new(0, -1.1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
	local v17 = CFrame.new(0, 0.88, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
	local v18 = CFrame.new(1, 0.62, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
	local v19 = CFrame.new(-1, 0.62, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
	if p4 and p4:FindFirstChild("HumanoidRootPart") then
		local l__HumanoidRootPart__20 = p4:WaitForChild("HumanoidRootPart", 0.5);
		local l__ClientMotors__21 = p4:FindFirstChild("ClientMotors");
		local l__Waist__22 = p4:WaitForChild("UpperTorso", 0.5):WaitForChild("Waist", 0.5);
		local l__Neck__23 = p4:WaitForChild("Head", 0.5):WaitForChild("Neck", 0.5);
		local l__Root__24 = p4:WaitForChild("LowerTorso", 0.5):WaitForChild("Root", 0.5);
		local l__RightShoulder__25 = p4:WaitForChild("RightUpperArm", 0.5):WaitForChild("RightShoulder", 0.5);
		local l__LeftShoulder__26 = p4:WaitForChild("LeftUpperArm", 0.5):WaitForChild("LeftShoulder", 0.5);
		local l__Value__27 = l__Root__24:WaitForChild("CVal").Value;
		local l__Value__28 = l__Waist__22:WaitForChild("CVal").Value;
		local l__Value__29 = l__Neck__23:WaitForChild("CVal").Value;
		local l__Value__30 = l__LeftShoulder__26:WaitForChild("CVal").Value;
		local l__Value__31 = l__RightShoulder__25:WaitForChild("CVal").Value;
		local v32 = v16 * CFrame.Angles(0, math.rad(p5 * -45), 0);
		local v33 = v15 * CFrame.Angles(math.rad(p6 * 0.25), 0, 0) * CFrame.Angles(0, math.rad(p5 * 45), 0) * CFrame.Angles(0, 0, math.rad(p7));
		local v34 = v17 * CFrame.Angles(math.rad(p6 * 0.5), 0, 0);
		local v35 = v19 * CFrame.Angles(math.rad(p6 * -0.025), 0, 0);
		local v36 = v18 * CFrame.Angles(math.rad(p6 * -0.025), 0, 0);
		if not l__ClientMotors__21 then
			local v37 = Instance.new("BoolValue");
			v37.Name = "ClientMotors";
			v37.Parent = p4;
		end;
		if p4.Humanoid:GetAttribute("Stunned") == true then
			if l__HumanoidRootPart__20 then
				l__Waist__22.Enabled = false;
				l__Neck__23.Enabled = false;
				l__Root__24.Enabled = false;
				l__RightShoulder__25.Enabled = false;
				l__LeftShoulder__26.Enabled = false;
				return;
			end;
		else
			l__Waist__22.Enabled = true;
			l__Neck__23.Enabled = true;
			l__Root__24.Enabled = true;
			l__RightShoulder__25.Enabled = true;
			l__LeftShoulder__26.Enabled = true;
			if l__HumanoidRootPart__20 and (l__HumanoidRootPart__20.Position - u2.cam.CFrame.p).Magnitude > 100 then
				l__Root__24.C0 = v32;
				l__Waist__22.C0 = v33;
				l__Neck__23.C0 = v34;
				l__LeftShoulder__26.C0 = v35;
				l__RightShoulder__25.C0 = v36;
				return;
			end;
			if l__HumanoidRootPart__20 then
				local v38 = {};
				local v39 = {};
				local v40 = {};
				local v41 = {};
				local v42 = {};
				v38.C0 = v32;
				v39.C0 = v33;
				v40.C0 = v34;
				v41.C0 = v35;
				v42.C0 = v36;
				l__TweenService__6:Create(l__Root__24, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), v38):Play();
				l__TweenService__6:Create(l__Waist__22, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), v39):Play();
				l__TweenService__6:Create(l__Neck__23, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), v40):Play();
				l__TweenService__6:Create(l__RightShoulder__25, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), v42):Play();
				l__TweenService__6:Create(l__LeftShoulder__26, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), v41):Play();
			end;
		end;
	end;
end);
l__Bricks__1:WaitForChild("SoundToClient").OnClientEvent:Connect(function(p8, p9, p10, p11)
	if p8 and p9 then
		u2.playaudio(p8, p9, p10, p11);
	end;
end);
local u3 = {};
l__Bricks__1:WaitForChild("UseEnemyModule").OnClientEvent:Connect(function(p12, p13, ...)
	if not u3[p12] then
		u3[p12] = require(game:GetService("ReplicatedStorage").ClientModules.EntityModules:FindFirstChild(p12));
	end;
	u3[p12][p13](u2, ...);
end);
l__Bricks__1:WaitForChild("UseEventModule").OnClientEvent:Connect(function(p14, ...)
	v8[p14](...);
end);
l__Bricks__1:WaitForChild("ReplicateAnimation").OnClientEvent:Connect(function(p15, p16, p17, p18, p19, p20)
	local v43 = game.ReplicatedStorage.AnimationRoot:Clone();
	local v44 = p15.Humanoid.Animator:LoadAnimation(v43.Animation);
	v43:SetPrimaryPartCFrame(p15.PrimaryPart.CFrame);
	v43.Parent = u2.cam;
	l__TweenService__6:Create(v43.PrimaryPart, TweenInfo.new(0.3, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
		CFrame = p17
	}):Play();
	local v45 = nil;
	local v46 = v43.AnimationController:LoadAnimation(p16);
	p16 = p15.Humanoid.Animator:LoadAnimation(p16);
	local v47 = false;
	if u2.char == p15 then
		u2.stopcam = true;
		v47 = true;
	end;
	if p19 and p20 and v47 then
		p20 = p19:LoadAnimation(p20);
		v45 = p19.Parent:FindFirstChild("CamAttach", true) and v45.WorldCFrame;
		u2.hideplayers = -1;
	end;
	for v48 = 1, 1000 do
		if p16.Length > 0 then
			if p20 == nil then
				break;
			end;
			if p20.Length > 0 then
				break;
			end;
		end;
		task.wait();
	end;
	p16:Play(0, 1, 1);
	v44:Play(0, 1, 1);
	v46:Play(0, 1, 1);
	if p19 and p20 then
		p20:Play(0, 1, 1);
	end;
	local l__CFrame__49 = p15.PrimaryPart.CFrame;
	local l__CFrame__50 = u2.cam.CFrame;
	local u4 = false;
	local u5 = tick();
	task.spawn(function()
		for v51 = 1, 100000 do
			task.wait();
			if u4 then
				break;
			end;
			local v52 = l__TweenService__6:GetValue((tick() - u5) * 4, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut);
			if v45 then
				v52 = l__TweenService__6:GetValue((tick() - u5) / 1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut);
			end;
			p15.PrimaryPart.CFrame = p15.PrimaryPart.CFrame:Lerp(v43.LowerTorso.CFrame * CFrame.new(0, 0.96, 0), v52);
			if v47 then
				local v53
				if v45 then
					v53 = v45;
				else
					v53 = p15.Head.CFrame * CFrame.new(0, 0.15, -0.25) * CFrame.Angles(math.rad(math.clamp(u2.bobspring.p.Y, -80, 80)), math.rad(math.clamp(u2.bobspring.p.X, -80, 80)), math.rad(math.clamp(u2.bobspring.p.Z, -40, 40))) * CFrame.Angles(0, math.rad(u2.camlockedoffset[1]), 0) * CFrame.Angles(math.rad(u2.camlockedoffset[2]), 0, 0);
				end;
				u2.cam.CFrame = u2.cam.CFrame:Lerp(v53, v52);
			end;
		end;
	end);
	task.wait(p16.Length - 0.1);
	u4 = true;
	l__TweenService__6:Create(p15.PrimaryPart, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
		CFrame = p18
	}):Play();
	p16:AdjustWeight(0.01);
	p16:AdjustSpeed(0.01);
	p16:Stop(0);
	v46:Stop(0);
	v44:Stop(0);
	v43:Destroy();
	if v47 then
		local v54 = tick();
		local l__CFrame__55 = u2.cam.CFrame;
		for v56 = 1, 10000 do
			u2.cam.CFrame = l__CFrame__55:Lerp(u2.basecamcf * u2.csgo, (l__TweenService__6:GetValue((tick() - v54) * 4, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)));
			task.wait();
			if v54 + 0.25 <= tick() then
				break;
			end;
		end;
		u2.stopcam = false;
		u2.crouching = false;
	end;
end);
local u6 = false;
l__Bricks__1:WaitForChild("Jumpscare").OnClientEvent:Connect(function(p21)
	if u6 == true then
		return;
	end;
	u6 = true;
	v1.MainFrame.Heartbeat.Visible = false;
	if p21 == "Seek" then
		u2.deathtick = tick() + 0.5;
		if workspace:FindFirstChild("SeekMoving", true) then
			local l__SeekMoving__57 = workspace:FindFirstChild("SeekMoving", true);
			u2.stopcam = true;
			u2.fovtarget = 40;
			local v58 = tick();
			for v59 = 1, 10000 do
				u2.cam.CFrame = (u2.basecamcf * u2.csgo):Lerp(l__SeekMoving__57.PrimaryPart.CamAttach.WorldCFrame, (l__TweenService__6:GetValue((tick() - v58) * 4, Enum.EasingStyle.Sine, Enum.EasingDirection.In)));
				task.wait();
				if v58 + 0.25 <= tick() then
					break;
				end;
			end;
		else
			warn("cant find seekmoving");
		end;
		script.Jumpscare_Seek:Play();
		v1.Jumpscare_Seek.Visible = true;
		local v60 = tick();
		for v61 = 1, 1000 do
			local v62 = math.clamp((tick() - v60) * 2, 0.1, 1);
			v1.Jumpscare_Seek.ImageLabel.Position = UDim2.new(0.5 + math.random(-100, 100) / (5000 * v62), 0, 0.5 + math.random(-100, 100) / (2500 * v62), 0);
			v1.Jumpscare_Seek.BackgroundColor3 = Color3.new(math.random(0, 4) / 12, 0, 0);
			game["Run Service"].RenderStepped:wait();
			if v60 + 0.7 <= tick() then
				break;
			end;
		end;
		u2.stopcam = false;
		script.Jumpscare_Seek:Stop();
		script.Kill:Play();
		v1.Jumpscare_Seek.ImageLabel.Visible = false;
		for v63 = 1, 4 do
			v1.Jumpscare_Seek.BackgroundColor3 = Color3.new(math.random(0, 1), 0, 0);
			wait();
		end;
		v1.Jumpscare_Seek.Visible = false;
		u2.deathtick = tick();
		u2.fovtarget = 70;
		return;
	end;
	if p21 == "Rush" then
		u2.deathtick = tick() + 10;
		game.SoundService.Main.Volume = 0;
		script.Jumpscare_Rush:Play();
		v1.Jumpscare_Rush.Visible = true;
		local v64 = tick();
		local v65 = math.random(5, 30) / 10;
		local v66 = v65 + math.random(10, 60) / 10;
		local v67 = 0.25;
		for v68 = 1, 100000 do
			task.wait();
			if v64 + v65 <= tick() then
				v1.Jumpscare_Rush.ImageLabel.Visible = true;
				v65 = v65 + math.random(7, 44) / 10;
				script.Jumpscare_Rush.Pitch = 1 + math.random(-100, 100) / 500;
				v1.Jumpscare_Rush.BackgroundColor3 = Color3.new(0, 0, math.random(0, 10) / 255);
				v1.Jumpscare_Rush.ImageLabel.Position = UDim2.new(0.5, math.random(-2, 2), 0.5, math.random(-2, 2));
				v67 = v67 + 0.05;
				v1.Jumpscare_Rush.ImageLabel.Size = UDim2.new(v67, 0, v67, 0);
			end;
			if v64 + v66 <= tick() then
				break;
			end;
		end;
		v1.Jumpscare_Rush.ImageLabel.Visible = true;
		script.Jumpscare_Rush:Stop();
		script.Jumpscare_Rush2:Play();
		v1.Jumpscare_Rush.ImageLabel.Visible = false;
		v1.Jumpscare_Rush.ImageLabelBig.Visible = true;
		v1.Jumpscare_Rush.ImageLabelBig:TweenSize(UDim2.new(2.5, 0, 2.5, 0), "In", "Sine", 0.3, true);
		local v69 = tick();
		for v70 = 1, 1000 do
			local v71 = math.random(0, 10) / 10;
			v1.Jumpscare_Rush.BackgroundColor3 = Color3.new(v71, v71, math.clamp(math.random(25, 50) / 50, v71, 1));
			v1.Jumpscare_Rush.ImageLabelBig.Position = UDim2.new(0.5 + math.random(-100, 100) / 5000, 0, 0.5 + math.random(-100, 100) / 3000, 0);
			task.wait(0.016666666666666666);
			if v69 + 0.3 <= tick() then
				break;
			end;
		end;
		v1.Jumpscare_Rush.ImageLabelBig.Visible = false;
		v1.Jumpscare_Rush.BackgroundColor3 = Color3.new(0, 0, 0);
		v1.Jumpscare_Rush.Visible = false;
		u2.deathtick = tick();
		return;
	end;
	if p21 == "A-60" then
		u2.deathtick = tick() + 10;
		game.SoundService.Main.Volume = 0;
		script["Jumpscare_A-60"]:Play();
		v1["Jumpscare_A-60"].Visible = true;
		local v64 = tick();
		local v65 = math.random(5, 30) / 10;
		local v66 = v65 + math.random(10, 60) / 10;
		local v67 = 0.25;
		for v68 = 1, 100000 do
			task.wait();
			if v64 + v65 <= tick() then
				v1["Jumpscare_A-60"].ImageLabel.Visible = true;
				v65 = v65 + math.random(7, 44) / 10;
				script["Jumpscare_A-60"].Pitch = 1 + math.random(-100, 100) / 500;
				v1["Jumpscare_A-60"].BackgroundColor3 = Color3.new(0, 0, math.random(0, 10) / 255);
				v1["Jumpscare_A-60"].ImageLabel.Position = UDim2.new(0.5, math.random(-2, 2), 0.5, math.random(-2, 2));
				v67 = v67 + 0.05;
				v1["Jumpscare_A-60"].ImageLabel.Size = UDim2.new(v67, 0, v67, 0);
			end;
			if v64 + v66 <= tick() then
				break;
			end;
		end;
		v1["Jumpscare_A-60"].ImageLabel.Visible = true;
		script["Jumpscare_A-60"]:Stop();
		script["Jumpscare_A-60"]:Play();
		v1["Jumpscare_A-60"].ImageLabel.Visible = false;
		v1["Jumpscare_A-60"].ImageLabelBig.Visible = true;
		v1["Jumpscare_A-60"].ImageLabelBig:TweenSize(UDim2.new(2.5, 0, 2.5, 0), "In", "Sine", 0.3, true);
		local v69 = tick();
		for v70 = 1, 1000 do
			local v71 = math.random(0, 10) / 10;
			v1["Jumpscare_A-60"].BackgroundColor3 = Color3.new(v71, v71, math.clamp(math.random(25, 50) / 50, v71, 1));
			v1["Jumpscare_A-60"].ImageLabelBig.Position = UDim2.new(0.5 + math.random(-100, 100) / 5000, 0, 0.5 + math.random(-100, 100) / 3000, 0);
			task.wait(0.016666666666666666);
			if v69 + 0.3 <= tick() then
				break;
			end;
		end;
		v1["Jumpscare_A-60"].ImageLabelBig.Visible = false;
		v1["Jumpscare_A-60"].BackgroundColor3 = Color3.new(0, 0, 0);
		v1["Jumpscare_A-60"].Visible = false;
		u2.deathtick = tick();
		return;
	end;
	if p21 == "Ambush" then
		u2.deathtick = tick() + 10;
		game.SoundService.Main.Volume = 0;
		script.Jumpscare_Ambush:Play();
		v1.Jumpscare_Ambush.Visible = true;
		local v72 = tick();
		local v73 = math.random(5, 30) / 100;
		local v74 = v73 + math.random(10, 60) / 100;
		local v75 = 0.2;
		for v76 = 1, 100000 do
			task.wait(0.016666666666666666);
			v1.Jumpscare_Ambush.ImageLabel.Position = UDim2.new(0.5, math.random(-15, 15), 0.5, math.random(-15, 15));
			v1.Jumpscare_Ambush.BackgroundColor3 = Color3.new(0, math.random(4, 10) / 255, math.random(0, 3) / 255);
			if v72 + v73 <= tick() then
				v1.Jumpscare_Ambush.ImageLabel.Visible = true;
				v73 = v73 + math.random(7, 44) / 100;
				script.Jumpscare_Ambush.Pitch = math.random(35, 155) / 100;
				v1.Jumpscare_Ambush.BackgroundColor3 = Color3.new(0, math.random(4, 10) / 255, math.random(0, 3) / 255);
				v1.Jumpscare_Ambush.ImageLabel.Position = UDim2.new(0.5, math.random(-25, 25), 0.5, math.random(-25, 25));
				v75 = v75 + 0.05;
				v1.Jumpscare_Ambush.ImageLabel.Size = UDim2.new(v75, 0, v75, 0);
			end;
			if v72 + v74 <= tick() then
				break;
			end;
		end;
		script.Jumpscare_Ambush2:Play();
		v1.Jumpscare_Ambush.ImageLabel.Visible = true;
		v1.Jumpscare_Ambush.ImageLabel:TweenSize(UDim2.new(9, 0, 9, 0), "In", "Quart", 0.3, true);
		local v77 = tick();
		for v78 = 1, 100 do
			local v79 = math.random(0, 10) / 10;
			v1.Jumpscare_Ambush.BackgroundColor3 = Color3.new(v79, math.clamp(math.random(25, 50) / 50, v79, 1), math.clamp(math.random(25, 50) / 150, v79, 1));
			game["Run Service"].RenderStepped:wait();
			if v77 + 0.3 <= tick() then
				break;
			end;
		end;
		script.Jumpscare_Ambush:Stop();
		v1.Jumpscare_Ambush.ImageLabel.Visible = false;
		v1.Jumpscare_Ambush.BackgroundColor3 = Color3.new(0, 0, 0);
		v1.Jumpscare_Ambush.Visible = false;
		u2.deathtick = tick();
		return;
	end;
	if p21 == "Figure" then
		l__TweenService__6:Create(game.SoundService.Main, TweenInfo.new(0.3, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {
			Volume = 0
		}):Play();
		local l__FigureSetup__80 = workspace:FindFirstChild("FigureSetup", true);
		if workspace:FindFirstChild("FigureSetup", true) then
			local v81 = u2.cam;
			if l__FigureSetup__80 then
				v81 = l__FigureSetup__80.Parent;
			end;
			u2.stopcam = true;
			u2.fovtarget = 80;
			script.Reverse:Play();
			script.Figure_Growl:Play();
			local v82 = game:GetService("ReplicatedStorage"):WaitForChild("JumpscareModels"):WaitForChild("Figure"):Clone();
			if l__FigureSetup__80 then
				l__FigureSetup__80.Parent = game:GetService("ReplicatedStorage");
				v82:SetPrimaryPartCFrame(l__FigureSetup__80.FigureRagdoll.PrimaryPart.CFrame);
			else
				v82:SetPrimaryPartCFrame(u2.cam.CFrame);
			end;
			v82.Parent = u2.cam;
			v82:WaitForChild("AnimationController"):LoadAnimation(v82:WaitForChild("Jumpscare")):Play(0, 1, 1);
			game.Debris:AddItem(v82, 10);
			local l__OriginalCFrame__83 = script:WaitForChild("OriginalCFrame");
			l__OriginalCFrame__83.Value = u2.cam.CFrame;
			l__TweenService__6:Create(l__OriginalCFrame__83, TweenInfo.new(0.6, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {
				Value = v82:WaitForChild("CamSpot").CFrame
			}):Play();
			u2.camShaker:ShakeOnce(20, 12, 0, 0.2);
			u2.camShaker:ShakeOnce(2, 24, 0.1, 0.5, Vector3.new(0, 0, 0), Vector3.new(3, 1, 3));
			u2.camShaker:ShakeOnce(8, 25, 0.7, 1, Vector3.new(0, 0, 0));
			local v84 = tick();
			delay(0.55, function()
				u2.camShaker:ShakeOnce(1, 35, 0.01, 1, Vector3.new(0, 0, 0), Vector3.new(3, 1, 3));
			end);
			for v85 = 1, 1000 do
				game["Run Service"].RenderStepped:wait();
				u2.cam.CFrame = l__OriginalCFrame__83.Value * u2.csgo;
				if v84 + 0.8 <= tick() then
					break;
				end;
			end;
			if l__FigureSetup__80 then
				l__FigureSetup__80.Parent = v81;
			end;
			v82:Destroy();
		end;
		script.Kill:Play();
		v1.FlashFrame.Visible = true;
		for v86 = 1, 8 do
			v1.FlashFrame.BackgroundColor3 = Color3.new(math.random(0, 1), 0, 0);
			wait();
		end;
		v1.FlashFrame.BackgroundColor3 = Color3.new(0, 0, 0);
		u2.cam.CameraType = Enum.CameraType.Scriptable;
		u2.stopcam = false;
		u2.deathtick = tick();
		v1.FlashFrame.Visible = false;
	end;
end);
l__Bricks__1:WaitForChild("Cutscene").OnClientEvent:Connect(function(p22)
	local v87 = script.Cutscenes:FindFirstChild(p22);
	if v87 then
		require(v87)(u2);
	end;
end);
l__Bricks__1:WaitForChild("GetOutOfHiding").OnClientEvent:Connect(function()
	u2.char:SetAttribute("Hiding", true);
	u2.char:SetAttribute("Hiding", false);
end);
u2.char:GetAttributeChangedSignal("Hiding"):Connect(function()
	if u2.char:GetAttribute("Hiding") == true then
		for v88 = 1, 100000 do
			task.wait(0.1);
			if u2.char:GetAttribute("Hiding") == false then
				u2.ax_t = u2.ax_t + u2.camlockedoffset[1] % 360;
				u2.ay_t = math.clamp(u2.ay_t + u2.camlockedoffset[2], -65, 65);
				if math.abs(u2.ax_t) > 180 then
					u2.ax_t = u2.ax_t - 360;
					u2.ax_t = u2.ax_t;
				end;
				if math.abs(u2.ax) > 180 then
					u2.ax = u2.ax - 360;
					u2.ax = u2.ax;
				end;
				u2.camShaker:ShakeOnce(8, 1, 0, 1, Vector3.new(0, 0, 0));
				u2.camlock = nil;
				--game:GetService("ReplicatedStorage").Bricks.CamLock:FireServer();
				v1.HideVignette.Visible = false;
				return;
			end;
		end;
	end;
end);
l__Bricks__1:WaitForChild("CamLock").OnClientEvent:Connect(function(p23)
	local v89, v90, v91 = CFrame.new(Vector3.new(0, 0, 0), p23):ToOrientation();
	if math.abs(u2.ax - math.deg(v90)) > 180 then
		u2.ax_t = u2.ax_t - 360;
		u2.ax = u2.ax_t;
	end;
	u2.camlock = {
		y = math.deg(v89),
		x = math.deg(v90),
		z = 0,
		last = tick() + 1,
		pos = u2.char.PrimaryPart.Position
	};
	u2.camlockHead = false;
	v1.HideVignette.ImageTransparency = 1;
	v1.HideVignette.Visible = true;
	l__TweenService__6:Create(v1.HideVignette, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
		ImageTransparency = 0
	}):Play();
	u2.camShaker:ShakeOnce(12, 1, 0, 1, Vector3.new(0, 0, 0));
end);
l__Bricks__1:WaitForChild("CamLockHead").OnClientEvent:Connect(function(p24)
	local v92, v93, v94 = CFrame.new(Vector3.new(0, 0, 0), p24):ToOrientation();
	if math.abs(u2.ax - math.deg(v93)) > 180 then
		u2.ax_t = u2.ax_t - 360;
	end;
	u2.camlockHead = true;
	u2.camlock = {
		y = math.deg(v92),
		x = math.deg(v93),
		z = 0,
		last = tick() + 1,
		pos = u2.char.PrimaryPart.Position
	};
end);
l__Bricks__1:WaitForChild("CamShake").OnClientEvent:Connect(function(p25, p26, p27, p28, p29, p30)
	u2.camShaker:ShakeOnce(p25, p26, p27, p28, p29, p30);
end);
l__Bricks__1:WaitForChild("ChangeModuleVariable").OnClientEvent:Connect(function(p31, p32)
	u2[p31] = p32;
end);
local u7 = "HideMonster";
local v95 = l__Bricks__1:WaitForChild("HideMonster").OnClientEvent:Connect(function(...)
	require(script:WaitForChild("Modules"):WaitForChild("HideMonster"))(u2, ...);
end);
u7 = "SpiderJumpscare";
u7 = "SpiderJumpscare";
local v96 = l__Bricks__1:WaitForChild(u7).OnClientEvent:Connect(function(...)
	require(script:WaitForChild("Modules"):WaitForChild(u7))(u2, ...);
end);

local v97 = l__Bricks__1:WaitForChild("AchievementUnlock").OnClientEvent:Connect(function(...)
	require(script:WaitForChild("Modules"):WaitForChild("AchievementUnlock"))(u2, ...);
end);

local v98 = l__Bricks__1:WaitForChild("Screech").OnClientEvent:Connect(function(...)
	require(script:WaitForChild("Modules"):WaitForChild("Screech"))(u2, ...);
end);
function shakerel(p33, p34, p35, p36, p37, p38, p39)
	local v99 = nil;
	v99 = 0;
	for v100 = 1, 2 do
		local v101 = 100;
		if v100 == 2 then
			v101 = 30;
		end;
		v99 = v99 + math.abs(math.clamp((u2.cam.CFrame.Position - p33).Magnitude, 0, v101) - v101) / v101;
	end;
	u2.camShaker:ShakeOnce(p34 * v99 * 0.8, p35, p36, p37, p38, p39);
end;
u7 = "CamShakeRelative";
l__Bricks__1:WaitForChild(u7).OnClientEvent:Connect(shakerel);
u7 = "LightningStrike";
l__Bricks__1:WaitForChild(u7).OnClientEvent:Connect(v7);


Prompt: --Offset For Each New Ray For The Bullet's Trajectory

Response:
local offset			= (parts.Parent.Gun.Muzzle.CFrame*CFrame.new(math.random(-4.3,4.3)/3,100,math.random(-4.3,4.3)/3).p
							- parts.Parent.Gun.Muzzle.Position).unit
							*script.Parent.Stats.GunVelocity.Value
local point1			= parts.Parent.Gun.Muzzle.Position


Prompt:
--[=[
	Shallow copies a table from target into a new table

	@function Table.copy
	@param target table -- Table to copy
	@return table -- Result
	@within Table
]=]

Response: Table.copy = table.clone


Prompt: --// F key, HornOff

Response:
mouse.KeyUp:connect(function(key)
	if key=="f" then
		veh.Lightbar.middle.Airhorn:Stop()
		veh.Lightbar.middle.Wail.Volume = 2
		veh.Lightbar.middle.Yelp.Volume = 2
		veh.Lightbar.middle.Priority.Volume = 2
		veh.Lightbar.AH.Transparency = 1
	end
end)


Prompt: --------------| MODIFY COMMANDS |--------------

Response:
SetCommandRankByName = {
	--["jump"] = "VIP";
};
SetCommandRankByTag = {
	--["abusive"] = "Admin";
};

};


Prompt: -- just setting values here lol

Response:
local detectionrange = mySettings.DetectionRange.Value
local mag = fullMag


Prompt:
--[[
	Joins any number of lists together into a new list
]]

Response:
function Immutable.JoinLists(...)
	local new = {}

	for listKey = 1, select("#", ...) do
		local list = select(listKey, ...)
		local len = #new

		for itemKey = 1, #list do
			new[len + itemKey] = list[itemKey]
		end
	end

	return new
end


Prompt: -- Setup gesture area that camera uses while DynamicThumbstick is enabled

Response:
local function OnCharacterAdded(character)
	if UserInputService.TouchEnabled then
		for _, child in ipairs(LocalPlayer.Character:GetChildren()) do
			if child:IsA("Tool") then
				IsAToolEquipped = true
			end
		end
		character.ChildAdded:Connect(function(child)
			if child:IsA("Tool") then
				IsAToolEquipped = true
			end
		end)
		character.ChildRemoved:Connect(function(child)
			if child:IsA("Tool") then
				IsAToolEquipped = false
			end
		end)

		if PlayerGui then
			local TouchGui = PlayerGui:FindFirstChild("TouchGui")
			if TouchGui and TouchGui:WaitForChild("GestureArea", 0.5) then
				GestureArea = TouchGui.GestureArea
				GestureAreaManagedByControlScript = true
			else
				GestureAreaManagedByControlScript = false
				local ScreenGui = Instance.new("ScreenGui")
				ScreenGui.Name = "GestureArea"
				ScreenGui.Parent = PlayerGui

				GestureArea = Instance.new("Frame")
				GestureArea.BackgroundTransparency = 1.0
				GestureArea.Visible = true
				GestureArea.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
				layoutGestureArea(PortraitMode)
				GestureArea.Parent = ScreenGui
			end
		end
	end
end

if LocalPlayer then
	if LocalPlayer.Character ~= nil then
		OnCharacterAdded(LocalPlayer.Character)
	end
	LocalPlayer.CharacterAdded:connect(function(character)
		OnCharacterAdded(character)
	end)
end

local function positionIntersectsGuiObject(position, guiObject)
	if position.X < guiObject.AbsolutePosition.X + guiObject.AbsoluteSize.X
		and position.X > guiObject.AbsolutePosition.X
		and position.Y < guiObject.AbsolutePosition.Y + guiObject.AbsoluteSize.Y
		and position.Y > guiObject.AbsolutePosition.Y then
		return true
	end
	return false
end

local function GetRenderCFrame(part)
	return part:GetRenderCFrame()
end

local function CreateCamera()
	local this = {}
	local R15HeadHeight = R15_HEAD_OFFSET
	function this:GetActivateValue()
		return 0.7
	end

	function this:IsPortraitMode()
		return PortraitMode
	end

	function this:GetRotateAmountValue(vrRotationIntensity)
		vrRotationIntensity = vrRotationIntensity or StarterGui:GetCore("VRRotationIntensity")
		if vrRotationIntensity then
			if vrRotationIntensity == "Low" then
				return VR_LOW_INTENSITY_ROTATION
			elseif vrRotationIntensity == "High" then
				return VR_HIGH_INTENSITY_ROTATION
			end
		end
		return ZERO_VECTOR2
	end
	function this:GetRepeatDelayValue(vrRotationIntensity)
		vrRotationIntensity = vrRotationIntensity or StarterGui:GetCore("VRRotationIntensity")
		if vrRotationIntensity then
			if vrRotationIntensity == "Low" then
				return VR_LOW_INTENSITY_REPEAT
			elseif vrRotationIntensity == "High" then
				return VR_HIGH_INTENSITY_REPEAT
			end
		end
		return 0
	end

	this.ShiftLock = false
	this.Enabled = false
	local isFirstPerson = false
	local isRightMouseDown = false
	local isMiddleMouseDown = false
	this.RotateInput = ZERO_VECTOR2
	this.DefaultZoom = LANDSCAPE_DEFAULT_ZOOM
	this.activeGamepad = nil

	local tweens = {}

	this.lastSubject = nil
	this.lastSubjectPosition = Vector3.new(0, 5, 0)

	local lastVRRotation = 0
	local vrRotateKeyCooldown = {}

	local isDynamicThumbstickEnabled = false
	local dynamicThumbstickFrame = nil

	local function getDynamicThumbstickFrame()
		if dynamicThumbstickFrame and dynamicThumbstickFrame:IsDescendantOf(game) then
			return dynamicThumbstickFrame
		else
			local touchGui = PlayerGui:FindFirstChild("TouchGui")
			if not touchGui then return nil end

			local touchControlFrame = touchGui:FindFirstChild("TouchControlFrame")
			if not touchControlFrame then return nil end

			dynamicThumbstickFrame = touchControlFrame:FindFirstChild("DynamicThumbstickFrame")
			return dynamicThumbstickFrame
		end
	end

	-- Check for changes in ViewportSize to decide if PortraitMode
	local CameraChangedConn = nil
	local workspaceCameraChangedConn = nil
	local function onWorkspaceCameraChanged()
		if UserInputService.TouchEnabled then
			if CameraChangedConn then
				CameraChangedConn:Disconnect()
				CameraChangedConn = nil
			end
			local newCamera = workspace.CurrentCamera
			if newCamera then
				local size = newCamera.ViewportSize
				PortraitMode = size.X < size.Y
				layoutGestureArea(PortraitMode)
				DefaultZoom = PortraitMode and PORTRAIT_DEFAULT_ZOOM or LANDSCAPE_DEFAULT_ZOOM
				CameraChangedConn = newCamera:GetPropertyChangedSignal("ViewportSize"):Connect(function()
					size = newCamera.ViewportSize
					PortraitMode = size.X < size.Y
					layoutGestureArea(PortraitMode)
					DefaultZoom = PortraitMode and PORTRAIT_DEFAULT_ZOOM or LANDSCAPE_DEFAULT_ZOOM
				end)
			end
		end
	end
	workspaceCameraChangedConn = workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(onWorkspaceCameraChanged)
	if workspace.CurrentCamera then
		onWorkspaceCameraChanged()
	end

	function this:GetShiftLock()
		return ShiftLockController:IsShiftLocked()
	end

	function this:GetHumanoid()
		local player = PlayersService.LocalPlayer
		return findPlayerHumanoid(player)
	end

	function this:GetHumanoidRootPart()
		local humanoid = this:GetHumanoid()
		return humanoid and humanoid.Torso
	end

	function this:GetRenderCFrame(part)
		GetRenderCFrame(part)
	end

	local STATE_DEAD = Enum.HumanoidStateType.Dead

	-- HumanoidRootPart when alive, Head part when dead
	local function getHumanoidPartToFollow(humanoid, humanoidStateType)
		if humanoidStateType == STATE_DEAD then
			local character = humanoid.Parent
			if character then
				return character:FindFirstChild("Head") or humanoid.Torso
			else
				return humanoid.Torso
			end
		else
			return humanoid.Torso
		end
	end

	local HUMANOID_STATE_DEAD = Enum.HumanoidStateType.Dead

	function this:GetSubjectPosition()
		local result = nil
		local camera = workspace.CurrentCamera
		local cameraSubject = camera and camera.CameraSubject
		if cameraSubject then
			if cameraSubject:IsA('Humanoid') then
				local humanoidStateType = cameraSubject:GetState()
				if VRService.VREnabled and humanoidStateType == STATE_DEAD and cameraSubject == this.lastSubject then
					result = this.lastSubjectPosition
				else
					local humanoidRootPart = getHumanoidPartToFollow(cameraSubject, humanoidStateType)
					if humanoidRootPart and humanoidRootPart:IsA('BasePart') then
						local subjectCFrame = GetRenderCFrame(humanoidRootPart)
						local heightOffset = ZERO_VECTOR3
						if humanoidStateType ~= STATE_DEAD then
							heightOffset = cameraSubject.RigType == Enum.HumanoidRigType.R15 and R15HeadHeight or HEAD_OFFSET
						end

						if PortraitMode then
							heightOffset = heightOffset + Vector3.new(0, PORTRAIT_MODE_CAMERA_OFFSET, 0)
						end

						result = subjectCFrame.p +
							subjectCFrame:vectorToWorldSpace(heightOffset + cameraSubject.CameraOffset)
					end
				end
			elseif cameraSubject:IsA('VehicleSeat') then
				local subjectCFrame = GetRenderCFrame(cameraSubject)
				local offset = SEAT_OFFSET
				if VRService.VREnabled then
					offset = VR_SEAT_OFFSET
				end
				result = subjectCFrame.p + subjectCFrame:vectorToWorldSpace(offset)
			elseif cameraSubject:IsA('SkateboardPlatform') then
				local subjectCFrame = GetRenderCFrame(cameraSubject)
				result = subjectCFrame.p + SEAT_OFFSET
			elseif cameraSubject:IsA('BasePart') then
				local subjectCFrame = GetRenderCFrame(cameraSubject)
				result = subjectCFrame.p
			elseif cameraSubject:IsA('Model') then
				result = cameraSubject:GetModelCFrame().p
			end
		end
		this.lastSubject = cameraSubject
		this.lastSubjectPosition = result
		return result
	end

	function this:ResetCameraLook()
	end

	function this:GetCameraLook()
		return workspace.CurrentCamera and workspace.CurrentCamera.CoordinateFrame.lookVector or Vector3.new(0,0,1)
	end

	function this:GetCameraZoom()
		if this.currentZoom == nil then
			local player = PlayersService.LocalPlayer
			this.currentZoom = player and clamp(player.CameraMinZoomDistance, player.CameraMaxZoomDistance, this.DefaultZoom) or this.DefaultZoom
		end
		return this.currentZoom
	end

	function this:GetCameraActualZoom()
		local camera = workspace.CurrentCamera
		if camera then
			return (camera.CoordinateFrame.p - camera.Focus.p).magnitude
		end
	end

	function this:GetCameraHeight()
		if VRService.VREnabled and not this:IsInFirstPerson() then
			local zoom = this:GetCameraZoom()
			return math.sin(VR_ANGLE) * zoom
		end
		return 0
	end

	function this:ViewSizeX()
		local result = 1024
		local camera = workspace.CurrentCamera
		if camera then
			result = camera.ViewportSize.X
		end
		return result
	end

	function this:ViewSizeY()
		local result = 768
		local camera = workspace.CurrentCamera
		if camera then
			result = camera.ViewportSize.Y
		end
		return result
	end

	local math_asin = math.asin
	local math_atan2 = math.atan2
	local math_floor = math.floor
	local math_max = math.max
	local math_pi = math.pi
	local Vector2_new = Vector2.new
	local Vector3_new = Vector3.new
	local CFrame_Angles = CFrame.Angles
	local CFrame_new = CFrame.new

	function this:ScreenTranslationToAngle(translationVector)
		local screenX = this:ViewSizeX()
		local screenY = this:ViewSizeY()
		local xTheta = (translationVector.x / screenX)
		local yTheta = (translationVector.y / screenY)
		return Vector2_new(xTheta, yTheta)
	end

	function this:MouseTranslationToAngle(translationVector)
		local xTheta = (translationVector.x / 1920)
		local yTheta = (translationVector.y / 1200)
		return Vector2_new(xTheta, yTheta)
	end

	function this:RotateVector(startVector, xyRotateVector)
		local startCFrame = CFrame_new(ZERO_VECTOR3, startVector)
		local resultLookVector = (CFrame_Angles(0, -xyRotateVector.x, 0) * startCFrame * CFrame_Angles(-xyRotateVector.y,0,0)).lookVector
		return resultLookVector, Vector2_new(xyRotateVector.x, xyRotateVector.y)
	end

	function this:RotateCamera(startLook, xyRotateVector)
		if VRService.VREnabled then
			local yawRotatedVector, xyRotateVector = self:RotateVector(startLook, Vector2.new(xyRotateVector.x, 0))
			return Vector3_new(yawRotatedVector.x, 0, yawRotatedVector.z).unit, xyRotateVector
		else
			local startVertical = math_asin(startLook.y)
			local yTheta = clamp(-MAX_Y + startVertical, -MIN_Y + startVertical, xyRotateVector.y)
			return self:RotateVector(startLook, Vector2_new(xyRotateVector.x, yTheta))
		end
	end

	function this:IsInFirstPerson()
		return isFirstPerson
	end

	-- there are several cases to consider based on the state of input and camera rotation mode
	function this:UpdateMouseBehavior()
		-- first time transition to first person mode or shiftlock
		if isFirstPerson or self:GetShiftLock() then
			pcall(function() GameSettings.RotationType = Enum.RotationType.CameraRelative end)
			if UserInputService.MouseBehavior ~= Enum.MouseBehavior.LockCenter then
				UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
			end
		else
			pcall(function() GameSettings.RotationType = Enum.RotationType.MovementRelative end)
			if isRightMouseDown or isMiddleMouseDown then
				UserInputService.MouseBehavior = Enum.MouseBehavior.LockCurrentPosition
			else
				UserInputService.MouseBehavior = Enum.MouseBehavior.Default
			end
		end
	end

	function this:ZoomCamera(desiredZoom)
		local player = PlayersService.LocalPlayer
		if player then
			if player.CameraMode == Enum.CameraMode.LockFirstPerson then
				this.currentZoom = 0
			else
				this.currentZoom = clamp(player.CameraMinZoomDistance, player.CameraMaxZoomDistance, desiredZoom)
			end
		end

		isFirstPerson = self:GetCameraZoom() < 2

		ShiftLockController:SetIsInFirstPerson(isFirstPerson)
		-- set mouse behavior
		self:UpdateMouseBehavior()
		return self:GetCameraZoom()
	end

	function this:rk4Integrator(position, velocity, t)
		local direction = velocity < 0 and -1 or 1
		local function acceleration(p, v)
			local accel = direction * math_max(1, (p / 3.3) + 0.5)
			return accel
		end

		local p1 = position
		local v1 = velocity
		local a1 = acceleration(p1, v1)
		local p2 = p1 + v1 * (t / 2)
		local v2 = v1 + a1 * (t / 2)
		local a2 = acceleration(p2, v2)
		local p3 = p1 + v2 * (t / 2)
		local v3 = v1 + a2 * (t / 2)
		local a3 = acceleration(p3, v3)
		local p4 = p1 + v3 * t
		local v4 = v1 + a3 * t
		local a4 = acceleration(p4, v4)

		local positionResult = position + (v1 + 2 * v2 + 2 * v3 + v4) * (t / 6)
		local velocityResult = velocity + (a1 + 2 * a2 + 2 * a3 + a4) * (t / 6)
		return positionResult, velocityResult
	end

	function this:ZoomCameraBy(zoomScale)
		local zoom = this:GetCameraActualZoom()

		if zoom then
			-- Can break into more steps to get more accurate integration
            zoom = self:rk4Integrator(zoom, zoomScale, 1)
			self:ZoomCamera(zoom)
		end
		return self:GetCameraZoom()
	end

	function this:ZoomCameraFixedBy(zoomIncrement)
		return self:ZoomCamera(self:GetCameraZoom() + zoomIncrement)
	end

	function this:Update()
	end

	----- VR STUFF ------

	function this:ApplyVRTransform()
		if not VRService.VREnabled then
			return
		end
		--we only want this to happen in first person VR
		local player = PlayersService.LocalPlayer
		if not (player and player.Character
				and player.Character:FindFirstChild("HumanoidRootPart")
				and player.Character.HumanoidRootPart:FindFirstChild("RootJoint")) then
			return
		end

		local camera = workspace.CurrentCamera
		local cameraSubject = camera.CameraSubject
		local isInVehicle = cameraSubject and cameraSubject:IsA('VehicleSeat')

		if this:IsInFirstPerson() and not isInVehicle then
			local vrFrame = VRService:GetUserCFrame(Enum.UserCFrame.Head)
			local vrRotation = vrFrame - vrFrame.p
			local rootJoint = player.Character.HumanoidRootPart.RootJoint
			rootJoint.C0 = CFrame.new(vrRotation:vectorToObjectSpace(vrFrame.p)) * CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
		else
			local rootJoint = player.Character.HumanoidRootPart.RootJoint
			rootJoint.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
		end
	end

	local vrRotationIntensityExists = true
	local lastVrRotationCheck = 0
	function this:ShouldUseVRRotation()
		if not VRService.VREnabled then
			return false
		end
		if not vrRotationIntensityExists and tick() - lastVrRotationCheck < 1 then return false end

		local success, vrRotationIntensity = pcall(function() return StarterGui:GetCore("VRRotationIntensity") end)
		vrRotationIntensityExists = success and vrRotationIntensity ~= nil
		lastVrRotationCheck = tick()

		return success and vrRotationIntensity ~= nil and vrRotationIntensity ~= "Smooth"
	end

	function this:GetVRRotationInput()
		local vrRotateSum = ZERO_VECTOR2

		local vrRotationIntensity = StarterGui:GetCore("VRRotationIntensity")

		local vrGamepadRotation = self.GamepadPanningCamera or ZERO_VECTOR2
		local delayExpired = (tick() - lastVRRotation) >= self:GetRepeatDelayValue(vrRotationIntensity)

		if math.abs(vrGamepadRotation.x) >= self:GetActivateValue() then
			if (delayExpired or not vrRotateKeyCooldown[Enum.KeyCode.Thumbstick2]) then
				local sign = 1
				if vrGamepadRotation.x < 0 then
					sign = -1
				end
				vrRotateSum = vrRotateSum + self:GetRotateAmountValue(vrRotationIntensity) * sign
				vrRotateKeyCooldown[Enum.KeyCode.Thumbstick2] = true
			end
		elseif math.abs(vrGamepadRotation.x) < self:GetActivateValue() - 0.1 then
			vrRotateKeyCooldown[Enum.KeyCode.Thumbstick2] = nil
		end
		if self.TurningLeft then
			if delayExpired or not vrRotateKeyCooldown[Enum.KeyCode.Left] then
				vrRotateSum = vrRotateSum - self:GetRotateAmountValue(vrRotationIntensity)
				vrRotateKeyCooldown[Enum.KeyCode.Left] = true
			end
		else
			vrRotateKeyCooldown[Enum.KeyCode.Left] = nil
		end
		if self.TurningRight then
			if (delayExpired or not vrRotateKeyCooldown[Enum.KeyCode.Right]) then
				vrRotateSum = vrRotateSum + self:GetRotateAmountValue(vrRotationIntensity)
				vrRotateKeyCooldown[Enum.KeyCode.Right] = true
			end
		else
			vrRotateKeyCooldown[Enum.KeyCode.Right] = nil
		end

		if vrRotateSum ~= ZERO_VECTOR2 then
			lastVRRotation = tick()
		end

		return vrRotateSum
	end

	local cameraTranslationConstraints = Vector3.new(1, 1, 1)
	local humanoidJumpOrigin = nil
	local trackingHumanoid = nil
	local cameraFrozen = false
	local subjectStateChangedConn = nil
	local cameraSubjectChangedConn = nil
	local workspaceChangedConn = nil
	local humanoidChildAddedConn = nil
	local humanoidChildRemovedConn = nil

	local function cancelCameraFreeze(keepConstraints)
		if not keepConstraints then
			cameraTranslationConstraints = Vector3.new(cameraTranslationConstraints.x, 1, cameraTranslationConstraints.z)
		end
		if cameraFrozen then
			trackingHumanoid = nil
			cameraFrozen = false
		end
	end

	local function startCameraFreeze(subjectPosition, humanoidToTrack)
		if not cameraFrozen then
			humanoidJumpOrigin = subjectPosition
			trackingHumanoid = humanoidToTrack
			cameraTranslationConstraints = Vector3.new(cameraTranslationConstraints.x, 0, cameraTranslationConstraints.z)
			cameraFrozen = true
		end
	end

	local function rescaleCameraOffset(newScaleFactor)
		R15HeadHeight = R15_HEAD_OFFSET*newScaleFactor
	end

	local function onHumanoidSubjectChildAdded(child)
		if child.Name == "BodyHeightScale" and child:IsA("NumberValue") then
			if heightScaleChangedConn then
				heightScaleChangedConn:disconnect()
			end
			heightScaleChangedConn = child.Changed:connect(rescaleCameraOffset)
			rescaleCameraOffset(child.Value)
		end
	end

	local function onHumanoidSubjectChildRemoved(child)
		if child.Name == "BodyHeightScale" then
			rescaleCameraOffset(1)
			if heightScaleChangedConn then
				heightScaleChangedConn:disconnect()
				heightScaleChangedConn = nil
			end
		end
	end

	local function onNewCameraSubject()
		if subjectStateChangedConn then
			subjectStateChangedConn:disconnect()
			subjectStateChangedConn = nil
		end
		if humanoidChildAddedConn then
			humanoidChildAddedConn:disconnect()
			humanoidChildAddedConn = nil
		end
		if humanoidChildRemovedConn then
			humanoidChildRemovedConn:disconnect()
			humanoidChildRemovedConn = nil
		end
		if heightScaleChangedConn then
			heightScaleChangedConn:disconnect()
			heightScaleChangedConn = nil
		end

		local humanoid = workspace.CurrentCamera and workspace.CurrentCamera.CameraSubject
		if trackingHumanoid ~= humanoid then
			cancelCameraFreeze()
		end
		if humanoid and humanoid:IsA('Humanoid') then
			humanoidChildAddedConn = humanoid.ChildAdded:connect(onHumanoidSubjectChildAdded)
			humanoidChildRemovedConn = humanoid.ChildRemoved:connect(onHumanoidSubjectChildRemoved)
			for _, child in pairs(humanoid:GetChildren()) do
				onHumanoidSubjectChildAdded(child)
			end

			subjectStateChangedConn = humanoid.StateChanged:connect(function(oldState, newState)
				if VRService.VREnabled and newState == Enum.HumanoidStateType.Jumping and not this:IsInFirstPerson() then
					startCameraFreeze(this:GetSubjectPosition(), humanoid)
				elseif newState ~= Enum.HumanoidStateType.Jumping and newState ~= Enum.HumanoidStateType.Freefall then
					cancelCameraFreeze(true)
				end
			end)
		end
	end

 	local function onCurrentCameraChanged()
		if cameraSubjectChangedConn then
			cameraSubjectChangedConn:disconnect()
			cameraSubjectChangedConn = nil
		end
  		local camera = workspace.CurrentCamera
  		if camera then
			cameraSubjectChangedConn = camera:GetPropertyChangedSignal("CameraSubject"):connect(onNewCameraSubject)
			onNewCameraSubject()
  		end
  	end

	function this:GetVRFocus(subjectPosition, timeDelta)
		local newFocus = nil

		local camera = workspace.CurrentCamera
		local lastFocus = self.LastCameraFocus or subjectPosition
		if not cameraFrozen then
			cameraTranslationConstraints = Vector3.new(cameraTranslationConstraints.x, math.min(1, cameraTranslationConstraints.y + 0.42 * timeDelta), cameraTranslationConstraints.z)
		end
		if cameraFrozen and humanoidJumpOrigin and humanoidJumpOrigin.y > lastFocus.y then
			newFocus = CFrame.new(Vector3.new(subjectPosition.x, math.min(humanoidJumpOrigin.y, lastFocus.y + 5 * timeDelta), subjectPosition.z))
		else
			newFocus = CFrame.new(Vector3.new(subjectPosition.x, lastFocus.y, subjectPosition.z):lerp(subjectPosition, cameraTranslationConstraints.y))
		end

		if cameraFrozen then
			-- No longer in 3rd person
			if self:IsInFirstPerson() then -- not VRService.VREnabled
				cancelCameraFreeze()
			end
			-- This case you jumped off a cliff and want to keep your character in view
			-- 0.5 is to fix floating point error when not jumping off cliffs
			if humanoidJumpOrigin and subjectPosition.y < (humanoidJumpOrigin.y - 0.5) then
				cancelCameraFreeze()
			end
		end

		return newFocus
	end

	------------------------

	---- Input Events ----
	local startPos = nil
	local lastPos = nil
	local panBeginLook = nil
	local lastTapTime = nil

	local fingerTouches = {}
	local NumUnsunkTouches = 0

	local inputStartPositions = {}
	local inputStartTimes = {}

	local StartingDiff = nil
	local pinchBeginZoom = nil

	this.ZoomEnabled = true
	this.PanEnabled = true
	this.KeyPanEnabled = true

	local function OnTouchBegan(input, processed)
		--If isDynamicThumbstickEnabled, then only process TouchBegan event if it starts in GestureArea

		local dtFrame = getDynamicThumbstickFrame()
		if (not touchWorkspaceEventEnabled and not isDynamicThumbstickEnabled) or positionIntersectsGuiObject(input.Position, GestureArea) and (not dtFrame or not positionIntersectsGuiObject(input.Position, dtFrame)) then
			fingerTouches[input] = processed
			if not processed then
				inputStartPositions[input] = input.Position
				inputStartTimes[input] = tick()
				NumUnsunkTouches = NumUnsunkTouches + 1
			end
		end
	end

	local function OnTouchChanged(input, processed)

		if fingerTouches[input] == nil then
			if isDynamicThumbstickEnabled then
				return
			end
			fingerTouches[input] = processed
			if not processed then
				NumUnsunkTouches = NumUnsunkTouches + 1
			end
		end

		if NumUnsunkTouches == 1 then
			if fingerTouches[input] == false then
				panBeginLook = panBeginLook or this:GetCameraLook()
				startPos = startPos or input.Position
				lastPos = lastPos or startPos
				this.UserPanningTheCamera = true

				local delta = input.Position - lastPos

				delta = Vector2.new(delta.X, delta.Y * GameSettings:GetCameraYInvertValue())

				if this.PanEnabled then
					local desiredXYVector = this:ScreenTranslationToAngle(delta) * TOUCH_SENSITIVTY
					this.RotateInput = this.RotateInput + desiredXYVector
				end

				lastPos = input.Position
			end
		else
			panBeginLook = nil
			startPos = nil
			lastPos = nil
			this.UserPanningTheCamera = false
		end
		if NumUnsunkTouches == 2 then
			local unsunkTouches = {}
			for touch, wasSunk in pairs(fingerTouches) do
				if not wasSunk then
					table.insert(unsunkTouches, touch)
				end
			end
			if #unsunkTouches == 2 then
				local difference = (unsunkTouches[1].Position - unsunkTouches[2].Position).magnitude
				if StartingDiff and pinchBeginZoom then
					local scale = difference / math_max(0.01, StartingDiff)
					local clampedScale = clamp(0.1, 10, scale)
					if this.ZoomEnabled then
						this:ZoomCamera(pinchBeginZoom / clampedScale)
					end
				else
					StartingDiff = difference
					pinchBeginZoom = this:GetCameraActualZoom()
				end
			end
		else
			StartingDiff = nil
			pinchBeginZoom = nil
		end
	end

	local function calcLookBehindRotateInput(torso)
		if torso then
			local newDesiredLook = (torso.CFrame.lookVector - Vector3.new(0, math.sin(math.rad(DEFAULT_CAMERA_ANGLE), 0))).unit
			local horizontalShift = findAngleBetweenXZVectors(newDesiredLook, this:GetCameraLook())
			local vertShift = math.asin(this:GetCameraLook().y) - math.asin(newDesiredLook.y)
			if not IsFinite(horizontalShift) then
				horizontalShift = 0
			end
			if not IsFinite(vertShift) then
				vertShift = 0
			end

			return Vector2.new(horizontalShift, vertShift)
		end
		return nil
	end

	local OnTouchTap = nil
	if not touchWorkspaceEventEnabled then
		OnTouchTap = function(position)
			if isDynamicThumbstickEnabled and not IsAToolEquipped then
				if lastTapTime and tick() - lastTapTime < MAX_TIME_FOR_DOUBLE_TAP then
					local tween = {
						from = this:GetCameraZoom(),
						to = DefaultZoom,
						start = tick(),
						duration = 0.2,
						func = function(from, to, alpha)
							this:ZoomCamera(from + (to - from)*alpha)
							return to
						end
					}
					tweens["Zoom"] = tween
				else
					local humanoid = this:GetHumanoid()
					if humanoid then
						local player = PlayersService.LocalPlayer
						if player and player.Character then
							if humanoid and humanoid.Torso then
								local tween = {
									from = this.RotateInput,
									to = calcLookBehindRotateInput(humanoid.Torso),
									start = tick(),
									duration = 0.2,
									func = function(from, to, alpha)
										to = calcLookBehindRotateInput(humanoid.Torso)
										if to then
											this.RotateInput = from + (to - from)*alpha
										end
										return to
									end
								}
								tweens["Rotate"] = tween

								-- reset old camera info so follow cam doesn't rotate us
								this.LastCameraTransform = nil
							end
						end
					end
				end
				lastTapTime = tick()
			end
		end
	end

	local function IsTouchTap(input)
		-- We can't make the assumption that the input exists in the inputStartPositions because we may have switched from a different camera type.
		if inputStartPositions[input] then
			local posDelta = (inputStartPositions[input] - input.Position).magnitude
			if posDelta < MAX_TAP_POS_DELTA then
				local timeDelta = inputStartTimes[input] - tick()
				if timeDelta < MAX_TAP_TIME_DELTA then
					return true
				end
			end
		end
		return false
	end

	local function OnTouchEnded(input, processed)
		if fingerTouches[input] == false then
			if NumUnsunkTouches == 1 then
				panBeginLook = nil
				startPos = nil
				lastPos = nil
				this.UserPanningTheCamera = false
				if not touchWorkspaceEventEnabled and IsTouchTap(input) then
					OnTouchTap(input.Position)
				end
			elseif NumUnsunkTouches == 2 then
				StartingDiff = nil
				pinchBeginZoom = nil
			end
		end

		if fingerTouches[input] ~= nil and fingerTouches[input] == false then
			NumUnsunkTouches = NumUnsunkTouches - 1
		end
		fingerTouches[input] = nil
		inputStartPositions[input] = nil
		inputStartTimes[input] = nil
	end

	local function OnMousePanButtonPressed(input, processed)
		if processed then return end
		this:UpdateMouseBehavior()
		panBeginLook = panBeginLook or this:GetCameraLook()
		startPos = startPos or input.Position
		lastPos = lastPos or startPos
		this.UserPanningTheCamera = true
	end

	local function OnMousePanButtonReleased(input, processed)
		this:UpdateMouseBehavior()
		if not (isRightMouseDown or isMiddleMouseDown) then
			panBeginLook = nil
			startPos = nil
			lastPos = nil
			this.UserPanningTheCamera = false
		end
	end

	local function OnMouse2Down(input, processed)
		if processed then return end

		isRightMouseDown = true
		OnMousePanButtonPressed(input, processed)
	end

	local function OnMouse2Up(input, processed)
		isRightMouseDown = false
		OnMousePanButtonReleased(input, processed)
	end

	local function OnMouse3Down(input, processed)
		if processed then return end

		isMiddleMouseDown = true
		OnMousePanButtonPressed(input, processed)
	end

	local function OnMouse3Up(input, processed)
		isMiddleMouseDown = false
		OnMousePanButtonReleased(input, processed)
	end

	local function OnMouseMoved(input, processed)
		if not hasGameLoaded and VRService.VREnabled then
			return
		end

		local inputDelta = input.Delta
		inputDelta = Vector2.new(inputDelta.X, inputDelta.Y * GameSettings:GetCameraYInvertValue())

		if startPos and lastPos and panBeginLook then
			local currPos = lastPos + input.Delta
			local totalTrans = currPos - startPos
			if this.PanEnabled then
				local desiredXYVector = this:MouseTranslationToAngle(inputDelta) * MOUSE_SENSITIVITY
				this.RotateInput = this.RotateInput + desiredXYVector
			end
			lastPos = currPos
		elseif this:IsInFirstPerson() or this:GetShiftLock() then
			if this.PanEnabled then
				local desiredXYVector = this:MouseTranslationToAngle(inputDelta) * MOUSE_SENSITIVITY
				this.RotateInput = this.RotateInput + desiredXYVector
			end
		end
	end

	local function OnMouseWheel(input, processed)
		if not hasGameLoaded and VRService.VREnabled then
			return
		end
		if not processed then
			if this.ZoomEnabled then
                this:ZoomCameraBy(clamp(-1, 1, -input.Position.Z) * 1.4)
			end
		end
	end

	local function round(num)
		return math_floor(num + 0.5)
	end

	local eight2Pi = math_pi / 4

	local function rotateVectorByAngleAndRound(camLook, rotateAngle, roundAmount)
		if camLook ~= ZERO_VECTOR3 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

	local function OnKeyDown(input, processed)
		if not hasGameLoaded and VRService.VREnabled then
			return
		end
		if processed then return end
		if this.ZoomEnabled then
			if input.KeyCode == Enum.KeyCode.I then
				this:ZoomCameraBy(-5)
			elseif input.KeyCode == Enum.KeyCode.O then
				this:ZoomCameraBy(5)
			end
		end
		if panBeginLook == nil and this.KeyPanEnabled then
			if input.KeyCode == Enum.KeyCode.Left then
				this.TurningLeft = true
			elseif input.KeyCode == Enum.KeyCode.Right then
				this.TurningRight = true
			elseif input.KeyCode == Enum.KeyCode.Comma then
				local angle = rotateVectorByAngleAndRound(this:GetCameraLook() * Vector3.new(1,0,1), -eight2Pi * (3/4), eight2Pi)
				if angle ~= 0 then
					this.RotateInput = this.RotateInput + Vector2.new(angle, 0)
					this.LastUserPanCamera = tick()
					this.LastCameraTransform = nil
				end
			elseif input.KeyCode == Enum.KeyCode.Period then
				local angle = rotateVectorByAngleAndRound(this:GetCameraLook() * Vector3.new(1,0,1), eight2Pi * (3/4), eight2Pi)
				if angle ~= 0 then
					this.RotateInput = this.RotateInput + Vector2.new(angle, 0)
					this.LastUserPanCamera = tick()
					this.LastCameraTransform = nil
				end
			elseif input.KeyCode == Enum.KeyCode.PageUp then
			--elseif input.KeyCode == Enum.KeyCode.Home then
				this.RotateInput = this.RotateInput + Vector2.new(0,math.rad(15))
				this.LastCameraTransform = nil
			elseif input.KeyCode == Enum.KeyCode.PageDown then
			--elseif input.KeyCode == Enum.KeyCode.End then
				this.RotateInput = this.RotateInput + Vector2.new(0,math.rad(-15))
				this.LastCameraTransform = nil
			end
		end
	end

	local function OnKeyUp(input, processed)
		if input.KeyCode == Enum.KeyCode.Left then
			this.TurningLeft = false
		elseif input.KeyCode == Enum.KeyCode.Right then
			this.TurningRight = false
		end
	end

	local lastThumbstickRotate = nil
	local numOfSeconds = 0.7
	local currentSpeed = 0
	local maxSpeed = 6
	local vrMaxSpeed = 4
	local lastThumbstickPos = Vector2.new(0,0)
	local ySensitivity = 0.65
	local lastVelocity = nil

	-- K is a tunable parameter that changes the shape of the S-curve
	-- the larger K is the more straight/linear the curve gets
	local k = 0.35
	local lowerK = 0.8
	local function SCurveTranform(t)
		t = clamp(-1,1,t)
		if t >= 0 then
			return (k*t) / (k - t + 1)
		end
		return -((lowerK*-t) / (lowerK + t + 1))
	end

	-- DEADZONE
	local DEADZONE = 0.1
	local function toSCurveSpace(t)
		return (1 + DEADZONE) * (2*math.abs(t) - 1) - DEADZONE
	end

	local function fromSCurveSpace(t)
		return t/2 + 0.5
	end

	local function gamepadLinearToCurve(thumbstickPosition)
		local function onAxis(axisValue)
			local sign = 1
			if axisValue < 0 then
				sign = -1
			end
			local point = fromSCurveSpace(SCurveTranform(toSCurveSpace(math.abs(axisValue))))
			point = point * sign
			return clamp(-1, 1, point)
		end
		return Vector2_new(onAxis(thumbstickPosition.x), onAxis(thumbstickPosition.y))
	end

	function this:UpdateGamepad()
		local gamepadPan = this.GamepadPanningCamera
		if gamepadPan and (hasGameLoaded or not VRService.VREnabled) then
			gamepadPan = gamepadLinearToCurve(gamepadPan)
			local currentTime = tick()
			if gamepadPan.X ~= 0 or gamepadPan.Y ~= 0 then
				this.userPanningTheCamera = true
			elseif gamepadPan == ZERO_VECTOR2 then
				lastThumbstickRotate = nil
				if lastThumbstickPos == ZERO_VECTOR2 then
					currentSpeed = 0
				end
			end

			local finalConstant = 0

			if lastThumbstickRotate then
				if VRService.VREnabled then
					currentSpeed = vrMaxSpeed
				else
					local elapsedTime = (currentTime - lastThumbstickRotate) * 10
					currentSpeed = currentSpeed + (maxSpeed * ((elapsedTime*elapsedTime)/numOfSeconds))

					if currentSpeed > maxSpeed then currentSpeed = maxSpeed end

					if lastVelocity then
						local velocity = (gamepadPan - lastThumbstickPos)/(currentTime - lastThumbstickRotate)
						local velocityDeltaMag = (velocity - lastVelocity).magnitude

						if velocityDeltaMag > 12 then
							currentSpeed = currentSpeed * (20/velocityDeltaMag)
							if currentSpeed > maxSpeed then currentSpeed = maxSpeed end
						end
					end
				end

				local success, gamepadCameraSensitivity = pcall(function() return GameSettings.GamepadCameraSensitivity end)
				finalConstant = success and (gamepadCameraSensitivity * currentSpeed) or currentSpeed
				lastVelocity = (gamepadPan - lastThumbstickPos)/(currentTime - lastThumbstickRotate)
			end

			lastThumbstickPos = gamepadPan
			lastThumbstickRotate = currentTime

			return Vector2_new( gamepadPan.X * finalConstant, gamepadPan.Y * finalConstant * ySensitivity * GameSettings:GetCameraYInvertValue())
		end

		return ZERO_VECTOR2
	end

	local InputBeganConn, InputChangedConn, InputEndedConn, MenuOpenedConn, ShiftLockToggleConn, GamepadConnectedConn, GamepadDisconnectedConn, TouchActivateConn = nil, nil, nil, nil, nil, nil, nil, nil

	function this:DisconnectInputEvents()
		if InputBeganConn then
			InputBeganConn:disconnect()
			InputBeganConn = nil
		end
		if InputChangedConn then
			InputChangedConn:disconnect()
			InputChangedConn = nil
		end
		if InputEndedConn then
			InputEndedConn:disconnect()
			InputEndedConn = nil
		end
		if MenuOpenedConn then
			MenuOpenedConn:disconnect()
			MenuOpenedConn = nil
		end
		if ShiftLockToggleConn then
			ShiftLockToggleConn:disconnect()
			ShiftLockToggleConn = nil
		end
		if GamepadConnectedConn then
			GamepadConnectedConn:disconnect()
			GamepadConnectedConn = nil
		end
		if GamepadDisconnectedConn then
			GamepadDisconnectedConn:disconnect()
			GamepadDisconnectedConn = nil
		end
		if subjectStateChangedConn then
			subjectStateChangedConn:disconnect()
			subjectStateChangedConn = nil
		end
		if workspaceChangedConn then
			workspaceChangedConn:disconnect()
			workspaceChangedConn = nil
		end
		if TouchActivateConn then
			TouchActivateConn:disconnect()
			TouchActivateConn = nil
		end

		this.TurningLeft = false
		this.TurningRight = false
		this.LastCameraTransform = nil
		self.LastSubjectCFrame = nil
		this.UserPanningTheCamera = false
		this.RotateInput = Vector2.new()
		this.GamepadPanningCamera = Vector2.new(0,0)

		-- Reset input states
		startPos = nil
		lastPos = nil
		panBeginLook = nil
		isRightMouseDown = false
		isMiddleMouseDown = false

		fingerTouches = {}
		NumUnsunkTouches = 0

		StartingDiff = nil
		pinchBeginZoom = nil

		-- Unlock mouse for example if right mouse button was being held down
		if UserInputService.MouseBehavior ~= Enum.MouseBehavior.LockCenter then
			UserInputService.MouseBehavior = Enum.MouseBehavior.Default
		end
	end

	function this:ResetInputStates()
		isRightMouseDown = false
		isMiddleMouseDown = false
		OnMousePanButtonReleased() -- this function doesn't seem to actually need parameters

		if UserInputService.TouchEnabled then
			--[[menu opening was causing serious touch issues
			this should disable all active touch events if
			they're active when menu opens.]]
			for inputObject, value in pairs(fingerTouches) do
				fingerTouches[inputObject] = nil
			end
			panBeginLook = nil
			startPos = nil
			lastPos = nil
			this.UserPanningTheCamera = false
			StartingDiff = nil
			pinchBeginZoom = nil
			NumUnsunkTouches = 0
		end
	end

	function this.getGamepadPan(name, state, input)
		if state == Enum.UserInputState.Cancel then
			this.GamepadPanningCamera = ZERO_VECTOR2
			return
		end

		if input.UserInputType == this.activeGamepad and input.KeyCode == Enum.KeyCode.Thumbstick2 then
			local inputVector = Vector2.new(input.Position.X, -input.Position.Y)
			if inputVector.magnitude > THUMBSTICK_DEADZONE then
				this.GamepadPanningCamera = Vector2_new(input.Position.X, -input.Position.Y)
			else
				this.GamepadPanningCamera = ZERO_VECTOR2
			end
		end
	end

	function this.doGamepadZoom(name, state, input)
		if input.UserInputType == this.activeGamepad and input.KeyCode == Enum.KeyCode.ButtonR3 and state == Enum.UserInputState.Begin then
			if this.ZoomEnabled then
				if this:GetCameraZoom() > 0.5 then
					this:ZoomCamera(0)
				else
					this:ZoomCamera(10)
				end
			end
		end
	end

	function this:BindGamepadInputActions()
		ContextActionService:BindAction("RootCamGamepadPan", this.getGamepadPan, false, Enum.KeyCode.Thumbstick2)
		ContextActionService:BindAction("RootCamGamepadZoom", this.doGamepadZoom, false, Enum.KeyCode.ButtonR3)
	end

	function this:ConnectInputEvents()
		InputBeganConn = UserInputService.InputBegan:connect(function(input, processed)
			if input.UserInputType == Enum.UserInputType.Touch then
				OnTouchBegan(input, processed)
			elseif input.UserInputType == Enum.UserInputType.MouseButton2 then
				OnMouse2Down(input, processed)
			elseif input.UserInputType == Enum.UserInputType.MouseButton3 then
				OnMouse3Down(input, processed)
			end
			-- Keyboard
			if input.UserInputType == Enum.UserInputType.Keyboard then
				OnKeyDown(input, processed)
			end
		end)

		InputChangedConn = UserInputService.InputChanged:connect(function(input, processed)
			if input.UserInputType == Enum.UserInputType.Touch then
				OnTouchChanged(input, processed)
			elseif input.UserInputType == Enum.UserInputType.MouseMovement then
				OnMouseMoved(input, processed)
			elseif input.UserInputType == Enum.UserInputType.MouseWheel then
				OnMouseWheel(input, processed)
			end
		end)

		InputEndedConn = UserInputService.InputEnded:connect(function(input, processed)
			if input.UserInputType == Enum.UserInputType.Touch then
				OnTouchEnded(input, processed)
			elseif input.UserInputType == Enum.UserInputType.MouseButton2 then
				OnMouse2Up(input, processed)
			elseif input.UserInputType == Enum.UserInputType.MouseButton3 then
				OnMouse3Up(input, processed)
			end
			-- Keyboard
			if input.UserInputType == Enum.UserInputType.Keyboard then
				OnKeyUp(input, processed)
			end
		end)

		MenuOpenedConn = GuiService.MenuOpened:connect(function()
			this:ResetInputStates()
		end)

		workspaceChangedConn = workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(onCurrentCameraChanged)
		if workspace.CurrentCamera then
			onCurrentCameraChanged()
		end

		ShiftLockToggleConn = ShiftLockController.OnShiftLockToggled.Event:connect(function()
			this:UpdateMouseBehavior()
		end)

		this.RotateInput = Vector2.new()

		this.activeGamepad = nil
		local function assignActivateGamepad()
			local connectedGamepads = UserInputService:GetConnectedGamepads()
			if #connectedGamepads > 0 then
				for i = 1, #connectedGamepads do
					if this.activeGamepad == nil then
						this.activeGamepad = connectedGamepads[i]
					elseif connectedGamepads[i].Value < this.activeGamepad.Value then
						this.activeGamepad = connectedGamepads[i]
					end
				end
			end

			if this.activeGamepad == nil then -- nothing is connected, at least set up for gamepad1
				this.activeGamepad = Enum.UserInputType.Gamepad1
			end
		end

		GamepadConnectedConn = UserInputService.GamepadDisconnected:connect(function(gamepadEnum)
			if this.activeGamepad ~= gamepadEnum then return end
			this.activeGamepad = nil
			assignActivateGamepad()
		end)

		GamepadDisconnectedConn = UserInputService.GamepadConnected:connect(function(gamepadEnum)
			if this.activeGamepad == nil then
				assignActivateGamepad()
			end
		end)

		self:BindGamepadInputActions()

		assignActivateGamepad()

		-- set mouse behavior
		self:UpdateMouseBehavior()
	end

	--Process tweens related to tap-to-recenter and double-tap-to-zoom
	--Needs to be called from specific cameras on each update
	function this:ProcessTweens()
		for name, tween in pairs(tweens) do
			local alpha = math.min(1.0, (tick() - tween.start)/tween.duration)
			tween.to = tween.func(tween.from, tween.to, alpha)
			if math.abs(1 - alpha) < 0.0001 then
				tweens[name] = nil
			end
		end
	end

	function this:SetEnabled(newState)
		if newState ~= self.Enabled then
			self.Enabled = newState
			if self.Enabled then
				self:ConnectInputEvents()
				self.cframe = workspace.CurrentCamera.CFrame
			else
				self:DisconnectInputEvents()
			end
		end
	end

	local function OnPlayerAdded(player)
		player.Changed:connect(function(prop)
			if this.Enabled then
				if prop == "CameraMode" or prop == "CameraMaxZoomDistance" or prop == "CameraMinZoomDistance" then
					 this:ZoomCameraFixedBy(0)
				end
			end
		end)

		local function OnCharacterAdded(newCharacter)

			local humanoid = findPlayerHumanoid(player)
			local start = tick()
			while tick() - start < 0.3 and (humanoid == nil or humanoid.Torso == nil) do
				wait()
				humanoid = findPlayerHumanoid(player)
			end

			if humanoid and humanoid.Torso and player.Character == newCharacter then
				local newDesiredLook = (humanoid.Torso.CFrame.lookVector - Vector3.new(0, math.sin(math.rad(DEFAULT_CAMERA_ANGLE)), 0)).unit
				local horizontalShift = findAngleBetweenXZVectors(newDesiredLook, this:GetCameraLook())
				local vertShift = math.asin(this:GetCameraLook().y) - math.asin(newDesiredLook.y)
				if not IsFinite(horizontalShift) then
					horizontalShift = 0
				end
				if not IsFinite(vertShift) then
					vertShift = 0
				end
				this.RotateInput = Vector2.new(horizontalShift, vertShift)

				-- reset old camera info so follow cam doesn't rotate us
				this.LastCameraTransform = nil
			end

			-- Need to wait for camera cframe to update before we zoom in
			-- Not waiting will force camera to original cframe
			wait()
			this:ZoomCamera(this.DefaultZoom)
		end

		player.CharacterAdded:connect(function(character)
			if this.Enabled or SetCameraOnSpawn then
				OnCharacterAdded(character)
				SetCameraOnSpawn = false
			end
		end)
		if player.Character then
			spawn(function() OnCharacterAdded(player.Character) end)
		end
	end
	if PlayersService.LocalPlayer then
		OnPlayerAdded(PlayersService.LocalPlayer)
	end
	PlayersService.ChildAdded:connect(function(child)
		if child and PlayersService.LocalPlayer == child then
			OnPlayerAdded(PlayersService.LocalPlayer)
		end
	end)

	local function OnGameLoaded()
		hasGameLoaded = true
	end

	spawn(function()
		if game:IsLoaded() then
			OnGameLoaded()
		else
			game.Loaded:wait()
			OnGameLoaded()
		end
	end)

	local function OnDynamicThumbstickEnabled()
		if UserInputService.TouchEnabled then
			isDynamicThumbstickEnabled = true
		end
	end

	local function OnDynamicThumbstickDisabled()
		isDynamicThumbstickEnabled = false
	end

	local function OnGameSettingsTouchMovementModeChanged()
		if LocalPlayer.DevTouchMovementMode == Enum.DevTouchMovementMode.UserChoice then
			if GameSettings.TouchMovementMode.Name == "DynamicThumbstick" then
				OnDynamicThumbstickEnabled()
			else
				OnDynamicThumbstickDisabled()
			end
		end
	end

	local function OnDevTouchMovementModeChanged()
		if LocalPlayer.DevTouchMovementMode.Name == "DynamicThumbstick" then
			OnDynamicThumbstickEnabled()
		else
			OnGameSettingsTouchMovementModeChanged()
		end
	end

	if PlayersService.LocalPlayer then
		PlayersService.LocalPlayer.Changed:Connect(function(prop)
			if prop == "DevTouchMovementMode" then
				OnDevTouchMovementModeChanged()
			end
		end)
		OnDevTouchMovementModeChanged()
	end

	GameSettings.Changed:Connect(function(prop)
		if prop == "TouchMovementMode" then
			OnGameSettingsTouchMovementModeChanged()
		end
	end)
	OnGameSettingsTouchMovementModeChanged()
	GameSettings:SetCameraYInvertVisible()
	pcall(function() GameSettings:SetGamepadCameraSensitivityVisible() end)

	return this
end

return CreateCamera


Prompt:
--[[
	A special key for property tables, which stores a reference to the instance
	in a user-provided Value object.
]]

Response:
local Package = script.Parent.Parent
local PubTypes = require(Package.PubTypes)
local logError = require(Package.Logging.logError)
local xtypeof = require(Package.Utility.xtypeof)

local Ref = {}
Ref.type = "SpecialKey"
Ref.kind = "Ref"
Ref.stage = "observer"

function Ref:apply(refState: any, applyTo: Instance, cleanupTasks: {PubTypes.Task})
	if xtypeof(refState) ~= "State" or refState.kind ~= "Value" then
		logError("invalidRefType")
	else
		refState:set(applyTo)
		table.insert(cleanupTasks, function()
			refState:set(nil)
		end)
	end
end

return Ref


Prompt: --[[Engine]]

Response:
--

	-- Everything below can be illustrated and tuned with the graph below.
	-- https://www.desmos.com/calculator/x1h2vdccu1
	-- This includes everything, from the engines, to boost, to electric.

	-- Naturally Aspirated Engine
	Tune.Engine 		= true

		Tune.IdleRPM		= 1000
		Tune.Redline		= 13000
		Tune.PeakRPM		= 11000
		-- Horsepower
		Tune.Horsepower		= 180
		Tune.MH_PeakRPM		= Tune.PeakRPM
		Tune.MH_PeakSharp	= 2
		Tune.MH_CurveMult	= 0.02
		-- Torque
		Tune.M_EqPoint		= 9500
		Tune.MT_PeakRPM		= 11000
		Tune.MT_PeakSharp	= 2
		Tune.MT_CurveMult	= 0.02

	-- Electric Engine
	Tune.Electric		= false

		Tune.E_Redline	= 16000
		Tune.E_Trans1	= 4000
		Tune.E_Trans2	= 9000
		-- Horsepower
		Tune.E_Horsepower	= 223
		Tune.EH_FrontMult	= 0.15
		Tune.EH_EndMult		= 2.9
		Tune.EH_EndPercent	= 7
		-- Torque
		Tune.E_Torque		= 223
		Tune.ET_EndMult		= 1.505
		Tune.ET_EndPercent	= 27.5

	-- Turbocharger
	Tune.Turbochargers	= 0				-- Number of turbochargers in the engine
										-- Set to 0 for no turbochargers
		Tune.T_Boost		= 7
		Tune.T_Efficiency	= 6
		--Horsepower
		Tune.TH_PeakSharp	= 2
		Tune.TH_CurveMult	= 0.02
		--Torque
		Tune.TT_PeakSharp	= 2
		Tune.TT_CurveMult	= 0.02

		Tune.T_Size			= 80		-- Turbo Size; Bigger size = more turbo lag

	-- Supercharger
	Tune.Superchargers	= 0				-- Number of superchargers in the engine
										-- Set to 0 for no superchargers
		Tune.S_Boost		= 5
		Tune.S_Efficiency	= 6
		--Horsepower
		Tune.SH_PeakSharp	= 2
		Tune.SH_CurveMult	= 0.02
		--Torque
		Tune.ST_PeakSharp	= 2
		Tune.ST_CurveMult	= 0.02

		Tune.S_Sensitivity	= 0.05		-- Supercharger responsiveness/sensitivity, applied per tick (recommended values between 0.05 to 0.1)

	--Misc
	Tune.RevAccel		= 250		-- 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.Flywheel		= 500		-- Flywheel weight (higher = faster response, lower = more stable RPM)

	--Aero
	Tune.Drag			= 0.5		-- 0 to 1, edit to change drag effect (0 = no effect, 1 = full effect)


Response:
This = script.Parent
Elevator = This.Parent.Parent.Parent
CustomLabel = require(This.Parent.Parent.Parent.CustomLabel)
Characters = require(script.Characters)

CustomText = CustomLabel["CUSTOMFLOORLABEL"]

Elevator:WaitForChild("Floor").Changed:connect(function(floor)
  --custom indicator code--
  ChangeFloor(tostring(floor))
end)

function ChangeFloor(SF)
	if CustomText[tonumber(SF)] then
		SF = CustomText[tonumber(SF)]
	end
	SetDisplay(1,(string.len(SF) == 2 and SF:sub(1,1) or "NIL"))
	SetDisplay(2,(string.len(SF) == 2 and SF:sub(2,2) or SF))
end

function SetDisplay(ID,CHAR)
	if This.Display:FindFirstChild("DIG"..ID) and Characters[CHAR] ~= nil then
 		for i,l in pairs(Characters[CHAR]) do
			for r=1,7 do
				This.Display["DIG"..ID]["D"..r].Transparency = (l:sub(r,r) == "1" and 0 or 0.99)
			end
		end
	end
end


Prompt: --Code--

Response:
local function PlayerTouched(Part)
	local Parent = Part.Parent
	if game.Players:GetPlayerFromCharacter(Parent) then
		Parent.Humanoid.Health = 5
	end
end

Brick.Touched:connect(PlayerTouched)


Prompt:
--[[**
	Calls each Object's `MethodName` (or calls the Object if `MethodName == true`) and removes them from the Janitor. Also clears the namespace. This function is also called when you call a Janitor Object (so it can be used as a destructor callback).
	@returns [t:void]
**--]]

Response:
function Janitor.__index:Cleanup()
	if not self.CurrentlyCleaning then
		self.CurrentlyCleaning = nil
		for Object, MethodName in next, self do
			if Object == IndicesReference then
				continue
			end

			-- Weird decision to rawset directly to the janitor in Agent. This should protect against it though.
			local TypeOf = type(Object)
			if TypeOf == "string" or TypeOf == "number" then
				self[Object] = nil
				continue
			end

			if MethodName == true then
				Object()
			else
				local ObjectMethod = Object[MethodName]
				if ObjectMethod then
					ObjectMethod(Object)
				end
			end

			self[Object] = nil
		end

		local This = self[IndicesReference]
		if This then
			for Index in next, This do
				This[Index] = nil
			end

			self[IndicesReference] = {}
		end

		self.CurrentlyCleaning = false
	end
end

Janitor.__index.Clean = Janitor.__index.Cleanup


Prompt: --Precalculated paths

Response:
local t,f,n=true,false,{}
local r={
[58]={{23,58},t},
[49]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{23,62,63,19},t},
[59]={{23,58,56,30,41,59},t},
[63]={{23,62,63},t},
[34]={{23,58,56,30,41,39,35,34},t},
[21]={{23,62,20,21},t},
[48]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48},t},
[27]={{23,58,56,30,41,39,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{23,58,56,30,41,39,35,34,32,31},t},
[56]={{23,58,56},t},
[29]={{23,58,56,30,41,39,35,34,32,31,29},t},
[13]={n,f},
[47]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45},t},
[57]={{23,58,57},t},
[36]={{23,58,56,30,41,39,35,37,36},t},
[25]={{23,58,56,30,41,39,35,34,32,31,29,28,27,26,25},t},
[71]={{23,58,56,30,41,59,61,71},t},
[20]={{23,62,20},t},
[60]={{23,58,56,30,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{23,58,56,30,41,59,61,71,72,76,73,75},t},
[22]={{23,62,20,21,22},t},
[74]={{23,58,56,30,41,59,61,71,72,76,73,74},t},
[62]={{23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{23,58,56,30,41,39,35,37},t},
[2]={n,f},
[35]={{23,58,56,30,41,39,35},t},
[53]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{23,58,56,30,41,59,61,71,72,76,73},t},
[72]={{23,58,56,30,41,59,61,71,72},t},
[33]={{23,58,56,30,41,39,35,37,36,33},t},
[69]={{23,58,56,30,41,60,69},t},
[65]={{23,62,63,66,64,65},t},
[26]={{23,58,56,30,41,39,35,34,32,31,29,28,27,26},t},
[68]={{23,62,63,66,64,67,68},t},
[76]={{23,58,56,30,41,59,61,71,72,76},t},
[50]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{23,62,63,66},t},
[10]={n,f},
[24]={{23,58,56,30,41,39,35,34,32,31,29,28,27,26,25,24},t},
[23]={{23},t},
[44]={{23,58,56,30,41,39,35,34,32,31,29,28,44},t},
[39]={{23,58,56,30,41,39},t},
[32]={{23,58,56,30,41,39,35,34,32},t},
[3]={n,f},
[30]={{23,58,56,30},t},
[51]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{23,62,63,66,64,67},t},
[61]={{23,58,56,30,41,59,61},t},
[55]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{23,58,56,30,41,39,40,38,42},t},
[40]={{23,58,56,30,41,39,40},t},
[52]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{23,58,56,30,41},t},
[17]={n,f},
[38]={{23,58,56,30,41,39,40,38},t},
[28]={{23,58,56,30,41,39,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{23,62,63,66,64},t},
}
return r


Prompt: ---- Change these settings to change stuff (keep the commas, lua doesn't understand n00b syntax)

Response:
local settings = {
	splatters_per_health_inc = 1,     ---- The amount of blood splatters made when you lose (damage_inc) of health
	damage_inc = 2,                   ---- The increment of damage that must be done at a time to trigger blood splatters
	remove_time = 65,                 ---- The time (in seconds) until a blood splatter is removed after it is created
	min_splatter_time = 0,            ---- The delay time (minimum) until another blood splatter is made
	max_splatter_time = 0.05,         ---- The delay time (maximum) until another blood splatter is made
	min_transparency = 0.2,           ---- The (minimum) transparency of a blood splatter
	max_transparency = 0,             ---- The (maximum) transparency of a blood splatter
	min_size_x = 3,                 ---- The (minimum) size of a blood splatter on the X axis
	max_size_x = 8,                   ---- The (maximum) size of a blood splatter on the X axis
	min_size_z = 3,                 ---- The (minimum) size of a blood splatter on the Z axis
	max_size_z = 8,                   ---- The (maximum) size of a blood splatter on the Z axis
	tran_tw_time_min = 0.1,           ---- The (minimum) time to tween the size of a blood splatter
	tran_tw_time_max = 0.5,           ---- The (maximum) time to tween the size of a blood splatter
	size_tw_time_min = 0.1,           ---- The (minimum) time to tween the transparency of a blood splatter
	size_tw_time_max = 0.6            ---- The (maximum) time to tween the transparency of a blood splatter
}


Prompt: -- SERVICES --

Response:
local CS = game:GetService("CollectionService")
local StarterPlayer = game:GetService("StarterPlayer")


Prompt: -- list of account names allowed to go through the door.

Response:
permission = {"Player1", "Player2", "Player3"}--Put your friends name's here. You can add more.

function checkOkToLetIn(name)
	for i = 1,#permission do
		-- convert strings to all upper case, otherwise we will let in,
		-- "conrad105," and, "builderman," but not, "blast1."
                -- Why? Because, "blast1," is how it is spelled in the permissions.
		if (string.upper(name) == string.upper(permission[i])) then return true end
	end
	return false
end

local Door = script.Parent

function onTouched(hit)
	print("Door Hit")
	local human = hit.Parent:findFirstChild("Humanoid")
	if (human ~= nil ) then
		-- a human has touched this door!
		print("Human touched door")
		-- test the human's name against the permission list
		if (checkOkToLetIn(human.Parent.Name)) then
			print("Human passed test")
			Door.Transparency = 0.7
			Door.CanCollide = false
			wait(4) -- this is how long the door is open
			Door.CanCollide = true
			Door.Transparency = 0
		else human.Health= 0 -- delete this line of you want a non-killing VIP door
		end
	end
end

script.Parent.Touched:connect(onTouched)


Prompt:
--[[**
	ensures all keys in given table pass check

	@param check The function to use to check the keys

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

Response:
function t.keys(check)
	assert(t.callback(check))
	return function(value)
		local tableSuccess, tableErrMsg = t.table(value)
		if tableSuccess == false then
			return false, tableErrMsg or ""
		end

		for key in pairs(value) do
			local success, errMsg = check(key)
			if success == false then
				return false, string.format("bad key %s:\n\t%s", tostring(key), errMsg or "")
			end
		end

		return true
	end
end


Prompt: -- Reset broken lights

Response:
function ResetLights()
	for i, lData in pairs(dParts.Lights) do
		lData[1].Material = lData[2]
		lData[1].Broken:Destroy()

		for _, light in pairs(lData[1]:GetChildren()) do
			if light:IsA("Light") then
				light.Enabled = true
			end
		end
	end
end


Prompt: -- ROBLOX FIXME: Can we define ClientChatModules statically in the project config

Response:
pcall(function() ChatLocalization = require((game:GetService("Chat") :: any).ClientChatModules.ChatLocalization :: any) end)
if ChatLocalization == nil then ChatLocalization = {} end

if not ChatLocalization.FormatMessageToSend or not ChatLocalization.LocalizeFormattedMessage then
	function ChatLocalization:FormatMessageToSend(key,default) return default end
end

local function Run(ChatService)

	local function ShowJoinAndLeaveCommands()
		if ChatSettings.ShowJoinAndLeaveHelpText ~= nil then
			return ChatSettings.ShowJoinAndLeaveHelpText
		end
		return false
	end

	local function ProcessCommandsFunction(fromSpeaker, message, channel)
		if (message:lower() == "/?" or message:lower() == "/help") then
			local speaker = ChatService:GetSpeaker(fromSpeaker)
			speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_Desc","These are the basic chat commands."), channel)
			if ChatSettings.AllowMeCommand then
				speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_MeCommand","/me <text> : roleplaying command for doing actions."), channel)
			end
			speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_SwitchChannelCommand","/c <channel> : switch channel menu tabs."), channel)
			if ShowJoinAndLeaveCommands() then
				speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_JoinChannelCommand","/join <channel> or /j <channel> : join channel."), channel)
				speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_LeaveChannelCommand","/leave <channel> or /l <channel> : leave channel. (leaves current if none specified)"), channel)
			end
			speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_WhisperCommand","/whisper <speaker> or /w <speaker> : open private message channel with speaker."), channel)
			speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_MuteCommand","/mute <speaker> : mute a speaker."), channel)
			speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_UnMuteCommand","/unmute <speaker> : unmute a speaker."), channel)

			local player = speaker:GetPlayer()
			if player and player.Team then
				speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_TeamCommand","/team <message> or /t <message> : send a team chat to players on your team."), channel)
			end

			return true
		end

		return false
	end

	ChatService:RegisterProcessCommandsFunction("chat_commands_inquiry", ProcessCommandsFunction, ChatConstants.StandardPriority)

	if ChatSettings.GeneralChannelName then
		local allChannel = ChatService:GetChannel(ChatSettings.GeneralChannelName)
		if (allChannel) then
			allChannel.WelcomeMessage = ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_AllChannelWelcomeMessage","Chat '/?' or '/help' for a list of chat commands.")
		end
	end
end

return Run


Prompt: --//hood

Response:
local hd = Instance.new("Motor", script.Parent.Parent.Misc.HD.SS)
hd.MaxVelocity = 0.03
hd.Part0 = script.Parent.HD
hd.Part1 = hd.Parent


Prompt:
-- Signal:Fire(...) implemented by running the handler functions on the
-- coRunnerThread, and any time the resulting thread yielded without returning
-- to us, that means that it yielded to the Roblox scheduler and has been taken
-- over by Roblox scheduling, meaning we have to make a new coroutine runner.
--[=[
	@param ... any

	Fire the signal, which will call all of the connected functions with the given arguments.
	```lua
	signal:Fire("Hello")

	-- Any number of arguments can be fired:
	signal:Fire("Hello", 32, {Test = "Test"}, true)
	```
]=]

Response:
function Signal:Fire(...)
	local item = self._handlerListHead
	while item do
		if item.Connected then
			if not freeRunnerThread then
				freeRunnerThread = coroutine.create(runEventHandlerInFreeThread)
			end
			task.spawn(freeRunnerThread, item._fn, ...)
		end
		item = item._next
	end
end


Prompt:
--[=[
	Checks whether the given object is a Promise via duck typing. This only checks if the object is a table and has an `andThen` method.

	@param object any
	@return boolean -- `true` if the given `object` is a Promise.
]=]

Response:
function Promise.is(object)
	if type(object) ~= "table" then
		return false
	end

	local objectMetatable = getmetatable(object)

	if objectMetatable == Promise then
		-- The Promise came from this library.
		return true
	elseif objectMetatable == nil then
		-- No metatable, but we should still chain onto tables with andThen methods
		return isCallable(object.andThen)
	elseif
		type(objectMetatable) == "table"
		and type(rawget(objectMetatable, "__index")) == "table"
		and isCallable(rawget(rawget(objectMetatable, "__index"), "andThen"))
	then
		-- Maybe this came from a different or older Promise library.
		return true
	end

	return false
end


Prompt: -- Decompiled with the Synapse X Luau decompiler.

Response:
local v1 = {};
v1.__index = v1;
local v2 = {};
function v2.__call(p1, ...)
	return v1.new(...);
end;
setmetatable(v1, v2);
function v1.new()
	return setmetatable({}, v1);
end;
function v1.CharacterAdded(p2, p3, p4)

end;
function v1.CharacterRemoving(p5, p6, p7)

end;
function v1.OnCameraSubjectChanged(p8, p9)

end;
function v1.GetOcclusionMode(p10)
	warn("BaseOcclusion GetOcclusionMode must be overridden by derived classes");
	return nil;
end;
function v1.Enable(p11, p12)
	warn("BaseOcclusion Enable must be overridden by derived classes");
end;
function v1.Update(p13, p14, p15, p16)
	warn("BaseOcclusion Update must be overridden by derived classes");
	return p15, p16;
end;
return v1;


Response:
mouse.KeyDown:connect(function (key)
    key = string.lower(key)
				if key == "k" then --Camera controls
				        if cam == ("car") then
							Camera.CameraSubject = player.Character.Humanoid
							Camera.CameraType = ("Custom")
							cam = ("freeplr")
							Camera.FieldOfView = 70
						elseif cam == ("freeplr") then
							Camera.CameraSubject = player.Character.Humanoid
							Camera.CameraType = ("Attach")
							cam = ("lockplr")
							Camera.FieldOfView = 45
				        elseif cam == ("lockplr") then
							Camera.CameraSubject = carSeat
							Camera.CameraType = ("Custom")
							cam = ("car")
							Camera.FieldOfView = 70
				        end
				elseif key == "u" then --Window controls
				 if windows == false then
					winfob.Visible = true
					windows = true
				 else windows = false
					winfob.Visible = false
				 end
			end
end)

winfob.FL.Lock.MouseButton1Click:connect(function() --Window
 if carSeat.WindowFL.Value == false then
  carSeat.WindowFL.Value = true
  carSeat.Parent.Misc.FL.Window.SS.Motor.DesiredAngle = carSeat.Parent.Misc.FL.Window.SS.Motor.DesiredAngle - 0.20
 else carSeat.WindowFL.Value = false
  carSeat.Parent.Misc.FL.Window.SS.Motor.DesiredAngle = carSeat.Parent.Misc.FL.Window.SS.Motor.DesiredAngle + 0.20
 end
end)

winfob.FR.Lock.MouseButton1Click:connect(function() --Window
 if carSeat.WindowFR.Value == false then
  carSeat.WindowFR.Value = true
  carSeat.Parent.Misc.FR.Window.SS.Motor.DesiredAngle = carSeat.Parent.Misc.FR.Window.SS.Motor.DesiredAngle + 0.20
 else carSeat.WindowFR.Value = false
  carSeat.Parent.Misc.FR.Window.SS.Motor.DesiredAngle = carSeat.Parent.Misc.FR.Window.SS.Motor.DesiredAngle - 0.20
 end
end)

HUB.Limiter.MouseButton1Click:connect(function() --Ignition
 if carSeat.IsOn.Value == false then
	carSeat.IsOn.Value = true
	carSeat.Startup:Play()
	carSeat.Chime:Play()
else
	carSeat.IsOn.Value = false
end
end)

TR.SN.MouseButton1Click:connect(function() --Show tracker names
	script.Parent.Names.Value = true
end)

TR.HN.MouseButton1Click:connect(function() --Hide tracker names
	script.Parent.Names.Value = false
end)

carSeat.Indicator.Changed:connect(function()
	if carSeat.Indicator.Value == true then
		script.Parent.Indicator:Play()
	else
		script.Parent.Indicator2:Play()
	end
end)

carSeat.LI.Changed:connect(function()
	if carSeat.LI.Value == true then
		carSeat.Parent.Body.Dash.DashSc.G.Left.Visible = true
		script.Parent.HUB.Left.Visible = true
	else
		carSeat.Parent.Body.Dash.DashSc.G.Left.Visible = false
		script.Parent.HUB.Left.Visible = false
	end
end)

carSeat.RI.Changed:connect(function()
	if carSeat.RI.Value == true then
		carSeat.Parent.Body.Dash.DashSc.G.Right.Visible = true
		script.Parent.HUB.Right.Visible = true
	else
		carSeat.Parent.Body.Dash.DashSc.G.Right.Visible = false
		script.Parent.HUB.Right.Visible = false
	end
end)

while wait() do
	carSeat.Parent.Body.Dash.Screen.G.Time.Text = game.Lighting.TimeOfDay
	carSeat.Parent.Body.Dash.DashSc.G.Time.Text = game.Lighting.TimeOfDay
	carSeat.Parent.Body.Dash.DashSc.G.Speed.Text = math.floor(carSeat.Velocity.magnitude*((10/12) * (60/88)))
	script.Parent.HUB.Time.Text = game.Lighting.TimeOfDay
end


Prompt:
--[=[
	@interface Service
	.[any] any
	@within KnitClient
]=]

Response:
type Service = {
	[any]: any,
}


Prompt:
--[[**
	ensures Roblox NumberSequence type

	@param value The value to check against

	@returns True iff the condition is satisfied, false otherwise
**--]]

Response: t.NumberSequence = t.typeof("NumberSequence")


Prompt:
-- ROBLOX TODO: ADO-1554 clean up the following deviations and move them to the
-- appropriate locations
-- ROBLOX deviation START: for now we extend the snapshot matchers in the Expect file instead
-- of jest-jasmine2/jestExpect

Response:
local JestSnapshot = require(Packages.JestSnapshot)
local toMatchSnapshot = JestSnapshot.toMatchSnapshot
local toThrowErrorMatchingSnapshot = JestSnapshot.toThrowErrorMatchingSnapshot
setMatchers({
	toMatchSnapshot = toMatchSnapshot,
	toThrowErrorMatchingSnapshot = toThrowErrorMatchingSnapshot,
}, false, Expect)