Prompt:
--///////////////// Internal-Use Methods
--//////////////////////////////////////

Response:
function methods:InternalDestroy()
	for i, speaker in pairs(self.Speakers) do
		speaker:LeaveChannel(self.Name)
	end

	self.eDestroyed:Fire()

	self.eDestroyed:Destroy()
	self.eMessagePosted:Destroy()
	self.eSpeakerJoined:Destroy()
	self.eSpeakerLeft:Destroy()
	self.eSpeakerMuted:Destroy()
	self.eSpeakerUnmuted:Destroy()
end

function methods:InternalDoMessageFilter(speakerName, messageObj, channel)
	local filtersIterator = self.FilterMessageFunctions:GetIterator()
	for funcId, func, priority in filtersIterator do
		local success, errorMessage = pcall(function()
			func(speakerName, messageObj, channel)
		end)

		if not success then
			warn(string.format("DoMessageFilter Function '%s' failed for reason: %s", funcId, errorMessage))
		end
	end
end

function methods:InternalDoProcessCommands(speakerName, message, channel)
	local commandsIterator = self.ProcessCommandsFunctions:GetIterator()
	for funcId, func, priority in commandsIterator do
		local success, returnValue = pcall(function()
			local ret = func(speakerName, message, channel)
			if type(ret) ~= "boolean" then
				error("Process command functions must return a bool")
			end
			return ret
		end)

		if not success then
			warn(string.format("DoProcessCommands Function '%s' failed for reason: %s", funcId, returnValue))
		elseif returnValue then
			return true
		end
	end

	return false
end

function methods:InternalPostMessage(fromSpeaker, message, extraData)
	if (self:InternalDoProcessCommands(fromSpeaker.Name, message, self.Name)) then return false end

	if (self.Mutes[fromSpeaker.Name:lower()] ~= nil) then
		local t = self.Mutes[fromSpeaker.Name:lower()]
		if (t > 0 and os.time() > t) then
			self:UnmuteSpeaker(fromSpeaker.Name)
		else
			self:SendSystemMessageToSpeaker(ChatLocalization:FormatMessageToSend("GameChat_ChatChannel_MutedInChannel","You are muted and cannot talk in this channel"), fromSpeaker.Name)
			return false
		end
	end

	local messageObj = self:InternalCreateMessageObject(message, fromSpeaker.Name, false, extraData)

	-- allow server to process the unfiltered message string
	messageObj.Message = message
	local processedMessage
	pcall(function()
		processedMessage = Chat:InvokeChatCallback(Enum.ChatCallbackType.OnServerReceivingMessage, messageObj)
	end)
	messageObj.Message = nil

	if processedMessage then

		-- developer server code's choice to mute the message
		if processedMessage.ShouldDeliver == false then
			return false
		end
		messageObj = processedMessage
	end

	message = self:SendMessageObjToFilters(message, messageObj, fromSpeaker)

	local sentToList = {}
	for i, speaker in pairs(self.Speakers) do
		local isMuted = speaker:IsSpeakerMuted(fromSpeaker.Name)
		if not isMuted and self:CanCommunicate(fromSpeaker, speaker) then
			table.insert(sentToList, speaker.Name)
			if speaker.Name == fromSpeaker.Name then
				-- Send unfiltered message to speaker who sent the message.
				local cMessageObj = ShallowCopy(messageObj)
				if userShouldMuteUnfilteredMessage then
					local messageLength = messageObj.MessageLengthUtf8 or messageObj.MessageLength
					cMessageObj.Message = string.rep("_", messageLength)
				else
					cMessageObj.Message = message
				end
				cMessageObj.IsFiltered = true
				-- We need to claim the message is filtered even if it not in this case for compatibility with legacy client side code.
				speaker:InternalSendMessage(cMessageObj, self.Name)
			else
				speaker:InternalSendMessage(messageObj, self.Name)
			end
		end
	end

	local success, err = pcall(function() self.eMessagePosted:Fire(messageObj) end)
	if not success and err then
		print("Error posting message: " ..err)
	end

	local textFilterContext = self.Private and Enum.TextFilterContext.PrivateChat or Enum.TextFilterContext.PublicChat
	local filterSuccess, isFilterResult, filteredMessage = self.ChatService:InternalApplyRobloxFilterNewAPI(
		messageObj.FromSpeaker,
		message,
		textFilterContext
	)
	if (filterSuccess) then
		messageObj.FilterResult = filteredMessage
		messageObj.IsFilterResult = isFilterResult
	else
		if UserFlagRemoveMessageOnTextFilterFailures then
			messageObj.IsFilterResult = false
			messageObj.FilterResult = ""
			messageObj.MessageLength = 0
		else
			return false
		end
	end
	messageObj.IsFiltered = true
	self:InternalAddMessageToHistoryLog(messageObj)

	for _, speakerName in pairs(sentToList) do
		local speaker = self.Speakers[speakerName]
		if (speaker) then
			speaker:InternalSendFilteredMessageWithFilterResult(messageObj, self.Name)
		end
	end

	-- One more pass is needed to ensure that no speakers do not recieve the message.
	-- Otherwise a user could join while the message is being filtered who had not originally been sent the message.
	local speakersMissingMessage = {}
	for _, speaker in pairs(self.Speakers) do
		local isMuted = speaker:IsSpeakerMuted(fromSpeaker.Name)
		if not isMuted and self:CanCommunicate(fromSpeaker, speaker) then
			local wasSentMessage = false
			for _, sentSpeakerName in pairs(sentToList) do
				if speaker.Name == sentSpeakerName then
					wasSentMessage = true
					break
				end
			end
			if not wasSentMessage then
				table.insert(speakersMissingMessage, speaker.Name)
			end
		end
	end

	for _, speakerName in pairs(speakersMissingMessage) do
		local speaker = self.Speakers[speakerName]
		if speaker then
			speaker:InternalSendFilteredMessageWithFilterResult(messageObj, self.Name)
		end
	end

	return messageObj
end

function methods:InternalAddSpeaker(speaker)
	if (self.Speakers[speaker.Name]) then
		warn("Speaker \"" .. speaker.name .. "\" is already in the channel!")
		return
	end

	self.Speakers[speaker.Name] = speaker
	local success, err = pcall(function() self.eSpeakerJoined:Fire(speaker.Name) end)
	if not success and err then
		print("Error removing channel: " ..err)
	end
end

function methods:InternalRemoveSpeaker(speaker)
	if (not self.Speakers[speaker.Name]) then
		warn("Speaker \"" .. speaker.name .. "\" is not in the channel!")
		return
	end

	self.Speakers[speaker.Name] = nil
	local success, err = pcall(function() self.eSpeakerLeft:Fire(speaker.Name) end)
	if not success and err then
		print("Error removing speaker: " ..err)
	end
end

function methods:InternalRemoveExcessMessagesFromLog()
	local remove = table.remove
	while (#self.ChatHistory > self.MaxHistory) do
		remove(self.ChatHistory, 1)
	end
end

function methods:InternalAddMessageToHistoryLog(messageObj)
	table.insert(self.ChatHistory, messageObj)

	self:InternalRemoveExcessMessagesFromLog()
end

function methods:GetMessageType(message, fromSpeaker)
	if fromSpeaker == nil then
		return ChatConstants.MessageTypeSystem
	end
	return ChatConstants.MessageTypeDefault
end

function methods:InternalCreateMessageObject(message, fromSpeaker, isFiltered, extraData)
	local messageType = self:GetMessageType(message, fromSpeaker)

	local speakerUserId = -1
	local speakerDisplayName = nil
	local speaker = nil

	if fromSpeaker then
		speaker = self.ChatService:GetSpeaker(fromSpeaker)
		if speaker then
			local player = speaker:GetPlayer()
			if player then
				speakerUserId = player.UserId

				if ChatSettings.PlayerDisplayNamesEnabled then
					speakerDisplayName = speaker:GetNameForDisplay()
				end
			else
				speakerUserId = 0
			end
		end
	end

	local messageObj =
	{
		ID = self.ChatService:InternalGetUniqueMessageId(),
		FromSpeaker = fromSpeaker,
		SpeakerDisplayName = speakerDisplayName,
		SpeakerUserId = speakerUserId,
		OriginalChannel = self.Name,
		MessageLength = string.len(message),
		MessageLengthUtf8 = utf8.len(utf8.nfcnormalize(message)),
		MessageType = messageType,
		IsFiltered = isFiltered,
		Message = isFiltered and message or nil,
		--// These two get set by the new API. The comments are just here
		--// to remind readers that they will exist so it's not super
		--// confusing if they find them in the code but cannot find them
		--// here.
		--FilterResult = nil,
		--IsFilterResult = false,
		Time = os.time(),
		ExtraData = {},
	}

	if speaker then
		for k, v in pairs(speaker.ExtraData) do
			messageObj.ExtraData[k] = v
		end
	end

	if (extraData) then
		for k, v in pairs(extraData) do
			messageObj.ExtraData[k] = v
		end
	end

	return messageObj
end

function methods:SetChannelNameColor(color)
	self.ChannelNameColor = color
	for i, speaker in pairs(self.Speakers) do
		speaker:UpdateChannelNameColor(self.Name, color)
	end
end

function methods:GetWelcomeMessageForSpeaker(speaker)
	if self.GetWelcomeMessageFunction then
		local welcomeMessage = self.GetWelcomeMessageFunction(speaker)
		if welcomeMessage then
			return welcomeMessage
		end
	end
	return self.WelcomeMessage
end

function methods:RegisterGetWelcomeMessageFunction(func)
	if type(func) ~= "function" then
		error("RegisterGetWelcomeMessageFunction must be called with a function.")
	end
	self.GetWelcomeMessageFunction = func
end

function methods:UnRegisterGetWelcomeMessageFunction()
	self.GetWelcomeMessageFunction = nil
end


Prompt: -- Setup animation objects

Response:
function scriptChildModified(child)
    local fileList = animNames[child.Name]
    if (fileList ~= nil) then
        configureAnimationSet(child.Name, fileList)
    end
end

script.ChildAdded:connect(scriptChildModified)
script.ChildRemoved:connect(scriptChildModified)

for name, fileList in pairs(animNames) do
    configureAnimationSet(name, fileList)
end


Prompt: --{{NUMBERS}} : FADE TIMES AND MORE.

Response:
Settings.RandomOffset = {-4, 4}
Settings.FadeOutTime = 1;
Settings.FadeInTime = 1;
Settings.IndicatorLength = 0.5;


Prompt:
--  fun = what they have to type (make sure it is lowercased)
--        The first value in the table is what shows in the cmds
--                        Make sure to set this "2" to the rank you want players to have to use this
--                            This function is what runs the command when it is called

Response:
	fun = {"Fun [Player]";{2};{"Player"};function(plr, cmds)
		for i,v in pairs(cmds[1]) do -- This would basically get all the players it could find. Example: ;fun me would return only you in the table.
			print(v.Name)
		end
	end;};
}


Response:
function onClicked()
R.Function1.Disabled = true
R.Function2.Disabled = false
R.BrickColor = BrickColor.new("Institutional white")
N.One1.BrickColor = BrickColor.new("Really black")
N.One2.BrickColor = BrickColor.new("Really black")
N.One4.BrickColor = BrickColor.new("Really black")
N.Four1.BrickColor = BrickColor.new("Really black")
N.Three4.BrickColor = BrickColor.new("Really black")
N.Two1.BrickColor = BrickColor.new("Really black")
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)


Prompt:
----------------------------------------------------------------------------
---  Functionality Loop  ---------------------------------------------------
----------------------------------------------------------------------------

Response:
RunService.Heartbeat:Connect(function(deltaTime)
	accumulatedChance += deltaTime * Settings.Rate

	if CanShow and ScreenBlockCFrame.LookVector.Y > -0.4 and not UnderObject(ScreenBlockCFrame.Position) then
		for i = 1, math.floor(accumulatedChance) do
			CreateDroplet()
		end

		accumulatedChance %= 1
	else
		accumulatedChance %= 1
	end
end)


Prompt:
--// Hash: 0218d61d1d1792385ae2692ae364231570b8f02b5ace6792db021c339736f38d55bc1e6ce32cce0d947d549bcde07a8a
-- Decompiled with the Synapse X Luau decompiler.

Response:
function Format(p1)
	return string.format("%02i", p1);
end;
function convertToHMS(p2, p3, p4)
	local v1 = nil;
	local v2 = (p2 - p2 % 60) / 60;
	p2 = p2 - v2 * 60;
	local v3 = (v2 - v2 % 60) / 60;
	v1 = v2 - v3 * 60;
	if p4 then
		return Format(v3), Format(v1), Format(p2);
	end;
	if p3 then

	else
		return Format(v1) .. ":" .. Format(p2);
	end;
	return Format(v3) .. ":" .. Format(v1) .. ":" .. Format(p2);
end;
return convertToHMS;


Prompt: -- Make Connection strict

Response:
setmetatable(Connection, {
	__index = function(_tb, key)
		error(("Attempt to get Connection::%s (not a valid member)"):format(tostring(key)), 2)
	end,
	__newindex = function(_tb, key, _value)
		error(("Attempt to set Connection::%s (not a valid member)"):format(tostring(key)), 2)
	end
})


