Prompt: --Made by Luckymaxer

Response:
Seat = script.Parent
Model = Seat.Parent

Engine = Model:WaitForChild("Engine")
BeamPart = Model:WaitForChild("BeamPart")
Lights = Model:WaitForChild("Lights")
Seats = Model:WaitForChild("Seats")

Sounds = {
	Flying = Engine:WaitForChild("UFO_Flying"),
	Beam = Engine:WaitForChild("UFO_Beam"),
	Idle = Engine:WaitForChild("UFO_Idle"),
	TakingOff = Engine:WaitForChild("UFO_Taking_Off")
}

Players = game:GetService("Players")
Debris = game:GetService("Debris")

BeamSize = 50
CurrentBeamSize = 0

MaxVelocity = 40
MinVelocity = -40

MaxSideVelocity = 40
MinSideVelocity = -40

Acceleration = 2
Deceleration = 2
AutoDeceleration = 2

SideAcceleration = 2
SideDeceleration = 2
AutoSideDeceleration = 2

LiftOffSpeed = 5
LiftSpeed = 10
LowerSpeed = -10

Velocity = Vector3.new(0, 0, 0)
SideVelocity = 0

FlipForce = 1000000

InUse = false
PlayerUsing = nil
PlayerControlScript = nil
PlayerConnection = nil
BeamActive = false
TakingOff = false

LightsEnabled = false

Enabled = false

Controls = {
	Forward = {Key = "W", Byte = 17, Mode = false},
	Backward = {Key = "S", Byte = 18, Mode = false},
	Left = {Key = "A", Byte = 20, Mode = false},
	Right = {Key = "D", Byte = 19, Mode = false},
	Up = {Key = "Q", Byte = 113, Mode = false},
	Down = {Key = "E", Byte = 101, Mode = false},
}

ControlScript = script:WaitForChild("ControlScript")

Beam = Instance.new("Part")
Beam.Name = "Beam"
Beam.Transparency = 0.3
Beam.BrickColor = BrickColor.new("Pastel Blue")
Beam.Material = Enum.Material.Plastic
Beam.Shape = Enum.PartType.Block
Beam.TopSurface = Enum.SurfaceType.Smooth
Beam.BottomSurface = Enum.SurfaceType.Smooth
Beam.FormFactor = Enum.FormFactor.Custom
Beam.Size = Vector3.new(BeamPart.Size.X, 0.2, BeamPart.Size.Z)
Beam.Anchored = false
Beam.CanCollide = false
BeamMesh = Instance.new("CylinderMesh")
BeamMesh.Parent = Beam
script.Parent.Parent.BeamPart.SpotLight.Enabled = true

for i, v in pairs(Sounds) do
	v:Stop()
end

RemoteConnection = script:FindFirstChild("RemoteConnection")
if not RemoteConnection then
	RemoteConnection = Instance.new("RemoteFunction")
	RemoteConnection.Name = "RemoteConnection"
	RemoteConnection.Parent = script
end

BodyGyro = Engine:FindFirstChild("BodyGyro")
if not BodyGyro then
	BodyGyro = Instance.new("BodyGyro")
	BodyGyro.Parent = Engine
end
BodyGyro.maxTorque = Vector3.new(0, 0, 0)
BodyGyro.D = 7500
BodyGyro.P = 10000

BodyPosition = Engine:FindFirstChild("BodyPosition")
if not BodyPosition then
	BodyPosition = Instance.new("BodyPosition")
	BodyPosition.Parent = Engine
end
BodyPosition.maxForce = Vector3.new(0, 0, 0)
BodyPosition.D = 10000
BodyPosition.P = 50000

BodyVelocity = Engine:FindFirstChild("BodyVelocity")
if not BodyVelocity then
	BodyVelocity = Instance.new("BodyVelocity")
	BodyVelocity.Parent = Engine
end
BodyVelocity.velocity = Vector3.new(0, 0, 0)
BodyVelocity.maxForce = Vector3.new(0, 0, 0)
BodyVelocity.P = 10000

FlipGyro = BeamPart:FindFirstChild("FlipGyro")
if not FlipGyro then
	FlipGyro = Instance.new("BodyGyro")
	FlipGyro.Name = "FlipGyro"
	FlipGyro.Parent = BeamPart
end
FlipGyro.maxTorque = Vector3.new(0, 0, 0)
FlipGyro.D = 500
FlipGyro.P = 3000

RiseVelocity = BeamPart:FindFirstChild("RiseVelocity")
if not RiseVelocity then
	RiseVelocity = Instance.new("BodyVelocity")
	RiseVelocity.Name = "RiseVelocity"
	RiseVelocity.Parent = BeamPart
end
RiseVelocity.velocity = Vector3.new(0, 0, 0)
RiseVelocity.maxForce = Vector3.new(0, 0, 0)
RiseVelocity.P = 10000

function RayCast(Position, Direction, MaxDistance, IgnoreList)
	return game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position, Direction.unit * (MaxDistance or 999.999)), IgnoreList)
end

function ToggleLights()
	for i, v in pairs(Lights:GetChildren()) do
		if v:IsA("BasePart") then
			for ii, vv in pairs(v:GetChildren()) do
				if vv:IsA("Light") then
					vv.Enabled = LightsEnabled
				end
			end
		end
	end
end

ToggleLights()

function CheckTable(Table, Instance)
	for i, v in pairs(Table) do
		if v == Instance then
			return true
		end
	end
	return false
end