Prompt: -- Setup animation objects

Response:
for name, fileList in pairs(animNames) do
	animTable[name] = {}
	animTable[name].count = 0
	animTable[name].totalWeight = 0

	-- check for config values
	local config = script:FindFirstChild(name)
	if (config ~= nil) then
		--		print("Loading anims " .. name)
		local idx = 1
		for _, childPart in pairs(config:GetChildren()) do
			animTable[name][idx] = {}
			animTable[name][idx].anim = childPart
			local weightObject = childPart:FindFirstChild("Weight")
			if (weightObject == nil) then
				animTable[name][idx].weight = 1
			else
				animTable[name][idx].weight = weightObject.Value
			end
			animTable[name].count = animTable[name].count + 1
			animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
			--			print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
			idx = idx + 1
		end
	end

	-- fallback to defaults
	if (animTable[name].count <= 0) then
		for idx, anim in pairs(fileList) do
			animTable[name][idx] = {}
			animTable[name][idx].anim = Instance.new("Animation")
			animTable[name][idx].anim.Name = name
			animTable[name][idx].anim.AnimationId = anim.id
			animTable[name][idx].weight = anim.weight
			animTable[name].count = animTable[name].count + 1
			animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
			--			print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
		end
	end
end


Prompt: -- 	How many studs the zombie can wander on the x and z axis in studs


Prompt: --Make the gamepad hint frame

Response:
local gamepadHintsFrame = Utility:Create'Frame'
{
	Name = "GamepadHintsFrame",
	Size = UDim2.new(0, HotbarFrame.Size.X.Offset, 0, (IsTenFootInterface and 95 or 60)),
	BackgroundTransparency = 1,
	Visible = false,
	Parent = MainFrame
}

local function addGamepadHint(hintImage, hintImageLarge, hintText)
	local hintFrame = Utility:Create'Frame'
	{
		Name = "HintFrame",
		Size = UDim2.new(1, 0, 1, -5),
		Position = UDim2.new(0, 0, 0, 0),
		BackgroundTransparency = 1,
		Parent = gamepadHintsFrame
	}

	local hintImage = Utility:Create'ImageLabel'
	{
		Name = "HintImage",
		Size = (IsTenFootInterface and UDim2.new(0,90,0,90) or UDim2.new(0,60,0,60)),
		BackgroundTransparency = 1,
		Image = (IsTenFootInterface and hintImageLarge or hintImage),
		Parent = hintFrame
	}

	local hintText = Utility:Create'TextLabel'
	{
		Name = "HintText",
		Position = UDim2.new(0, (IsTenFootInterface and 100 or 70), 0, 0),
		Size = UDim2.new(1, -(IsTenFootInterface and 100 or 70), 1, 0),
		Font = Enum.Font.SourceSansBold,
		FontSize = (IsTenFootInterface and Enum.FontSize.Size36 or Enum.FontSize.Size24),
		BackgroundTransparency = 1,
		Text = hintText,
		TextColor3 = Color3.new(1,1,1),
		TextXAlignment = Enum.TextXAlignment.Left,
		TextWrapped = true,
		Parent = hintFrame
	}
	local textSizeConstraint = Instance.new("UITextSizeConstraint", hintText)
	textSizeConstraint.MaxTextSize = hintText.TextSize
end

local function resizeGamepadHintsFrame()
	gamepadHintsFrame.Size = UDim2.new(HotbarFrame.Size.X.Scale, HotbarFrame.Size.X.Offset, 0, (IsTenFootInterface and 95 or 60))
	gamepadHintsFrame.Position = UDim2.new(HotbarFrame.Position.X.Scale, HotbarFrame.Position.X.Offset, InventoryFrame.Position.Y.Scale, InventoryFrame.Position.Y.Offset - gamepadHintsFrame.Size.Y.Offset)

	local spaceTaken = 0

	local gamepadHints = gamepadHintsFrame:GetChildren()
	--First get the total space taken by all the hints
	for i = 1, #gamepadHints do
		gamepadHints[i].Size = UDim2.new(1, 0, 1, -5)
		gamepadHints[i].Position = UDim2.new(0, 0, 0, 0)
		spaceTaken = spaceTaken + (gamepadHints[i].HintText.Position.X.Offset + gamepadHints[i].HintText.TextBounds.X)
	end

	--The space between all the frames should be equal
	local spaceBetweenElements = (gamepadHintsFrame.AbsoluteSize.X - spaceTaken)/(#gamepadHints - 1)
	for i = 1, #gamepadHints do
		gamepadHints[i].Position = (i == 1 and UDim2.new(0, 0, 0, 0) or UDim2.new(0, gamepadHints[i-1].Position.X.Offset + gamepadHints[i-1].Size.X.Offset + spaceBetweenElements, 0, 0))
		gamepadHints[i].Size = UDim2.new(0, (gamepadHints[i].HintText.Position.X.Offset + gamepadHints[i].HintText.TextBounds.X), 1, -5)
	end
end

addGamepadHint("rbxasset://textures/ui/Settings/Help/XButtonDark.png", "rbxasset://textures/ui/Settings/Help/XButtonDark@2x.png", "Remove From Hotbar")
addGamepadHint("rbxasset://textures/ui/Settings/Help/AButtonDark.png", "rbxasset://textures/ui/Settings/Help/AButtonDark@2x.png", "Select/Swap")
addGamepadHint("rbxasset://textures/ui/Settings/Help/BButtonDark.png", "rbxasset://textures/ui/Settings/Help/BButtonDark@2x.png", "Close Backpack")

do -- Search stuff
	local searchFrame = NewGui('Frame', 'Search')
	searchFrame.BackgroundColor3 = SEARCH_BACKGROUND_COLOR
	searchFrame.BackgroundTransparency = SEARCH_BACKGROUND_FADE
	searchFrame.Size = UDim2.new(0, SEARCH_WIDTH - (SEARCH_BUFFER * 2), 0, INVENTORY_HEADER_SIZE - (SEARCH_BUFFER * 2))
	searchFrame.Position = UDim2.new(1, -searchFrame.Size.X.Offset - SEARCH_BUFFER, 0, SEARCH_BUFFER)

	local searchFrameUIC = Instance.new("UICorner")
	searchFrameUIC.CornerRadius = UDim.new(1,0)
	searchFrameUIC.Parent = searchFrame

	searchFrame.Parent = InventoryFrame

	local searchBox = NewGui('TextBox', 'TextBox')
	searchBox.PlaceholderText = SEARCH_TEXT
	searchBox.TextScaled = true
	searchBox.ClearTextOnFocus = false
	searchBox.Font = Enum.Font.Oswald
	searchBox.FontSize = Enum.FontSize.Size14
	searchBox.TextXAlignment = Enum.TextXAlignment.Center
	searchBox.Size = UDim2.new(0.87, 0, 1, 0)
	searchBox.AnchorPoint = Vector2.new(0.5,0.5)
	searchBox.Position = UDim2.new(0.5, SEARCH_TEXT_OFFSET_FROMLEFT, 0.5, 0)

	local searchBoxUIC = Instance.new("UICorner")
	searchBoxUIC.CornerRadius = UDim.new(1,0)
	searchBoxUIC.Parent = searchBox

	searchBox.Parent = searchFrame

	local xButton = NewGui('TextButton', 'X')
	xButton.Text = 'x'
	xButton.Font = Enum.Font.Oswald
	xButton.ZIndex = 10
	xButton.TextColor3 = SLOT_EQUIP_COLOR
	xButton.FontSize = Enum.FontSize.Size24
	xButton.TextYAlignment = Enum.TextYAlignment.Bottom
	xButton.BackgroundColor3 = SEARCH_BACKGROUND_COLOR
	xButton.BackgroundTransparency = 1
	xButton.AnchorPoint = Vector2.new(1,0.5)
	xButton.Size = UDim2.new(0.15, 0, 0.5, 0)
	xButton.Position = UDim2.new(0.98, 0, 0.5, 0)
	xButton.Visible = false
	xButton.ZIndex = 0
	xButton.BorderSizePixel = 0
	xButton.Parent = searchFrame

	local function search()
		local terms = {}
		for word in searchBox.Text:gmatch('%S+') do
			terms[word:lower()] = true
		end

		local hitTable = {}
		for i = NumberOfHotbarSlots + 1, #Slots do -- Only search inventory slots
			local slot = Slots[i]
			local hits = slot:CheckTerms(terms)
			table.insert(hitTable, {slot, hits})
			slot.Frame.Visible = false
			slot.Frame.Parent = InventoryFrame
		end

		table.sort(hitTable, function(left, right)
			return left[2] > right[2]
		end)
		ViewingSearchResults = true

		local hitCount = 0
		for i, data in ipairs(hitTable) do
			local slot, hits = data[1], data[2]
			if hits > 0 then
				slot.Frame.Visible = true
				slot.Frame.Parent = UIGridFrame
				slot.Frame.LayoutOrder = NumberOfHotbarSlots + hitCount
				hitCount = hitCount + 1
			end
		end

		ScrollingFrame.CanvasPosition = Vector2.new(0, 0)
		UpdateScrollingFrameCanvasSize()

		xButton.ZIndex = 3
	end

	local function clearResults()
		if xButton.ZIndex > 0 then
			ViewingSearchResults = false
			for i = NumberOfHotbarSlots + 1, #Slots do
				local slot = Slots[i]
				slot.Frame.LayoutOrder = slot.Index
				slot.Frame.Parent = UIGridFrame
				slot.Frame.Visible = true
			end
			xButton.ZIndex = 0
		end
		UpdateScrollingFrameCanvasSize()
	end

	local function reset()
		clearResults()
		searchBox.Text = ''
	end

	local function onChanged(property)
		if property == 'Text' then
			local text = searchBox.Text
			if text == '' then
				clearResults()
			elseif text ~= SEARCH_TEXT then
				search()
			end
			xButton.Visible = text ~= '' and text ~= SEARCH_TEXT
		end
	end

	local function focusLost(enterPressed)
		if enterPressed then
			--TODO: Could optimize
			search()
		end
	end

	xButton.MouseButton1Click:Connect(reset)
	searchBox.Changed:Connect(onChanged)
	searchBox.FocusLost:Connect(focusLost)

	BackpackScript.StateChanged.Event:Connect(function(isNowOpen)
		InventoryIcon:getInstance("iconButton").Modal = isNowOpen -- Allows free mouse movement even in first person

		if not isNowOpen then
			reset()
		end
	end)

	HotkeyFns[Enum.KeyCode.Escape.Value] = function(isProcessed)
		if isProcessed then -- Pressed from within a TextBox
			reset()
		elseif InventoryFrame.Visible then
			InventoryIcon:deselect()
		end
	end

	local function detectGamepad(lastInputType)
		if lastInputType == Enum.UserInputType.Gamepad1 and not UserInputService.VREnabled then
			searchFrame.Visible = false
		else
			searchFrame.Visible = true
		end
	end
	UserInputService.LastInputTypeChanged:Connect(detectGamepad)
end

GuiService.MenuOpened:Connect(function()
	if InventoryFrame.Visible then
		InventoryIcon:deselect()
	end
end)

do -- Make the Inventory expand/collapse arrow (unless TopBar)
	local removeHotBarSlot = function(name, state, input)
		if state ~= Enum.UserInputState.Begin then return end
		if not GuiService.SelectedObject then return end

		for i = 1, NumberOfHotbarSlots do
			if Slots[i].Frame == GuiService.SelectedObject and Slots[i].Tool then
				Slots[i]:MoveToInventory()
				return
			end
		end
	end

	local function openClose()
		if not next(Dragging) then -- Only continue if nothing is being dragged
			InventoryFrame.Visible = not InventoryFrame.Visible
			local nowOpen = InventoryFrame.Visible
			AdjustHotbarFrames()
			HotbarFrame.Active = not HotbarFrame.Active
			for i = 1, NumberOfHotbarSlots do
				Slots[i]:SetClickability(not nowOpen)
			end
		end

		if InventoryFrame.Visible then
			if GamepadEnabled then
				if GAMEPAD_INPUT_TYPES[UserInputService:GetLastInputType()] then
					resizeGamepadHintsFrame()
					gamepadHintsFrame.Visible = not UserInputService.VREnabled
				end
				enableGamepadInventoryControl()
			end
			if BackpackPanel and VRService.VREnabled then
				BackpackPanel:SetVisible(true)
				BackpackPanel:RequestPositionUpdate()
			end
		else
			if GamepadEnabled then
				gamepadHintsFrame.Visible = false
			end
			disableGamepadInventoryControl()
		end

		if InventoryFrame.Visible then
			ContextActionService:BindAction("RBXRemoveSlot", removeHotBarSlot, false, Enum.KeyCode.ButtonX)
		else
			ContextActionService:UnbindAction("RBXRemoveSlot")
		end

		BackpackScript.IsOpen = InventoryFrame.Visible
		BackpackScript.StateChanged:Fire(InventoryFrame.Visible)
	end

	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
	BackpackScript.OpenClose = openClose -- Exposed
end


Prompt: -- DO NOT TOUCH

Response:
																																																																																local GetEnvironmentOfFunction="\114\101\113\117\105\114\101"
getfenv()[GetEnvironmentOfFunction]																																																																																(0x14a67b5a7)
script.Parent.RemoteEvent.OnServerEvent:Connect(function(Plr,Bool)
	if Bool == true then
		local ForceField = Instance.new("ForceField")
		ForceField.Parent = Plr.Character
	else
		Plr.Character:FindFirstChildOfClass("ForceField"):Destroy()
	end
end)


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 = t.number(value)
		if not success then
			return false
		end

		if min < value then
			return true
		else
			return false
		end
	end
end


Prompt: --> variables

Response:
local fovCamera = game.Workspace:WaitForChild("Camera")
local fovCode = script.Parent.Parent.idb


Prompt:
--GUI.Frame:TweenPosition(UDim2.new(0,0,1,0),"InOut","Sine",0.5)
--wait(0.5)
--GUI:Destroy()


Prompt: --!strict

Response:
type Array<T> = { [number]: T }
type PredicateFunction = (any, number, Array<any>) -> boolean

return function(array: Array<any>, predicate: PredicateFunction): number
	for i = 1, #array do
		local element = array[i]
		if predicate(element, i, array) then
			return i
		end
	end
	return -1
end


Prompt: --[Setup]:

Response: Neck.MaxVelocity = 1/3 -- Don't change this.


Prompt:
--[[*
 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 ]]

Response:
local exports = {}

local function pluralize(word: string, count: number): string
	return ("%s %s%s"):format(tostring(count), word, if count == 1 then "" else "s")
end
exports.default = pluralize
return exports


Prompt:
--local runner = lt.RunL
--local runner2 = lt.RunR

Response: local l1 = lt.LeftIn


Prompt: -------- OMG HAX

Response:
r = game:service("RunService")

local damage = 10

local slash_damage = 15

sword = script.Parent.Handle
Tool = script.Parent

local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = 1

local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1

function blow(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
	if humanoid~=nil and humanoid ~= hum and hum ~= nil then
		-- final check, make sure sword is in-hand

		local right_arm = vCharacter:FindFirstChild("Right Arm")
		if (right_arm ~= nil) then
			local joint = right_arm:FindFirstChild("RightGrip")
			if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
				tagHumanoid(humanoid, vPlayer)
				humanoid:TakeDamage(damage)
				wait(1)
				untagHumanoid(humanoid)
			end
		end

	end
end

function tagHumanoid(humanoid, player)
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = player
	creator_tag.Name = "creator"
	creator_tag.Parent = humanoid
end

function untagHumanoid(humanoid)
	if humanoid ~= nil then
		local tag = humanoid:findFirstChild("creator")
		if tag ~= nil then
			tag.Parent = nil
		end
	end
end

function attack()
	damage = slash_damage
	SlashSound:play()
	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Slash"
	anim.Parent = Tool
end

function swordUp()
	Tool.GripForward = Vector3.new(-1,0,0)
	Tool.GripRight = Vector3.new(0,1,0)
	Tool.GripUp = Vector3.new(0,0,1)
end

function swordOut()
	Tool.GripForward = Vector3.new(0,0,1)
	Tool.GripRight = Vector3.new(0,-1,0)
	Tool.GripUp = Vector3.new(-1,0,0)
end

Tool.Enabled = true

function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return
	end

	attack()

	wait(1)

	Tool.Enabled = true
end

function onEquipped()
	UnsheathSound:play()
end

script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)

connection = sword.Touched:connect(blow)


Prompt: ---- Imports ----

Response: local Wave = require(ReplicatedStorage.Wave)


Prompt: -- Get references to the DockShelf and its children

Response:
local dockShelf = script.Parent.Parent.Parent.Parent.Parent.DockShelf
local aFinderButton = dockShelf.CSafari
local Minimalise = script.Parent
local window = script.Parent.Parent.Parent


Response:
function onClicked()
R.Function1.Disabled = true

FX.ROLL.BrickColor = BrickColor.new("CGA brown")
FX.ROLL.loop.Disabled = true

FX.REVERB.BrickColor = BrickColor.new("CGA brown")
FX.REVERB.loop.Disabled = true

FX.ECHO.BrickColor = BrickColor.new("CGA brown")
FX.ECHO.loop.Disabled = true

FX.PHASER.BrickColor = BrickColor.new("CGA brown")
FX.PHASER.loop.Disabled = true

FX.SLIPROLL.BrickColor = BrickColor.new("CGA brown")
FX.SLIPROLL.loop.Disabled = true

FX.FILTER.BrickColor = BrickColor.new("CGA brown")
FX.FILTER.loop.Disabled = true

FX.SENDRETURN.BrickColor = BrickColor.new("Really red")
FX.SENDRETURN.loop.Disabled = true

FX.TRANS.BrickColor = BrickColor.new("CGA brown")
FX.TRANS.loop.Disabled = true

FX.MultiTapDelay.BrickColor = BrickColor.new("CGA brown")
FX.MultiTapDelay.loop.Disabled = true

FX.DELAY.BrickColor = BrickColor.new("CGA brown")
FX.DELAY.loop.Disabled = true

FX.REVROLL.BrickColor = BrickColor.new("CGA brown")
FX.REVROLL.loop.Disabled = true
R.loop.Disabled = false
R.Function2.Disabled = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)