function RandomizeTable(Table)
	local TableCopy = {}
	for i = 1, #Table do
		local Index = math.random(1, #Table)
		table.insert(TableCopy, Table[Index])
		table.remove(Table, Index)
	end
	return TableCopy
end

for i, v in pairs(Model:GetChildren()) do
	if v:IsA("BasePart") and v.Name == "Beam" then
		v:Destroy()
	end
end

function GetPartsInBeam(beam)
	local IgnoreObjects = {(((PlayerUsing and PlayerUsing.Character) and PlayerUsing.Character) or nil), Model}
	local NegativePartRadius = Vector3.new((beam.Size.X / 2), ((CurrentBeamSize / 5) / 2), (beam.Size.Z / 2))
	local PositivePartRadius = Vector3.new((beam.Size.X / 2), ((CurrentBeamSize / 5) / 2), (beam.Size.Z / 2))
	local Parts = game:GetService("Workspace"):FindPartsInRegion3WithIgnoreList(Region3.new(beam.Position - NegativePartRadius, beam.Position + PositivePartRadius), IgnoreObjects, 100)
	local Humanoids = {}
	local Torsos = {}
	for i, v in pairs(Parts) do
		if v and v.Parent then
			local humanoid = v.Parent:FindFirstChild("Humanoid")
			local torso = v.Parent:FindFirstChild("Torso")
			local player = Players:GetPlayerFromCharacter(v.Parent)
			if player and humanoid and humanoid.Health > 0 and torso and not CheckTable(Humanoids, humanoid) then
				table.insert(Humanoids, humanoid)
				table.insert(Torsos, {Humanoid = humanoid, Torso = torso})
			end
		end
	end
	return Torsos
end

RemoteConnection.OnServerInvoke = (function(Player, Script, Action, Value)
	if Script and Script ~= PlayerControlScript then
		Script.Disabled = true
		Script:Destroy()
	else
		if Action == "KeyDown" then
			if Value == "l" then
				LightsEnabled = not LightsEnabled
				ToggleLights()
			elseif Value == "t" then
				if TemporaryBeam and TemporaryBeam.Parent then
					local Torsos = GetPartsInBeam(TemporaryBeam)
					local TorsosUsed = {}
					Torsos = RandomizeTable(Torsos)
					for i, v in pairs(Seats:GetChildren()) do
						if v:IsA("Seat") and not v:FindFirstChild("SeatWeld") then
							for ii, vv in pairs(Torsos) do
								if vv.Humanoid and vv.Humanoid.Parent and vv.Humanoid.Health > 0 and not vv.Humanoid.Sit and vv.Torso and vv.Torso.Parent and not CheckTable(TorsosUsed, vv.Torso) then
									table.insert(TorsosUsed, vv.Torso)
									vv.Torso.CFrame = v.CFrame
									break
								end
							end
						end
					end
				end
			end
			if not TakingOff then
				for i, v in pairs(Controls) do
					if string.lower(v.Key) == string.lower(Value) or v.Byte == string.byte(Value) then
						v.Mode = true
					end
				end
				if Controls.Up.Mode or Controls.Down.Mode then
					RiseVelocity.maxForce = Vector3.new(0, 1000000, 0)
				end
				if Controls.Forward.Mode or Controls.Backward.Mode or Controls.Left.Mode or Controls.Right.Mode or Controls.Up.Mode or Controls.Down.Mode then
					Sounds.Idle:Stop()
					Sounds.Flying:Play()
				end
			end
		elseif Action == "KeyUp" then
			if not TakingOff then
				for i, v in pairs(Controls) do
					if string.lower(v.Key) == string.lower(Value) or v.Byte == string.byte(Value) then
						v.Mode = false
					end
				end
				if not Controls.Up.Mode and not Controls.Down.Mode then
					BodyPosition.position = Engine.Position
					BodyPosition.maxForce = Vector3.new(0, 100000000, 0)
					RiseVelocity.maxForce = Vector3.new(0, 0, 0)
					RiseVelocity.velocity = Vector3.new(0, 0, 0)
				end
				if not Controls.Forward.Mode and not Controls.Backward.Mode and not Controls.Left.Mode and not Controls.Right.Mode and not Controls.Up.Mode and not Controls.Down.Mode then
					Sounds.Flying:Stop()
					Sounds.Idle:Play()
				end
			end
		elseif Action == "Button1Down" then
			if not BeamActive and not TakingOff then
				BeamActive = true
				if TemporaryBeam and TemporaryBeam.Parent then
					TemporaryBeam:Destroy()
				end
				TemporaryBeam = Beam:Clone()
				TemporaryBeam.Parent = Model
				Spawn(function()
					while TemporaryBeam and TemporaryBeam.Parent do
						local Torsos = GetPartsInBeam(TemporaryBeam)
						for i, v in pairs(Torsos) do
							if v.Humanoid and v.Humanoid.Parent and v.Humanoid.Health > 0 and v.Torso and v.Torso.Parent and not v.Torso:FindFirstChild("UFOPullForce") and not v.Torso:FindFirstChild("UFOBalanceForce") then
								local UFOPullForce = Instance.new("BodyVelocity")
								UFOPullForce.Name = "UFOPullForce"
								UFOPullForce.maxForce = Vector3.new(0, 1000000, 0)
								UFOPullForce.velocity = CFrame.new(v.Torso.Position, BeamPart.Position).lookVector * 25
								Debris:AddItem(UFOPullForce, 0.25)
								UFOPullForce.Parent = v.Torso
								local UFOBalanceForce = Instance.new("BodyGyro")
								UFOBalanceForce.Name = "UFOBalanceForce"
								UFOBalanceForce.maxTorque = Vector3.new(1000000, 0, 1000000)
								Debris:AddItem(UFOBalanceForce, 0.25)
								UFOBalanceForce.Parent = v.Torso
							end
						end
						wait()
					end
				end)
				local BeamWeld = Instance.new("Weld")
				BeamWeld.Part0 = BeamPart
				BeamWeld.Part1 = TemporaryBeam
				Spawn(function()
					Sounds.Beam:Play()
					while Enabled and BeamActive and TemporaryBeam and TemporaryBeam.Parent do
						local IgnoreTable = {Model}
						for i, v in pairs(Players:GetChildren()) do
							if v:IsA("Player") and v.Character then
								table.insert(IgnoreTable, v.Character)
							end
						end
						local BeamPartClone = BeamPart:Clone()
						local BeamPartCloneY = BeamPartClone:Clone()
						BeamPartCloneY.CFrame = BeamPartCloneY.CFrame * CFrame.Angles(-math.rad(90), 0, 0)
						BeamPartCloneY.CFrame = BeamPartCloneY.CFrame - BeamPartCloneY.CFrame.lookVector * ((BeamPart.Size.Y / 2))
						local Hit, Position = RayCast(BeamPart.Position, BeamPartCloneY.CFrame.lookVector, BeamSize, IgnoreTable)
						CurrentBeamSize = ((BeamPart.Position - Position).magnitude * 5)
						TemporaryBeam.Mesh.Scale = Vector3.new(1, CurrentBeamSize, 1)
						BeamWeld.Parent = TemporaryBeam
						BeamWeld.C0 = CFrame.new(0, 0, 0) - Vector3.new(0, ((CurrentBeamSize / 2) + (BeamPart.Size.Y / 2)) / 5 , 0)
						wait()
					end
					BeamActive = false
					Sounds.Beam:Stop()
					if TemporaryBeam and TemporaryBeam.Parent then
						TemporaryBeam:Destroy()
					end
				end)
			end
		elseif Action == "Button1Up" then
			BeamActive = false
		end
	end
end)

function ManageMotionStep(ForceLift, CoordinateFrame)

	local CameraForwards = -CoordinateFrame:vectorToWorldSpace(Vector3.new(0, 0, 1))
	local CameraSideways = -CoordinateFrame:vectorToWorldSpace(Vector3.new(1, 0, 0))
	local CameraRotation = -CoordinateFrame:vectorToWorldSpace(Vector3.new(0, 1, 0))

	CameraForwards = CameraForwards * Vector3.new(1, 0, 1)
	CameraSideways = CameraSideways * Vector3.new(1, 0, 1)

	if CameraForwards:Dot(CameraForwards) < 0.1 or CameraSideways:Dot(CameraSideways) < 0.1 then
		return
	end

	CameraForwards = CameraForwards.unit
	CameraSideways = CameraSideways.unit

	if math.abs(Velocity.X) < 2 and math.abs(Velocity.Z) < 2 then
		BodyVelocity.velocity = Vector3.new(0, 0, 0)
	else
		BodyVelocity.velocity = Velocity
	end
	BodyGyro.cframe = CFrame.new(0, 0, 0) * CFrame.Angles(Velocity:Dot(Vector3.new(0, 0, 1)) * (math.pi / 320), 0, math.pi - Velocity:Dot(Vector3.new(1, 0, 0)) * (math.pi / 320))
	if Controls.Forward.Mode and (not Controls.Backward.Mode) and Velocity:Dot(CameraForwards) < MaxVelocity then
		Velocity = Velocity + Acceleration * CameraForwards
	elseif Controls.Backward.Mode and (not Controls.Forward.Mode) and Velocity:Dot(CameraForwards) > MinVelocity then
		Velocity = Velocity - Deceleration * CameraForwards
	elseif (not Controls.Backward.Mode) and (not Controls.Forward.Mode) and Velocity:Dot(CameraForwards) > 0 then
		Velocity = Velocity - AutoDeceleration * CameraForwards
	elseif (not Controls.Backward.Mode) and (not Controls.Forward.Mode) and Velocity:Dot(CameraForwards) < 0 then
		Velocity = Velocity + AutoDeceleration * CameraForwards
	end

	if Controls.Left.Mode and (not Controls.Right.Mode) and Velocity:Dot(CameraSideways) < MaxSideVelocity then
		Velocity = Velocity + SideAcceleration * CameraSideways
	elseif Controls.Right.Mode and (not Controls.Left.Mode) and Velocity:Dot(CameraSideways) > MinSideVelocity then
		Velocity = Velocity - SideDeceleration * CameraSideways
	elseif (not Controls.Right.Mode) and (not Controls.Left.Mode) and Velocity:Dot(CameraSideways) > 0 then
		Velocity = Velocity - AutoSideDeceleration * CameraSideways
	elseif (not Controls.Right.Mode) and (not Controls.Left.Mode) and Velocity:Dot(CameraSideways) < 0 then
		Velocity = Velocity + AutoSideDeceleration * CameraSideways
	end

	if ForceLift then
		RiseVelocity.velocity = Vector3.new(0, LiftOffSpeed, 0)
	else
		if Controls.Up.Mode and (not Controls.Down.Mode) then
			RiseVelocity.velocity = Vector3.new(0, LiftSpeed, 0)
			BodyPosition.maxForce = Vector3.new(0, 0, 0)
		elseif Controls.Down.Mode and (not Controls.Up.Mode) then
			RiseVelocity.velocity = Vector3.new(0, LowerSpeed, 0)
			BodyPosition.maxForce = Vector3.new(0, 0, 0)
		end
	end

end

function MotionManager()
	Spawn(function()
		TakingOff = true
		RiseVelocity.maxForce = Vector3.new(0, 1000000, 0)
		local StartTime = tick()
		Sounds.TakingOff:Play()
		while Enabled and PlayerConnection and (tick() - StartTime) < 3 do
			local CoordinateFrame = PlayerConnection:InvokeClient(PlayerUsing, "CoordinateFrame")
			ManageMotionStep(true, CoordinateFrame)
			wait()
		end
		TakingOff = false
		Sounds.TakingOff:Stop()
		while PlayerConnection and (Enabled or Velocity:Dot(Velocity) > 0.5) do
			local CoordinateFrame = PlayerConnection:InvokeClient(PlayerUsing, "CoordinateFrame")
			ManageMotionStep(false, CoordinateFrame)
			wait()
		end
	end)
end

function LiftOff()

	BodyGyro.maxTorque = Vector3.new(1000000, 1000000, 1000000)
	BodyVelocity.maxForce = Vector3.new(1000000, 0, 1000000)

	Velocity = Vector3.new(0, 0, 0)

	Enabled = true

	MotionManager()

end

function Equipped(Player)
	local Backpack = Player:FindFirstChild("Backpack")
	if Backpack then
		InUse = true
		PlayerUsing = Player
		PlayerControlScript = ControlScript:Clone()
		local RemoteController = Instance.new("ObjectValue")
		RemoteController.Name = "RemoteController"
		RemoteController.Value = RemoteConnection
		RemoteController.Parent = PlayerControlScript
		local VehicleSeat = Instance.new("ObjectValue")
		VehicleSeat.Name = "VehicleSeat"
		VehicleSeat.Value = Seat
		VehicleSeat.Parent = PlayerControlScript
		PlayerConnection = Instance.new("RemoteFunction")
		PlayerConnection.Name = "PlayerConnection"
		PlayerConnection.Parent = PlayerControlScript
		PlayerControlScript.Disabled = false
		PlayerControlScript.Parent = Backpack
		LiftOff()
	end
end

function Unequipped()
	if PlayerControlScript and PlayerControlScript.Parent then
		PlayerControlScript:Destroy()
	end
	Enabled = false
	PlayerControlScript = nil
	PlayerUsing = nil
	PlayerConnection = nil
	BeamActive = false
	TakingOff = false
	InUse = false
	BodyGyro.maxTorque = Vector3.new(0, 0, 0)
	BodyPosition.maxForce = Vector3.new(0, 0, 0)
	BodyVelocity.maxForce = Vector3.new(0, 0, 0)
	BodyVelocity.velocity = Vector3.new(0, 0, 0)
	RiseVelocity.maxForce = Vector3.new(0, 0, 0)
	RiseVelocity.velocity = Vector3.new(0, 0, 0)
	for i, v in pairs(Controls) do
		v.Mode = false
	end
end

function Flip()
	local EngineCloneY = Engine:Clone()
	EngineCloneY.CFrame = EngineCloneY.CFrame * CFrame.Angles(-math.rad(90), 0, 0)
	if EngineCloneY.CFrame.lookVector.Y < 0.707 then
		FlipGyro.cframe = CFrame.new(Vector3.new(0, 0, 0), Vector3.new(0, 1, 0)) * CFrame.Angles((-math.pi / 2), 0, 0)
		FlipGyro.maxTorque = Vector3.new(FlipForce, FlipForce, FlipForce)
		wait(2)
		FlipGyro.maxTorque = Vector3.new(0,0,0)
	end
end

Seat.ChildAdded:connect(function(Child)
	if Child:IsA("Weld") and Child.Name == "SeatWeld" then
		if Child.Part0 and Child.Part0 == Seat and Child.Part1 and Child.Part1.Parent then
			local Player = Players:GetPlayerFromCharacter(Child.Part1.Parent)
			if Player then
				Equipped(Player)
			end
		end
	end
end)

Seat.ChildRemoved:connect(function(Child)
	if Child:IsA("Weld") and Child.Name == "SeatWeld" then
		if Child.Part0 and Child.Part0 == Seat and Child.Part1 and Child.Part1.Parent then
			local Player = Players:GetPlayerFromCharacter(Child.Part1.Parent)
			if Player and Player == PlayerUsing then
				Unequipped(Player)
			end
		end
	end
end)

Spawn(function()
	while true do
		Flip()
		wait(5)
	end
end)


Prompt: --// Recoil Settings

Response:
	gunrecoil = -0.3; -- How much the gun recoils backwards when not aiming
	camrecoil = 0.05; -- How much the camera flicks when not aiming
	AimGunRecoil = -0.1; -- How much the gun recoils backwards when aiming
	AimCamRecoil = 0.02; -- How much the camera flicks when aiming

	CamShake = 56; -- THIS IS NEW!!!! CONTROLS CAMERA SHAKE WHEN FIRING
	AimCamShake = 38; -- THIS IS ALSO NEW!!!!

	Kickback = 3; -- Upward gun rotation when not aiming
	AimKickback = 0.1; -- Upward gun rotation when aiming


Prompt: -- innit bruv

Response:
local renderResolution = 10
local cam = workspace.CurrentCamera
local viewportSize = cam.ViewportSize


Prompt: -- Driver Input Loop --

Response:
while script.Parent ~= nil do
	--Update throttle, steer, handbrake
	getInputValues()

	local currentVel = Chassis.GetAverageVelocity()

	local steer = script.Steering.Value
	Chassis.UpdateSteering(steer, currentVel)

	-- Taking care of throttling
	local throttle = script.Throttle.Value
	script.AngularMotorVelocity.Value = currentVel
	script.ForwardVelocity.Value = DriverSeat.CFrame.LookVector:Dot(DriverSeat.Velocity)
	Chassis.UpdateThrottle(currentVel, throttle)

	-- Taking care of handbrake
	if script.HandBrake.Value > 0 then
		Chassis.EnableHandbrake()
	end
	wait()
end


Prompt:
-- LIGHT SETTINGS
--[[
	LIGHT TYPES:
		- Halogen
		- LED
]]

Response:
--

local Low_Beam_Brightness = 0.55

local High_Beam_Brightness = 0.80

local Fog_Light_Brightness = 0.7

local Rear_Light_Brightness = 1.0

local Brake_Light_Brightness = 1.5

local Reverse_Light_Brightness = 1

local Headlight_Type = "Halogen"

local Indicator_Type = "Halogen"

local Fog_Light_Type = "Halogen"

local Plate_Light_Type = "Halogen"

local Rear_Light_Type = "Halogen"

local Reverse_Light_Type = "Halogen"

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

local CustomDRL_Type = "LED"

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

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

local Popup_Hinge_Angle = -0.75 -- Changes the angle of your popup headlights. (only use if your car has popups)


Prompt: --use this to determine if you want this human to be harmed or not, returns boolean

Response:
function checkTeams(otherHuman)
	return not (sameTeam(otherHuman) and not FriendlyFire==true)
end

function boom()
	wait(1.5)
	Used = true
	Object.Anchored = true
	Object.CanCollide = true
	Object.Sparks.Enabled = false
	Object.Orientation = Vector3.new(0,0,0)
	Object.Transparency = 1
	Object.Fuse:Stop()
	Object.Explode:Play()
	Object.Explosion:Emit(100)
	Explode()
end

Object.Touched:Connect(function(part)
	if Used == true or part.Name == "Handle" then return end
	if part:IsDescendantOf(Tag.Value.Character) then return end
	if part.Parent then
		if part.Parent:FindFirstChild("Humanoid") then
			local human = part.Parent.Humanoid
			if checkTeams(human) then
				tagHuman(human)
				human:TakeDamage(Damage)
			end
		end
		Used = true
		Object.Impact:Play()
		Object.Velocity = Vector3.new(Object.Velocity.x/10,Object.Velocity.y/10,Object.Velocity.z/10)
		Object.RotVelocity = Vector3.new(Object.RotVelocity.x/10,Object.RotVelocity.y/10,Object.RotVelocity.z/10)
		game:GetService("Debris"):AddItem(Object, 10)
	end
end)

boom()


Prompt: --[[ The Module ]]

Response:
--
local BaseCharacterController = require(script.Parent:WaitForChild("BaseCharacterController"))
local Keyboard = setmetatable({}, BaseCharacterController)
Keyboard.__index = Keyboard

local bindAtPriorityFlagExists, bindAtPriorityFlagEnabled = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserPlayerScriptsBindAtPriority")
end)
local FFlagPlayerScriptsBindAtPriority = bindAtPriorityFlagExists and bindAtPriorityFlagEnabled

function Keyboard.new(CONTROL_ACTION_PRIORITY)
	local self = setmetatable(BaseCharacterController.new(), Keyboard)

	self.CONTROL_ACTION_PRIORITY = CONTROL_ACTION_PRIORITY

	self.textFocusReleasedConn = nil
	self.textFocusGainedConn = nil
	self.windowFocusReleasedConn = nil

	self.forwardValue  = 0
	self.backwardValue = 0
	self.leftValue = 0
	self.rightValue = 0
	return self
end

function Keyboard:Enable(enable)
	if not UserInputService.KeyboardEnabled then
		return false
	end

	if enable == self.enabled then
		-- Module is already in the state being requested. True is returned here since the module will be in the state
		-- expected by the code that follows the Enable() call. This makes more sense than returning false to indicate
		-- no action was necessary. False indicates failure to be in requested/expected state.
		return true
	end

	self.forwardValue  = 0
	self.backwardValue = 0
	self.leftValue = 0
	self.rightValue = 0
	self.moveVector = ZERO_VECTOR3
	self.isJumping = false

	if enable then
		self:BindContextActions()
		self:ConnectFocusEventListeners()
	else
		self:UnbindContextActions()
		self:DisconnectFocusEventListeners()
	end

	self.enabled = enable
	return true
end

function Keyboard:UpdateMovement(inputState)
	if inputState == Enum.UserInputState.Cancel then
		self.moveVector = ZERO_VECTOR3
	else
		self.moveVector = Vector3.new(self.leftValue + self.rightValue, 0, self.forwardValue + self.backwardValue)
	end
end

function Keyboard:BindContextActions()

	-- Note: In the previous version of this code, the movement values were not zeroed-out on UserInputState. Cancel, now they are,
	-- which fixes them from getting stuck on.
	local handleMoveForward = function(actionName, inputState, inputObject)
		self.forwardValue = (inputState == Enum.UserInputState.Begin) and -1 or 0
		self:UpdateMovement(inputState)
		if FFlagPlayerScriptsBindAtPriority then
			return Enum.ContextActionResult.Sink
		end
	end

	local handleMoveBackward = function(actionName, inputState, inputObject)
		self.backwardValue = (inputState == Enum.UserInputState.Begin) and 1 or 0
		self:UpdateMovement(inputState)
		if FFlagPlayerScriptsBindAtPriority then
			return Enum.ContextActionResult.Sink
		end
	end

	local handleMoveLeft = function(actionName, inputState, inputObject)
		self.leftValue = (inputState == Enum.UserInputState.Begin) and -1 or 0
		self:UpdateMovement(inputState)
		if FFlagPlayerScriptsBindAtPriority then
			return Enum.ContextActionResult.Sink
		end
	end

	local handleMoveRight = function(actionName, inputState, inputObject)
		self.rightValue = (inputState == Enum.UserInputState.Begin) and 1 or 0
		self:UpdateMovement(inputState)
		if FFlagPlayerScriptsBindAtPriority then
			return Enum.ContextActionResult.Sink
		end
	end

	local handleJumpAction = function(actionName, inputState, inputObject)
		self.isJumping = (inputState == Enum.UserInputState.Begin)
		if FFlagPlayerScriptsBindAtPriority then
			return Enum.ContextActionResult.Sink
		end
	end

	-- TODO: Revert to KeyCode bindings so that in the future the abstraction layer from actual keys to
	-- movement direction is done in Lua
	if FFlagPlayerScriptsBindAtPriority then
		ContextActionService:BindActionAtPriority("moveForwardAction", handleMoveForward, false,
			self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterForward)
		ContextActionService:BindActionAtPriority("moveBackwardAction", handleMoveBackward, false,
			self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterBackward)
		ContextActionService:BindActionAtPriority("moveLeftAction", handleMoveLeft, false,
			self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterLeft)
		ContextActionService:BindActionAtPriority("moveRightAction", handleMoveRight, false,
			self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterRight)
		ContextActionService:BindActionAtPriority("jumpAction", handleJumpAction, false,
			self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterJump)
	else
		ContextActionService:BindAction("moveForwardAction", handleMoveForward, false, Enum.PlayerActions.CharacterForward)
		ContextActionService:BindAction("moveBackwardAction", handleMoveBackward, false, Enum.PlayerActions.CharacterBackward)
		ContextActionService:BindAction("moveLeftAction", handleMoveLeft, false, Enum.PlayerActions.CharacterLeft)
		ContextActionService:BindAction("moveRightAction", handleMoveRight, false, Enum.PlayerActions.CharacterRight)
		ContextActionService:BindAction("jumpAction",handleJumpAction,false,Enum.PlayerActions.CharacterJump)
	end
end

function Keyboard:UnbindContextActions()
	ContextActionService:UnbindAction("moveForwardAction")
	ContextActionService:UnbindAction("moveBackwardAction")
	ContextActionService:UnbindAction("moveLeftAction")
	ContextActionService:UnbindAction("moveRightAction")
	ContextActionService:UnbindAction("jumpAction")
end

function Keyboard:ConnectFocusEventListeners()
	local function onFocusReleased()
		self.moveVector = ZERO_VECTOR3
		self.forwardValue  = 0
		self.backwardValue = 0
		self.leftValue = 0
		self.rightValue = 0
		self.isJumping = false
	end

	local function onTextFocusGained(textboxFocused)
		self.isJumping = false
	end

	self.textFocusReleasedConn = UserInputService.TextBoxFocusReleased:Connect(onFocusReleased)
	self.textFocusGainedConn = UserInputService.TextBoxFocused:Connect(onTextFocusGained)
	self.windowFocusReleasedConn = UserInputService.WindowFocused:Connect(onFocusReleased)
end

function Keyboard:DisconnectFocusEventListeners()
	if self.textFocusReleasedCon then
		self.textFocusReleasedCon:Disconnect()
		self.textFocusReleasedCon = nil
	end
	if self.textFocusGainedConn then
		self.textFocusGainedConn:Disconnect()
		self.textFocusGainedConn = nil
	end
	if self.windowFocusReleasedConn then
		self.windowFocusReleasedConn:Disconnect()
		self.windowFocusReleasedConn = nil
	end
end

return Keyboard


Prompt: ---Finds the characters position, based off their torso

Response:
local t = P.Character:FindFirstChild("Torso")
if t then
local Char = P.Character
local X = Char.Torso.Position.X
local Y = Char.Torso.Position.Y
local Z = Char.Torso.Position.Z

local X1 = Instance.new("IntValue")
X1.Value = X
local Y1 = Instance.new("IntValue")
Y1.Value = Y
local Z1 = Instance.new("IntValue")
Z1.Value = Z

script.Parent.Text = " " ..X1.Value.. ", " ..Y1.Value.. ", " ..Z1.Value.. " "
end
end
wait(T)
end


Prompt: --		print(animName .. " " .. idx .. " [" .. origRoll .. "]")

Response:
		local anim = animTable[animName][idx].anim

		-- load it to the humanoid; get AnimationTrack
		currentAnimTrack = humanoid:LoadAnimation(anim)

		-- play the animation
		currentAnimTrack:Play(transitionTime)
		currentAnim = animName

		-- set up keyframe name triggers
		if currentAnimKeyframeHandler then
			currentAnimKeyframeHandler:disconnect()
		end
		currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
	end
end


Prompt:
--[[
	Gamepad Character Control - This module handles controlling your avatar using a game console-style controller

	2018 PlayerScripts Update - AllYourBlox
--]]

Response:
local UserInputService = game:GetService("UserInputService")
local ContextActionService = game:GetService("ContextActionService")


Prompt: --------------| SYSTEM SETTINGS |--------------