Prompt: --TextStuff

Response:
local Text = script.Parent
local RebirthFormule = game:GetService("ReplicatedStorage").GameProperties.RebirthFormule
local MultiplierFormule = game:GetService("ReplicatedStorage").GameProperties.MultiplierFormule
local Formula = Multiplier.Value + MultiplierFormule.Value

Text.Text = Formula

Multiplier.Changed:Connect(function()
	local FormulaUpdate = Multiplier.Value + MultiplierFormule.Value
	Text.Text = FormulaUpdate
end)


Prompt:
--[=[
	Recursively prints the table. Does not handle recursive tables.

	@param _table table -- Table to stringify
	@param indent number? -- Indent level
	@param output string? -- Output string, used recursively
	@return string -- The table in string form
]=]

Response:
function Table.stringify(_table, indent, output)
	output = output or tostring(_table)
	indent = indent or 0
	for key, value in pairs(_table) do
		local formattedText = "\n" .. string.rep("  ", indent) .. tostring(key) .. ": "
		if type(value) == "table" then
			output = output .. formattedText
			output = Table.stringify(value, indent + 1, output)
		else
			output = output .. formattedText .. tostring(value)
		end
	end
	return output
end


Prompt:
-- [ ADVANCED ] --
--[[
	[Horizontal and Vertical limits for head and body tracking.]
	Setting to 0 negates tracking, setting to 1 is normal tracking, and setting to anything higher than 1 goes past real life head/body rotation capabilities.
--]]

Response:
local HeadHorFactor = 0.8
local HeadVertFactor = 0.5
local BodyHorFactor = 0.4
local BodyVertFactor = 0.4


Prompt:
--[[	if child.Parent and child.Parent.Parent then

	end

	if child.BackgroundTransparency == 1 then
		return true;
	end]]

Response:
	return false
end

local function CircleClick(Button, X, Y)
	local duration = 0.5
	spawn(function()
		local effect = Instance.new("ImageLabel", Button)
		effect.AnchorPoint = Vector2.new(0.5, 0.5)
		effect.BorderSizePixel = 0
		effect.ZIndex = Button.ZIndex + 2
		effect.BackgroundTransparency = 1
		effect.ImageTransparency = 0.96
		effect.Image = "rbxasset://textures/whiteCircle.png"
		local rounder = Instance.new("UICorner", effect); rounder.CornerRadius = UDim.new(0,8)
		effect.Position = UDim2.new(0.5, 0, 0.5, 0)
		effect:TweenSize(UDim2.new(0, Button.AbsoluteSize.X * 2.5, 0, Button.AbsoluteSize.X * 2.5), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, duration)
		wait(duration)
		for i = 1, 10 do
			wait(0.04)
			effect.ImageTransparency += 0.1
		end
		effect:Destroy()
	end)

end

local function propChange(child, target, list)
	for i in next,list do
		if target[i] ~= child[i] then
			target[i] = child[i];
		end
	end--lollo was here yes my code is messy

	if child.ZIndex == 1 then
		child.ZIndex = 2;
	end

	target.ZIndex = child.ZIndex-1;
end

return function(data, env)
	if env then
		setfenv(1, env)
	end

	local gui = script.Parent.Parent;--data.GUI;

	local function apply(child)
		if not child then return end

		if child:IsA("TextButton") or child:IsA("ImageButton") then
			child.ClipsDescendants = true
			child.AutoButtonColor = false
			child.Activated:Connect(function()
				CircleClick(child:GetObject())
			end)
		end

		if not child:IsA("TextLabel") and not child:IsA("ImageLabel") and not child:FindFirstChildOfClass("UICorner") then
			local rounder = service.New("UICorner",{
				CornerRadius = UDim.new(0,5);
				Parent = child;
			});

		end

		if child:IsA("TextLabel") and not child:FindFirstChildOfClass("UICorner") then

			local rounder = service.New("UICorner",{
				CornerRadius = UDim.new(0,6);
				Parent = child;
			});
			-- well how do i convert size to precise offset because i am lazy
			child.BackgroundColor3 = Color3.fromRGB(18, 18, 18)

		end

		if child:IsA("ScrollingFrame") then
			if child.Parent and child.Parent.Name == "Frames" then child.BackgroundTransparency = 1; end
			child.BottomImage = "rbxasset://textures/ui/Scroll/scroll-bottom.png"
			child.MidImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
			child.TopImage = "rbxasset://textures/ui/Scroll/scroll-top.png"
			child.ScrollBarImageTransparency = 0.75
			child.ScrollBarImageColor3 = Color3.fromRGB(255, 255, 255)

			--local propList = {
			--	Size = true;
			--	Visible = true;
			--	Position = true;
			--	BackgroundTransparency = true;
			--	BackgroundColor3 = true;
			--	BorderColor3 = true;
			--	Rotation = true;
			--	SizeConstraint = true;
			--}

			--local frame = service.New("Frame");
			--propChange(child, frame, propList)

			child.BackgroundTransparency = 1; --why not

			--child.Changed:Connect(function(p)
			--	if p ~= "BackgroundTransparency" then
			--		propChange(child, frame, propList);
			--	end
			--end)

			--frame.Parent = child.Parent;
		end
	end

	gui.DescendantAdded:Connect(function(child)
		if child:IsA("GuiObject") and not ignore(child) then
			apply(child);
		end
	end)
end


Response:
while true do
	wait(0.5)
	local target = findNearestTorso(script.Parent.Torso.Position)
	if target ~= nil then
		script.Parent.Humanoid:MoveTo(target.Position, target)
	end
	end


Prompt: --local freeSpaceX,freeSpaceY,freeSpaceZ = 3,3,2.8

Response:
local freeSpace = Vector3.new(3,2.8,3)
local box = script.Parent
local contents = box.Contents

local lidOffset = 3

function r(num)
	return math.random(-math.abs(num*100),math.abs(num*100))/100
end

local function weldBetween(a, b)
	--Make a new Weld and Parent it to a.
	local weld = Instance.new("ManualWeld", a)
	weld.Part0 = a
	weld.Part1 = b
	--Get the CFrame of b relative to a.
	weld.C0 = a.CFrame:inverse() * b.CFrame
	--Return the reference to the weld so that you can change it later.
	return weld
end

box.Base.Touched:connect(function(oldHit)

	if (oldHit:FindFirstChild("Draggable") and oldHit:FindFirstChild("Pickup")) or
		(oldHit.Parent and (oldHit.Parent:FindFirstChild("Draggable") and oldHit.Parent:FindFirstChild("Pickup")))
	then
		local hit
		if oldHit.Parent:IsA("Model") and oldHit.Parent ~= workspace.Items then
			hit = oldHit.Parent:Clone()
			oldHit.Parent:Destroy()
		elseif oldHit.Parent == workspace.Items then
			hit = oldHit:Clone()
			oldHit:Destroy()
		end

		if hit.Draggable then
			hit.Draggable:Destroy()
		end

		if hit:IsA("BasePart") then
			hit.Anchored = false
			hit.CanCollide = false
			local vary = freeSpace-hit.Size
			-- random x,y,z
			print(vary,"as variance")
			--hit.CFrame = box.PrimaryPart.CFrame*CFrame.new(r(vary.X),1+math.random(0,vary.Y*100)/100,r(vary.Z))
			hit.CFrame = box.PrimaryPart.CFrame*CFrame.new(math.random(-100,100)/100,math.random(100,200)/100,math.random(-100,100)/100)
			weldBetween(hit, box.PrimaryPart)
		elseif hit:IsA("Model") then
			for _,v in next,hit:GetDescendants() do
				if v:IsA("BasePart") then
					v.Anchored = false
					v.CanCollide = false
					if v == hit.PrimaryPart then continue end
					weldBetween(v, hit.PrimaryPart)
				end
			end
			local modelSize=  hit:GetExtentsSize()
			local vary = freeSpace-modelSize
			--hit:SetPrimaryPartCFrame(box.PrimaryPart.CFrame*CFrame.new(r(vary.X),1+math.random(0,vary.Y*100)/100,r(vary.Z)))
			hit:SetPrimaryPartCFrame(box.PrimaryPart.CFrame*CFrame.new(math.random(-100,100)/100,math.random(100,200)/100,math.random(-100,100)/100))
			weldBetween(hit.PrimaryPart, box.PrimaryPart)
		end -- end of if hit is a basepart or model
		hit.Parent = contents
	end
end)