Response:
Prefix				= ";";			-- The character you use before every command (e.g. ';jump me').
SplitKey 			= " ";			-- The character inbetween command arguments (e.g. setting it to '/' would change ';jump me' to ';jump/me').
BatchKey 			= "";			-- The character inbetween batch commands (e.g. setting it to '|' would change ';jump me ;fire me ;smoke me' to ';jump me | ;fire me | ;smoke me'
QualifierBatchKey 	= ",";			-- The character used to split up qualifiers (e.g. ;jump player1,player2,player3)

Theme				= "Blue";		-- The default UI theme.
NoticeSoundId		= 2865227271;	-- The SoundId for notices.
NoticeVolume		= 0.1;			-- The Volume for notices.
NoticePitch			= 1;			-- The Pitch/PlaybackSpeed for notices.
ErrorSoundId		= 2865228021;	-- The SoundId for error notifications.
ErrorVolume			= 0.1;			-- The Volume for error notifications.
ErrorPitch			= 1;			-- The Pitch/PlaybackSpeed for error notifications.
AlertSoundId		= 3140355872;	-- The SoundId for alerts.
AlertVolume			= 0.5;			-- The Volume for alerts.
AlertPitch			= 1;			-- The Pitch/PlaybackSpeed for alerts.

WelcomeBadgeId		= 0;			-- Award new players a badge, such as 'Welcome to the game!'. Set to 0 for no badge.

CommandDebounce		= true;			-- Wait until the command effect is over to use again. Helps to limit abuse & lag. Set to 'false' to disable.
SaveRank			= true;			-- Saves a player's rank in the server they received it. (e.g. ;rank plrName rank). Use ';permRank plrName rank' to permanently save a rank. Set to 'false' to disable.
LoopCommands		= 3;			-- The minimum rank required to use LoopCommands.
MusicList 			= {505757009,};	-- Songs which automatically appear in a user's radio. Type '!radio' to display the radio.

ThemeColors = {						-- The colours players can set their HD Admin UI (in the 'Settings' menu). | Format: {ThemeName, ThemeColor3Value};
	{"Red", 	Color3.fromRGB(150, 0, 0),		};
	{"Orange", 	Color3.fromRGB(150, 75, 0),		};
	{"Brown", 	Color3.fromRGB(120, 80, 30),	};
	{"Yellow", 	Color3.fromRGB(130, 120, 0),	};
	{"Green", 	Color3.fromRGB(0, 120, 0),		};
	{"Blue", 	Color3.fromRGB(0, 100, 150),	};
	{"Purple", 	Color3.fromRGB(100, 0, 150),	};
	{"Pink",	Color3.fromRGB(150, 0, 100),	};
	{"Black", 	Color3.fromRGB(60, 60, 60),		};
};

Colors = {							-- The colours for ChatColors and command arguments. | Format: {"ShortName", "FullName", Color3Value};
	{"r", 		"Red",		 		Color3.fromRGB(255, 0, 0)		};
	{"o", 		"Orange",	 		Color3.fromRGB(250, 100, 0)		};
	{"y", 		"Yellow",			Color3.fromRGB(255, 255, 0)		};
	{"g", 		"Green"	,			Color3.fromRGB(0, 255, 0)		};
	{"dg", 		"DarkGreen"	, 		Color3.fromRGB(0, 125, 0)		};
	{"b", 		"Blue",		 		Color3.fromRGB(0, 255, 255)		};
	{"db", 		"DarkBlue",			Color3.fromRGB(0, 50, 255)		};
	{"p", 		"Purple",	 		Color3.fromRGB(150, 0, 255)		};
	{"pk",		"Pink",		 		Color3.fromRGB(255, 85, 185)	};
	{"bk",		"Black",		 	Color3.fromRGB(0, 0, 0)			};
	{"w",		"White",	 		Color3.fromRGB(255, 255, 255)	};
};
ChatColors = {						-- The colour a player's chat will appear depending on their rank. '["Owner"] = "Yellow";' makes the owner's chat yellow.
		[0] 		= "Yellow";
		[5]         = "White";
};

Cmdbar						= 1;			-- The minimum rank required to use the Cmdbar.
Cmdbar2						= 3;			-- The minimum rank required to use the Cmdbar2.
ViewBanland					= 3;			-- The minimum rank required to view the banland.
OnlyShowUsableCommands		= false;		-- Only display commands equal to or below the user's rank on the Commands page.
RankRequiredToViewPage		= {				-- || The pages on the main menu ||
	["Commands"]		= 0;
	["Admin"]			= 0;
	["Settings"]		= 0;
};
RankRequiredToViewRank		= {				-- || The rank categories on the 'Ranks' subPage under Admin ||
	["Owner"]			= 0;
	["HeadAdmin"]		= 0;
	["Admin"]			= 0;
	["Mod"]				= 0;
	["VIP"]				= 0;
};
RankRequiredToViewRankType	= {				-- || The collection of loader-rank-rewarders on the 'Ranks' subPage under Admin ||
	["Owner"]			= 0;
	["SpecificUsers"]	= 5;
	["Gamepasses"] 		= 0;
	["Assets"] 			= 0;
	["Groups"] 			= 0;
	["Friends"] 		= 0;
	["FreeAdmin"] 		= 0;
	["VipServerOwner"] 	= 0;
};
RankRequiredToViewIcon		= 0;

WelcomeRankNotice			= true;			-- The 'You're a [rankName]' notice that appears when you join the game. Set to false to disable.
WelcomeDonorNotice			= true;			-- The 'You're a Donor' notice that appears when you join the game. Set to false to disable.
WarnIncorrectPrefix			= true;			-- Warn the user if using the wrong prefix | "Invalid prefix! Try using [correctPrefix][commandName] instead!"
DisableAllNotices			= false;		-- Set to true to disable all HD Admin notices.

ScaleLimit					= 4;			-- The maximum size players with a rank lower than 'IgnoreScaleLimit' can scale theirself. For example, players will be limited to ;size me 4 (if limit is 4) - any number above is blocked.
IgnoreScaleLimit			= 3;			-- Any ranks equal or above this value will ignore 'ScaleLimit'
CommandLimits				= {				-- Enables you to set limits for commands which have a number argument. Ranks equal to or higher than 'IgnoreLimit' will not be affected by Limit.
	["fly"]	= {
		Limit 				= 10000;
		IgnoreLimit 		= 3;
	};
	["fly2"]	= {
		Limit 				= 10000;
		IgnoreLimit 		= 3;
	};
	["noclip"]	= {
		Limit 				= 10000;
		IgnoreLimit 		= 3;
	};
	["noclip2"]	= {
		Limit 				= 10000;
		IgnoreLimit 		= 3;
	};
	["speed"]	= {
		Limit 				= 10000;
		IgnoreLimit 		= 3;
	};
	["jumpPower"]	= {
		Limit 				= 10000;
		IgnoreLimit 		= 3;
	};
};

VIPServerCommandBlacklist	= {"permRank", "permBan", "globalAnnouncement"};	-- Commands players are probihited from using in VIP Servers.
GearBlacklist				= {67798397};	-- The IDs of gear items to block when using the ;gear command.
IgnoreGearBlacklist			= 4;			-- The minimum rank required to ignore the gear blacklist.

PlayerDataStoreVersion		= "V1.0";		-- Data about the player (i.e. permRanks, custom settings, etc). Changing the Version name will reset all PlayerData.
SystemDataStoreVersion		= "V1.0";		-- Data about the game (i.e. the banland, universal message system, etc). Changing the Version name will reset all SystemData.

CoreNotices					= {				-- Modify core notices. You can find a table of all CoreNotices under [MainModule > Client > SharedModules > CoreNotices]
	--NoticeName = NoticeDetails;
};


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

Response:
local v1 = {};

	for v2, v3 in ipairs(script:GetChildren()) do
	if not v2 then
		break;
	end;
	if v3.ClassName == "ModuleScript" then
		for v5, v6 in pairs((require(v3))) do
			v1[v5] = v6;
		end;
	end;
end;
return v1;


Prompt:
----------------------------------
------------VARIABLES-------------
----------------------------------

Response:
PianoId = nil
Connector = game.Workspace:FindFirstChild("GlobalPianoConnector")
local Transposition, Volume = script.Parent:WaitForChild("Transpose"), 1


Prompt: ---Box thing

Response:
for _,v in pairs(script.Parent.ShopFrame.Boxes:GetChildren()) do
	if v:IsA("TextButton") then
		v.MouseButton1Click:Connect(function()
			---Clean
			for _,y in pairs(script.Parent.ShopFrame.BoxContaining.Frame:GetChildren()) do
				if y:IsA("ImageLabel") then
					y:Destroy()
				end
			end

			--Add
			local Weaponfolder = game.ReplicatedStorage.Weapons:FindFirstChild(v.Parent.Weapon.Value)
			print(Weaponfolder.Name)
			print(v.Name)
			local Boxfolder = Weaponfolder:FindFirstChild(v.Name)
			local Weapons = Boxfolder:GetChildren()
			if #Weapons > 0 then
				for _,y in pairs(Weapons) do
					local ImgFrame = Instance.new("ImageLabel")
					ImgFrame.Parent = script.Parent.ShopFrame.BoxContaining.Frame
					ImgFrame.Image = y.TextureId
				end
			end
			script.Parent.ShopFrame.BoxContaining.TextLabel.Text = (Boxfolder.Name).." box contains:"
			script.Parent.ShopFrame.BoxContaining.Box.Value = Boxfolder
			script.Parent.ShopFrame.BoxContaining.Visible = true
			script.Parent.ShopFrame.Boxes.Visible = false
		end)
	end
end


Prompt:
--[[

	LOWGames Studios
	Date: 27 October 2022
	by Elder

]]

Response:
--

local u1 = nil;
coroutine.wrap(function()
	u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
end)();
return function(p1)
	local v1 = Instance.new("Part");
	v1.Anchored = true;
	v1.CanCollide = false;
	v1.Transparency = 1;
	v1.Material = Enum.Material.SmoothPlastic;
	v1.CastShadow = false;
	v1.Size = Vector3.new();
	v1.CFrame = typeof(p1) == "Vector3" and CFrame.new(p1) or p1;
	v1.Name = "host";
	local v2 = Instance.new("Attachment");
	v2.Parent = v1;
	v1.Parent = u1.Debris;
	return v1, v2;
end;


Prompt: -- Declaring Variables

Response:
local ts = game:GetService("TweenService")

local mainUI = script.Parent.Parent

local shopFrame = mainUI.Frame
local shopBtn = mainUI.OpenShop


Prompt: --!strict

Response:
local function startsWith(value: string, substring: string, position: number?): boolean
	if string.len(substring) == 0 then
		return true
	end
	-- Luau FIXME: we have to use a tmp variable, as Luau doesn't understand the logic below narrow position to `number`
	local position_
	if position == nil or position < 1 then
		position_ = 1
	else
		position_ = position
	end

	if position_ > string.len(value) then
		return false
	end
	return value:find(substring, position_, true) == position_
end

return startsWith


Prompt:
--local function pad_and_xor(str, result_length, byte_for_xor)
--	return string.gsub(str, ".", function(c)
--		return string.char(bit32_bxor(string.byte(c), byte_for_xor))
--	end) .. string.rep(string.char(byte_for_xor), result_length - #str)
--end


Prompt:
--bin.Equipped:connect(onEquipped)
--bin.Selected:connect(onSelected)


Prompt:
--[[
	Sets the text on the touchable button
]]

Response:
function BaseSystem:_setButtonText(text)
	local button = self._model:FindFirstChild("ToggleButton")

	if not button then
		return
	end

	local textLabel = button:FindFirstChild("SurfaceGui"):FindFirstChild("Text")

	if not textLabel then
		return
	end

	textLabel.Text = text
end


Prompt: --Disable script if car is removed from workspace

Response:
Car.AncestryChanged:Connect(function()
	if not Car:IsDescendantOf(Workspace) then
		unbindActions()

		LocalVehicleSeating.ExitSeat()
		LocalVehicleSeating.DisconnectFromSeatExitEvent(onExitSeat)
		-- stop seated anim
		--print("car removed from workspace")

		script.Disabled = true
		ProximityPromptService.Enabled = true
	end
end)

local function exitVehicle(action, inputState, inputObj)
	if inputState == Enum.UserInputState.Begin then
		LocalVehicleSeating.ExitSeat()
		-- stop seated anim
	end
end

local function _updateRawInput(_, inputState, inputObj)
	local key = inputObj.KeyCode
	local data = Keymap.getData(key)

	if not data then
		return
	end

	local axis = data.Axis
	local val = 0

	if axis then
		val = inputObj.Position:Dot(axis)
	else
		val = (inputState == Enum.UserInputState.Begin or inputState == Enum.UserInputState.Change) and 1 or 0
	end

	val = val * (data.Sign or 1)

	_rawInput[key] = val

	if data.Pass then
		return Enum.ContextActionResult.Pass
	end
end

local function _calculateInput(action)
	-- Loop through all mappings for this action and calculate a resultant value from the raw input
	local mappings = Keymap[action]
	local val = 0
	local absVal = val

	for _, data in ipairs(mappings) do
		local thisVal = _rawInput[data.KeyCode]
		if math.abs(thisVal) > absVal then
			val = thisVal
			absVal = math.abs(val)
		end
	end

	return val
end

ContextActionService:BindAction(
	EXIT_ACTION_NAME,
	exitVehicle,
	false,
	Keymap.EnterVehicleGamepad,
	Keymap.EnterVehicleKeyboard
)

ContextActionService:BindActionAtPriority(
	RAW_INPUT_ACTION_NAME,
	_updateRawInput,
	false,
	Enum.ContextActionPriority.High.Value,
	unpack(Keymap.allKeys()))


Prompt:
--[[

	Calculates a ratio for interface scaling based on resolution (screen size). Used for scaling down, not up.

	Functions.ResolutionScale()

--]]

Response:
return function()
	--- Return cache
	if tick() - lastCalcTick <= 0.05 then
		return lastCalc
	end

	--- calc
	local resolution = camera.ViewportSize
	local resolutionScale = resolution.Magnitude
	local scale = math.clamp(resolutionScale / 1800, 0.33, 1)

	--- Cache
	lastCalc = scale
	lastCalcTick = tick()

	--
	return scale
end


Prompt:
--[[
		___      _______                _
	   / _ |____/ ___/ /  ___ ____ ___ (_)__
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]

Response:
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local on = 0

script:WaitForChild("Rev")

if not FE then
	for i,v in pairs(car.DriveSeat:GetChildren()) do
		for _,a in pairs(script:GetChildren()) do
			if v.Name==a.Name then v:Stop() wait() v:Destroy() end
		end
	end
	for i,v in pairs(script:GetChildren()) do
		v.Parent=car.DriveSeat
	end

	car.DriveSeat.Rev:Play()

	while wait() do
		local _RPM = script.Parent.Values.RPM.Value

		if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end
		car.DriveSeat.Rev.Pitch = (car.DriveSeat.Rev.SetPitch.Value + car.DriveSeat.Rev.SetRev.Value*_RPM/_Tune.Redline)*on^2
	end
else
	local handler = car.AC6_FE_Sounds
	handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)
	handler:FireServer("playSound","Rev")
	local pitch=0
	while wait() do
		local _RPM = script.Parent.Values.RPM.Value

		if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end
		pitch = (script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline)*on^2
		handler:FireServer("updateSound","Rev",script.Rev.SoundId,pitch,script.Rev.Volume)
	end
end


Prompt: -- this script is optional and not required to have, delete it or keep it

Response:
local player = {}
local input = {}
local animation = {}

local players = game:GetService("Players")
local runservice = game:GetService("RunService")
local userinput = game:GetService("UserInputService")

do -- player
	local PLAYER = players.LocalPlayer

	player = setmetatable({}, {__index = function(k)
		return rawget(player, k) or PLAYER:FindFirstChild(tostring(k))
	end})

	local function onCharacter(character)
		wait()
		player.character = character
		player.mouse = PLAYER:GetMouse()
		player.backpack = PLAYER:WaitForChild("Backpack")
		player.humanoid = player.character:WaitForChild("Humanoid")
		player.torso = player.character:WaitForChild("Torso")
		player.alive = true

		repeat wait() until player.humanoid.Parent == player.character and player.character:IsDescendantOf(game)
		animation.crouch = player.humanoid:LoadAnimation(script:WaitForChild("crouch"))
		input.stance = "stand"
		local onDied onDied = player.humanoid.Died:connect(function()
			player.alive = false
			onDied:disconnect()
			if animation.crouch then
				animation.crouch:Stop(.2)
			end
		end)
	end
	if PLAYER.Character then
		onCharacter(PLAYER.Character)
	end
	PLAYER.CharacterAdded:connect(onCharacter)
end

do -- input
	input.stance = "stand"
	local sprinting = false
	local default_right = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
	local default_left = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
	runservice.RenderStepped:connect(function()
		if animation.crouch then
			if animation.crouch.IsPlaying then
				animation.crouch:AdjustSpeed(Vector3.new(player.torso.Velocity.x, 0, player.torso.Velocity.z).magnitude/10)
			end
		end
	end)
	userinput.TextBoxFocused:connect(function()
		if sprinting then
			sprinting = false
			player.humanoid.WalkSpeed = 16
		end
	end)
	userinput.InputBegan:connect(function(object, g)
		if not g then
			if object.UserInputType == Enum.UserInputType.Keyboard then
				local key = object.KeyCode
				if key == Enum.KeyCode.C then
					if input.stance == "crouch" then
						player.humanoid.HipHeight = 0
						player.humanoid.WalkSpeed = 16
						animation.crouch:Stop(.2)
						input.stance = "stand"
					else
						input.stance = "crouch"
						player.humanoid.HipHeight = -1
						player.humanoid.WalkSpeed = 16 * 0.4
						animation.crouch:Play(.2)
					end
				elseif key == Enum.KeyCode.LeftShift then
					if not sprinting then
						sprinting = true
						player.humanoid.WalkSpeed = 16 * (input.stance == "crouch" and 0.8 or 1.25)
					end
				end
			end
		end
	end)
	userinput.InputEnded:connect(function(object, g)
		if not g then
			if object.UserInputType == Enum.UserInputType.Keyboard then
				local key = object.KeyCode
				if key == Enum.KeyCode.LeftShift then
					if sprinting then
						sprinting = false
						player.humanoid.WalkSpeed = 16 * (input.stance == "crouch" and 0.4 or 1)
					end
				end
			end
		end
	end)
end


Prompt: -- UAEmaple

Response:
function onTouch(part)
local human = part.Parent:findFirstChild("Humanoid")
if human ~= nil then
part.Parent:findFirstChild("Head").Transparency = 0.99
part.Parent:findFirstChild("Torso").Transparency = 1
part.Parent:findFirstChild("Left Arm").Transparency = 1
part.Parent:findFirstChild("Right Arm").Transparency = 1
part.Parent:findFirstChild("Left Leg").Transparency = 1
part.Parent:findFirstChild("Right Leg").Transparency = 1
if part.Parent:findFirstChild("Head"):findFirstChild("face") == nil then return end
part.Parent:findFirstChild("Head"):findFirstChild("face"):remove()
if part.Parent:findFirstChild("Torso"):findFirstChild("roblox") == nil then return end
part.Parent:findFirstChild("Torso"):findFirstChild("roblox"):remove()
end
end
script.Parent.Touched:connect(onTouch)print("Hello world!")


Prompt:
--[=[
	@return ... any
	@yields

	Yields the current thread until the signal is fired, and returns the arguments fired from the signal.
	Yielding the current thread is not always desirable. If the desire is to only capture the next event
	fired, using `ConnectOnce` might be a better solution.
	```lua
	task.spawn(function()
		local msg, num = signal:Wait()
		print(msg, num) --> "Hello", 32
	end)
	signal:Fire("Hello", 32)
	```
]=]

Response:
function Signal:Wait()
	local waitingCoroutine = coroutine.running()
	local connection
	local done = false
	connection = self:Connect(function(...)
		if done then
			return
		end
		done = true
		connection:Disconnect()
		task.spawn(waitingCoroutine, ...)
	end)
	return coroutine.yield()
end


Prompt: --Player.CameraMode = "LockFirstPerson"

Response:
elseif key == "q" or key== "ButtonL2" and zoomed then
zoomed = false
Cam.FieldOfView = 70
Player.Character.Humanoid.CameraOffset = Vector3.new(0,0,0)


Prompt: -- << AUTO UPDATE FRAMES >>

Response:
spawn(function()
	while wait(20) do
		if frame.Visible and main.gui.MainFrame.Visible then
			module:UpdatePages()
		end
	end
end)

return module


Prompt:
-- Given two pairs of arrays of strings:
-- Compare the pair of comparison arrays line-by-line.
-- Format the corresponding lines in the pair of displayable arrays.

Response:
local function diffLinesUnified2(
	aLinesDisplay: { [number]: string },
	bLinesDisplay: { [number]: string },
	aLinesCompare: { [number]: string },
	bLinesCompare: { [number]: string },
	options: DiffOptions?
): string
	if isEmptyString(aLinesDisplay) and isEmptyString(aLinesCompare) then
		aLinesDisplay = {}
		aLinesCompare = {}
	end
	if isEmptyString(bLinesDisplay) and isEmptyString(bLinesCompare) then
		bLinesDisplay = {}
		bLinesCompare = {}
	end

	if #aLinesDisplay ~= #aLinesCompare or #bLinesDisplay ~= #bLinesCompare then
		-- Fall back to diff of display lines.
		return diffLinesUnified(aLinesDisplay, bLinesDisplay, options)
	end

	local diffs = diffLinesRaw(aLinesCompare, bLinesCompare)

	-- Replace comparison lines with displayable lines.
	local aIndex = 0
	local bIndex = 0
	for _, d in ipairs(diffs) do
		local case = d[1]
		if case == DIFF_DELETE then
			d[2] = aLinesDisplay[aIndex + 1]
			aIndex += 1
		elseif case == DIFF_INSERT then
			d[2] = bLinesDisplay[bIndex + 1]
			bIndex += 1
		else
			d[2] = bLinesDisplay[bIndex + 1]
			aIndex += 1
			bIndex += 1
		end
	end

	return printDiffLines(diffs, normalizeDiffOptions(options))
end


Prompt: --// F key, Manual

Response:
mouse.KeyDown:connect(function(key)
	if key=="f" then
		script.Parent.Parent.Man.TextTransparency = 0
		veh.Lightbar.middle.Man:Play()
		veh.Lightbar.middle.Wail.Volume = 0
		veh.Lightbar.middle.Yelp.Volume = 0
		veh.Lightbar.middle.Priority.Volume = 0
		veh.Lightbar.middle.Hilo.Volume = 0
		veh.Lightbar.middle.Rwail.Volume = 0
script.Parent.Parent.MBOV.Visible = true
			script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
	end
end)


Prompt: --// Variables

Response:
repeat wait() until Players.LocalPlayer
local Player = Players.LocalPlayer


Prompt: -- Set the tank's welds to face the right direction

Response:
function setTurretDirection(elevation, rotation)
	parts.MantletBase.MainGunWeld.C1 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0, elevation, 0);
	parts.TurretRing2.TurretRingWeld.C1 = CFrame.new(0,0,0.8) * CFrame.fromEulerAnglesXYZ(0, 0, rotation);
end


Prompt: -- Create component

Response:
local AboutPane = Roact.PureComponent:extend(script.Name)

function AboutPane:init()
    self.DockSize, self.SetDockSize = Roact.createBinding(UDim2.new())
    self.Maid = Maid.new()
end

function AboutPane:willUnmount()
    self.Maid:Destroy()
end

function AboutPane:render()
    return new('ImageButton', {
        Image = '';
        BackgroundTransparency = 0.75;
        BackgroundColor3 = Color3.fromRGB(0, 0, 0);
        LayoutOrder = self.props.LayoutOrder;
        Size = UDim2.new(1, 0, 0, 32);
        [Roact.Event.Activated] = function (rbx)
            self:setState({
                IsManualOpen = not self.state.IsManualOpen;
            })
        end;
        [Roact.Event.MouseButton1Down] = function (rbx)
            local Dock = rbx.Parent
            local InitialAbsolutePosition = UserInputService:GetMouseLocation() - GuiService:GetGuiInset()
            local InitialPosition = Dock.Position

            self.Maid.DockDragging = UserInputService.InputChanged:Connect(function (Input)
                if (Input.UserInputType.Name == 'MouseMovement') or (Input.UserInputType.Name == 'Touch') then

                    -- Suppress activation response if dragging detected
                    if (Vector2.new(Input.Position.X, Input.Position.Y) - InitialAbsolutePosition).Magnitude > 3 then
                        rbx.Active = false
                    end

                    -- Reposition dock
                    Dock.Position = UDim2.new(
                        InitialPosition.X.Scale,
                        InitialPosition.X.Offset + (Input.Position.X - InitialAbsolutePosition.X),
                        InitialPosition.Y.Scale,
                        InitialPosition.Y.Offset + (Input.Position.Y - InitialAbsolutePosition.Y)
                    )
                end
            end)

            self.Maid.DockDraggingEnd = UserInputService.InputEnded:Connect(function (Input)
                if (Input.UserInputType.Name == 'MouseButton1') or (Input.UserInputType.Name == 'Touch') then
                    self.Maid.DockDragging = nil
                    self.Maid.DockDraggingEnd = nil
                    rbx.Active = true
                end
            end)
        end;
    }, {
        Corners = new('UICorner', {
            CornerRadius = UDim.new(0, 3);
        });
        Signature = new('ImageLabel', {
            AnchorPoint = Vector2.new(0, 0.5);
            BackgroundTransparency = 1;
            Size = UDim2.new(1, 0, 0, 13);
            Image = 'rbxassetid://2326685066';
            Position = UDim2.new(0, 6, 0.5, 0);
        }, {
            AspectRatio = new('UIAspectRatioConstraint', {
                AspectRatio = 2.385;
            });
        });
        HelpIcon = new('ImageLabel', {
            AnchorPoint = Vector2.new(1, 0.5);
            BackgroundTransparency = 1;
            Position = UDim2.new(1, 0, 0.5, 0);
            Size = UDim2.new(0, 30, 0, 30);
            Image = 'rbxassetid://141911973';

        });
        ManualWindowPortal = new(Roact.Portal, {
            target = self.props.Core.UI;
        }, {
            ManualWindow = (self.state.IsManualOpen or nil) and new(ToolManualWindow, {
                Text = MANUAL_CONTENT;
                ThemeColor = Color3.fromRGB(255, 176, 0);
            });
        });
    })
end

return AboutPane


Response:
local PhysicsManager, SeatManager, ControlManager
local BoatModel = script.Parent
local Seat = WaitForChild(BoatModel, "qBoatSeat")


Prompt:
--[[
	Function called upon entering the state
]]

Response:
function PlayerPreGame.enter(stateMachine, playerComponent)
end


Prompt: --[[Weight and CG]]

Response:
	Tune.Weight			= 3472		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		3		,
	 --[[Length]]		14		}
	Tune.WeightDist		= 60		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= 1		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible

	--Unsprung Weight
	Tune.FWheelDensity	= .45		-- Front Wheel Density
	Tune.RWheelDensity	= .45		-- Rear Wheel Density
	Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
	Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]

	Tune.AxleSize		= 2			-- Size of structural members (larger = more stable/carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members


Prompt:
-- Standard Flash Rates
-- 50 flashes/min -> wait(.6)
-- 60 flashes/min -> wait(.5) (default)


Prompt: -- module

Response:
local INPUT	= {}

function INPUT.GetActionInput(self, action)
	local input	= "nil"

	local replacements	= {
		Zero	= "0";
		One		= "1";
		Two		= "2";
		Three	= "3";
		Four	= "4";
		Five	= "5";
		Six		= "6";
		Seven	= "7";
		Eight	= "8";
		Nine	= "9";

		MouseButton1	= "MB1";
		MouseButton2	= "MB2";
		MouseButton3	= "MB3";
		Return			= "Enter";
		Slash			= "/";
		Tilde			= "~";
		Backquote		= "`";
	}

	if actions[action] then
		local primary, secondary	= actions[action].Primary, actions[action].Secondary

		if primary then
			input	= primary.Name
		elseif secondary then
			input	= secondary.Name
		end
	end

	if replacements[input] then
		input	= replacements[input]
	end

	return string.upper(input)
end

if not initialized then
	local keybindChanged	= Instance.new("BindableEvent")
	INPUT.KeybindChanged	= keybindChanged.Event

	actionBegan	= Instance.new("BindableEvent")
	actionEnded	= Instance.new("BindableEvent")

	INPUT.ActionBegan	= actionBegan.Event
	INPUT.ActionEnded	= actionEnded.Event

	-- register actions

	local function Register(action, bindP, bindS)
		local primary, secondary
		if bindP then
			local A, B	= string.match(bindP, "(.-)%.(.+)")

			if A and B then
				primary	= Enum[A][B]
			end
		end
		if bindS then
			local A, B	= string.match(bindS, "(.-)%.(.+)")

			if A and B then
				secondary	= Enum[A][B]
			end
		end

		RegisterAction(action, primary, secondary)
		keybindChanged:Fire(action)
	end

	local function Handle(keybind)
		local action	= keybind.Name
		local bind		= keybind.Value

		if string.match(bind, ";") then
			local bindP, bindS	= string.match(bind, "(.-);(.+)")

			if bindP and bindS then
				Register(action, bindP, bindS)
			elseif bindP then
				Register(action, bindP)
			elseif bindS then
				Register(action, nil, bindS)
			end
		else
			Register(action, bind)
		end
	end

	initialized			= true
end

return INPUT


Prompt:
--[=[
	Converts the string to `UpperCamelCase` from `camelCase` or `snakeCase` or `YELL_CASE`
	@param str string
	@return string
]=]

Response:
function String.toCamelCase(str: string): string
	str = str:lower()
	str = str:gsub("[ _](%a)", string.upper)
	str = str:gsub("^%a", string.upper)
	str = str:gsub("%p", "")

	return str
end


Prompt: -- Door variables

Response:
local Door 			= script.Parent.Parent.Door.Door
local DoorLogo 		= Door.DoorLogo
local DoorSeg 		= Door.DoorSegment
Door.PrimaryPart 	= Door.DoorSegment

local Open, ShouldBe = false, false
local InZone = {}


Prompt:
--[[
	Button for opening the EmoteBar on gamepad enabled devices.
]]

Response:
local ContextActionService = game:GetService("ContextActionService")

local Roact = require(script.Parent.Parent.Packages.Roact)
local t = require(script.Parent.Parent.Packages.t)
local ConfigurationContext = require(script.Parent.Parent.Libraries.Configuration).ConfigurationContext

local GamepadToggleButton = Roact.Component:extend("GamepadToggleButton")

local MAX_SIZE = 66

GamepadToggleButton.defaultProps = {
	actionName = "GamepadToggleButton",
	onActivated = function() end,
}

GamepadToggleButton.validateProps = t.interface({
	onActivated = t.callback,
	transparency = t.optional(t.union(t.table, t.number)), -- Binding or number
})

function GamepadToggleButton:init()
	self.onActivated = function(_actionName, inputState)
		if inputState ~= Enum.UserInputState.Begin then
			return
		end

		self.props.onActivated()
	end
end

function GamepadToggleButton:render()
	return Roact.createElement("ImageButton", {
		Size = UDim2.fromOffset(MAX_SIZE, MAX_SIZE),
		Image = self.props.configuration.gamepadButtonIcon,
		ImageTransparency = self.props.transparency,
		BackgroundTransparency = 1,

		[Roact.Event.Activated] = self.props.onActivated,
	}, {
		AspectRatio = Roact.createElement("UIAspectRatioConstraint", {
			AspectRatio = 1,
		}),

		GamepadButton = Roact.createElement("ImageLabel", {
			Image = self.props.configuration.toggleButtonImage,
			ImageTransparency = self.props.transparency,
			Size = UDim2.fromScale(0.5, 0.5),
			Position = UDim2.fromScale(1, 1),
			AnchorPoint = Vector2.new(0.85, 0.85),
			BackgroundTransparency = 1,
		}),
	})
end

function GamepadToggleButton:didMount()
	ContextActionService:BindAction(
		self.props.actionName,
		self.onActivated,
		false,
		self.props.configuration.toggleButton
	)
end

function GamepadToggleButton:willUnmount()
	ContextActionService:UnbindAction(self.props.actionName)
end

return ConfigurationContext.withConfiguration(GamepadToggleButton)


Prompt: --Made by Stickmasterluke ;D

Response:
sp=script.Parent

theface="http://www.roblox.com/asset?id=103838612"
health=80
textureclosed="http://www.roblox.com/asset?id=103920391"
textureopen="http://www.roblox.com/asset?id=103920471"

storedface=""
local debris=game:GetService("Debris")
check=true

sp.Equipped:connect(function(mouse)
	equipped=true
	if mouse~=nil then
		mouse.Icon="rbxasset://textures\\GunCursor.png"
		mouse.Button1Down:connect(function()
			local chr=sp.Parent
			if chr and check then
				local t=chr:FindFirstChild("Torso")
				local h=chr:FindFirstChild("Humanoid")
				local anim=sp:FindFirstChild("Eat")
				if anim and t and h and h.Health>0 and equipped and check then
					mouse.Icon="rbxasset://textures\\GunWaitCursor.png"
					check=false
					anim2=h:LoadAnimation(anim)
					anim2:Play()
					local handle=sp:FindFirstChild("Handle")
					if handle~=nil then
						local mesh=handle:FindFirstChild("Mesh")
						if mesh~=nil then
							mesh.TextureId=textureopen
						end
					end
					wait(2)
					local s=sp.Handle:FindFirstChild("Sound")
					if s~=nil and equipped and w~=nil then
						w.C0=CFrame.new(0,-1,-.3)*CFrame.Angles(-.3,0,math.pi/4)
						s:Play()
					else
						check=true
						return
					end
					wait(2)
					if h~=nil and h.Health>0 and equipped and w~=nil then
						h:TakeDamage(-math.min(health*.5,h.MaxHealth-h.Health))
						head=nil
						face=nil
						local head=h.Parent:FindFirstChild("Head")
						if head~=nil then
							face=head:FindFirstChild("face")
							if face~=nil then
								storedface=face.Texture
								face.Texture=theface
							end
						end
						w.C0=CFrame.new(0,-1,-.3)*CFrame.Angles(.3,0,math.pi/4)
					else
						check=true
						return
					end
					wait(2)
					local s=sp.Handle:FindFirstChild("Sound")
					if s~=nil and equipped and w~=nil then
						w.C0=CFrame.new(0,-1,-.3)*CFrame.Angles(-.3,0,math.pi/4)
						s:Play()
					else
						check=true
						return
					end
					wait(2)
					if h~=nil and h.Health>0 and equipped and w~=nil then
						h:TakeDamage(-math.min(health*.5,h.MaxHealth-h.Health))
						w.C0=CFrame.new(0,-1,-.3)*CFrame.Angles(0,0,math.pi/4)
					end
					wait(3)
					if mouse~=nil then
						mouse.Icon="rbxasset://textures\\GunCursor.png"
					end
					if face~=nil then
						face.Texture=storedface
					end
					local handle=sp:FindFirstChild("Handle")
					if handle~=nil then
						local mesh=handle:FindFirstChild("Mesh")
						if mesh~=nil then
							mesh.TextureId=textureclosed
						end
					end
					check=true
				end
			end
		end)
	end
	delay(0,function()
		local la=sp.Parent:FindFirstChild("Left Arm")
		if la~=nil then
			if spoon then
				spoon:remove()
			end
			spoon=Instance.new("Part")
			spoon.FormFactor="Custom"
			spoon.Name="Handle"
			spoon.Size=Vector3.new(.2,.2,1.3)
			spoon.TopSurface="Smooth"
			spoon.BottomSurface="Smooth"
			spoon.CanCollide=false
			local m=Instance.new("SpecialMesh")
			m.MeshId="http://www.roblox.com/asset?id=103919885"
			m.TextureId=textureopen
			m.Parent=spoon
			w=Instance.new("Motor")
			w.Part0=la
			w.Part1=spoon
			w.C0=CFrame.new(0,-1,-.3)*CFrame.Angles(0,0,math.pi/4)
			w.Parent=spoon
			debris:AddItem(spoon,600)
			spoon.Parent=game.Workspace
		end
	end)
end)

sp.Unequipped:connect(function()
	equipped=false
	if anim2 then
		anim2:Stop()
	end
	if face~=nil then
		face.Texture=storedface
	end
	local handle=sp:FindFirstChild("Handle")
	if handle~=nil then
		local mesh=handle:FindFirstChild("Mesh")
		if mesh~=nil then
			mesh.TextureId=textureclosed
		end
	end
	if spoon then
		spoon:remove()
	end
end)


Prompt:
-- Fires off everytime the link is reconfigured into a valid link
-- Fires with link, linkValue

Response:
function RxLinkUtils.observeValidityBrio(linkName, link)
	assert(typeof(link) == "Instance" and link:IsA("ObjectValue"), "Bad link")
	assert(type(linkName) == "string", "Bad linkName")

	return Observable.new(function(sub)
		local maid = Maid.new()

		local function updateValidity()
			if not ((link.Name == linkName) and link.Value) then
				maid._lastValid = nil
				return
			end

			local newValid = Brio.new(link, link.Value)
			maid._lastValid = newValid
			sub:Fire(newValid)
		end

		maid:GiveTask(link:GetPropertyChangedSignal("Value")
			:Connect(updateValidity))
		maid:GiveTask(link:GetPropertyChangedSignal("Name")
			:Connect(updateValidity))
		updateValidity()

		return maid
	end)
end

return RxLinkUtils


Prompt: ---------------------------------------DO NOT EDIT-------------------------------------------------------

Response:
		local AbiltyGui = script.Parent.ScreenGui:Clone()
		AbiltyGui.AbilitySecs.Value = script.Parent.Configuration.AbilityCoolDown.Value
		AbiltyGui.AbilitySecs2.Value = script.Parent.Configuration.AbilityCoolDown.Value
		wait(0.01)
		AbiltyGui.LocalScript.Disabled = false
		wait()
		AbiltyGui.LocalScript2.Disabled = false
		wait(0.1)
		AbiltyGui.Parent = Player.PlayerGui

		wait(script.Parent.Configuration.AbilityCoolDown.Value)
		script.Disabled = false
		script.Parent.Ability.Disabled = false
	end
end)


Prompt: --	elseif inputType == Enum.UserInputType.Keyboard or inputType.Value <= 4 then


Prompt: -- SpeederSpawnLocation part

Response: local SpeederSpawnLocation = workspace:FindFirstChild("SpeederSpawnLocation")


Prompt:
--[[
	The symbol used to denote the children of an instance when working with the
	`New` function.
]]

Response:
local Package = script.Parent.Parent
local PubTypes = require(Package.PubTypes)

return {
	type = "Symbol",
	name = "Children"
} :: PubTypes.ChildrenKey


Prompt:
-- Formerly getCurrentCameraMode, this function resolves developer and user camera control settings to
-- decide which camera control module should be instantiated. The old method of converting redundant enum types

Response:
function CameraModule:GetCameraControlChoice()
	local player = Players.LocalPlayer

	if player then
		if self.lastInputType == Enum.UserInputType.Touch or UserInputService.TouchEnabled then
			-- Touch
			if player.DevTouchCameraMode == Enum.DevTouchCameraMovementMode.UserChoice then
				return CameraUtils.ConvertCameraModeEnumToStandard( UserGameSettings.TouchCameraMovementMode )
			else
				return CameraUtils.ConvertCameraModeEnumToStandard( player.DevTouchCameraMode )
			end
		else
			-- Computer
			if player.DevComputerCameraMode == Enum.DevComputerCameraMovementMode.UserChoice then
				local computerMovementMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)
				return CameraUtils.ConvertCameraModeEnumToStandard(computerMovementMode)
			else
				return CameraUtils.ConvertCameraModeEnumToStandard(player.DevComputerCameraMode)
			end
		end
	end