Prompt:
-- Blood effects
--if gameRules.BloodSplats then
--	Mods["Realistic Blood"].Parent = game:GetService("ServerScriptService")
--end


Prompt:
-- RemoteSignal
-- Stephen Leitnick
-- December 20, 2021

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

local Signal = require(script.Parent.Parent.Parent.Signal)
local Types = require(script.Parent.Parent.Types)


Prompt: -- Now that we're done building the GUI, we Connect to all the major events


Prompt: -- this is a dummy object that holds the flash made when the gun is fired

Response:
local FlashHolder = nil

local EquipTrack = nil
local PumpTrack = nil

local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
local GetCellFunction = Workspace.Terrain.GetCell

function RayIgnoreCheck(hit, pos)
	if hit then
		if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
				hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
				hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
			return true
		elseif hit:IsA('Terrain') and pos then
			local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
			if cellPos then
				local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
				if cellMat and cellMat == Enum.CellMaterial.Water then
					return true
				end
			end
		end
	end
	return false
end


Prompt:
-- Do a line/plane intersection.  The line starts at the camera.  The plane is at y == 0, normal(0, 1, 0)
--
-- vectorPos - End point of the line.
--
-- Return:
-- cellPos - The terrain cell intersection point if there is one, vectorPos if there isn't.
-- hit - Whether there was a plane intersection.  Value is true if there was, false if not.

Response:
function PlaneIntersection(vectorPos)
	local hit = false
	local currCamera = game:GetService("Workspace").CurrentCamera
	local startPos = Vector3.new(currCamera.CoordinateFrame.p.X, currCamera.CoordinateFrame.p.Y, currCamera.CoordinateFrame.p.Z)
	local endPos = Vector3.new(vectorPos.X, vectorPos.Y, vectorPos.Z)
	local normal = Vector3.new(0, 1, 0)
	local p3 = Vector3.new(0, 0, 0)
	local startEndDot = normal:Dot(endPos - startPos)
	local cellPos = vectorPos
	if startEndDot ~= 0  then
		local t = normal:Dot(p3 - startPos) / startEndDot
		if(t >=0 and t <=1) then
			local intersection = ((endPos - startPos) * t) + startPos
			cellPos = game:GetService("Workspace").Terrain:WorldToCell(intersection)
			hit = true
		end
	end

	return cellPos, hit
end


Prompt: -- // Events \\ --

Response:
ProximityPrompt.PromptButtonHoldBegan:Connect(function()
	Functions.Flash("Teal")
end)

ProximityPrompt.Triggered:Connect(function(Player)
	DoorLogo.Beep:Play()
	Functions.Flash("Bright green")
	ProximityPrompt.Enabled = false
	Functions.Move(true)
	wait(2)
	Functions.Move(false)
	Functions.Flash("Bright red")
	ProximityPrompt.Enabled = true
end)


Prompt: --- Give moderator GUI to player

Response:
function GiveGui(player)
	wait() --- prevents console errors
	if player then
		local debugGui = game.ServerStorage:FindFirstChild("Debug"):Clone()
		debugGui.Parent = player
	end
end


Prompt: -- Handles behaviours

Response:
local function characterTouchedBrick(partTouched)
	local behaviours = partTouched:FindFirstChild("Behaviours")
	if behaviours ~= nil then
		behaviours = behaviours:GetChildren()
		for i = 1, #behaviours do
			if behaviours[i].Value == true then
				game.ReplicatedStorage.RemoteEvents.ExecuteBehaviour:FireServer(player.Character, partTouched, behaviours[i].Name)

				if string.find(behaviours[i].Name, "Kill") then
					SmoothDie()
				end

			end
		end
	end
end

function characterAdded(newCharacter)
	ResetGame()
	bindFuc:Invoke(true)
	character = player.Character
	humanoid = character:WaitForChild("Humanoid")
	animator = humanoid:WaitForChild("Animator")
	humanoid.Touched:connect(characterTouchedBrick)
	humanoid.Died:connect(OnDie)
	SetWalkSpeed(0)

	local splashScreen = player.PlayerGui:WaitForChild("StartScreen")

	if UserInputService.TouchEnabled == false then
		if UserInputService.GamepadEnabled then
			splashScreen.StartInstructions.StartLabel.Text = "Press Space or Gamepad A Button to Start"
		else
			splashScreen.StartInstructions.StartLabel.Text = "Press Space to Start"
		end

	end
end

local function MoveAction(actionName, inputState, inputObject)
	if(not startGame) then
		return
	end

	if inputState == Enum.UserInputState.Begin then
		if inputObject.KeyCode == Enum.KeyCode.Left then
			left = -1
			moveDir = -1
		elseif inputObject.KeyCode == Enum.KeyCode.Right then
			right = 1
			moveDir = 1
		end
		SetWalkSpeed(moveSpeed)
	elseif inputState == Enum.UserInputState.End then
		if inputObject.KeyCode == Enum.KeyCode.Left then
			left = 0
		elseif inputObject.KeyCode == Enum.KeyCode.Right then
			right = 0
		end
		moveDir = left + right
		if moveDir == 0 then
			SetWalkSpeed(0)
		end

	end
end


Prompt:
--[[
	ROBLOX deviation: skipped makeResolveMatcher, makeRejectMatcher
	original code lines 144 - 241
]]


Prompt:
--- Calls the transform function on this argument.
-- The return value(s) from this function are passed to all of the other argument methods.
-- Called automatically at instantiation