end

function CameraModule:OnCharacterAdded(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterAdded(char, player)
	end
end

function CameraModule:OnCharacterRemoving(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterRemoving(char, player)
	end
end

function CameraModule:OnPlayerAdded(player)
	player.CharacterAdded:Connect(function(char)
		self:OnCharacterAdded(char, player)
	end)
	player.CharacterRemoving:Connect(function(char)
		self:OnCharacterRemoving(char, player)
	end)
end

function CameraModule:OnMouseLockToggled()
	if self.activeMouseLockController then
		local mouseLocked = self.activeMouseLockController:GetIsMouseLocked()
		local mouseLockOffset = self.activeMouseLockController:GetMouseLockOffset()
		if self.activeCameraController then
			self.activeCameraController:SetIsMouseLocked(mouseLocked)
			self.activeCameraController:SetMouseLockOffset(mouseLockOffset)
		end
	end
end

return CameraModule.new()


Prompt:
--[[**
	ensures value is a number where min < value

	@param min The minimum to use

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

Response:
function t.numberMinExclusive(min)
	return function(value)
		local success, errMsg = t.number(value)
		if not success then
			return false, errMsg or ""
		end
		if min < value then
			return true
		else
			return false, string.format("number > %s expected, got %s", min, value)
		end
	end
end


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

Response:
local v1 = {};
v1.__index = v1;
local l__Players__2 = game:GetService("Players");
local l__RunService__3 = game:GetService("RunService");
local l__UserInputService__4 = game:GetService("UserInputService");
local l__VRService__5 = game:GetService("VRService");
local l__UserGameSettings__6 = UserSettings():GetService("UserGameSettings");
local v7 = require(script:WaitForChild("CameraUtils"));
local v8 = require(script:WaitForChild("CameraInput"));
local v9 = require(script:WaitForChild("ClassicCamera"));
local v10 = require(script:WaitForChild("OrbitalCamera"));
local v11 = require(script:WaitForChild("LegacyCamera"));
local v12 = require(script:WaitForChild("VehicleCamera"));
local v13 = require(script:WaitForChild("VRCamera"));
local v14 = require(script:WaitForChild("VRVehicleCamera"));
local v15 = require(script:WaitForChild("Invisicam"));
local v16 = require(script:WaitForChild("Poppercam"));
local v17 = require(script:WaitForChild("TransparencyController"));
local v18 = require(script:WaitForChild("MouseLockController"));
local l__PlayerScripts__19 = l__Players__2.LocalPlayer:WaitForChild("PlayerScripts");
l__PlayerScripts__19:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Default);
l__PlayerScripts__19:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Follow);
l__PlayerScripts__19:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Classic);
l__PlayerScripts__19:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Default);
l__PlayerScripts__19:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Follow);
l__PlayerScripts__19:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Classic);
l__PlayerScripts__19:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.CameraToggle);
local u1 = { "CameraMinZoomDistance", "CameraMaxZoomDistance", "CameraMode", "DevCameraOcclusionMode", "DevComputerCameraMode", "DevTouchCameraMode", "DevComputerMovementMode", "DevTouchMovementMode", "DevEnableMouseLock" };
local u2 = { "ComputerCameraMovementMode", "ComputerMovementMode", "ControlMode", "GamepadCameraSensitivity", "MouseSensitivity", "RotationType", "TouchCameraMovementMode", "TouchMovementMode" };
function v1.new()
	local v20 = setmetatable({}, v1);
	v20.activeCameraController = nil;
	v20.activeOcclusionModule = nil;
	v20.activeTransparencyController = nil;
	v20.activeMouseLockController = nil;
	v20.currentComputerCameraMovementMode = nil;
	v20.cameraSubjectChangedConn = nil;
	v20.cameraTypeChangedConn = nil;
	for v21, v22 in pairs(l__Players__2:GetPlayers()) do
		v20:OnPlayerAdded(v22);
	end;
	l__Players__2.PlayerAdded:Connect(function(p1)
		v20:OnPlayerAdded(p1);
	end);
	v20.activeTransparencyController = v17.new();
	v20.activeTransparencyController:Enable(true);
	if not l__UserInputService__4.TouchEnabled then
		v20.activeMouseLockController = v18.new();
		local v23 = v20.activeMouseLockController:GetBindableToggleEvent();
		if v23 then
			v23:Connect(function()
				v20:OnMouseLockToggled();
			end);
		end;
	end;
	v20:ActivateCameraController(v20:GetCameraControlChoice());
	v20:ActivateOcclusionModule(l__Players__2.LocalPlayer.DevCameraOcclusionMode);
	v20:OnCurrentCameraChanged();
	l__RunService__3:BindToRenderStep("cameraRenderUpdate", Enum.RenderPriority.Camera.Value, function(p2)
		v20:Update(p2);
	end);
	for v24, v25 in pairs(u1) do
		l__Players__2.LocalPlayer:GetPropertyChangedSignal(v25):Connect(function()
			v20:OnLocalPlayerCameraPropertyChanged(v25);
		end);
	end;
	for v26, v27 in pairs(u2) do
		l__UserGameSettings__6:GetPropertyChangedSignal(v27):Connect(function()
			v20:OnUserGameSettingsPropertyChanged(v27);
		end);
	end;
	game.Workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
		v20:OnCurrentCameraChanged();
	end);
	return v20;
end;
function v1.GetCameraMovementModeFromSettings(p3)
	if l__Players__2.LocalPlayer.CameraMode == Enum.CameraMode.LockFirstPerson then
		return v7.ConvertCameraModeEnumToStandard(Enum.ComputerCameraMovementMode.Classic);
	end;
	if l__UserInputService__4.TouchEnabled then
		local v28 = v7.ConvertCameraModeEnumToStandard(l__Players__2.LocalPlayer.DevTouchCameraMode);
		local v29 = v7.ConvertCameraModeEnumToStandard(l__UserGameSettings__6.TouchCameraMovementMode);
	else
		v28 = v7.ConvertCameraModeEnumToStandard(l__Players__2.LocalPlayer.DevComputerCameraMode);
		v29 = v7.ConvertCameraModeEnumToStandard(l__UserGameSettings__6.ComputerCameraMovementMode);
	end;
	if v28 == Enum.DevComputerCameraMovementMode.UserChoice then
		return v29;
	end;
	return v28;
end;
local u3 = {};
function v1.ActivateOcclusionModule(p4, p5)
	if p5 == Enum.DevCameraOcclusionMode.Zoom then
		local v30 = v16;
	else
		if p5 ~= Enum.DevCameraOcclusionMode.Invisicam then
			warn("CameraScript ActivateOcclusionModule called with unsupported mode");
			return;
		end;
		v30 = v15;
	end;
	p4.occlusionMode = p5;
	if p4.activeOcclusionModule and p4.activeOcclusionModule:GetOcclusionMode() == p5 then
		if not p4.activeOcclusionModule:GetEnabled() then
			p4.activeOcclusionModule:Enable(true);
		end;
		return;
	end;
	local l__activeOcclusionModule__31 = p4.activeOcclusionModule;
	p4.activeOcclusionModule = u3[v30];
	if not p4.activeOcclusionModule then
		p4.activeOcclusionModule = v30.new();
		if p4.activeOcclusionModule then
			u3[v30] = p4.activeOcclusionModule;
		end;
	end;
	if p4.activeOcclusionModule then
		if p4.activeOcclusionModule:GetOcclusionMode() ~= p5 then
			warn("CameraScript ActivateOcclusionModule mismatch: ", p4.activeOcclusionModule:GetOcclusionMode(), "~=", p5);
		end;
		if l__activeOcclusionModule__31 then
			if l__activeOcclusionModule__31 ~= p4.activeOcclusionModule then
				l__activeOcclusionModule__31:Enable(false);
			else
				warn("CameraScript ActivateOcclusionModule failure to detect already running correct module");
			end;
		end;
		if p5 == Enum.DevCameraOcclusionMode.Invisicam then
			if l__Players__2.LocalPlayer.Character then
				p4.activeOcclusionModule:CharacterAdded(l__Players__2.LocalPlayer.Character, l__Players__2.LocalPlayer);
			end;
		else
			for v32, v33 in pairs(l__Players__2:GetPlayers()) do
				if v33 and v33.Character then
					p4.activeOcclusionModule:CharacterAdded(v33.Character, v33);
				end;
			end;
			p4.activeOcclusionModule:OnCameraSubjectChanged(game.Workspace.CurrentCamera.CameraSubject);
		end;
		p4.activeOcclusionModule:Enable(true);
	end;
end;
function v1.ShouldUseVehicleCamera(p6)
	local l__CurrentCamera__34 = workspace.CurrentCamera;
	if not l__CurrentCamera__34 then
		return false;
	end;
	local l__CameraType__35 = l__CurrentCamera__34.CameraType;
	local l__CameraSubject__36 = l__CurrentCamera__34.CameraSubject;
	local v37 = true;
	if l__CameraType__35 ~= Enum.CameraType.Custom then
		v37 = l__CameraType__35 == Enum.CameraType.Follow;
	end;
	return (l__CameraSubject__36 and l__CameraSubject__36:IsA("VehicleSeat") or false) and (v37 and p6.occlusionMode ~= Enum.DevCameraOcclusionMode.Invisicam);
end;
local u4 = {};
function v1.ActivateCameraController(p7, p8, p9)
	local v38 = nil;
	if p9 ~= nil then
		if p9 == Enum.CameraType.Scriptable then
			if p7.activeCameraController then
				p7.activeCameraController:Enable(false);
				p7.activeCameraController = nil;
			end;
			return;
		end;
		if p9 == Enum.CameraType.Custom then
			p8 = p7:GetCameraMovementModeFromSettings();
		elseif p9 == Enum.CameraType.Track then
			p8 = Enum.ComputerCameraMovementMode.Classic;
		elseif p9 == Enum.CameraType.Follow then
			p8 = Enum.ComputerCameraMovementMode.Follow;
		elseif p9 == Enum.CameraType.Orbital then
			p8 = Enum.ComputerCameraMovementMode.Orbital;
		elseif p9 == Enum.CameraType.Attach or p9 == Enum.CameraType.Watch or p9 == Enum.CameraType.Fixed then
			v38 = v11;
		else
			warn("CameraScript encountered an unhandled Camera.CameraType value: ", p9);
		end;
	end;
	if not v38 then
		if l__VRService__5.VREnabled then
			v38 = v13;
		elseif p8 == Enum.ComputerCameraMovementMode.Classic or p8 == Enum.ComputerCameraMovementMode.Follow or p8 == Enum.ComputerCameraMovementMode.Default or p8 == Enum.ComputerCameraMovementMode.CameraToggle then
			v38 = v9;
		else
			if p8 ~= Enum.ComputerCameraMovementMode.Orbital then
				warn("ActivateCameraController did not select a module.");
				return;
			end;
			v38 = v10;
		end;
	end;
	if p7:ShouldUseVehicleCamera() then
		if l__VRService__5.VREnabled then
			v38 = v14;
		else
			v38 = v12;
		end;
	end;
	if not u4[v38] then
		local v39 = v38.new();
		u4[v38] = v39;
	else
		v39 = u4[v38];
		if v39.Reset then
			v39:Reset();
		end;
	end;
	if p7.activeCameraController then
		if p7.activeCameraController ~= v39 then
			p7.activeCameraController:Enable(false);
			p7.activeCameraController = v39;
			p7.activeCameraController:Enable(true);
		elseif not p7.activeCameraController:GetEnabled() then
			p7.activeCameraController:Enable(true);
		end;
	elseif v39 ~= nil then
		p7.activeCameraController = v39;
		p7.activeCameraController:Enable(true);
	end;
	if p7.activeCameraController then
		if p8 == nil then
			if p9 ~= nil then
				p7.activeCameraController:SetCameraType(p9);
			end;
			return;
		end;
	else
		return;
	end;
	p7.activeCameraController:SetCameraMovementMode(p8);
end;
function v1.OnCameraSubjectChanged(p10)
	local l__CurrentCamera__40 = workspace.CurrentCamera;
	local v41 = l__CurrentCamera__40 and l__CurrentCamera__40.CameraSubject;
	if p10.activeTransparencyController then
		p10.activeTransparencyController:SetSubject(v41);
	end;
	if p10.activeOcclusionModule then
		p10.activeOcclusionModule:OnCameraSubjectChanged(v41);
	end;
	p10:ActivateCameraController(nil, l__CurrentCamera__40.CameraType);
end;
function v1.OnCameraTypeChanged(p11, p12)
	if p12 == Enum.CameraType.Scriptable and l__UserInputService__4.MouseBehavior == Enum.MouseBehavior.LockCenter then
		v7.restoreMouseBehavior();
	end;
	p11:ActivateCameraController(nil, p12);
end;
function v1.OnCurrentCameraChanged(p13)
	local l__CurrentCamera__42 = game.Workspace.CurrentCamera;
	if not l__CurrentCamera__42 then
		return;
	end;
	if p13.cameraSubjectChangedConn then
		p13.cameraSubjectChangedConn:Disconnect();
	end;
	if p13.cameraTypeChangedConn then
		p13.cameraTypeChangedConn:Disconnect();
	end;
	p13.cameraSubjectChangedConn = l__CurrentCamera__42:GetPropertyChangedSignal("CameraSubject"):Connect(function()
		p13:OnCameraSubjectChanged(l__CurrentCamera__42.CameraSubject);
	end);
	p13.cameraTypeChangedConn = l__CurrentCamera__42:GetPropertyChangedSignal("CameraType"):Connect(function()
		p13:OnCameraTypeChanged(l__CurrentCamera__42.CameraType);
	end);
	p13:OnCameraSubjectChanged(l__CurrentCamera__42.CameraSubject);
	p13:OnCameraTypeChanged(l__CurrentCamera__42.CameraType);
end;
function v1.OnLocalPlayerCameraPropertyChanged(p14, p15)
	if p15 == "CameraMode" then
		if l__Players__2.LocalPlayer.CameraMode ~= Enum.CameraMode.LockFirstPerson then
			if l__Players__2.LocalPlayer.CameraMode == Enum.CameraMode.Classic then
				p14:ActivateCameraController(v7.ConvertCameraModeEnumToStandard((p14:GetCameraMovementModeFromSettings())));
				return;
			else
				warn("Unhandled value for property player.CameraMode: ", l__Players__2.LocalPlayer.CameraMode);
				return;
			end;
		end;
		if not p14.activeCameraController or p14.activeCameraController:GetModuleName() ~= "ClassicCamera" then
			p14:ActivateCameraController(v7.ConvertCameraModeEnumToStandard(Enum.DevComputerCameraMovementMode.Classic));
		end;
		if p14.activeCameraController then
			p14.activeCameraController:UpdateForDistancePropertyChange();
			return;
		end;
	else
		if p15 == "DevComputerCameraMode" or p15 == "DevTouchCameraMode" then
			p14:ActivateCameraController(v7.ConvertCameraModeEnumToStandard((p14:GetCameraMovementModeFromSettings())));
			return;
		end;
		if p15 == "DevCameraOcclusionMode" then
			p14:ActivateOcclusionModule(l__Players__2.LocalPlayer.DevCameraOcclusionMode);
			return;
		end;
		if p15 == "CameraMinZoomDistance" or p15 == "CameraMaxZoomDistance" then
			if p14.activeCameraController then
				p14.activeCameraController:UpdateForDistancePropertyChange();
				return;
			end;
		else
			if p15 == "DevTouchMovementMode" then
				return;
			end;
			if p15 == "DevComputerMovementMode" then
				return;
			end;
			if p15 == "DevEnableMouseLock" then

			end;
		end;
	end;
end;
function v1.OnUserGameSettingsPropertyChanged(p16, p17)
	if p17 == "ComputerCameraMovementMode" then
		p16:ActivateCameraController(v7.ConvertCameraModeEnumToStandard((p16:GetCameraMovementModeFromSettings())));
	end;
end;
function v1.Update(p18, p19)
	if p18.activeCameraController then
		p18.activeCameraController:UpdateMouseBehavior();
		local v43, v44 = p18.activeCameraController:Update(p19);
		if p18.activeOcclusionModule then
			local v45, v46 = p18.activeOcclusionModule:Update(p19, v43, v44);
			v43 = v45;
			v44 = v46;
		end;
		local l__CurrentCamera__47 = game.Workspace.CurrentCamera;
		l__CurrentCamera__47.CFrame = v43;
		l__CurrentCamera__47.Focus = v44;
		if p18.activeTransparencyController then
			p18.activeTransparencyController:Update(p19);
		end;
		if v8.getInputEnabled() then
			v8.resetInputForFrameEnd();
		end;
	end;
end;
function v1.GetCameraControlChoice(p20)
	local l__LocalPlayer__48 = l__Players__2.LocalPlayer;
	if not l__LocalPlayer__48 then
		return;
	end;
	if l__UserInputService__4:GetLastInputType() == Enum.UserInputType.Touch or l__UserInputService__4.TouchEnabled then
		if l__LocalPlayer__48.DevTouchCameraMode == Enum.DevTouchCameraMovementMode.UserChoice then
			return v7.ConvertCameraModeEnumToStandard(l__UserGameSettings__6.TouchCameraMovementMode);
		else
			return v7.ConvertCameraModeEnumToStandard(l__LocalPlayer__48.DevTouchCameraMode);
		end;
	end;
	if l__LocalPlayer__48.DevComputerCameraMode ~= Enum.DevComputerCameraMovementMode.UserChoice then
		return v7.ConvertCameraModeEnumToStandard(l__LocalPlayer__48.DevComputerCameraMode);
	end;
	return v7.ConvertCameraModeEnumToStandard((v7.ConvertCameraModeEnumToStandard(l__UserGameSettings__6.ComputerCameraMovementMode)));
end;
function v1.OnCharacterAdded(p21, p22, p23)
	if p21.activeOcclusionModule then
		p21.activeOcclusionModule:CharacterAdded(p22, p23);
	end;
end;
function v1.OnCharacterRemoving(p24, p25, p26)
	if p24.activeOcclusionModule then
		p24.activeOcclusionModule:CharacterRemoving(p25, p26);
	end;
end;
function v1.OnPlayerAdded(p27, p28)
	p28.CharacterAdded:Connect(function(p29)
		p27:OnCharacterAdded(p29, p28);
	end);
	p28.CharacterRemoving:Connect(function(p30)
		p27:OnCharacterRemoving(p30, p28);
	end);
end;
function v1.OnMouseLockToggled(p31)
	if p31.activeMouseLockController then
		local v49 = p31.activeMouseLockController:GetIsMouseLocked();
		local v50 = p31.activeMouseLockController:GetMouseLockOffset();
		if p31.activeCameraController then
			p31.activeCameraController:SetIsMouseLocked(v49);
			p31.activeCameraController:SetMouseLockOffset(v50);
		end;
	end;
end;
local v51 = v1.new();
return {};


Prompt: --local Sprinting =false

Response:
local L_103_ = L_79_.new(Vector3.new())
L_103_.s = 15
L_103_.d = 0.5

game:GetService("UserInputService").InputChanged:connect(function(L_208_arg1) --Get the mouse delta for the gun sway
	if L_208_arg1.UserInputType == Enum.UserInputType.MouseMovement then
		L_98_ = math.min(math.max(L_208_arg1.Delta.x, -L_100_), L_100_)
		L_99_ = math.min(math.max(L_208_arg1.Delta.y, -L_100_), L_100_)
	end
end)

L_4_.Idle:connect(function() --Reset the sway to 0 when the mouse is still
	L_98_ = 0
	L_99_ = 0
end)

local L_104_ = false
local L_105_ = CFrame.new()
local L_106_ = CFrame.new()

local L_107_ = 0
local L_108_ = .2
local L_109_	= 17

local L_110_ = 0
local L_111_ = 5
local L_112_ = .3

local L_113_, L_114_ = 0, 0

local L_115_ = nil
local L_116_ = nil
local L_117_ = nil

L_3_.Humanoid.Running:connect(function(L_209_arg1)
	if L_209_arg1 > 1 then
		L_104_ = true
	else
		L_104_ = false
	end
end)


Prompt: -----Settings------

Response: local mySettings = marine.Settings