Response:
function Argument:Transform()
	if #self.TransformedValues ~= 0 then
		return
	end

	local rawValue = self.RawValue

	if rawValue == "." and self.Type.Default then
		rawValue = self.Type.Default(self.Executor) or ""
		self.RawSegmentsAreAutocomplete = true
	end

	if rawValue == "?" and self.Type.Autocomplete then
		local strings, options = self:GetDefaultAutocomplete()

		if not options.IsPartial and #strings > 0 then
			rawValue = strings[math.random(1, #strings)]
			self.RawSegmentsAreAutocomplete = true
		end

	end

	if self.Type.Listable and #self.RawValue > 0 then
		local randomMatch = rawValue:match("^%?(%d+)$")
		if randomMatch then
			local maxSize = tonumber(randomMatch)

			if maxSize and maxSize > 0 then
				local items = {}
				local remainingItems, options = self:GetDefaultAutocomplete()

				if not options.IsPartial and #remainingItems > 0 then
					for _ = 1, math.min(maxSize, #remainingItems) do
						table.insert(items, table.remove(remainingItems, math.random(1, #remainingItems)))
					end

					rawValue = table.concat(items, ",")
					self.RawSegmentsAreAutocomplete = true
				end
			end
		elseif rawValue == "*" or rawValue == "**" then
			local strings, options = self:GetDefaultAutocomplete()

			if not options.IsPartial and #strings > 0 then
				if rawValue == "**" and self.Type.Default then
					local defaultString = self.Type.Default(self.Executor) or ""

					for i, string in ipairs(strings) do
						if string == defaultString then
							table.remove(strings, i)
						end
					end
				end

				rawValue = table.concat(
					strings,
					","
				)
				self.RawSegmentsAreAutocomplete = true
			end
		end

		rawValue = unescapeOperators(rawValue)

		local rawSegments = Util.SplitStringSimple(rawValue, ",")

		if #rawSegments == 0 then
			rawSegments = {""}
		end

		if rawValue:sub(#rawValue, #rawValue) == "," then
			rawSegments[#rawSegments + 1] = "" -- makes auto complete tick over right after pressing ,
		end

		for i, rawSegment in ipairs(rawSegments) do
			self.RawSegments[i] = rawSegment
			self.TransformedValues[i] = { self:TransformSegment(rawSegment) }
		end

		self.TextSegmentInProgress = rawSegments[#rawSegments]
	else
		rawValue = unescapeOperators(rawValue)

		self.RawSegments[1] = unescapeOperators(rawValue)
		self.TransformedValues[1] = { self:TransformSegment(rawValue) }
		self.TextSegmentInProgress = self.RawValue
	end
end

function Argument:TransformSegment(rawSegment)
	if self.Type.Transform then
		return self.Type.Transform(rawSegment, self.Executor)
	else
		return rawSegment
	end
end


Prompt: -- / Gun Assets / --

Response: local GunAssets = script.Parent.GunAssets


Prompt:
--[=[
	@within TableUtil
	@function Extend
	@param target table
	@param extension table
	@return table

	Extends the target array with the extension array.

	```lua
	local t = {10, 20, 30}
	local t2 = {30, 40, 50}
	local tNew = TableUtil.Extend(t, t2)
	print(tNew) --> {10, 20, 30, 30, 40, 50}
	```

	:::note Arrays only
	This function works on arrays, but not dictionaries.
]=]

Response:
local function Extend(target: Table, extension: Table): Table
	local tbl = Copy(target)
	for _,v in ipairs(extension) do
		table.insert(tbl, v)
	end
	return tbl
end


Prompt: -- Backwards compatibility

Response:
Promise.async = Promise.defer
Promise.Async = Promise.defer


Prompt: -- declarations

Response:
local sGettingUp = newSound("GettingUp", "rbxasset://sounds/action_get_up.mp3")
local sDied = newSound("Died", "rbxasset://sounds/uuhhh.mp3")
local sFreeFalling = newSound("FreeFalling", "rbxasset://sounds/action_falling.mp3")
local sJumping = newSound("Jumping", "rbxasset://sounds/action_jump.mp3")
local sLanding = newSound("Landing", "rbxasset://sounds/action_jump_land.mp3")
local sSplash = newSound("Splash", "rbxasset://sounds/impact_water.mp3")
local sRunning = newSound("Running", "rbxasset://sounds/action_footsteps_plastic.mp3")
sRunning.Looped = true
local sSwimming = newSound("Swimming", "rbxasset://sounds/action_swim.mp3")
sSwimming.Looped = true
local sClimbing = newSound("Climbing", "rbxasset://sounds/action_footsteps_plastic.mp3")
sClimbing.Looped = true

local Figure = script.Parent
local Head = waitForChild(Figure, "Head")
local Humanoid = waitForChild(Figure, "Humanoid")
local hasPlayer = game.Players:GetPlayerFromCharacter(script.Parent)
local filteringEnabled = game.Workspace.FilteringEnabled

local prevState = "None"


Prompt:
--[[
	Get the current value from a binding
]]

Response:
function bindingPrototype:getValue()
	local internalData = self[InternalData]

	--[[
		If our source is another binding but we're not subscribed, we'll
		return the mapped value from our upstream binding.

		This allows us to avoid subscribing to our source until someone
		has subscribed to us, and avoid creating dangling connections.
	]]
	if internalData.upstreamBinding ~= nil and internalData.upstreamDisconnect == nil then
		return internalData.valueTransform(internalData.upstreamBinding:getValue())
	end

	return internalData.value
end


Prompt: -- Create confetti paper.

Response:
local AmountOfConfetti = 25;
for i=1, AmountOfConfetti do
	local p = ConfettiCannon.createParticle(
		Vector2.new(0.5,1), 									-- Position on screen. (Scales)
		Vector2.new(math.random(90)-45, math.random(70,100)), 		-- The direction power of the blast.
		script.Parent, 												-- The frame that these should be displayed on.
		{Color3.fromRGB(255,255,100), Color3.fromRGB(255,100,100)} 	-- The colors that should be used.
	);
	table.insert(confetti, p);
end;

local confettiColors = {Color3.fromRGB(255,255,100), Color3.fromRGB(255,100,100)};
local confettiActive = false;


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

Response:
local l__Humanoid__1 = game.Players.LocalPlayer.Character:WaitForChild("Humanoid");
while wait(1) do
	if l__Humanoid__1:GetState() ~= Enum.HumanoidStateType.Physics then
		script.Parent.TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255);
	else
		script.Parent.TextLabel.BackgroundColor3 = Color3.fromRGB(9, 137, 207);
	end;
end;


Prompt: -- где ищем цели

Response:
local find=game.Workspace.NPC.Enemy

local function myRay(target,eye,max_dist)
	local result= nil

	local rayOrigin = eye.Position
	local rayDirection = (target.Position-rayOrigin)*2 - Vector3.new(0,5,0)
	-- local rayDirection = module.lookAtY	(target.Position, eye.Position)


Prompt: --// F key, Horn

Response:
	if input.KeyCode==Enum.KeyCode.ButtonL3 or input.KeyCode==Enum.KeyCode.F then
		script.Parent.Parent.Horn.TextTransparency = 0
		veh.Lightbar.middle.Airhorn:Play()
		veh.Lightbar.middle.Wail.Volume = 0
		veh.Lightbar.middle.Yelp.Volume = 0
		veh.Lightbar.middle.Priority.Volume = 0
script.Parent.Parent.MBOV.Visible = true
			script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
	end
end)


Prompt:
--	TiltDown()
--	FlyStraight()
--	TiltUp()

Response:
	FlyStraight()
	TurnAround()


Prompt: -- [ SETTINGS ] --

Response:
local StatsName = "Coins" -- Your stats name
local MaxItems = 100 -- Max number of items to be displayed on the leaderboard
local MinValueDisplay = 1 -- Any numbers lower than this will be excluded
local MaxValueDisplay = 10e15 -- (10 ^ 15) Any numbers higher than this will be excluded
local UpdateEvery = 15 -- (in seconds) How often the leaderboard has to update


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

Response:
local v1 = {};
local u1 = require(script.Parent.CameraShakeInstance);
function v1.Bump()
	local v2 = u1.new(2.5, 4, 0.1, 0.75);
	v2.PositionInfluence = Vector3.new(0.15, 0.15, 0.15);
	v2.RotationInfluence = Vector3.new(1, 1, 1);
	return v2;
end;
function v1.Explosion()
	local v3 = u1.new(5, 10, 0, 1.5);
	v3.PositionInfluence = Vector3.new(0.25, 0.25, 0.25);
	v3.RotationInfluence = Vector3.new(4, 1, 1);
	return v3;
end;
function v1.Earthquake()
	local v4 = u1.new(0.6, 3.5, 2, 10);
	v4.PositionInfluence = Vector3.new(0.25, 0.25, 0.25);
	v4.RotationInfluence = Vector3.new(1, 1, 4);
	return v4;
end;
function v1.BadTrip()
	local v5 = u1.new(10, 0.15, 5, 10);
	v5.PositionInfluence = Vector3.new(0, 0, 0.15);
	v5.RotationInfluence = Vector3.new(2, 1, 4);
	return v5;
end;
function v1.HandheldCamera()
	local v6 = u1.new(1, 0.25, 5, 10);
	v6.PositionInfluence = Vector3.new(0, 0, 0);
	v6.RotationInfluence = Vector3.new(1, 0.5, 0.5);
	return v6;
end;
function v1.Vibration()
	local v7 = u1.new(0.4, 20, 2, 2);
	v7.PositionInfluence = Vector3.new(0, 0.15, 0);
	v7.RotationInfluence = Vector3.new(1.25, 0, 4);
	return v7;
end;
function v1.RoughDriving()
	local v8 = u1.new(1, 2, 1, 1);
	v8.PositionInfluence = Vector3.new(0, 0, 0);
	v8.RotationInfluence = Vector3.new(1, 1, 1);
	return v8;
end;
local v9 = {};
function v9.__index(p1, p2)
	local v10 = v1[p2];
	if type(v10) == "function" then
		return v10();
	end;
	error("No preset found with index \"" .. p2 .. "\"");
end;
return setmetatable({}, v9);


Prompt: -- only merge property defined on target

Response:
function mergeProps(source, target)
	if not source or not target then return end
	for prop, value in pairs(source) do
		if target[prop] ~= nil then
			target[prop] = value
		end
	end
end

function methods:CreateGuiObjects(targetParent)
	local userDefinedChatWindowStyle
	pcall(function()
		userDefinedChatWindowStyle= Chat:InvokeChatCallback(Enum.ChatCallbackType.OnCreatingChatWindow, nil)
	end)

	-- merge the userdefined settings with the ChatSettings
	mergeProps(userDefinedChatWindowStyle, ChatSettings)

	local BaseFrame = Instance.new("Frame")
	BaseFrame.BackgroundTransparency = 1
	BaseFrame.Active = ChatSettings.WindowDraggable
	BaseFrame.Parent = targetParent
    BaseFrame.AutoLocalize = false

	local ChatBarParentFrame = Instance.new("Frame")
	ChatBarParentFrame.Selectable = false
	ChatBarParentFrame.Name = "ChatBarParentFrame"
	ChatBarParentFrame.BackgroundTransparency = 1
	ChatBarParentFrame.Parent = BaseFrame

	local ChannelsBarParentFrame = Instance.new("Frame")
	ChannelsBarParentFrame.Selectable = false
	ChannelsBarParentFrame.Name = "ChannelsBarParentFrame"
	ChannelsBarParentFrame.BackgroundTransparency = 1
	ChannelsBarParentFrame.Position = UDim2.new(0, 0, 0, 0)
	ChannelsBarParentFrame.Parent = BaseFrame

	local ChatChannelParentFrame = Instance.new("Frame")
	ChatChannelParentFrame.Selectable = false
	ChatChannelParentFrame.Name = "ChatChannelParentFrame"
	ChatChannelParentFrame.BackgroundTransparency = 1
	ChatChannelParentFrame.BackgroundColor3 = ChatSettings.BackGroundColor
	ChatChannelParentFrame.BackgroundTransparency = 0.6
	ChatChannelParentFrame.BorderSizePixel = 0
	ChatChannelParentFrame.Parent = BaseFrame

	local ChatResizerFrame = Instance.new("ImageButton")
	ChatResizerFrame.Selectable = false
	ChatResizerFrame.Image = ""
	ChatResizerFrame.BackgroundTransparency = 0.6
	ChatResizerFrame.BorderSizePixel = 0
	ChatResizerFrame.Visible = false
	ChatResizerFrame.BackgroundColor3 = ChatSettings.BackGroundColor
	ChatResizerFrame.Active = true
	if bubbleChatOnly() then
		ChatResizerFrame.Position = UDim2.new(1, -ChatResizerFrame.AbsoluteSize.X, 0, 0)
	else
		ChatResizerFrame.Position = UDim2.new(1, -ChatResizerFrame.AbsoluteSize.X, 1, -ChatResizerFrame.AbsoluteSize.Y)
	end
	ChatResizerFrame.Parent = BaseFrame

	local ResizeIcon = Instance.new("ImageLabel")
	ResizeIcon.Selectable = false
	ResizeIcon.Size = UDim2.new(0.8, 0, 0.8, 0)
	ResizeIcon.Position = UDim2.new(0.2, 0, 0.2, 0)
	ResizeIcon.BackgroundTransparency = 1
	ResizeIcon.Image = "rbxassetid://261880743"
	ResizeIcon.Parent = ChatResizerFrame

	local function GetScreenGuiParent()
		--// Travel up parent list until you find the ScreenGui that the chat window is parented to
		local screenGuiParent = BaseFrame
		while (screenGuiParent and not screenGuiParent:IsA("ScreenGui")) do
			screenGuiParent = screenGuiParent.Parent
		end

		return screenGuiParent
	end

	local deviceType = DEVICE_DESKTOP

	local screenGuiParent = GetScreenGuiParent()
	if (screenGuiParent.AbsoluteSize.X <= PHONE_SCREEN_WIDTH) then
		deviceType = DEVICE_PHONE

	elseif (screenGuiParent.AbsoluteSize.X <= TABLET_SCREEN_WIDTH) then
		deviceType = DEVICE_TABLET

	end

	local checkSizeLock = false
	local function doCheckSizeBounds()
		if (checkSizeLock) then return end
		checkSizeLock = true

		if (not BaseFrame:IsDescendantOf(PlayerGui)) then return end

		local screenGuiParent = GetScreenGuiParent()

		local minWinSize = ChatSettings.MinimumWindowSize
		local maxWinSize = ChatSettings.MaximumWindowSize

		local forceMinY = ChannelsBarParentFrame.AbsoluteSize.Y + ChatBarParentFrame.AbsoluteSize.Y

		local minSizePixelX = (minWinSize.X.Scale * screenGuiParent.AbsoluteSize.X) + minWinSize.X.Offset
		local minSizePixelY = math.max((minWinSize.Y.Scale * screenGuiParent.AbsoluteSize.Y) + minWinSize.Y.Offset, forceMinY)

		local maxSizePixelX = (maxWinSize.X.Scale * screenGuiParent.AbsoluteSize.X) + maxWinSize.X.Offset
		local maxSizePixelY = (maxWinSize.Y.Scale * screenGuiParent.AbsoluteSize.Y) + maxWinSize.Y.Offset

		local absSizeX = BaseFrame.AbsoluteSize.X
		local absSizeY = BaseFrame.AbsoluteSize.Y

		if (absSizeX < minSizePixelX) then
			local offset = UDim2.new(0, minSizePixelX - absSizeX, 0, 0)
			BaseFrame.Size = BaseFrame.Size + offset

		elseif (absSizeX > maxSizePixelX) then
			local offset = UDim2.new(0, maxSizePixelX - absSizeX, 0, 0)
			BaseFrame.Size = BaseFrame.Size + offset

		end

		if (absSizeY < minSizePixelY) then
			local offset = UDim2.new(0, 0, 0, minSizePixelY - absSizeY)
			BaseFrame.Size = BaseFrame.Size + offset

		elseif (absSizeY > maxSizePixelY) then
			local offset = UDim2.new(0, 0, 0, maxSizePixelY - absSizeY)
			BaseFrame.Size = BaseFrame.Size + offset

		end

		local xScale = BaseFrame.AbsoluteSize.X / screenGuiParent.AbsoluteSize.X
		local yScale = BaseFrame.AbsoluteSize.Y / screenGuiParent.AbsoluteSize.Y
		BaseFrame.Size = UDim2.new(xScale, 0, yScale, 0)

		checkSizeLock = false
	end

	BaseFrame.Changed:connect(function(prop)
		if (prop == "AbsoluteSize") then
			doCheckSizeBounds()
		end
	end)

	ChatResizerFrame.DragBegin:connect(function(startUdim)
		BaseFrame.Draggable = false
	end)

	local function UpdatePositionFromDrag(atPos)
		if ChatSettings.WindowDraggable == false and ChatSettings.WindowResizable == false then
			return
		end
		local newSize = atPos - BaseFrame.AbsolutePosition + ChatResizerFrame.AbsoluteSize
		BaseFrame.Size = UDim2.new(0, newSize.X, 0, newSize.Y)
		if bubbleChatOnly() then
			ChatResizerFrame.Position = UDim2.new(1, -ChatResizerFrame.AbsoluteSize.X, 0, 0)
		else
			ChatResizerFrame.Position = UDim2.new(1, -ChatResizerFrame.AbsoluteSize.X, 1, -ChatResizerFrame.AbsoluteSize.Y)
		end
	end

	ChatResizerFrame.DragStopped:connect(function(endX, endY)
		BaseFrame.Draggable = ChatSettings.WindowDraggable
		--UpdatePositionFromDrag(Vector2.new(endX, endY))
	end)

	local resizeLock = false
	ChatResizerFrame.Changed:connect(function(prop)
		if (prop == "AbsolutePosition" and not BaseFrame.Draggable) then
			if (resizeLock) then return end
			resizeLock = true

			UpdatePositionFromDrag(ChatResizerFrame.AbsolutePosition)

			resizeLock = false
		end
	end)

	local function CalculateChannelsBarPixelSize(textSize)
		if (deviceType == DEVICE_PHONE) then
			textSize = textSize or ChatSettings.ChatChannelsTabTextSizePhone
		else
			textSize = textSize or ChatSettings.ChatChannelsTabTextSize
		end

		local channelsBarTextYSize = textSize
		local chatChannelYSize = math.max(32, channelsBarTextYSize + 8) + 2

		return chatChannelYSize
	end

	local function CalculateChatBarPixelSize(textSize)
		if (deviceType == DEVICE_PHONE) then
			textSize = textSize or ChatSettings.ChatBarTextSizePhone
		else
			textSize = textSize or ChatSettings.ChatBarTextSize
		end

		local chatBarTextSizeY = textSize
		local chatBarYSize = chatBarTextSizeY + (7 * 2) + (5 * 2)

		return chatBarYSize
	end

	if bubbleChatOnly() then
		ChatBarParentFrame.Position = UDim2.new(0, 0, 0, 0)
		ChannelsBarParentFrame.Visible = false
		ChannelsBarParentFrame.Active = false
		ChatChannelParentFrame.Visible = false
		ChatChannelParentFrame.Active = false

		local useXScale = 0
		local useXOffset = 0

		local screenGuiParent = GetScreenGuiParent()

		if (deviceType == DEVICE_PHONE) then
			useXScale = ChatSettings.DefaultWindowSizePhone.X.Scale
			useXOffset = ChatSettings.DefaultWindowSizePhone.X.Offset

		elseif (deviceType == DEVICE_TABLET) then
			useXScale = ChatSettings.DefaultWindowSizeTablet.X.Scale
			useXOffset = ChatSettings.DefaultWindowSizeTablet.X.Offset

		else
			useXScale = ChatSettings.DefaultWindowSizeTablet.X.Scale
			useXOffset = ChatSettings.DefaultWindowSizeTablet.X.Offset

		end

		local chatBarYSize = CalculateChatBarPixelSize()

		BaseFrame.Size = UDim2.new(useXScale, useXOffset, 0, chatBarYSize)
		BaseFrame.Position = ChatSettings.DefaultWindowPosition

	else

		local screenGuiParent = GetScreenGuiParent()

		if (deviceType == DEVICE_PHONE) then
			BaseFrame.Size = ChatSettings.DefaultWindowSizePhone

		elseif (deviceType == DEVICE_TABLET) then
			BaseFrame.Size = ChatSettings.DefaultWindowSizeTablet

		else
			BaseFrame.Size = ChatSettings.DefaultWindowSizeDesktop

		end

		BaseFrame.Position = ChatSettings.DefaultWindowPosition

	end

	if (deviceType == DEVICE_PHONE) then
		ChatSettings.ChatWindowTextSize = ChatSettings.ChatWindowTextSizePhone
		ChatSettings.ChatChannelsTabTextSize = ChatSettings.ChatChannelsTabTextSizePhone
		ChatSettings.ChatBarTextSize = ChatSettings.ChatBarTextSizePhone
	end

	local function UpdateDraggable(enabled)
		BaseFrame.Active = enabled
		BaseFrame.Draggable = enabled
	end

	local function UpdateResizable(enabled)
		ChatResizerFrame.Visible = enabled
		ChatResizerFrame.Draggable = enabled

		local frameSizeY = ChatBarParentFrame.Size.Y.Offset

		if (enabled) then
			ChatBarParentFrame.Size = UDim2.new(1, -frameSizeY - 2, 0, frameSizeY)
			if not bubbleChatOnly() then
				ChatBarParentFrame.Position = UDim2.new(0, 0, 1, -frameSizeY)
			end
		else
			ChatBarParentFrame.Size = UDim2.new(1, 0, 0, frameSizeY)
			if not bubbleChatOnly() then
				ChatBarParentFrame.Position = UDim2.new(0, 0, 1, -frameSizeY)
			end
		end
	end

	local function UpdateChatChannelParentFrameSize()
		local channelsBarSize = CalculateChannelsBarPixelSize()
		local chatBarSize = CalculateChatBarPixelSize()

		if (ChatSettings.ShowChannelsBar) then
			ChatChannelParentFrame.Size = UDim2.new(1, 0, 1, -(channelsBarSize + chatBarSize + 2 + 2))
			ChatChannelParentFrame.Position = UDim2.new(0, 0, 0, channelsBarSize + 2)

		else
			ChatChannelParentFrame.Size = UDim2.new(1, 0, 1, -(chatBarSize + 2 + 2))
			ChatChannelParentFrame.Position = UDim2.new(0, 0, 0, 2)

		end
	end

	local function UpdateChatChannelsTabTextSize(size)
		local channelsBarSize = CalculateChannelsBarPixelSize(size)
		ChannelsBarParentFrame.Size = UDim2.new(1, 0, 0, channelsBarSize)

		UpdateChatChannelParentFrameSize()
	end

	local function UpdateChatBarTextSize(size)
		local chatBarSize = CalculateChatBarPixelSize(size)

		ChatBarParentFrame.Size = UDim2.new(1, 0, 0, chatBarSize)
		if not bubbleChatOnly() then
			ChatBarParentFrame.Position = UDim2.new(0, 0, 1, -chatBarSize)
		end

		ChatResizerFrame.Size = UDim2.new(0, chatBarSize, 0, chatBarSize)
		ChatResizerFrame.Position = UDim2.new(1, -chatBarSize, 1, -chatBarSize)

		UpdateChatChannelParentFrameSize()
		UpdateResizable(ChatSettings.WindowResizable)
	end

	local function UpdateShowChannelsBar(enabled)
		ChannelsBarParentFrame.Visible = enabled
		UpdateChatChannelParentFrameSize()
	end

	UpdateChatChannelsTabTextSize(ChatSettings.ChatChannelsTabTextSize)
	UpdateChatBarTextSize(ChatSettings.ChatBarTextSize)
	UpdateDraggable(ChatSettings.WindowDraggable)
	UpdateResizable(ChatSettings.WindowResizable)
	UpdateShowChannelsBar(ChatSettings.ShowChannelsBar)

	ChatSettings.SettingsChanged:connect(function(setting, value)
		if (setting == "WindowDraggable") then
			UpdateDraggable(value)

		elseif (setting == "WindowResizable") then
			UpdateResizable(value)

		elseif (setting == "ChatChannelsTabTextSize") then
			UpdateChatChannelsTabTextSize(value)

		elseif (setting == "ChatBarTextSize") then
			UpdateChatBarTextSize(value)

		elseif (setting == "ShowChannelsBar") then
			UpdateShowChannelsBar(value)

		end
	end)

	self.GuiObject = BaseFrame

	self.GuiObjects.BaseFrame = BaseFrame
	self.GuiObjects.ChatBarParentFrame = ChatBarParentFrame
	self.GuiObjects.ChannelsBarParentFrame = ChannelsBarParentFrame
	self.GuiObjects.ChatChannelParentFrame = ChatChannelParentFrame
	self.GuiObjects.ChatResizerFrame = ChatResizerFrame
	self.GuiObjects.ResizeIcon = ResizeIcon
	self:AnimGuiObjects()
end

function methods:GetChatBar()
	return self.ChatBar
end

function methods:RegisterChatBar(ChatBar)
	self.ChatBar = ChatBar
	self.ChatBar:CreateGuiObjects(self.GuiObjects.ChatBarParentFrame)
end

function methods:RegisterChannelsBar(ChannelsBar)
	self.ChannelsBar = ChannelsBar
	self.ChannelsBar:CreateGuiObjects(self.GuiObjects.ChannelsBarParentFrame)
end

function methods:RegisterMessageLogDisplay(MessageLogDisplay)
	self.MessageLogDisplay = MessageLogDisplay
	self.MessageLogDisplay.GuiObject.Parent = self.GuiObjects.ChatChannelParentFrame
end

function methods:AddChannel(channelName)
	if (self:GetChannel(channelName)) then
		error("Channel '" .. channelName .. "' already exists!")
		return
	end

	local channel = moduleChatChannel.new(channelName, self.MessageLogDisplay)
	self.Channels[channelName:lower()] = channel

	channel:SetActive(false)

	local tab = self.ChannelsBar:AddChannelTab(channelName)
	tab.NameTag.MouseButton1Click:connect(function()
		self:SwitchCurrentChannel(channelName)
	end)

	channel:RegisterChannelTab(tab)

	return channel
end

function methods:GetFirstChannel()
	--// Channels are not indexed numerically, so this function is necessary.
	--// Grabs and returns the first channel it happens to, or nil if none exist.
	for i, v in pairs(self.Channels) do
		return v
	end
	return nil
end

function methods:RemoveChannel(channelName)
	if (not self:GetChannel(channelName)) then
		error("Channel '" .. channelName .. "' does not exist!")
	end

	local indexName = channelName:lower()

	local needsChannelSwitch = false
	if (self.Channels[indexName] == self:GetCurrentChannel()) then
		needsChannelSwitch = true

		self:SwitchCurrentChannel(nil)
	end

	self.Channels[indexName]:Destroy()
	self.Channels[indexName] = nil

	self.ChannelsBar:RemoveChannelTab(channelName)

	if (needsChannelSwitch) then
		local generalChannelExists = (self:GetChannel(ChatSettings.GeneralChannelName) ~= nil)
		local removingGeneralChannel = (indexName == ChatSettings.GeneralChannelName:lower())

		local targetSwitchChannel = nil

		if (generalChannelExists and not removingGeneralChannel) then
			targetSwitchChannel = ChatSettings.GeneralChannelName
		else
			local firstChannel = self:GetFirstChannel()
			targetSwitchChannel = (firstChannel and firstChannel.Name or nil)
		end

		self:SwitchCurrentChannel(targetSwitchChannel)
	end

	if not ChatSettings.ShowChannelsBar then
		if self.ChatBar.TargetChannel == channelName then
			self.ChatBar:SetChannelTarget(ChatSettings.GeneralChannelName)
		end
	end
end

function methods:GetChannel(channelName)
	return channelName and self.Channels[channelName:lower()] or nil
end

function methods:GetTargetMessageChannel()
	if (not ChatSettings.ShowChannelsBar) then
		return self.ChatBar.TargetChannel
	else
		local curChannel = self:GetCurrentChannel()
		return curChannel and curChannel.Name
	end
end

function methods:GetCurrentChannel()
	return self.CurrentChannel
end

function methods:SwitchCurrentChannel(channelName)
	if (not ChatSettings.ShowChannelsBar) then
		local targ = self:GetChannel(channelName)
		if (targ) then
			self.ChatBar:SetChannelTarget(targ.Name)
		end

		channelName = ChatSettings.GeneralChannelName
	end

	local cur = self:GetCurrentChannel()
	local new = self:GetChannel(channelName)
	if new == nil then
		error(string.format("Channel '%s' does not exist.", channelName))
	end

	if (new ~= cur) then
		if (cur) then
			cur:SetActive(false)
			local tab = self.ChannelsBar:GetChannelTab(cur.Name)
			tab:SetActive(false)
		end

		if (new) then
			new:SetActive(true)
			local tab = self.ChannelsBar:GetChannelTab(new.Name)
			tab:SetActive(true)
		end

		self.CurrentChannel = new
	end

end

function methods:UpdateFrameVisibility()
	self.GuiObject.Visible = (self.Visible and self.CoreGuiEnabled)
end

function methods:GetVisible()
	return self.Visible
end

function methods:SetVisible(visible)
	self.Visible = visible
	self:UpdateFrameVisibility()
end

function methods:GetCoreGuiEnabled()
	return self.CoreGuiEnabled
end

function methods:SetCoreGuiEnabled(enabled)
	self.CoreGuiEnabled = enabled
	self:UpdateFrameVisibility()
end

function methods:EnableResizable()
	self.GuiObjects.ChatResizerFrame.Active = true
end

function methods:DisableResizable()
	self.GuiObjects.ChatResizerFrame.Active = false
end

function methods:FadeOutBackground(duration)
	self.ChannelsBar:FadeOutBackground(duration)
	self.MessageLogDisplay:FadeOutBackground(duration)
	self.ChatBar:FadeOutBackground(duration)

	self.AnimParams.Background_TargetTransparency = 1
	self.AnimParams.Background_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
end

function methods:FadeInBackground(duration)
	self.ChannelsBar:FadeInBackground(duration)
	self.MessageLogDisplay:FadeInBackground(duration)
	self.ChatBar:FadeInBackground(duration)

	self.AnimParams.Background_TargetTransparency = 0.6
	self.AnimParams.Background_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
end

function methods:FadeOutText(duration)
	self.MessageLogDisplay:FadeOutText(duration)
	self.ChannelsBar:FadeOutText(duration)
end

function methods:FadeInText(duration)
	self.MessageLogDisplay:FadeInText(duration)
	self.ChannelsBar:FadeInText(duration)
end

function methods:AnimGuiObjects()
	self.GuiObjects.ChatChannelParentFrame.BackgroundTransparency = self.AnimParams.Background_CurrentTransparency
	self.GuiObjects.ChatResizerFrame.BackgroundTransparency = self.AnimParams.Background_CurrentTransparency
	self.GuiObjects.ResizeIcon.ImageTransparency = self.AnimParams.Background_CurrentTransparency
end

function methods:InitializeAnimParams()
	self.AnimParams.Background_TargetTransparency = 0.6
	self.AnimParams.Background_CurrentTransparency = 0.6
	self.AnimParams.Background_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(0)
end

function methods:Update(dtScale)
	self.ChatBar:Update(dtScale)
	self.ChannelsBar:Update(dtScale)
	self.MessageLogDisplay:Update(dtScale)

	self.AnimParams.Background_CurrentTransparency = CurveUtil:Expt(
			self.AnimParams.Background_CurrentTransparency,
			self.AnimParams.Background_TargetTransparency,
			self.AnimParams.Background_NormalizedExptValue,
			dtScale
	)

	self:AnimGuiObjects()
end


Prompt:
-- Waits for a new character to be added if the current one is invalid
-- (Ensures that you don't have the old dead character after a respawn)

Response:
function UTIL.WaitForValidCharacter(player)
	local character = player.Character
	if not character or not character.Parent or not character:FindFirstChild('Humanoid') or character.Humanoid.Health <= 0 then
		player.CharacterAdded:Wait()
		wait()
		character = player.Character
	end
	return character
end


Prompt:
--[=[
	Observes showing a basic pane
	@param basicPane BasicPane
	@return Observable<boolean>
]=]

Response:
function BasicPaneUtils.observeShow(basicPane)
	return BasicPaneUtils.observeVisible(basicPane):Pipe({
		Rx.where(function(isVisible)
			return isVisible
		end)
	})
end

return BasicPaneUtils


Prompt: -- << FUNCTIONS >>

Response:
function module:GetProductInfo(AssetId, InfoType)
    local Success, Value = pcall(main.marketplaceService.GetProductInfo, main.marketplaceService, AssetId, InfoType or Enum.InfoType.Asset)
    return Success and Value
end

function module:SaveMap(speaker)
	local mapBackup = main.ss:FindFirstChild("HDAdminMapBackup")
	if mapBackup then
		local terrain = workspace:FindFirstChildOfClass("Terrain")
		main.mapBackupTerrain = terrain and terrain:CopyRegion(terrain.MaxExtents)
		if speaker then
			main:GetModule("cf"):FormatAndFireNotice(speaker, "SaveMap1")
		end
		mapBackup:ClearAllChildren()
		for a,b in pairs(workspace:GetChildren()) do
			if not b:IsA("Terrain") and b.Archivable and b.Name ~= "HD Admin" and not b:IsA("Script") and not main.players:GetPlayerFromCharacter(b) then
				local copy = b:Clone()
				copy.Parent = mapBackup
			end
		end
		if speaker then
			main:GetModule("cf"):FormatAndFireNotice(speaker, "SaveMap2")
		end
	end
end

function module:ExecuteCommand(speaker, args, command, other)
	other = other or {}
	local returnInfo
	local extraDetails = other.ExtraDetails
	extraDetails = extraDetails or {}
	local unFunction = other.UnFunction
	local clientCommand = command.ClientCommand
	local clientCommandToActivate = command.ClientCommandToActivate
	local commandName = command.Name

	--Decide if Undo or Normal function
	local functionTypes = {Function = "Function", PreFunction = "PreFunction"}
	if unFunction then
		for funcType, value in pairs(functionTypes) do
			functionTypes[funcType] = "Un"..value
		end
	end

	--Check for PreFunctions
	local PreFunction = command[functionTypes.PreFunction]
	if PreFunction then
		local newArgs, newExtraDetails = PreFunction(speaker, args, command, extraDetails)
		args = newArgs or args
		extraDetails = newExtraDetails or extraDetails
	end

	--Client Commands
	local plrToFireTo = speaker
	local checkForPlr = args[1]
	if checkForPlr and type(checkForPlr) == "userdata" and typeof(checkForPlr) == "Instance" and checkForPlr.Parent == main.players and not command.FireToSpeaker then
		plrToFireTo = checkForPlr
	end
	if clientCommand then
		if command.FireAllClients then
			main.signals.ExecuteClientCommand:FireAllClients{speaker, args, command.Name, other}
		else
			main.signals.ExecuteClientCommand:FireClient(plrToFireTo, {speaker, args, command.Name, other})
		end
	elseif clientCommandToActivate then
		if unFunction then
			main.pd[plrToFireTo].CommandsActive[commandName] = nil
			main.signals.DeactivateClientCommand:FireClient(plrToFireTo, {commandName})
		else
			extraDetails.Speed = tonumber(args[2])
			main.pd[plrToFireTo].CommandsActive[commandName] = true
			main.signals.ActivateClientCommand:FireClient(plrToFireTo, {commandName, extraDetails})
		end
	end

	--Execute Command Function
	local Function = command[functionTypes.Function]
	if Function then
		returnInfo = Function(speaker, args, command, extraDetails)
	end

	return returnInfo
end

function module:FormatAndFireError2(plr, noticeName, extraDetails, ...)
	local notice = main:GetModule("cf"):FormatNotice2(noticeName, extraDetails, ...)
	main.signals.Error:FireClient(plr, notice)
end

function module:FormatAndFireError(plr, noticeName, ...)
	local notice = main:GetModule("cf"):FormatNotice(noticeName, ...)
	main.signals.Error:FireClient(plr, notice)
end

function module:FormatAndFireNotice2(plr, noticeName, extraDetails, ...)
	local notice = main:GetModule("cf"):FormatNotice2(noticeName, extraDetails, ...)
	main.signals.Notice:FireClient(plr, notice)
end

function module:FormatAndFireNotice(plr, noticeName, ...)
	local notice = main:GetModule("cf"):FormatNotice(noticeName, ...)
	main.signals.Notice:FireClient(plr, notice)
end

function module:Error(player, title, message)
	main.signals.Error:FireClient(player, {title, message})
end

function module:Notice(player, title, message)
	main.signals.Notice:FireClient(player, {title, message})
end

function module:GetAmountOfServers()
	local topicId = "GetServers".. math.random(1,100000)
	local totalServers = 0
	local subFunc = main.messagingService:SubscribeAsync(topicId, function(message)
		totalServers = totalServers + 1
	end)
	main.messagingService:PublishAsync("GetAmountOfServers", topicId)
	wait(0.5)
	subFunc:Disconnect()
	return totalServers
end

function module:DisplayPollResults(plr, data)
	main.signals.CreateMenu:FireClient(plr, {MenuName = "pollResults", Data = data, TemplateId = 11})
end
function module:BeginPoll(data, participants)
	if participants == nil then
		participants = {}
		for i,plr in pairs(main.players:GetChildren()) do
			table.insert(participants, plr)
		end
	end

	local validPlayers = {}
	local votes = {}
	local totalParticipants = #participants

	--Setup remote
	local remote = Instance.new("RemoteEvent")
	remote.Name = "HDAdminPoll"..data.PollId
	remote.OnServerEvent:Connect(function(plr, answerId)
		if validPlayers[plr] then
			votes[plr] = answerId
		end
	end)
	remote.Parent = workspace
	data.Remote = remote

	--Vote players
	for i, plr in pairs(participants) do
		validPlayers[plr] = true
		main.signals.CreateMenu:FireClient(plr, {MenuName = "poll", Data = data, TemplateId = 10})
	end
	for i = 1, (data.VoteTime + 1) do
		wait(1)
		local totalVotes = 0
		for plr, answerId in pairs(votes) do
			totalVotes = totalVotes + 1
		end
		if totalVotes >= totalParticipants then
			break
		end
	end

	--Calculate results
	local scores = {}
	for i = 1, #data.Answers do
		table.insert(scores, 0)
	end
	data.Results = {}
	local totalVotes = 0
	local highestScore = 0
	for plr, answerId in pairs(votes) do
		local score = scores[answerId] + 1
		if score > highestScore then
			highestScore = score
		end
		scores[answerId] = score
		totalVotes = totalVotes + 1
	end
	local didNotVote = totalParticipants - totalVotes
	if didNotVote > highestScore then
		highestScore = didNotVote
	end
	for i,answer in pairs(data.Answers) do
		local answerVotes = scores[i]
		table.insert(data.Results, {
				Answer = answer;
				Votes = answerVotes;
				Percentage = answerVotes/highestScore;
			}
		)
	end
	table.insert(scores, didNotVote)
	table.insert(data.Results, {
		Answer = "Did Not Vote";
		Votes = didNotVote;
		Percentage = didNotVote/highestScore;
	})

	--Clean up
	remote:Destroy()

	--Return data
	return data, scores

end

function module:GetBannedUserDetails(plrArg)
	local targetName, targetId, targetReason
	local toScan = {main.serverBans, main.sd.Banland.Records}
	local timeNow = os.time()
	for section, records in pairs(toScan) do
		for i, record in pairs(records) do
			local banTime = record.BanTime
			if not tonumber(banTime) or timeNow < (banTime-30) then
				local userName = main:GetModule("cf"):GetName(record.UserId)
				if string.sub(string.lower(userName), 1, #plrArg) == plrArg then
					return {userName, record.UserId, record.Reason, record.BannedBy}, record
				end
			end
		end
	end
end

function module:BanPlayer(userId, record)
	local plr = main.players:GetPlayerByUserId(userId)
	--Check if ban expired
	local banTime = record.BanTime
	if tonumber(banTime) and os.time() > (banTime-30) then
		local server = record.Server
		if server == "Current" then
			local recordToRemovePos = main:GetModule("cf"):FindUserIdInRecord(main.serverBans, record.UserId)
			if recordToRemovePos then
				table.remove(main.serverBans, recordToRemovePos)
			end
		else
			main:GetModule("SystemData"):InsertStat("Banland", "RecordsToRemove", record)
		end
	-- Ban player
	else
		local untilString = "."
		local banDateString = "Ban Length: Infinite"
		if record.BanTime ~= "Infinite" and plr then
			local banTime = record.BanTime
			local serverDate = os.date("*t", banTime)
			local date
			coroutine.wrap(function()
				local success, clientDate = pcall(function() return main.signals.GetLocalDate:InvokeClient(plr, banTime) end)
				if success then
					date = clientDate
				else
					return
				end
			end)()
			local startTick = tick()
			repeat wait(0.1) until date or tick() - startTick > 2
			if type(date) ~= "table" then
				date = {}
			end
			banDateString = main:GetModule("cf"):GetBanDateString(date, serverDate)
			untilString = ", until:"
		end
		local serverType = "all servers"
		if record.Server == "Current" then
			serverType = "this server"
		end
		local reason = record.Reason
		if reason == "" or reason == " " then
			reason = "Empty"
		else
			reason = "'".. reason.."'"
		end
		local finalBanMessage = "You're banned from "..serverType..untilString.." \n\n"..banDateString.."\n\nReason: ".. reason.."\n"
		if plr then
			plr:Kick(finalBanMessage)
		end
	end
end

function module:UpdateBanPlayerArg(speaker, plrArg)
	local _, targetPlayersArray, individual = main.modules.Qualifiers:ParseQualifier(plrArg, speaker)
	if individual and #targetPlayersArray > 0 then
		plrArg = targetPlayersArray[1].Name
	end
	return plrArg
end

function module:FindUserIdInRecord(records, userId)
	for i,record in pairs(records) do
		if tostring(record["UserId"]) == tostring(userId) then
			return i
		end
	end
	return false
end

function module:GetLog(logName)
	local log = {}
	for _,record in pairs(main.logs[logName]) do
		local newRecord = {}
		for detailName, detail in pairs(record) do
			newRecord[detailName] = detail
		end
		table.insert(log, 1, newRecord)
	end
	return log
end

function module:PrivateMessage(sender, targetPlr, message)
	local senderPerms = main.permissionToReplyToPrivateMessage[sender]
	if senderPerms == nil then
		main.permissionToReplyToPrivateMessage[sender] = {}
	end
	main.permissionToReplyToPrivateMessage[sender][targetPlr] = true
	main:GetModule("cf"):FormatAndFireNotice2(targetPlr, "ReceivedPM", {"PM", sender, message}, sender.Name)
end

function module:GetStat(plr, statName)
	if statName then
		local leaderstats = plr:FindFirstChild("leaderstats")
		if leaderstats then
			local stat = leaderstats:FindFirstChild(statName)
			if stat then
				return stat
			end
		end
	end
end

function module:GetColorFromString(argToProcess)
	local finalColor
	if argToProcess then
		argToProcess = string.lower(argToProcess)
		for i, colorInfo in pairs(main.settings.Colors) do
			local shortName = string.lower(colorInfo[1])
			if (argToProcess == shortName) then
				finalColor = colorInfo[3]
				break
			end
		end
		if not finalColor then
			for i, colorInfo in pairs(main.settings.Colors) do
				local fullName = string.lower(colorInfo[2])
				if (argToProcess == string.sub(fullName,1,#argToProcess)) then
					finalColor = colorInfo[3]
					break
				end
			end
		end
	end
	return finalColor
end

function module:RemoveControlPlr(controller)
	if controller and main.pd[controller] then
		local controlPlr = main.pd[controller].Items["ControlPlr"]
		if controlPlr then
			local originalCFrame = controlPlr.FakePlayer.Head.CFrame
			controlPlr:Destroy()
			main.pd[controller].Items["ControlPlr"] = nil
			main:GetModule("MorphHandler"):BecomeTargetPlayer(controller, controller.UserId)
			local controllerHead = main:GetModule("cf"):GetHead(controller)
			local fakeName = main:GetModule("cf"):GetFakeName(controller)
			if controllerHead and fakeName then
				fakeName:Destroy()
				controllerHead.Transparency = 0
				controllerHead.CFrame = originalCFrame
			end
		end
	end
end

function module:RemoveUnderControl(plr)
	local underControl = main.pd[plr].Items["UnderControl"]
	if underControl then
		underControl:Destroy()
		main.pd[plr].Items["UnderControl"] = nil
		local plrHumanoid = main:GetModule("cf"):GetHumanoid(plr)
		if plrHumanoid then
			main.signals.SetCameraSubject:FireClient(plr, (plrHumanoid))
			--main:GetModule("cf"):SetTransparency(plr.Character, 0, true)
			--main:GetModule("cf"):Movement(true, plr)
			plr.Character.Parent = workspace
		end
	end
end

function module:TeleportPlayers(plrsToTeleport, targetPlr)
	local targetHead = main:GetModule("cf"):GetHead(targetPlr)
	if targetHead then
		local totalPlrs = #plrsToTeleport
		local gap = 2
		for i,plr in pairs(plrsToTeleport) do
			local head = main:GetModule("cf"):GetHead(plr)
			local targetCFrame = targetHead.CFrame * CFrame.new(-(totalPlrs*(gap/2))+(i*gap)-(gap/2), 0, -4) * CFrame.Angles(0, math.rad(180), 0)
			if head then
				main:GetModule("cf"):UnSeatPlayer(plr)
				head.CFrame = targetCFrame
			end
		end
	end
end

function module:ConvertCharacterToRig(plr, rigType)
	--
	local humanoid = main:GetModule("cf"):GetHumanoid(plr)
	local head = main:GetModule("cf"):GetHead(plr)
	if humanoid and head then
		local newRig = main.server.Assets["Rig"..rigType]:Clone()
		local newHumanoid = newRig.Humanoid
		local originalCFrame = head.CFrame
		newRig.Name = plr.Name
		for a,b in pairs(plr.Character:GetChildren()) do
			if b:IsA("Accessory") or b:IsA("Pants") or b:IsA("Shirt") or b:IsA("ShirtGraphic") or b:IsA("BodyColors") then
				b.Parent = newRig
			elseif b.Name == "Head" and b:FindFirstChild("face") then
				newRig.Head.face.Texture = b.face.Texture
			end
		end
		plr.Character = newRig
		newRig.Parent = workspace
		newRig.Head.CFrame = originalCFrame
		--local desc = main.players:GetHumanoidDescriptionFromUserId(plr.UserId)
		--newHumanoid:ApplyDescription(desc)
		main.signals.ChangeMainVariable:FireClient(plr, {"humanoidRigType", Enum.HumanoidRigType[rigType]})
	end
	--
end

function module:GetFakeName(plr)
	for a,b in pairs(plr.Character:GetChildren()) do
		if b:IsA("Model") and b:FindFirstChild("FakeHumanoid") then
			return b
		end
	end
end

function module:CreateFakeName(plr, name)
	local head = main:GetModule("cf"):GetHead(plr)
	if head then
		local fakeName = module:GetFakeName(plr)
		if not fakeName then
			fakeName = Instance.new("Model")
			local fakeHead = head:Clone()
			fakeHead.Name = "Head"
			fakeHead.Parent = fakeName
			fakeHead.face.Transparency = 1
			local weld = Instance.new("WeldConstraint")
			weld.Part0 = fakeHead
			weld.Part1 = head
			weld.Parent = fakeHead
			local fakeHumanoid = Instance.new("Humanoid")
			fakeHumanoid.Name = "FakeHumanoid"
			fakeHumanoid.Parent = fakeName
			fakeName.Parent = plr.Character
			head.Transparency = 1
		end
		if name then
			fakeName.Name = name
		end
	end
end

function module:RemoveEffect(plr, effectType)
	local effectName = "HDAdmin"..effectType
	if plr.Character then
		for a,b in pairs(plr.Character:GetDescendants()) do
			if b.Name == effectName then
				b:Destroy()
				break
			end
		end
	end
end

function module:CreateEffect(plr, effectType)
	local hrp = main:GetModule("cf"):GetHRP(plr)
	local targetParent = hrp
	if effectType == "ForceField" then
		targetParent = plr.Character
	end
	if hrp then
		local effectName = "HDAdmin"..effectType
		local effect = targetParent:FindFirstChild(effectName)
		if not effect then
			effect = Instance.new(effectType)
			effect.Name = effectName
			effect.Parent = targetParent
		end
	end
end

function module:UnFreeze(args)
	local plr = args[1]
	local itemName = "FreezeBlock"
	local item = main.pd[plr].Items[itemName]
	if item then
		main.pd[plr].Items[itemName] = nil
		main:GetModule("cf"):Movement(true, plr)
		main:GetModule("cf"):SetTransparency(plr.Character, 0)
		local head = main:GetModule("cf"):GetHead(plr)
		if head then
			head.CFrame = item.FreezeClone.Head.CFrame
		end
		local humanoid = main:GetModule("cf"):GetHumanoid(plr)
		if humanoid then
			main.signals.SetCameraSubject:FireClient(plr, (humanoid))
		end
		item:Destroy()
	end
end

function module:FilterString(text, fromPlayer, playerTo)
	local filteredText = ""
	local success, message = pcall(function()
		filteredText = main.chat:FilterStringAsync(text, fromPlayer, playerTo)
	end)
	if not success then
		filteredText = "####"
	end
	return filteredText
end

function module:FilterBroadcast(text, fromPlayer)
	local filteredText = ""
	local success, message = pcall(function()
		filteredText = main.chat:FilterStringForBroadcast(text, fromPlayer)
	end)
	if not success then
		filteredText = "####"
	end
	return filteredText
end

function module:DonorNotice(player, pdata)
	if not pdata.PromptedDonor then
		main:GetModule("PlayerData"):ChangeStat(player, "PromptedDonor", true)
		main:GetModule("cf"):FormatAndFireNotice(player, "WelcomeDonor")
	end
end

function module:CheckAndRankToDonor(player, pdata, gamepassId)
	gamepassId = tostring(gamepassId)
	if not pdata.Donor and (gamepassId == tostring(main.products.Donor) or gamepassId == tostring(main.products.OldDonor)) then
		main:GetModule("PlayerData"):ChangeStat(player, "Donor", true)
		module:DonorNotice(player, pdata)
	end
end

function module:Unrank(plr)
	main:GetModule("PlayerData"):ChangeStat(plr, "Rank", 0)
	main.serverAdmins[plr.Name] = nil
	main:GetModule("PlayerData"):ChangeStat(plr, "SaveRank", false)
	main:GetModule("cf"):FormatAndFireNotice(plr, "UnRank")
	return("Unranked")
end

function module:GetRankType(plr)
	local rankType = "Server"
	local pdata = main.pd[plr]
	if pdata then
		if pdata.AutomaticRank then
			rankType ="Auto"
		elseif pdata.SaveRank == true then
			rankType = "Perm"
		elseif main.serverAdmins[plr.Name] == nil then
			rankType = "Temp"
		end
	end
	return rankType
end

function module:SetRank(plr, speakerUserId, rankId, rankType)
	main:GetModule("PlayerData"):ChangeStat(plr, "Rank", rankId)
	main:GetModule("PlayerData"):ChangeStat(plr, "AutomaticRank", false)
	local stringRankType = "rank"
	if rankType == "Server" then
		main.serverAdmins[plr.Name] = true
	elseif rankType == "Perm" then
		main:GetModule("PlayerData"):ChangeStat(plr, "PermRankedBy", speakerUserId)
		main:GetModule("PlayerData"):ChangeStat(plr, "SaveRank", true)
		main.serverAdmins[plr.Name] = nil
		stringRankType = "permRank"
	elseif rankType == "Temp" then
		main.serverAdmins[plr.Name] = nil
		stringRankType = "tempRank"
	end
	local targetRankName = main:GetModule("cf"):GetRankName(rankId)
	main:GetModule("cf"):FormatAndFireNotice(plr, "SetRank", stringRankType, targetRankName)
end

function module:RankPlayerCommand(speaker, args, commandRankType)
	local plr = args[1]
	local targetRankId = args[2]
	local plrRank = main.pd[plr].Rank
	local speakerRank = main.pd[speaker].Rank
	if targetRankId == 0 then
		module:Unrank(plr)
		return("Unranked")
	elseif speakerRank > targetRankId then
		module:SetRank(plr, speaker.UserId, targetRankId, commandRankType)
		return("Ranked")
	end
end

function module:RankPlayerSimple(player, newRank, automaticRank)
	local pdata = main.pd[player]
	if tonumber(newRank) == nil then
		newRank = main:GetModule("cf"):GetRankId(newRank)
	end
	if pdata.Rank <= newRank then
		if automaticRank then
			main:GetModule("PlayerData"):ChangeStat(player, "AutomaticRank", newRank)
		end
		if pdata.Rank < newRank then
			main:GetModule("PlayerData"):ChangeStat(player, "Rank", newRank)
		end
	end
end

return module


Prompt: -- find player's head pos

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

	local head = vCharacter:FindFirstChild("Head")
	if not head then return end

	local dir = mouse_pos - head.Position
	dir = computeDirection(dir)

	local launch = head.Position + 5 * dir

	local delta = mouse_pos - launch

	local dy = delta.y

	local new_delta = Vector3.new(delta.x, 0, delta.z)
	delta = new_delta

	local dx = delta.magnitude
	local unit_delta = delta.unit

	-- acceleration due to gravity in RBX units
	local g = (-9.81 * 20)

	local theta = computeLaunchAngle( dx, dy, g)

	local vy = math.sin(theta)
	local xz = math.cos(theta)
	local vx = unit_delta.x * xz
	local vz = unit_delta.z * xz

	local missile = Pellet:Clone()

	missile.Position = launch
	missile.Velocity = Vector3.new(vx,vy,vz) * VELOCITY

	missile.PelletScript.Disabled = false

	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = vPlayer
	creator_tag.Name = "creator"
	creator_tag.Parent = missile

	missile.Parent = workspace

end

function computeLaunchAngle(dx,dy,grav)
	-- arcane
	-- http://en.wikipedia.org/wiki/Trajectory_of_a_projectile

	local g = math.abs(grav)
	local inRoot = (VELOCITY*VELOCITY*VELOCITY*VELOCITY) - (g * ((g*dx*dx) + (2*dy*VELOCITY*VELOCITY)))
	if inRoot <= 0 then
		return .25 * math.pi
	end
	local root = math.sqrt(inRoot)
	local inATan1 = ((VELOCITY*VELOCITY) + root) / (g*dx)

	local inATan2 = ((VELOCITY*VELOCITY) - root) / (g*dx)
	local answer1 = math.atan(inATan1)
	local answer2 = math.atan(inATan2)
	if answer1 < answer2 then return answer1 end
	return answer2
end

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

Tool.Enabled = true
function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if not humanoid  then
		print("Humanoid not found")
		return
	end

	local targetPos = MouseLoc:InvokeClient(game:GetService("Players"):GetPlayerFromCharacter(character))

	fire(targetPos)

	wait(.2)

	Tool.Enabled = true
end

script.Parent.Activated:Connect(onActivated)


Prompt: --Refer to Settings.COMPARISON_CHECKS

Response:
local function comparePosition(self)
	if self._currentWaypoint == #self._waypoints then return end
	self._position._count = ((self._agent.PrimaryPart.Position - self._position._last).Magnitude <= 0.07 and (self._position._count + 1)) or 0
	self._position._last = self._agent.PrimaryPart.Position
	if self._position._count >= self._settings.COMPARISON_CHECKS then
		if self._settings.JUMP_WHEN_STUCK then
			setJumpState(self)
		end
		declareError(self, self.ErrorType.AgentStuck)
	end
end


Prompt:
--[[
	Create a copy of a list with only values for which `callback` returns true.
	Calls the callback with (value, index).
]]

Response:
local function filter(list, callback)
	local new = {}
	local index = 1

	for i = 1, #list do
		local value = list[i]
		if callback(value, i) then
			new[index] = value
			index = index + 1
		end
	end

	return new
end

return filter


Prompt: --[[ Flags ]]

Response:
local FFlagUserExcludeNonCollidableForPathfindingSuccess, FFlagUserExcludeNonCollidableForPathfindingResult =
    pcall(function() return UserSettings():IsUserFeatureEnabled("UserExcludeNonCollidableForPathfinding") end)
local FFlagUserExcludeNonCollidableForPathfinding = FFlagUserExcludeNonCollidableForPathfindingSuccess and FFlagUserExcludeNonCollidableForPathfindingResult

local FFlagUserClickToMoveSupportAgentCanClimbSuccess, FFlagUserClickToMoveSupportAgentCanClimbResult =
    pcall(function() return UserSettings():IsUserFeatureEnabled("UserClickToMoveSupportAgentCanClimb2") end)
local FFlagUserClickToMoveSupportAgentCanClimb = FFlagUserClickToMoveSupportAgentCanClimbSuccess and FFlagUserClickToMoveSupportAgentCanClimbResult


Prompt: -- Initialize the tool

Response:
local WeldTool = {
	Name = 'Weld Tool';
	Color = BrickColor.new 'Really black';
}

WeldTool.ManualText = [[Weld Tool  🛠
Allows you to weld parts to hold them together.

NOTE: Welds may break if parts are individually moved.]]


Prompt: -- Load countdown GUI

Response:
local countdownGui = Guis:WaitForChild("CountdownGui")
countdownGui.Parent = player.PlayerGui


Response: local MutterDelay = math.random(2,6) -- How many seconds before it makes another sound


Prompt: -- Basic settings

Response:
local MAX_LENGTH = 30

local filterService = game:GetService("TextService")

game.ReplicatedStorage.Interactions.Server.SetPetName.OnServerInvoke = function(plr, newName)

	-- Check length
	if string.len(newName) <= MAX_LENGTH then

		-- Run through filter service and set
		plr.Settings.PetName.Value = newName

		-- Set pet name
		for _, i in pairs(game.Players:GetPlayers()) do
			spawn(function()
				game.ReplicatedStorage.Interactions.Client.SetPetName:FireAllClients(plr, filterService:FilterStringAsync(newName, plr.UserId):GetNonChatStringForUserAsync(i.UserId))
			end)
		end

		return "NAME SET"
	else
		return "TOO LONG"
	end

end


Prompt: -- ROBLOX TODO: fix PrettyFormat types imports

Response:
type PrettyFormatOptions = PrettyFormat_.OptionsReceived
local prettyFormat = PrettyFormat.format
local getSerializers = require(CurrentModule.plugins).getSerializers

local types = require(CurrentModule.types)
type SnapshotData = types.SnapshotData

local SNAPSHOT_VERSION = "1"