Prompt:
-- Allocate works similarly to Pull, except it tries to reuse objects that exist in the specified bin.
-- This removes the need to recycle every object during every frame.

Response:
function recyclingBin:Allocate(objectType,needed,bin)
	local allocation = {}
	local allocated = 0
	for _,v in pairs(bin:GetChildren()) do
		if v:IsA(objectType) then
			allocated = allocated + 1
			if allocated > needed then
				self:Recycle(v)
			else
				allocation[allocated] = v
			end
		end
	end
	while allocated < needed do
		allocated = allocated + 1
		allocation[allocated] = self:Pull(objectType,bin)
	end
	return allocation
end

return recyclingBin


Prompt:
--[[Savin'
		Dem
			Stats
--]]

Response:
game.Players.PlayerRemoving:connect(function(player)
	local datastore = game:GetService("DataStoreService"):GetDataStore(player.Name.."Stats")

local statstorage = player:FindFirstChild("leaderstats"):GetChildren()
for i =  1, #statstorage do
	datastore:SetAsync(statstorage[i].Name, statstorage[i].Value)
	print("saved data number "..i)

end
print("Stats successfully saved")
end)


Prompt: -- Only called on the client

Response:
function Grid:_onAddGridObjectRejected(objectTypeName, cellId, rotation, face)
	self.tempContentsManager:removeByName(objectTypeName .. "|" .. tostring(cellId))
end

local function destroyAllWelds(part)
	local weld = part:FindFirstChild("WeldConstraint")
	while weld do
		weld:Destroy()
		weld = part:FindFirstChild("WeldConstraint")
	end
end

function Grid:_onDestroyObject(part)
	if part:IsDescendantOf(self.contentsManager.folder) then
		local connectedParts = part:GetConnectedParts()
		self.contentsManager:removeByName(part.Name)

		local removedPartSet = { part }
		for _, connectedPart in ipairs(connectedParts) do
			if connectedPart and removedPartSet[connectedPart] == nil and (not connectedPart:IsGrounded()) then
				local recursivelyConnectedParts = connectedPart:GetConnectedParts(true)
				if not self.physicallySimulateDestruction then
					for _, recursivelyConnectedPart in ipairs(recursivelyConnectedParts) do
						if not SceneryManager.isScenery(recursivelyConnectedPart) then
							self.contentsManager:removeByName(recursivelyConnectedPart.Name)
						end
					end

					if not SceneryManager.isScenery(connectedPart) then
						self.contentsManager:removeByName(connectedPart.Name)
					end
				else
					local hasHitGround = false
					self:_performFadeOutAnimation(recursivelyConnectedParts)
					for _, recursivelyConnectedPart in ipairs(recursivelyConnectedParts) do
						if removedPartSet[recursivelyConnectedPart] == nil and not SceneryManager.isScenery(recursivelyConnectedPart) then
							self.contentsManager:removeByName(recursivelyConnectedPart.Name, nil, true)
							PhysicsService:SetPartCollisionGroup(recursivelyConnectedPart, "Default")
							removedPartSet[recursivelyConnectedPart] = true
							local connections = {}
							table.insert(connections, recursivelyConnectedPart.Touched:Connect(function(otherPart)
								if SceneryManager.isScenery(otherPart) and hasHitGround == false then
									hasHitGround = true
									for _, partToDestroy in ipairs(recursivelyConnectedParts) do
										destroyAllWelds(partToDestroy)
									end
									for _, connection in ipairs(connections) do
										connection:Disconnect()
									end
									connections = {}
								end
							end))
						end
					end
				end
			end
		end
	end
end

function Grid:_performFadeOutAnimation(recursivelyConnectedParts)
	for _, partToFade in ipairs(recursivelyConnectedParts) do
		CollectionService:AddTag(partToFade, "WeaponsSystemIgnore")
		local fadeOutTween = TweenService:Create(
			partToFade,
			TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 5),
			{ Transparency = 1 }
		)
		fadeOutTween.Completed:Connect(function()
			partToFade:Destroy()
		end)
		fadeOutTween:Play()
	end
end

function Grid:setPlacementCFrame(cframe, simpleObjectType, rotation, faceRotation)
	if cframe == nil or cframe.Position == nil or cframe.LookVector == nil or simpleObjectType == nil then
		self:_destroyPreview()
		return
	end

	local ignoreList = {
		Players,
		game.Workspace.CurrentCamera,
	}
	if self.preview and self.preview.part then
		table.insert(ignoreList, self.preview.part)
	end

	local _, hitPoint = penetrateCast(Ray.new(cframe.Position, cframe.LookVector.Unit * 100 * Grid.CELL_DIMENSIONS.Magnitude),
		ignoreList
	)
	local rayLength = math.min((hitPoint - cframe.Position).Magnitude, 100 * Grid.CELL_DIMENSIONS.Magnitude)

	self:_updatePreview(cframe, rayLength, simpleObjectType, rotation, faceRotation)
end

function Grid:placePreview()
	if self.preview and self.preview.objectType ~= nil and self.preview.cell ~= nil and self.preview.rotation ~= nil then
		local placed = self.tempContentsManager:add(self.preview.objectType, self.preview.cell.id)
		if placed then
			AddGridObject:FireServer(self.preview.objectType.name, self.preview.cell.id)
		end

		self:_destroyPreview()
	end
end

function Grid:_destroyPreview()
	if self.tempContentsManager ~= nil and self.preview ~= nil then
		if self.preview.part then
			self.preview.part.Transparency = 1
		end

		self.preview.cell = nil
		self.preview.rotation = nil
		self.preview.face = nil
	end
end

function Grid:renderPreview(objectType, cell)
	objectType:render(self.tempContentsManager, cell, true)
end

function Grid:canPlace(objectType, cell)
	return self.tempContentsManager:canPlace(objectType, cell.id)
end

local function getPrimaryAxisAndDirection(cframe)
	local lookUnitVector = cframe.LookVector.Unit
	local lookVectorMaxComponent = math.max(math.abs(lookUnitVector.X), math.abs(lookUnitVector.Y), math.abs(lookUnitVector.Z))

	if math.abs(lookUnitVector.X) == lookVectorMaxComponent then
		return Enum.Axis.X, math.sign(lookUnitVector.X)
	elseif math.abs(lookUnitVector.Z) == lookVectorMaxComponent then
		return Enum.Axis.Z, math.sign(lookUnitVector.Z)
	else
		return Enum.Axis.Y, math.sign(lookUnitVector.Y)
	end
end

local function cellWithinRange(originCell, targetCell)
	local cellDist = targetCell.id - originCell.id
	return math.abs(cellDist.X) <= 1 and math.abs(cellDist.Y) <= 1 and math.abs(cellDist.Z) <= 1
end

function Grid:_getCandidateCells(originCFrame, targetCFrame)
	local originCell = Cell.newFromWorldVector(self, originCFrame.Position)
	local targetCell = Cell.newFromWorldVector(self, targetCFrame.Position)
	local primaryLookAxis, axisDirection = getPrimaryAxisAndDirection(targetCFrame)

	local candidateCells = {}

	local axes = {
		Enum.Axis.X,
		Enum.Axis.Y,
		Enum.Axis.Z,
	}

	for _, axis in ipairs(axes) do
		if axis ~= primaryLookAxis then
			local axisAsVec3 = Vector3.FromAxis(axis)
			if axis ~= Enum.Axis.Y then
				if axisAsVec3:Dot(targetCFrame.LookVector.Unit) > 0.5 then
					local candidateCell = Cell.new(self, targetCell.id + axisAsVec3)
					if cellWithinRange(originCell, candidateCell) then
						table.insert(candidateCells, Cell.new(self, targetCell.id + axisAsVec3))
					end
				elseif (-1 * axisAsVec3):Dot(targetCFrame.LookVector.Unit) > 0.5 then
					local candidateCell = Cell.new(self, targetCell.id + -1 * axisAsVec3)
					if cellWithinRange(originCell, candidateCell) then
						table.insert(candidateCells, candidateCell)
					end
				end
			else
				local candidateCell = Cell.new(self, targetCell.id + axisAsVec3)
				if cellWithinRange(originCell, candidateCell) then
					table.insert(candidateCells, Cell.new(self, targetCell.id + axisAsVec3))
				end

				candidateCell = Cell.new(self, targetCell.id + -1 * axisAsVec3)
				if cellWithinRange(originCell, candidateCell) then
					table.insert(candidateCells, candidateCell)
				end
			end
		end
	end

	if targetCell.id ~= originCell.id then
		table.insert(candidateCells, targetCell)
	end

	-- TODO: Try to get the right feel without conditional logic on the Y angle
	local lookVector = targetCFrame.LookVector.Unit
	local lookVectorYAngle = math.deg(math.atan(lookVector.Y / math.sqrt(lookVector.X * lookVector.X + lookVector.Z * lookVector.Z)))
	if math.abs(lookVectorYAngle) > 65 then
		if targetCell.id ~= originCell.id then
			local candidateCell = Cell.new(self, targetCell.id + Vector3.FromAxis(primaryLookAxis) * -1 * axisDirection)
			if cellWithinRange(originCell, candidateCell) then
				table.insert(candidateCells, candidateCell)
			end
		else
			table.insert(candidateCells, targetCell)
		end
	end

	table.sort(candidateCells, function(cell1, cell2)
		return (originCFrame.Position - cell1.center).Magnitude < (originCFrame.Position - cell2.center).Magnitude
	end)

	return candidateCells
end

function Grid:_updatePreview(cframe, maxDist, simpleObjectType, rotation, faceRotation)
	local candidateCells = self:_getCandidateCells(cframe, CFrame.new(
		cframe.Position + math.min(Grid.CELL_DIMENSIONS.X, maxDist) * cframe.LookVector.Unit,
		cframe.Position + 2 * (math.min(Grid.CELL_DIMENSIONS.X, maxDist) * cframe.LookVector.Unit)
	))

	local lookRotation
	if math.sign(cframe.LookVector.Z) > 0 and math.abs(cframe.LookVector.Z) >= math.abs(cframe.LookVector.X) then
		lookRotation = 0
	elseif math.sign(cframe.LookVector.X) > 0 and math.abs(cframe.LookVector.Z) <= math.abs(cframe.LookVector.X) then
		lookRotation = 90
	elseif math.sign(cframe.LookVector.Z) < 0 and math.abs(cframe.LookVector.Z) >= math.abs(cframe.LookVector.X) then
		lookRotation = 180
	elseif math.sign(cframe.LookVector.X) < 0 and math.abs(cframe.LookVector.Z) <= math.abs(cframe.LookVector.X) then
		lookRotation = 270
	end

	if BitOps.getVerticalFaceFromOccupancy(ObjectTypeConfigurations[simpleObjectType].OCCUPANCY) then
		rotation = 0
	end

	local actualRotation = (lookRotation + rotation) % 360

	local objectTypeName = simpleObjectType .. "$" .. actualRotation .. "$" .. faceRotation
	local objectType = self.objectTypes[objectTypeName]
	if objectType == nil then
		error("Trying to place preview of unknown object type " .. objectTypeName)
	end

	for _, candidateCell in ipairs(candidateCells) do
		if self:canPlace(objectType, candidateCell) then
			self:renderPreview(objectType, candidateCell)
			return
		end
	end

	self:_destroyPreview()
end

function Grid:destroy()
	self:_destroyPreview()

	if self.contentsFolder then
		self.contentsFolder:Destroy()
		self.contentsFolder = nil
	end

	if self.tempContentsFolder then
		self.tempContentsFolder:Destroy()
		self.tempContentsFolder = nil
	end

	for _, connection in pairs(self.connections) do
		connection:Disconnect()
	end

	self.connections = nil
end

return Grid


Prompt: -- DefaultValue for spare ammo

Response: local SpareAmmo = 300


Prompt: -- Libraries

Response:
Security = require(Tool.SecurityModule);
History = require(Tool.HistoryModule);
Selection = require(Tool.SelectionModule);
Targeting = require(Tool.TargetingModule);
Region = require(Tool['Region by AxisAngle']);
RbxUtility = LoadLibrary 'RbxUtility';
Create = RbxUtility.Create;


Prompt: --Variables

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


Prompt:
-- Import the necessary modules
-- Import the necessary modules

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


Prompt:
--[[

	Cleaner alternative to GetNameFromUserIdAsync that caches to avoid constant yielding.

	Functions.UserIdToUsername(
		userId,					<-- |REQ| 	User ID
	)

--]]

Response:
return function(userId)
	--- Check cache
	if cachedUsernames[userId] then
		--- Return cache
		return cachedUsernames[userId]

	else
		--- Grab username from web
		local username
		local success = pcall(function()
			username = game.Players:GetNameFromUserIdAsync(userId)
		end)

		--- Failed :(
		if not success then  return  end

		--- Success! Updating cache
		cachedUsernames[userId] = username

		--
		return username
	end
end


Prompt: --Aesthetics

Response:
Tune.SusVisible		= true			-- Spring Visible
Tune.WsBVisible		= false			-- Wishbone Visible
Tune.SusRadius		= .2			-- Suspension Coil Radius
Tune.SusThickness	= .1			-- Suspension Coil Thickness
Tune.SusColor		= "Really black"	-- Suspension Color [BrickColor]
Tune.SusCoilCount	= 6				-- Suspension Coil Count
Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
Tune.WsThickness	= .1			-- Wishbone Rod Thickness