Prompt: -- << FUNCTIONS >>

Response:
function module:ReplicateEffect(commandName, args)
	main.signals.ReplicateEffect:FireServer(commandName, args)
end

function module:UpdateIconVisiblity()
	local newTransparency = (main.pdata.Rank >= main.settings.RankRequiredToViewIcon and 0) or 1
	main.tweenService:Create(main.gui.CustomTopBar.ImageButton, TweenInfo.new(1), {ImageTransparency = newTransparency}):Play()
end

function module:DeactivateCommand(commandName)
	main.commandsAllowedToUse[commandName] = nil
	main.commandsActive[commandName] = nil
	if not main.commandsToDisableCompletely[commandName] then
		local frame = main.gui:FindFirstChild("CommandMenu"..commandName)
		main:GetModule("cf"):DestroyCommandMenuFrame(frame)
	end
end

function module:EndCommand(commandName)
	main.commandsActive[commandName] = nil
	main:GetModule("cf"):UpdateCommandMenu(commandName)
end

function module:ActivateClientCommand(commandName, extraDetails)
	if main.commandsAllowedToUse[commandName] and not main.commandsActive[commandName] then
		if not(extraDetails and extraDetails.DontForceActivate and main.gui:FindFirstChild("CommandMenu"..commandName)) then
			main.commandsActive[commandName] = true
			spawn(function()
				main:GetModule("cf"):UpdateCommandMenu(commandName)
				local clientCommand = main:GetModule("ClientCommands")[commandName]
				if clientCommand then
					local Function = clientCommand["Activate"]
					if Function then
						Function(clientCommand)
					end
				end
				main.commandsActive[commandName] = nil
			end)
		end
	end
end

function module:GetCF(part, isFor)
	--Credit to Scel for this
	local cframe = part.CFrame
	local noRot = CFrame.new(cframe.p)
	local x, y, z = (workspace.CurrentCamera.CFrame - workspace.CurrentCamera.CFrame.p):toEulerAnglesXYZ()
	return noRot * CFrame.Angles(isFor and z or x, y, z)
end

function module:GetNextMovement(deltaTime, speed)
	local nextMove = Vector3.new()
	local directions = {
		Left = Vector3.new(-1, 0, 0);
		Right = Vector3.new(1, 0, 0);
		Forwards = Vector3.new(0, 0, -1);
		Backwards = Vector3.new(0, 0, 1);
		Up = Vector3.new(0, 1, 0);
		Down = Vector3.new(0, -1, 0);
	}
	if main.device == "Computer" then
		for i,v in pairs(main.movementKeysPressed) do
			local vector = directions[v]
			if vector then
				nextMove = nextMove + vector
			end
		end
	else
		local humanoid = main:GetModule("cf"):GetHumanoid()
		local hrp = main:GetModule("cf"):GetHRP()
		if humanoid then
			local md = humanoid.MoveDirection
			for i,v in pairs(directions) do
				local isFor = false
				if i == "Forwards" or i == "Backwards" then
					isFor = true
				end
				local vector = ((module:GetCF(hrp, true)*CFrame.new(v)) - hrp.CFrame.p).p;
				if (vector - md).magnitude <= 1.05 and md ~= Vector3.new(0,0,0) then
					nextMove = nextMove + v
				end
			end
		end
	end
	return CFrame.new(nextMove * speed * deltaTime), nextMove
end

function module:GetAssetImage(assetId)
	return("https://www.roblox.com/asset-thumbnail/image?assetId="..assetId.."&width=420&height=420&format=png")
end

function module:GetUserImage(userId)
	return("https://www.roblox.com/headshot-thumbnail/image?userId="..userId.."&width=420&height=420&format=png")
end

function module:ShowPermRankedUser(details)
	local plrName, userId, rankedById = details[1], details[2], details[3]
	permRank.PlrName.Text = plrName
	permRank.PlrImage.Image = module:GetUserImage(userId)
	permRank.RankedBy.TextLabel.Text = main:GetModule("cf"):GetName(rankedById)
	main:GetModule("cf"):ShowWarning("PermRank")
end

function module:ShowBannedUser(banDetails)
	local plrName, userId, reason, bannedById = banDetails[1], banDetails[2], banDetails[3], banDetails[4]
	local reasonLabel = unBan.Reason.TextLabel
	unBan.PlrName.Text = plrName
	unBan.PlrImage.Image = module:GetUserImage(userId)
	unBan.BannedBy.TextLabel.Text = main:GetModule("cf"):GetName(bannedById)
	reasonLabel.Text = "'"..reason.."'"
	if reasonLabel.Text == "" or reasonLabel.Text == " " then
		reasonLabel.Text = "Empty"
		reasonLabel.Font = Enum.Font.SourceSansItalic
	else
		reasonLabel.Font = Enum.Font.SourceSans
	end
	main:GetModule("cf"):ShowWarning("UnBan")
end

function module:ShowWarning(warningName)
	for a,b in pairs(main.warnings:GetChildren()) do
		if b.Name == warningName then
			b.Visible = true
			main.warnings.Visible = true
		else
			b.Visible = false
		end
	end
end

function module:SetCameraSubject(newSubject)
	local face = main:GetModule("cf"):GetFace()
	if face then
		local originalT = face.Transparency
		main.camera.CameraSubject = newSubject
		face.Transparency = originalT
	end
end

function module:DestroyCommandMenuFrame(frame)
	if frame then
		for i,v in pairs(main.commandMenus) do
			if v == frame then
				table.remove(main.commandMenus, i)
			end
		end
		frame:Destroy()
	end
end

function module:UpdateCommandMenu(commandName, frame)
	if frame == nil then
		frame = main.gui:FindFirstChild("CommandMenu"..commandName)
	end
	if frame then
		local mainFrame = frame.MainFrame
		local status = mainFrame:FindFirstChild("Status")
		if status then
			if (main.commandsToDisableCompletely[commandName] and main.commandsAllowedToUse[commandName]) or main.commandsActive[commandName] then
				mainFrame.Status.TextLabel.Text = "On"
				mainFrame.Status.TextLabel.TextColor3 = Color3.fromRGB(0, 225, 0)
				mainFrame.ChangeStatus.TextLabel.Text = "DISABLE"
			else
				mainFrame.Status.TextLabel.Text = "Off"
				mainFrame.Status.TextLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
				mainFrame.ChangeStatus.TextLabel.Text = "ENABLE"
			end
		end
	end
end
function module:CreateNewCommandMenu(commandName, menuDetails, menuType, forceOnTop)
	----------------------
	local framesToDestroyOnClose = {4, 5, 8, 11, 12}
	local framesWithIncrementalNames = {4}
	local framesToDestroyExistingFrames = {--[[1,]] 5, 6, 7, 9, 12}
	----------------------
	menuType = tonumber(menuType)
	local destroyFrameOnClose = main:GetModule("cf"):FindValue(framesToDestroyOnClose, menuType)
	local isAnIncrementalName = main:GetModule("cf"):FindValue(framesWithIncrementalNames, menuType)
	local destroyExistingFrames = main:GetModule("cf"):FindValue(framesToDestroyExistingFrames, menuType)
	local frameName = "CommandMenu"..commandName
	if isAnIncrementalName then
		frameName = "CommandMenu"..commandName..pmId
		pmId = pmId + 1
	end
	local frame = main.gui:FindFirstChild(frameName)
	if frame and destroyExistingFrames then
		frame:Destroy()
		frame = nil
	end
	if not frame then
		local frameTemplate = menuTemplates["Template"..menuType]
		local mainFrameTemplate = frameTemplate.MainFrame
		frame = frameTemplate:Clone()
		frame.Name = frameName
		local dragBar = frame.DragBar
		local mainFrame = frame.MainFrame
		local commandNameSplit = string.upper(string.gsub(commandName, "%u", function(c) return " "..c end))
		dragBar.Title.Text = commandNameSplit
		main:GetModule("InputHandler"):MakeFrameDraggable(frame)
		dragBar.Close.MouseButton1Down:Connect(function()
			if destroyFrameOnClose then
				module:DestroyCommandMenuFrame(frame)
			else
				frame.Visible = false
			end
		end)
		local originalY = mainFrame.Position.Y.Scale
		local yTweenTarget = -(1 - dragBar.Size.Y.Scale - originalY)
		local minimise = dragBar:FindFirstChild("Minimise")
		if minimise then
			minimise.MouseButton1Down:Connect(function()
				if minimise.TextLabel.Text == "-" then
					main.tweenService:Create(mainFrame, TweenInfo.new(0.5), {Position = UDim2.new(0,0,yTweenTarget,-1)}):Play()
					minimise.TextLabel.Text = "+"
				else
					main.tweenService:Create(mainFrame, TweenInfo.new(0.5), {Position = UDim2.new(0,0,originalY,0)}):Play()
					minimise.TextLabel.Text = "-"
				end
			end)
		end

		-- << SHARED >>
		--updateCanvasSize(scrollFrame, scrollFrame["Answer"..#data.Answers], scrollFrame.Question)
		local function updateCanvasSize(scrollFrame, finalLabel, firstLabel)
			scrollFrame.CanvasSize = UDim2.new(0, 0, 0, (finalLabel.AbsolutePosition.Y - firstLabel.AbsolutePosition.Y) + finalLabel.AbsoluteSize.Y)
		end

		local function selectToggle(selectFrame, toggleName, ov)
			local defaultToggles, finalFunction, scrollFrame, finalLabel, firstLabel = ov[1],ov[2],ov[3],ov[4],ov[5]
			local button = selectFrame:FindFirstChild(toggleName)
			if not button then
				toggleName = defaultToggles[selectFrame.Name]
			end
			---------------
			if selectFrame.Name == "AC Server" and toggleName == "All" and main.pdata.Rank < main.commandRanks.globalvote then
				main:GetModule("Notices"):Notice("Error", main.hdAdminCoreName, "Must be '".. main:GetModule("cf"):GetRankName(main.commandRanks.globalvote).."' to use ;globalVote")
			else
			--------------
				for a,b in pairs(selectFrame:GetChildren()) do
					if b:IsA("TextButton") then
						finalFunction(b, toggleName, selectFrame)
					end
				end
				if finalLabel and firstLabel then
					updateCanvasSize(scrollFrame, finalLabel, firstLabel)
				end
			end
		end

		local function setupDefaultToggles(defaultToggles, scrollFrame, playerTextBox, organisedVariables, setupFunction, timeFrame, playerValue)
			local focused = false
			playerTextBox.Focused:Connect(function()
				focused = true
			end)
			playerTextBox.FocusLost:Connect(function()
				wait()
				focused = false
			end)
			for frameName, _ in pairs(defaultToggles) do
				local selectFrame = scrollFrame[frameName]
				for a,b in pairs(selectFrame:GetChildren()) do
					if b:IsA("TextButton") then
						b.MouseButton1Down:Connect(function()
							if not focused then
								selectToggle(selectFrame, b.Name, organisedVariables)
							end
						end)
					end
				end
				setupFunction(selectFrame)
			end
			if timeFrame then
				for a,b in pairs(timeFrame:GetChildren()) do
					local textBox = b:FindFirstChild("TextBox")
					if textBox then
						local originalNumber = textBox.Text
						textBox.Focused:Connect(function()
							focused = true
						end)
						textBox.FocusLost:connect(function(property)
							local newNumber = tonumber(textBox.Text)
							if newNumber then
								if newNumber < 0 then
									newNumber = 0
								elseif b.Name == "Minutes" and newNumber > 60 then
									newNumber = 60
								elseif b.Name == "Hours" and newNumber > 24 then
									newNumber = 24
								elseif b.Name == "Days" and newNumber > 100000 then
									newNumber = 100000
								end
								originalNumber = newNumber
							end
							textBox.Text = originalNumber
							wait()
							focused = false
						end)
					end
				end
			end
			if playerValue then
				local lowerPlayerValue = string.lower(playerValue)
				local newPlayerValue = playerValue
				for i,v in pairs(main.qualifiers) do
					if v == lowerPlayerValue then
						newPlayerValue = v
						break
					end
				end
				if not newPlayerValue then
					for i,plr in pairs(main.players:GetChildren()) do
						if string.sub(string.lower(plr.Name), 1, #lowerPlayerValue) == lowerPlayerValue then
							newPlayerValue = plr.Name
							break
						end
					end
				end
				playerTextBox.Text = newPlayerValue or ""
			end
		end

		local function setupFinalResult(frame, submitButton, loadingButton, serverInvocationFunction, retrievedDataFunction, broadcastFunction)
			local fr = frame.FinalResult
			local frFrame = fr.Frame
			local example = frFrame.Example
			local frLoading = frFrame.Loading
			local frBroadcast = frFrame.Broadcast
			fr.Visible = false
			frFrame.CloseX.MouseButton1Down:Connect(function()
				fr.Visible = false
			end)
			frBroadcast.MouseButton1Down:Connect(function()
				frLoading.Visible = true
				frBroadcast.Visible = false
				broadcastFunction()
				module:DestroyCommandMenuFrame(frame)
			end)
			submitButton.MouseButton1Down:Connect(function()
				loadingButton.Visible = true
				submitButton.Visible = false
				local data = serverInvocationFunction()
				if type(data) == "table" then
					retrievedDataFunction(data)
				else
					local errorMessage = tostring(data) or "Error"
					loadingButton.TextLabel.Text = errorMessage
					wait(1)
					loadingButton.TextLabel.Text = "Loading..."
				end
				loadingButton.Visible = false
				submitButton.Visible = true
			end)
		end

		local function setupPollResults(scrollFrame, data)
			local exampleAnswerTemplate = scrollFrame.AnswerTemplate
			exampleAnswerTemplate.Visible = false
			scrollFrame.Question.TextLabel.Text = data.Question
			for i,v in pairs(scrollFrame:GetChildren()) do
				if v:IsA("TextButton") and v ~= exampleAnswerTemplate then
					v:Destroy()
				end
			end
			for i,answer in pairs(data.Answers) do
				local answerButton = exampleAnswerTemplate:Clone()
				answerButton.Visible = true
				answerButton.Name = "Answer"..i
				answerButton.TextLabel.Text = i..". "..answer
				answerButton.BackgroundColor3 = module:GetLabelBackgroundColor(i)
				---------------
				local fade = answerButton.Fade
				local selectedAnswer = false
				if data.Remote then
					answerButton.MouseButton1Up:Connect(function()
						scrollFrame.Parent.Parent.Visible = false
						pcall(function() data.Remote:FireServer(i) end)
					end)
				end
				answerButton.InputBegan:Connect(function(input)
					main.tweenService:Create(fade, TweenInfo.new(0.2), {BackgroundTransparency = 0.8}):Play()
				end)
				answerButton.InputEnded:Connect(function(input)
					main.tweenService:Create(fade, TweenInfo.new(0.2), {BackgroundTransparency = 1}):Play()
				end)
				---------------
				answerButton.Parent = scrollFrame
			end
			spawn(function()
				wait(0.1)
				updateCanvasSize(scrollFrame, scrollFrame["Answer"..#data.Answers], scrollFrame.Question)
			end)
		end

		-------------- << MENU TYPE 1 >> --------------
		if menuType == 1 then
			local newPosition = UDim2.new(1, -255, 1, -155)
			if main.device ~= "Mobile" and frame.Position ~= newPosition then
				frame.Position = newPosition
				frame.Size = UDim2.new(0, 250, 0, 150)
			end
			local infoFrame = mainFrame.InfoFrame
			local min
			infoFrame.Visible = false
			mainFrame.Desc.Visible = false
			mainFrame.InputFrame.Visible = false
			local menuType = menuDetails[1]
			if menuType == "Info" then
				mainFrame.Desc.Text = menuDetails[2]
				mainFrame.Desc.Visible = true
			elseif menuType == "Input" then
				local inputType = menuDetails[2]
				local textBox = mainFrame.InputFrame.Frame.TextBox
				local defaultValue = main.commandSpeeds[commandName]
				mainFrame.InputFrame.InputName.Text = inputType..":"
				textBox.Text = defaultValue
				--
				if main.infoFramesViewed[inputType] then
					main.infoFramesViewed[inputType] = nil
					if inputType == "Speed" then
						local infoLabels = {}
						if main.device == "Computer" then
							infoLabels = {
								{"Movement", "WASD"};
								{"Toggle flight", "E"};
								{"Up & Down", "R & F"};
								}
						else
							infoLabels = {
								{"Movement", "Thumbstick"};
								{"Toggle flight", "Double-jump"};
								}
						end
						for i = 1,3 do
							local label = infoFrame["Info"..i]
							local labelInfo = infoLabels[i]
							if labelInfo then
								label.Text = labelInfo[1]..":"
								label.TextLabel.Text = labelInfo[2]
								label.Visible = true
							else
								label.Visible = false
							end
						end
						infoFrame.Okay.MouseButton1Down:Connect(function()
							infoFrame.Visible = false
						end)
						infoFrame.Visible = true
					end
				end
				local originalText = textBox.Text
				textBox.FocusLost:Connect(function()
					local newValue = tonumber(textBox.Text)
					if not newValue then
						newValue = defaultValue
					end
					local loadingText = "..."
					textBox.Text = loadingText
					local success = main.signals.RequestCommand:InvokeServer(main.pdata.Prefix..commandName.." me "..newValue)
					if not success then
						textBox.Text = originalText
					end
					originalText = textBox.Text
				end)
				mainFrame.InputFrame.Visible = true
			end
			module:UpdateCommandMenu(commandName, frame)
			mainFrame.ChangeStatus.MouseButton1Down:Connect(function()
				mainFrame.Loading.Visible = true
				if main.commandsToDisableCompletely[commandName] then
					local commandNameToSend
					if mainFrame.ChangeStatus.TextLabel.Text == "DISABLE" then
						commandNameToSend = "!Un"..commandName
					else
						commandNameToSend = "!"..commandName
					end
					main.signals.RequestCommand:InvokeServer(commandNameToSend)
					wait(1)
				elseif main.commandsActive[commandName] then
					main.commandsActive[commandName] = nil
				else
					main:GetModule("cf"):ActivateClientCommand(commandName)
					wait(0.5)
				end
				module:UpdateCommandMenu(commandName, frame)
				mainFrame.Loading.Visible = false
			end)

		-------------- << MENU TYPE 2 >> --------------
		elseif menuType == 2 then
			if commandName == "cmdbar2" then
				dragBar.Title.Text = "CMDBAR2"
			end
			if main.device ~= "Mobile" then
				frame.Position = UDim2.new(0, 5, 1, -75)
				frame.Size = UDim2.new(0, 315, 0, 70)
			end
			local searchFrame = mainFrame.SearchFrame
			local textBox = searchFrame.TextBox
			local props = {
				maxSuggestions = 3;
				mainParent = mainFrame.Parent;
				textBox = textBox;
				rframe = searchFrame.ResultsFrame;
				suggestionPos = 1;
				suggestionDisplayed = 0;
				forceExecute = false;
				highlightColor = Color3.fromRGB(50,50,50);
				otherColor = Color3.fromRGB(80,80,80);
				suggestionLabels = {};
				currentBarCommand = nil;
				}
			main:GetModule("CmdBar"):SetupTextbox(commandName, props)
			local loading = mainFrame.Loading
			mainFrame.Execute.MouseButton1Down:Connect(function()
				loading.Visible = true
				if #textBox.Text > 1 then
					local commandToRequest = textBox.Text
					local firstChar = string.sub(commandToRequest,1,1)
					if firstChar ~= main.settings.UniversalPrefix and firstChar ~= main.pdata.Prefix then
						commandToRequest = main.pdata.Prefix..commandToRequest
					end
					local endChar = string.sub(commandToRequest,-1)
					if endChar == " " then
						commandToRequest = string.sub(commandToRequest,1,-1)
					end
					main.signals.RequestCommand:InvokeServer(commandToRequest)
				end
				loading.Visible = false
			end)

		-------------- << MENU TYPE 3 >> --------------
		elseif menuType == 3 then
			if commandName == "cmdbar2" then
				dragBar.Title.Text = "CMDBAR2"
			end
			if main.device ~= "Mobile" then
				frame.Position = UDim2.new(0, 5, 1, -110)
				frame.Size = UDim2.new(0, 315, 0, 105)
			end

			local playerSearchFrame = mainFrame.PlayerFrame.SearchFrame
			local playerTextBox = playerSearchFrame.TextBox
			playerTextBox.Text = main.player.Name
			--
			local props = {
				maxSuggestions = 3;
				mainParent = mainFrame.Parent;
				textBox = playerTextBox;
				rframe = playerSearchFrame.ResultsFrame;
				suggestionPos = 1;
				suggestionDisplayed = 0;
				forceExecute = false;
				highlightColor = Color3.fromRGB(50,50,50);
				otherColor = Color3.fromRGB(80,80,80);
				suggestionLabels = {};
				currentBarCommand = nil;
				specificArg = "player";
				}
			main:GetModule("CmdBar"):SetupTextbox(commandName, props)
			--

			local messageSearchFrame = mainFrame.MessageFrame.SearchFrame
			local messageTextBox = messageSearchFrame.TextBox
			messageTextBox.FocusLost:connect(function(enter)
				if enter then
					local targetPlayerText = playerTextBox.Text
					local endChar = string.sub(targetPlayerText,-1)
					if endChar == " " then
						targetPlayerText = string.sub(targetPlayerText,1,-1)
					end
					local commandToRequest = main.pdata.Prefix.."talk"..main.pdata.SplitKey..targetPlayerText..main.pdata.SplitKey..messageTextBox.Text
					messageTextBox.Text = ""
					main.signals.RequestCommand:InvokeServer(commandToRequest)
				end
			end)

		-------------- << MENU TYPE 4 (messages) >> --------------
		elseif menuType == 4 then
			local speaker = menuDetails[1]
			local message = menuDetails[2]
			local textBox = mainFrame.ReplyFrame.TextBox
			local send = mainFrame.Send
			dragBar.Title.Text = "Message from "..speaker.Name
			mainFrame.MessageFrame.Message.Text = message
			textBox.Changed:connect(function(property)
				if property == "Text" then
					if #textBox.Text > 0 then
						send.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
						send.AutoButtonColor = true
					else
						send.TextLabel.TextColor3 = Color3.fromRGB(125, 125, 125)
						send.AutoButtonColor = false
					end
				end
			end)
			send.MouseButton1Down:Connect(function()
				if send.AutoButtonColor then
					module:DestroyCommandMenuFrame(frame)
					main.signals.ReplyToPrivateMessage:InvokeServer{speaker, textBox.Text}
				end
			end)

		-------------- << MENU TYPE 5 (logs) >> --------------
		elseif menuType == 5 then
			local log = menuDetails
			local labelY = math.ceil(mainFrameTemplate.ScrollFrame.AbsoluteSize.Y/11)
			local template = mainFrameTemplate.ScrollFrame.Template
			local marginX = labelY/3
			local scrollFrame = mainFrame.ScrollFrame
			local loadMoreFrame = mainFrame.LoadMore
			local displayingLabel = loadMoreFrame.Displaying
			local loadMore = loadMoreFrame.Load
			scrollFrame.Template:Destroy()
			frame.Parent = main.gui
			----
			local function getLabelText(record)
				local message = record.message
				local timeAdded = record.timeAdded-- -(record.timeAdded-os.time())
				local localTimeData = os.date("*t", timeAdded)
				local speakerName = record.speakerName
				local hour = localTimeData.hour
				local minute = localTimeData.min
				if hour < 10 then
					hour = "0"..hour
				end
				if minute < 10 then
					minute = "0"..minute
				end
				return("["..hour..":"..minute.."] "..speakerName..": "..message)
			end
			local logElements = {}
			local linesToLoadAtOnce = 20
			local currentDisplayIndex = 0
			local maxX = 0
			local function displayElements(index, range)
				currentDisplayIndex = math.min(index + range - 1, #logElements)
				for i = index, currentDisplayIndex do
					local label = logElements[i]
					local textLabel = label.TextLabel
					local labelTextSize = main.textService:GetTextSize(textLabel.Text, tonumber(textLabel.TextSize), textLabel.Font, Vector2.new(math.huge, labelY))
					local labelX = labelTextSize.X
					if labelX > maxX then
						maxX = labelX
					end
					label.Parent = scrollFrame
				end
				displayingLabel.Text = ("%d/%d"):format(currentDisplayIndex, #logElements)
				local showLoadMore = currentDisplayIndex < #logElements
				loadMoreFrame.Visible = showLoadMore
				scrollFrame.Size = (showLoadMore and UDim2.new(1,0,0.84,0)) or UDim2.new(1,0,0.92,0)
				scrollFrame.CanvasSize = UDim2.new(0, maxX, 0, currentDisplayIndex*labelY)
			end
			loadMore.MouseButton1Click:Connect(function()
				displayElements(currentDisplayIndex + 1, linesToLoadAtOnce)
			end)
			local function clearLogElements()
				logElements = {}
				for i,v in pairs(scrollFrame:GetChildren()) do
					if v.Name ~= "UIListLayout" then
						v:Destroy()
					end
				end
				displayingLabel.Text = "0/0"
				currentDisplayIndex = 0
				maxX = 0
				loadMore.Visible = true
			end
			local function updateLog(newLog)
				clearLogElements()
				local maxX = 0
				for i,record in pairs(newLog) do
					local label = template:Clone()
					local textLabel = label.TextLabel
					--print(labelText, tonumber(textLabel.TextSize), tostring(textLabel.Font), tostring(Vector2.new(labelY, math.huge)).." = ".. tostring(labelTextSize))
					textLabel.Text = getLabelText(record)
					label.BackgroundColor3 = module:GetLabelBackgroundColor(i)
					label.Visible = true
					label.Name = "Record"..i
					label.Size = UDim2.new(1,0,0,labelY)
					textLabel.Position = UDim2.new(0, marginX, 0.15, 0)
					textLabel.Size = UDim2.new(1,-marginX*2,0.7,0)
					logElements[#logElements+1] = label
				end
				displayElements(1, linesToLoadAtOnce)
			end
			updateLog(log)
			----
			local searchDe = true
			local textBox = mainFrame.SearchBar.Frame.TextBox
			local specialChars = {}
			textBox.FocusLost:connect(function(property)
				if searchDe then
					searchDe = false
					local searchText = string.lower(textBox.Text)
					local newLog = {}
					for i,record in pairs(log) do
						local labelText = string.lower(getLabelText(record))
						if string.find(labelText, searchText, 1, true) then
							table.insert(newLog, record)
						end
					end
					updateLog(newLog)
					setupOriginalZIndex(scrollFrame)
					updateZIndex(main.commandMenus, scrollFrame)
					wait(0.5)
					searchDe = true
				end
			end)
			----

		-------------- << MENU TYPE 6 (banMenu) >> --------------
		elseif menuType == 6 then
			local scrollFrame = mainFrame.ScrollFrame
			local defaultToggles = {["AG Server"] = "Current", ["AJ Length"] = "Infinite"}
			local selectedToggles = {}
			local playerSearchFrame = scrollFrame["AC Target Player"].SearchFrame
			local playerTextBox = playerSearchFrame.TextBox
			local playerValue = menuDetails.targetPlayer
			local timeFrame = scrollFrame["AJA Time"]
			local firstLabel = scrollFrame["AA Space"]
			local finalLabel = scrollFrame["AZ Space"]
			local banButton = scrollFrame["AX Ban"]
			local reasonTextBox = scrollFrame["AM Reason"].SearchFrame.TextBox
			local finalFunction = function(b, toggleName, selectFrame)
				if b.Name == toggleName then
					b.BackgroundTransparency = 0.1
					b.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
					selectedToggles[selectFrame.Name] = toggleName
					if selectFrame.Name == "AJ Length" then
						if b.Name == "Time" then
							timeFrame.Visible = true
						else
							timeFrame.Visible = false
						end
					end
				else
					b.BackgroundTransparency = 0.8
					b.TextLabel.TextColor3 = Color3.fromRGB(150, 150, 150)
				end
			end
			local organisedVariables = {defaultToggles, finalFunction, scrollFrame, finalLabel, firstLabel}
			local setupFunction = function(selectFrame)
				if selectFrame.Name == "AG Server" then
					selectToggle(selectFrame, menuDetails.server, organisedVariables)
				elseif selectFrame.Name == "AJ Length" then
					selectToggle(selectFrame, menuDetails.length, organisedVariables)
				end
			end
			setupDefaultToggles(defaultToggles, scrollFrame, playerTextBox, organisedVariables, setupFunction, timeFrame, playerValue)
			local props = {
				maxSuggestions = 3;
				mainParent = mainFrame.Parent;
				textBox = playerTextBox;
				rframe = playerSearchFrame.ResultsFrame;
				suggestionPos = 1;
				suggestionDisplayed = 0;
				forceExecute = false;
				highlightColor = Color3.fromRGB(50,50,50);
				otherColor = Color3.fromRGB(80,80,80);
				suggestionLabels = {};
				currentBarCommand = nil;
				specificArg = "player";
				}
			main:GetModule("CmdBar"):SetupTextbox(commandName, props)
			--Time
			local timeDetails = menuDetails.timeDetails
			if timeDetails then
				timeDetails:gsub("%d+%a", function(c)
					local d = tonumber(c:match("%d+"))
					if d then
						local timeType = c:match("%a")
						local amount, frameName, newD = main:GetModule("cf"):GetTimeAmount(timeType, d)
						timeFrame[frameName].TextBox.Text = newD
					end
					return
				end)
			end
			--
			local defaultReason = menuDetails.reason
			if defaultReason and defaultReason ~= "" and defaultReason ~= " " then
				reasonTextBox.Text = defaultReason
			end
			banButton.MouseButton1Down:Connect(function()
				local banReason = reasonTextBox.Text
				local playerName = playerTextBox.Text
				local minutes, hours, days = timeFrame.Minutes.TextBox.Text, timeFrame.Hours.TextBox.Text, timeFrame.Days.TextBox.Text
				local details = {server=selectedToggles["AG Server"], length=selectedToggles["AJ Length"], lengthTime=minutes.."m"..hours.."h"..days.."d"}
				module:DestroyCommandMenuFrame(frame)
				main.signals.RequestCommand:InvokeServer(main.pdata.Prefix.."directBan"..main.pdata.SplitKey..playerName..main.pdata.SplitKey..banReason, details)
			end)
			spawn(function()
				wait(0.1)
				updateCanvasSize(scrollFrame, finalLabel, firstLabel)
			end)

		-------------- << MENU TYPE 7 (global announcement) >> --------------
		elseif menuType == 7 then
			local scrollFrame = mainFrame.ScrollFrame
			local defaultToggles = {["AG DisplayFrom"] = "Enabled"}
			local selectedToggles = {}
			local colorSearchFrame = scrollFrame["AJ MessageColor"].SearchFrame
			local colorTextBox = colorSearchFrame.TextBox
			local submitButton = scrollFrame["AX Submit"]
			local loadingButton = scrollFrame["AZ Loading"]
			local displayFromTitle = scrollFrame["AF Title"]
			local titleTextBox = scrollFrame["AC MessageTitle"].SearchFrame.TextBox
			local messageTextBox = scrollFrame["AM Message"].SearchFrame.TextBox
			local finalFunction = function(b, toggleName, selectFrame)
				if b.Name == toggleName then
					b.BackgroundTransparency = 0.1
					b.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
					selectedToggles[selectFrame.Name] = toggleName
				else
					b.BackgroundTransparency = 0.8
					b.TextLabel.TextColor3 = Color3.fromRGB(150, 150, 150)
				end
			end
			local organisedVariables = {defaultToggles, finalFunction, scrollFrame, --[[finalLabel, firstLabel--]]}
			displayFromTitle.TextLabel.Text = "Display 'From ".. main.player.Name.."'"
			local setupFunction = function(selectFrame)
				if selectFrame.Name == "AG DisplayFrom" then
					selectToggle(selectFrame, "Enabled", organisedVariables)
				end
			end
			setupDefaultToggles(defaultToggles, scrollFrame, colorTextBox, organisedVariables, setupFunction)
			local props = {
				maxSuggestions = 3;
				mainParent = mainFrame.Parent;
				textBox = colorTextBox;
				rframe = colorSearchFrame.ResultsFrame;
				suggestionPos = 1;
				suggestionDisplayed = 0;
				forceExecute = false;
				highlightColor = Color3.fromRGB(50,50,50);
				otherColor = Color3.fromRGB(80,80,80);
				suggestionLabels = {};
				currentBarCommand = nil;
				specificArg = "color";
				}
			main:GetModule("CmdBar"):SetupTextbox(commandName, props)

			--Final result
			local fr = frame.FinalResult
			local frFrame = fr.Frame
			local example = frFrame.Example
			local serverInvocationFunction = function()
				local displayFrom = false
				if selectedToggles["AG DisplayFrom"] == "Enabled" then
					displayFrom = true
				end
				local data = main.signals.RetrieveBroadcastData:InvokeServer{["Title"] = titleTextBox.Text, ["DisplayFrom"] = displayFrom, ["Color"] = colorTextBox.Text, ["Message"] = messageTextBox.Text}
				return data
			end
			local retrievedDataFunction = function(data)
				example.Title.Text = data.Title
				local displayFrom = data.DisplayFrom
				example.Pic.Visible = displayFrom
				example.SubTitle.Visible = displayFrom
				if displayFrom then
					example.Pic.Image = module:GetUserImage(data.SenderId)
					example.SubTitle.Text = "From ".. data.SenderName
				end
				example.Desc.TextColor3 = Color3.new(data.Color[1], data.Color[2], data.Color[3])
				example.Desc.Text = data.Message
				fr.Visible = true
			end
			local broadcastFunction = function()
				main.signals.ExecuteBroadcast:InvokeServer()
			end
			setupFinalResult(frame, submitButton, loadingButton, serverInvocationFunction, retrievedDataFunction, broadcastFunction)

		-------------- << MENU TYPE 8 (alert) >> --------------
		elseif menuType == 8 then
			local title = menuDetails[1]
			local message = menuDetails[2]
			local mute = dragBar.Mute
			local muteLabel = mute.TextLabel
			local soundPlayingIcon = "🔊"
			local soundMutedIcon = "🔇"
			local sound = Instance.new("Sound")
			sound.SoundId = "rbxassetid://"..main.pdata.AlertSoundId
			sound.Volume = main.pdata.AlertVolume
			sound.Pitch = main.pdata.AlertPitch
			sound.Looped = true
			sound.Parent = frame
			sound:Play()
			dragBar.Title.Text = title
			mainFrame.MessageFrame.Message.Text = message
			mute.MouseButton1Down:Connect(function()
				if muteLabel.Text == soundPlayingIcon then
					muteLabel.Text = soundMutedIcon
					sound:Pause()
				else
					muteLabel.Text = soundPlayingIcon
					sound:Play()
				end
			end)

		-------------- << MENU TYPE 9 (pollMenu) >> --------------
		elseif menuType == 9 then
			local scrollFrame = mainFrame.ScrollFrame
			local defaultToggles = {["AC Server"] = "Current", ["AG ShowResultsTo"] = "You"}
			local selectedToggles = {}
			local targetPlayerLabel = scrollFrame["AD Target Player"]
			local playerSearchFrame = targetPlayerLabel.SearchFrame
			local playerTextBox = playerSearchFrame.TextBox
			local playerValue = menuDetails.targetPlayer
			local firstLabel = scrollFrame["AA Space"]
			local finalLabel = scrollFrame["AZ Space"]
			local loadingButton = scrollFrame["AZ Loading"]
			local submitButton = scrollFrame["AX Submit"]
			local questionTextBox = scrollFrame["AP Question"].SearchFrame.TextBox
			local finalFunction = function(b, toggleName, selectFrame)
				local selectFrameName = selectFrame.Name
				if b.Name == toggleName then
					b.BackgroundTransparency = 0.1
					b.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
					selectedToggles[selectFrame.Name] = toggleName
					if selectFrameName == "AC Server" then
						if b.Name == "Current" then
							targetPlayerLabel.Visible = true
						else
							targetPlayerLabel.Visible = false
						end
					end
				else
					b.BackgroundTransparency = 0.8
					b.TextLabel.TextColor3 = Color3.fromRGB(150, 150, 150)
				end
			end
			local organisedVariables = {defaultToggles, finalFunction, scrollFrame, finalLabel, firstLabel}
			local setupFunction = function(selectFrame)
				if selectFrame.Name == "AC Server" then
					selectToggle(selectFrame, menuDetails.server, organisedVariables)
				elseif defaultToggles[selectFrame.Name] then
					selectToggle(selectFrame, defaultToggles[selectFrame.Name], organisedVariables)
				end
			end
			setupDefaultToggles(defaultToggles, scrollFrame, playerTextBox, organisedVariables, setupFunction, nil, playerValue)
			local props = {
				maxSuggestions = 3;
				mainParent = mainFrame.Parent;
				textBox = playerTextBox;
				rframe = playerSearchFrame.ResultsFrame;
				suggestionPos = 1;
				suggestionDisplayed = 0;
				forceExecute = false;
				highlightColor = Color3.fromRGB(50,50,50);
				otherColor = Color3.fromRGB(80,80,80);
				suggestionLabels = {};
				currentBarCommand = nil;
				specificArg = "player";
				}
			main:GetModule("CmdBar"):SetupTextbox(commandName, props)
			local defaultQuestion = menuDetails.question
			if defaultQuestion and defaultQuestion ~= "" and defaultQuestion ~= " " then
				questionTextBox.Text = defaultQuestion
			end
			--Answers
			local answersLimit = 10
			local answerTemplate = scrollFrame["AS Answer"]
			local addAnswer = scrollFrame["AT AddAnswer"]
			local answerBoxes = {}
			answerTemplate.Visible = false
			local function removeAnswerBox(box)
				for i,v in pairs(answerBoxes) do
					if v == box then
						table.remove(answerBoxes, i)
						break
					end
				end
				box:Destroy()
				updateCanvasSize(scrollFrame, finalLabel, firstLabel)
			end
			local function createAnswerBox()
				local newBox = answerTemplate:Clone()
				newBox.Visible = true
				newBox.Parent = scrollFrame
				newBox.RemoveBox.MouseButton1Down:Connect(function()
					removeAnswerBox(newBox)
				end)
				table.insert(answerBoxes, newBox)
				updateCanvasSize(scrollFrame, finalLabel, firstLabel)
				return newBox
			end
			local defaultAnswers = menuDetails.answers
			if type(defaultAnswers) == "table" then
				for i, answer in pairs(defaultAnswers) do
					if answer and answer ~= "" and answer ~= " " then
						local box = createAnswerBox()
						box.SearchFrame.TextBox.Text = answer
						if #answerBoxes >= answersLimit then
							break
						end
					end
				end
			end
			addAnswer.Add.MouseButton1Down:Connect(function()
				if #answerBoxes >= answersLimit then
					main:GetModule("Notices"):Notice("Error", main.hdAdminCoreName, "Cannot exceed "..answersLimit.." answers!")
				else
					local box = createAnswerBox()
					scrollFrame.CanvasPosition = Vector2.new(0, scrollFrame.CanvasPosition.Y + box.AbsoluteSize.Y)
				end
			end)
			--VoteTime
			local voteTimeLabel = scrollFrame["AC VoteTime"]
			local voteTimeTextBox = voteTimeLabel.SearchFrame.TextBox
			local originalVoteTime = voteTimeTextBox.Text
			voteTimeTextBox.FocusLost:connect(function(property)
				local newNumber = tonumber(voteTimeTextBox.Text)
				if newNumber then
					if newNumber < 1 then
						newNumber = 1
					elseif newNumber > 60 then
						newNumber = 60
					end
				else
					newNumber = originalVoteTime
				end
				voteTimeTextBox.Text = newNumber
				originalVoteTime = newNumber
			end)
			--
			spawn(function()
				wait(0.1)
				updateCanvasSize(scrollFrame, finalLabel, firstLabel)
			end)

			--Final result
			local fr = frame.FinalResult
			local frFrame = fr.Frame
			local example = frFrame.Example
			local serverInvocationFunction = function()
				local voteTime = voteTimeTextBox.Text
				local question = questionTextBox.Text
				local server = selectedToggles["AC Server"]
				local showResultsTo = selectedToggles["AG ShowResultsTo"]
				local playerArg = playerTextBox.Text:gsub(" ", function(c) return "" end)
				local answers = {}
				for i,v in pairs(answerBoxes) do
					table.insert(answers, v.SearchFrame.TextBox.Text)
				end
				--
				local data = main.signals.RetrievePollData:InvokeServer{["VoteTime"] = voteTime, ["Question"] = question, ["Answers"] = answers, ["Server"] = server, ["ShowResultsTo"] = showResultsTo, ["PlayerArg"] = playerArg}
				--
				return data
			end
			local retrievedDataFunction = function(data)
				setupPollResults(example, data)
				fr.Visible = true--]]
			end
			local broadcastFunction = function()
				main.signals.ExecutePoll:InvokeServer()
			end
			setupFinalResult(frame, submitButton, loadingButton, serverInvocationFunction, retrievedDataFunction, broadcastFunction)

		-------------- << MENU TYPE 10 (pollSelection) >> --------------
		elseif menuType == 10 then
			main.audio.Notice:Play()
			local scrollFrame = mainFrame.ScrollFrame
			local questionLabel = scrollFrame.Question.TextLabel
			local titleLabel = dragBar.Title
			local data = menuDetails
			local voteTime = data.VoteTime
			local voteTimePlusOne = voteTime+1
			setupPollResults(scrollFrame, data)
			questionLabel.Text = data.Question
			coroutine.wrap(function()
				for i = 1, voteTime do
					titleLabel.Text = string.upper(data.SenderName).."'S POLL (".. voteTimePlusOne-i..")"
					wait(1)
				end
				module:DestroyCommandMenuFrame(frame)
			end)()

		-------------- << MENU TYPE 10 (pollSelection) >> --------------
		elseif menuType == 11 then
			main.audio.Notice:Play()
			local barColors = main:GetModule("cf"):RandomiseTable{
				Color3.fromRGB(220, 30, 30);
				Color3.fromRGB(220, 93, 29);
				Color3.fromRGB(188, 161, 23);
				Color3.fromRGB(107, 186, 22);
				Color3.fromRGB(19, 179, 46);
				Color3.fromRGB(20, 197, 197);
				Color3.fromRGB(24, 120, 255);
				Color3.fromRGB(101, 24, 255);
				Color3.fromRGB(217, 24, 255);
				Color3.fromRGB(255, 24, 128);
			}
			local scrollFrame = mainFrame.ScrollFrame
			local questionLabel = scrollFrame.Question.TextLabel
			local titleLabel = dragBar.Title
			local data = menuDetails
			questionLabel.Text = data.Question
			local resultTemplate = scrollFrame.ResultTemplate
			resultTemplate.Visible = false
			local totalResults = #data.Results
			for i,result in pairs(data.Results) do
				local answerButton = resultTemplate:Clone()
				answerButton.Visible = true
				answerButton.Name = "Answer"..i
				answerButton.Bar.BackgroundColor3 = barColors[i] --Color3.fromHSV(i/10, 1, 1)
				local resultTextStart = i..". "..result.Answer.." ("
				if i == totalResults then
					resultTextStart = result.Answer.." ("
					answerButton.Bar.BackgroundColor3 = Color3.fromRGB(175, 175, 175)
				end
				answerButton.TextLabel.Text = resultTextStart.."0)"
				answerButton.BackgroundColor3 = module:GetLabelBackgroundColor(i)
				answerButton.Bar.Size = UDim2.new(0, 0, 1, 0)
				delay((i-1)/10, function()
					local tweenTime = 2
					local tweenInfo = TweenInfo.new(tweenTime, Enum.EasingStyle.Quart)
					local intValue = Instance.new("IntValue")
					intValue.Value = 0
					main.tweenService:Create(answerButton.Bar, tweenInfo, {Size = UDim2.new(result.Percentage, 0, 1, 0)}):Play()
					main.tweenService:Create(intValue, tweenInfo, {Value = result.Votes}):Play()
					intValue.Changed:Connect(function(newVal)
						answerButton.TextLabel.Text = resultTextStart..newVal..")"
					end)
					wait(tweenTime)
					intValue:Destroy()
				end)
				answerButton.Parent = scrollFrame
			end
			spawn(function()
				wait(0.1)
				updateCanvasSize(scrollFrame, scrollFrame["Answer"..#data.Answers], scrollFrame.Question)
			end)

		-------------- << MENU TYPE 12 (globalAlert) >> --------------
		elseif menuType == 12 then
			local scrollFrame = mainFrame.ScrollFrame
			local defaultToggles = {["AC Server"] = "Current"}
			local selectedToggles = {}
			local targetPlayerLabel = scrollFrame["AD Target Player"]
			local playerSearchFrame = targetPlayerLabel.SearchFrame
			local playerTextBox = playerSearchFrame.TextBox
			local playerValue = menuDetails.targetPlayer
			local firstLabel = scrollFrame["AA Space"]
			local finalLabel = scrollFrame["AZ Space"]
			local spaceX = scrollFrame["AX Space"]
			local loadingButton = scrollFrame["AZ Loading"]
			local submitButton = scrollFrame["AX Submit"]
			local titleTextBox = scrollFrame["AG MessageTitle"].SearchFrame.TextBox
			local messageTextBox = scrollFrame["AM Message"].SearchFrame.TextBox
			local finalFunction = function(b, toggleName, selectFrame)
				local selectFrameName = selectFrame.Name
				if b.Name == toggleName then
					b.BackgroundTransparency = 0.1
					b.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
					selectedToggles[selectFrame.Name] = toggleName
					if selectFrameName == "AC Server" then
						if b.Name == "Current" then
							targetPlayerLabel.Visible = true
							spaceX.Visible = false
						else
							targetPlayerLabel.Visible = false
							spaceX.Visible = true
						end
					end
				else
					b.BackgroundTransparency = 0.8
					b.TextLabel.TextColor3 = Color3.fromRGB(150, 150, 150)
				end
			end
			local organisedVariables = {defaultToggles, finalFunction, scrollFrame, finalLabel, firstLabel}
			local setupFunction = function(selectFrame)
				if selectFrame.Name == "AC Server" then
					selectToggle(selectFrame, menuDetails.server, organisedVariables)
				elseif defaultToggles[selectFrame.Name] then
					selectToggle(selectFrame, defaultToggles[selectFrame.Name], organisedVariables)
				end
			end
			setupDefaultToggles(defaultToggles, scrollFrame, playerTextBox, organisedVariables, setupFunction, nil, playerValue)
			local props = {
				maxSuggestions = 3;
				mainParent = mainFrame.Parent;
				textBox = playerTextBox;
				rframe = playerSearchFrame.ResultsFrame;
				suggestionPos = 1;
				suggestionDisplayed = 0;
				forceExecute = false;
				highlightColor = Color3.fromRGB(50,50,50);
				otherColor = Color3.fromRGB(80,80,80);
				suggestionLabels = {};
				currentBarCommand = nil;
				specificArg = "player";
				}
			main:GetModule("CmdBar"):SetupTextbox(commandName, props)
			local defaultMessage = menuDetails.message
			if defaultMessage and defaultMessage ~= "" and defaultMessage ~= " " then
				messageTextBox.Text = defaultMessage
			end
			titleTextBox.Text = "Alert from ".. main.player.Name

			--Final result
			local fr = frame.FinalResult
			local frFrame = fr.Frame
			local example = frFrame.Example
			local serverInvocationFunction = function()
				local title = titleTextBox.Text
				local message = messageTextBox.Text
				local server = selectedToggles["AC Server"]
				local playerArg = playerTextBox.Text:gsub(" ", function(c) return "" end)
				--
				local data = main.signals.RetrieveAlertData:InvokeServer{
					["Title"] = title,
					["Message"] = message,
					["Server"] = server,
					["PlayerArg"] = playerArg
					}
				--
				return data
			end
			local retrievedDataFunction = function(data)
				example.Title.Text = data.Title
				example.Message.Text = data.Message
				fr.Visible = true
			end
			local broadcastFunction = function()
				main.signals.ExecuteAlert:InvokeServer()
			end
			setupFinalResult(frame, submitButton, loadingButton, serverInvocationFunction, retrievedDataFunction, broadcastFunction)

		end
		--
		setupOriginalZIndex(frame, forceOnTop)
		table.insert(main.commandMenus, frame)
		updateZIndex(main.commandMenus)
		--
	end
	frame.Parent = main.gui
	frame.Visible = true
end

function module:GetMousePoint(hitPosition)
	local rayMag1 = main.camera:ScreenPointToRay(main.lastHitPosition.X, main.lastHitPosition.Y)
	local newRay = Ray.new(rayMag1.Origin, rayMag1.Direction * 100)
	local hit, position = workspace:FindPartOnRay(newRay, main.player.Character)
	return hit, position
end

function module:GetLabelBackgroundColor(i)
	if i%2 == 0 then
		return(Color3.fromRGB(50, 50, 50))
	else
		return(Color3.fromRGB(40, 40, 40))
	end
end

function module:GenerateTagFromId(ID)
	local values = main.alphabet
	local totalValues = #values
	local loops2 = math.ceil(ID/#values)
	local loops3 = math.ceil(ID/(#values)^2)
	local v1 = values[ID%totalValues] or values[totalValues]
	local v2 = values[loops2%totalValues] or values[totalValues]
	local v3 = values[loops3%totalValues] or values[totalValues]
	return v3..v2..v1
end

function module:ClearPage(page)
	for _,label in pairs(page:GetChildren()) do
		if label.Name ~= "UIListLayout" and string.sub(label.Name,1,8) ~= "Template" then
			label:Destroy()
		elseif label:IsA("Frame") then
			label.Visible = false
		end
	end
end

function module:UpdateClientData()
	main.pdata = main.rfunction:InvokeServer("RetrievePlayerData")
end


Prompt:
--[[
	Utility function to log a Fusion-specific error.
]]

Response:
local Package = script.Parent.Parent
local Types = require(Package.Types)
local messages = require(Package.Logging.messages)

local function logError(messageID: string, errObj: Types.Error?, ...)
	local formatString: string

	if messages[messageID] ~= nil then
		formatString = messages[messageID]
	else
		messageID = "unknownMessage"
		formatString = messages[messageID]
	end

	local errorString

	if errObj == nil then
		errorString = string.format("[Fusion] " .. formatString .. "\n(ID: " .. messageID .. ")", ...)
	else
		formatString = string.gsub(formatString, "ERROR_MESSAGE", errObj.message)
		errorString = string.format("[Fusion] " .. formatString .. "\n(ID: " .. messageID .. ")\n---- Stack trace ----\n" .. errObj.trace, ...)
	end

	error(string.gsub(errorString, "\n", "\n    "), 0)
end

return logError


Prompt: -- Local Functions

Response:
local function makePurchase()
	local newLevel = upgrades.Value + 1

	BuyUpgradeEvent:FireServer()
	showLevelUpBanner()
end

local function updateUpgrades()
	local cost = GameSettings.upgradeCost(upgrades.Value)
	local upgradeProgress = points.Value/cost
	local starProgress = (points.Value % (cost / 3)) / (cost / 3)

	prevStarProgress = currStarProgress
	currStarProgress = starProgress

	local tweenTime = 1 * math.abs(starProgress - prevStarProgress)
	if starProgress <= prevStarProgress then
		local tweenTimeToFull = 1 * (1-prevStarProgress)
		tweenTime = 1 * (starProgress)

		ProgressBarContainer:TweenPosition(UDim2.fromScale(0, 0),
			Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweenTimeToFull, true)
		ProgressBarFill:TweenPosition(UDim2.fromScale(0, 0),
			Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweenTimeToFull, true)

		wait(tweenTime)
		if starProgress == currStarProgress then
			ProgressBarContainer.Position = UDim2.fromScale(-0.56, 0)
			ProgressBarFill.Position = UDim2.fromScale(0.56, 0)

			ProgressBarContainer:TweenPosition(UDim2.fromScale(-0.56 + math.min(1, starProgress) * 0.56, 0),
				Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweenTime, true)
			ProgressBarFill:TweenPosition(UDim2.fromScale(0.56 - math.min(1, starProgress) * 0.56, 0),
				Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweenTime, true)
		end
	else
		ProgressBarContainer:TweenPosition(UDim2.fromScale(-0.5 + math.min(1, starProgress) * 0.5, 0),
			Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweenTime, true)
		ProgressBarFill:TweenPosition(UDim2.fromScale(0.5 - math.min(1, starProgress) * 0.5, 0),
			Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweenTime, true)
	end

	if points.Value >= cost then
		-- 3 Stars, slight pause, upgrade
		Star1.Visible = true
		Star2.Visible = true
		Star3.Visible = true
		wait()
		makePurchase()
	elseif points.Value >= 2*cost / 3 then
		-- 2 Stars
		Star1.Visible = true
		Star2.Visible = true
	elseif points.Value >= cost / 3 then
		-- 1 Star
		Star1.Visible = true
	else
		-- 0 Stars
		Star1.Visible = false
		Star2.Visible = false
		Star3.Visible = false
	end
end

local function toggleEnabled()
	if GameplayUi.Enabled then
		ChangeController:FireServer(false)
	else
		ChangeController:FireServer(true)
	end
end

local function toggleLobby()
	if GameplayUi.Enabled then
		-- Enter lobby and exit game
		humanoidRoot.CFrame = SpawnLocation.CFrame + Vector3.new(0, 3, 0)
		humanoid.WalkSpeed = 16

		GameplayUi.Enabled = false
		Tutorial.Enabled = false
		Controller.Disabled = true
		InteractionBillboard.Enabled = true

		LobbyButton.Visible = false
	end
end


Prompt: -- Waits for the child of the specified parent

Response:
local function WaitForChild(parent, childName)
	while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
	return parent[childName]
end

local Tool = script.Parent

local Animations = {}
local MyHumanoid
local MyCharacter

local function PlayAnimation(animationName)
	if Animations[animationName] then
		Animations[animationName]:Play()
	end
end

local function StopAnimation(animationName)
	if Animations[animationName] then
		Animations[animationName]:Stop()
	end
end

function OnEquipped(mouse)
	MyCharacter = Tool.Parent
	MyHumanoid = WaitForChild(MyCharacter, 'Humanoid')
	if MyHumanoid then
		Animations['EquipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'EquipAnim5'))
		Animations['IdleAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
		Animations['OverheadAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'OverheadAnim2'))
		Animations['SlashAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'SlashAnim2'))
		Animations['ThrustAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'ThrustAnim2'))
		Animations['UnequipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'UnequipAnim2'))
	end
	PlayAnimation('EquipAnim')
	PlayAnimation('IdleAnim')
end

function OnUnequipped()
	for animName, _ in pairs(Animations) do
		StopAnimation(animName)
	end
end

Tool.Equipped:connect(OnEquipped)
Tool.Unequipped:connect(OnUnequipped)

WaitForChild(Tool, 'PlaySlash').Changed:connect(
	function (value)
		--if value then
			PlayAnimation('SlashAnim')
		--else
		--	StopAnimation('SlashAnim')
		--end
	end)

WaitForChild(Tool, 'PlayThrust').Changed:connect(
	function (value)
		--if value then
			PlayAnimation('ThrustAnim')
		--else
		--	StopAnimation('ThrustAnim')
		--end
	end)

WaitForChild(Tool, 'PlayOverhead').Changed:connect(
	function (value)
		--if value then
			PlayAnimation('OverheadAnim')
		--else
		--	StopAnimation('OverheadAnim')
		--end
	end)


Prompt: --[[Brakes]]

Response:
	Tune.ABSEnabled		= true		-- Implements ABS
	Tune.ABSThreshold	= 20		-- Slip speed allowed before ABS starts working (in SPS)

	Tune.FBrakeForce	= 400		-- Front brake force
	Tune.RBrakeForce	= 500		-- Rear brake force
	Tune.PBrakeForce	= 4000		-- Handbrake force

	Tune.FLgcyBForce	= 15000		-- Front brake force [PGS OFF]
	Tune.RLgcyBForce	= 10000		-- Rear brake force [PGS OFF]
	Tune.LgcyPBForce	= 25000		-- Handbrake force [PGS OFF]


Prompt: --// Admin

Response:
return function(Vargs, GetEnv)
	local env = GetEnv(nil, {script = script})
	setfenv(1, env)

	local server = Vargs.Server;
	local service = Vargs.Service;

	local Functions, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Settings, Commands
	local AddLog, TrackTask, Defaults
	local CreatorId = game.CreatorType == Enum.CreatorType.User and game.CreatorId
	local function Init()
		Functions = server.Functions;
		Admin = server.Admin;
		Anti = server.Anti;
		Core = server.Core;
		HTTP = server.HTTP;
		Logs = server.Logs;
		Remote = server.Remote;
		Process = server.Process;
		Variables = server.Variables;
		Settings = server.Settings;
		Commands = server.Commands;
		Defaults = server.Defaults

		TrackTask = service.TrackTask
		AddLog = Logs.AddLog;

		if not CreatorId then
			TrackTask("Thread: GetGroupCreatorId", function()
				local success, creator = pcall(service.GroupService.GetGroupInfoAsync, service.GroupService, game.CreatorId)
				if success and type(creator) == "table" then
					CreatorId = creator.Owner.Id
				end
			end)
		end

		TrackTask("Thread: ChatServiceHandler", function()
			--// ChatService mute handler (credit to Coasterteam)
			local chatService = Functions.GetChatService()

			if chatService then
				chatService:RegisterProcessCommandsFunction("ADONIS_CMD", function(speakerName, message)
					local speaker = chatService:GetSpeaker(speakerName)
					local speakerPlayer = speaker and speaker:GetPlayer()

					if not speakerPlayer then
						return false
					end

					if Admin.DoHideChatCmd(speakerPlayer, message) then
						return true
					end

					return false
				end)

				chatService:RegisterProcessCommandsFunction("ADONIS_MUTE_SERVER", function(speakerName, _, channelName)
					local slowCache = Admin.SlowCache

					local speaker = chatService:GetSpeaker(speakerName)
					local speakerPlayer = speaker and speaker:GetPlayer()

					if not speakerPlayer then
						return false
					end

					if speakerPlayer and Admin.IsMuted(speakerPlayer) then
						speaker:SendSystemMessage("[Adonis] :: You are muted!", channelName)
						return true
					elseif speakerPlayer and Admin.SlowMode and not Admin.CheckAdmin(speakerPlayer) and slowCache[speakerPlayer] and os.time() - slowCache[speakerPlayer] < Admin.SlowMode then
						speaker:SendSystemMessage(string.format("[Adonis] :: Slow mode enabled! (%g second(s) remaining)", Admin.SlowMode - (os.time() - slowCache[speakerPlayer])), channelName)
						return true
					end

					if Admin.SlowMode then
						slowCache[speakerPlayer] = os.time()
					end

					return false
				end)

				AddLog("Script", "ChatService Handler Loaded")
			else
				warn("Place is missing ChatService; Vanilla Roblox chat related features may not work")
				AddLog("Script", "ChatService Handler Not Found")
			end
		end)

		--// Make sure the default ranks are always present for compatability with existing commands
		local Ranks = Settings.Ranks
		for rank, data in pairs(Defaults.Settings.Ranks) do
			if not Ranks[rank] then
				Ranks[rank] = data
			end
		end

		--// Old settings/plugins backwards compatibility
		for _, rank in ipairs({"Owners", "HeadAdmins", "Admins", "Moderators", "Creators"}) do
			if Settings[rank] then
				Settings.Ranks[if rank == "Owners" then "HeadAdmins" else rank].Users = Settings[rank]
			end
		end

		if Settings.CustomRanks then
			local Ranks = Settings.Ranks
			for name, users in pairs(Settings.CustomRanks) do
				if not Ranks[name] then
					Ranks[name] = {
						Level = 1;
						Users = users;
					};
				end
			end
		end

		Admin.Init = nil;
		AddLog("Script", "Admin Module Initialized")
	end;

	local function RunAfterPlugins(data)
		--// Backup Map
		if Settings.AutoBackup then
			TrackTask("Thread: Initial Map Backup", Admin.RunCommand, Settings.Prefix.."backupmap")
		end

		--// Run OnStartup Commands
		for i,v in pairs(Settings.OnStartup) do
			warn("Running startup command ".. tostring(v))
			TrackTask("Thread: Startup_Cmd: ".. tostring(v), Admin.RunCommand, v)
			AddLog("Script", {
				Text = "Startup: Executed "..tostring(v);
				Desc = "Executed startup command; "..tostring(v);
			})
		end

		--// Check if Shutdownlogs is set and if not then set it
		if Core.DataStore and not Core.GetData("ShutdownLogs") then
			Core.SetData("ShutdownLogs", {})
		end

		Admin.RunAfterPlugins = nil;
		AddLog("Script", "Admin Module RunAfterPlugins Finished")
	end

	service.MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, id, purchased)
		if Variables and player.Parent and id == 1348327 and purchased then
			Variables.CachedDonors[tostring(player.UserId)] = os.time()
		end
	end)

	local function stripArgPlaceholders(alias)
		return service.Trim(string.gsub(alias, "<%S+>", ""))
	end

	local function FormatAliasArgs(alias, aliasCmd, msg)
		local uniqueArgs = {}
		local argTab = {}
		local numArgs = 0

		--// First try to extract args info from the alias
		for arg in string.gmatch(alias, "<(%S+)>") do
			if arg ~= "" and arg ~= " " then
				local arg = "<".. arg ..">"
				if not uniqueArgs[arg] then
					numArgs += 1
					uniqueArgs[arg] = true
					table.insert(argTab, arg)
				end
			end
		end

		--// If no args in alias string, check the command string instead and try to guess args based on order of appearance
		if numArgs == 0 then
			for arg in string.gmatch(aliasCmd, "<(%S+)>") do
				if arg ~= "" and arg ~= " " then
					local arg = "<".. arg ..">"
					if not uniqueArgs[arg] then --// Get only unique placeholder args, repeats will be matched to the same arg pos
						numArgs += 1
						uniqueArgs[arg] = true --// :cmd <arg1> <arg2>
						table.insert(argTab, arg)
					end
				end
			end
		end

		local suppliedArgs = Admin.GetArgs(msg, numArgs) -- User supplied args (when running :alias arg)
		local out = aliasCmd

		local EscapeSpecialCharacters = service.EscapeSpecialCharacters
		for i,argType in pairs(argTab) do
			local replaceWith = suppliedArgs[i]
			if replaceWith then
				out = string.gsub(out, EscapeSpecialCharacters(argType), replaceWith)
			end
		end

		return out
	end

	server.Admin = {
		Init = Init;
		RunAfterPlugins = RunAfterPlugins;

		SpecialLevels = {};
		TempAdmins = {};

		PrefixCache = {};
		CommandCache = {};
		SlowCache = {};
		UserIdCache = {};
		GroupsCache = {};

		BlankPrefix = false;

		--// How long admin levels will be cached (unless forcibly updated via something like :admin user)
		AdminLevelCacheTimeout = 30;

		DoHideChatCmd = function(p: Player, message: string, data: {[string]: any}?)
			local pData = data or Core.GetPlayer(p)
			if pData.Client.HideChatCommands then
				if Variables.BlankPrefix and
					(string.sub(message,1,1) ~= Settings.Prefix or string.sub(message,1,1) ~= Settings.PlayerPrefix) then
					local isCMD = Admin.GetCommand(message)
					if isCMD then
						return true
					else
						return false
					end
				elseif (string.sub(message,1,1) == Settings.Prefix or string.sub(message,1,1) == Settings.PlayerPrefix)
					and string.sub(message,2,2) ~= string.sub(message,1,1) then
					return true;
				end
			end
		end;

		GetPlayerGroups = function(p: Player)
			if not p or p.Parent ~= service.Players then
				return
			end

			local key = tostring(p.UserId)
			local cache = Admin.GroupsCache[key]
			if cache then
				return cache
			else
				local timestamp = os.time()
				local success, groups = pcall(service.GroupService.GetGroupsAsync, service.GroupService, p.UserId)
				if success then
					local mapped = {}
					for _, group in ipairs(groups) do
						table.insert(mapped, {
							Id = group.Id;
							Name = group.Name;
							Rank = group.Rank;
							Role = group.Role;
						})
					end
					local result = {
						CreatedAt = timestamp;
						Groups = mapped;
					}
					Admin.GroupsCache[key] = result
					task.delay(10 + (math.random() * 60), function()
						local cache = Admin.GroupsCache[key]
						if cache and timestamp == cache.CreatedAt then
							Admin.GroupsCache[key] = nil
						end
					end)
					return result
				end
			end
		end;

		GetPlayerGroup = function(p: Player, group: number | string)
			local groups = Admin.GetPlayerGroups(p)
			local isId = type(group) == "number"
			if groups and groups.Groups then
				for _, g in ipairs(groups.Groups) do
					if (isId and g.Id == group) or (not isId and g.Name == group) then
						return g
					end
				end
			end
		end;

		IsMuted = function(player: Player)
			local DoCheck = Admin.DoCheck

			for _, v in pairs(Settings.Muted) do
				if DoCheck(player, v) then
					return true
				end
			end

			for _, v in pairs(HTTP.Trello.Mutes) do
				if DoCheck(player, v) then
					return true
				end
			end

			if HTTP.WebPanel.Mutes then
				for _, v in pairs(HTTP.WebPanel.Mutes) do
					if DoCheck(player, v) then
						return true
					end
				end
			end
		end;

		DoCheck = function(p: string | number | Player, check: string | number | {[string]: any}, banCheck: boolean?)
			local pType = type(p)
			local cType = type(check)

			local lower = string.lower
			local match = string.match
			local sub = string.sub

			if pType == "string" and cType == "string" then
				if p == check or sub(lower(check), 1, #tostring(p)) == lower(p) then
					return true
				end
			elseif pType == "number" and (cType == "number" or tonumber(check)) then
				if p == tonumber(check) then
					return true
				end
			elseif cType == "number" then
				if p.UserId == check then
					return true
				end
			elseif cType == "string" and pType == "userdata" and p:IsA("Player") then
				local isGood = p and p.Parent == service.Players
				if isGood and match(check, "^Group:(.*):(.*)") then
					local sGroup, sRank = match(check, "^Group:(.*):(.*)")
					local group, rank = tonumber(sGroup), tonumber(sRank)
					if group and rank then
						local pGroup = Admin.GetPlayerGroup(p, group)
						if pGroup then
							local pRank = pGroup.Rank
							if pRank == rank or (rank < 0 and pRank >= math.abs(rank)) then
								return true
							end
						end
					end
				elseif isGood and sub(check, 1, 6) == "Group:" then --check:match("^Group:(.*)") then
					local group = tonumber(match(check, "^Group:(.*)"))
					if group then
						local pGroup = Admin.GetPlayerGroup(p, group)
						if pGroup then
							return true
						end
					end
				elseif isGood and sub(check, 1, 5) == "Item:" then --check:match("^Item:(.*)") then
					local item = tonumber(match(check, "^Item:(.*)"))
					if item then
						if service.MarketPlace:PlayerOwnsAsset(p, item) then
							return true
						end
					end
				elseif p and sub(check, 1, 9) == "GamePass:" then --check:match("^GamePass:(.*)") then
					local item = tonumber(match(check, "^GamePass:(.*)"))
					if item then
						if service.MarketPlace:UserOwnsGamePassAsync(p.UserId, item) then
							return true
						end
					end
				elseif match(check, "^(.*):(.*)") then
					local player, sUserid = match(check, "^(.*):(.*)")
					local userid = tonumber(sUserid)
					if player and userid and p.Name == player or p.UserId == userid then
						return true
					end
				elseif p.Name == check then
					return true
				elseif not banCheck and type(check) == "string" and not string.find(check, ":") then
					local cache = Admin.UserIdCache[check]

					if cache and p.UserId == cache then
						return true
					elseif not cache then
						local suc, userId = pcall(function() return service.Players:GetUserIdFromNameAsync(check) end)

						if suc and userId then
							Admin.UserIdCache[check] = userId

							if p.UserId == userId then
								return true
							end
						end
					end
				end
			elseif cType == "table" and pType == "userdata" and p and p:IsA("Player") then
				if check.Group and check.Rank then
					local rank = check.Rank
					local pGroup = Admin.GetPlayerGroup(p, check.Group)
					if pGroup then
						local pRank = pGroup.Rank
						if pRank == rank or (rank < 0 and pRank >= math.abs(rank)) then
							return true
						end
					end
				end
			end
		end;

		LevelToList = function(lvl: number)
			local lvl = tonumber(lvl)
			if not lvl then return end
			local listName = Admin.LevelToListName(lvl)
			if listName then
				local list = Settings.Ranks[listName];
				if list then
					return list.Users, listName, list;
				end
			end
		end;

		LevelToListName = function(lvl: number)
			if lvl > 999 then
				return "Place Owner"
			elseif lvl == 0 then
				return "Players"
			end

			--// Check if this is a default rank and if the level matches the default (so stuff like [Trello] Admins doesn't appear in the command list)
			for i,v in pairs(server.Defaults.Settings.Ranks) do
				local tRank = Settings.Ranks[i];
				if tRank and tRank.Level == v.Level and v.Level == lvl then
					return i
				end
			end

			for i,v in pairs(Settings.Ranks) do
				if v.Level == lvl then
					return i
				end
			end
		end;

		UpdateCachedLevel = function(p: Player, data: {[string]: any}?)
			local data = data or Core.GetPlayer(p)
			local level, rank = Admin.GetUpdatedLevel(p, data)

			data.AdminLevel = level
			data.AdminRank = rank
			data.LastLevelUpdate = os.time()

			AddLog("Script", {
				Text = "Updating cached level for ".. p.Name;
				Desc = "Updating the cached admin level for ".. p.Name;
				Player = p;
			})

			return level, rank
		end;

		GetLevel = function(p: Player)
			local data = Core.GetPlayer(p)
			local level = data.AdminLevel
			local rank = data.AdminRank
			local lastUpdate = data.LastLevelUpdate or 0
			local clients = Remote.Clients
			local key = tostring(p.UserId)

			local currentTime = os.time()

			if (not level or not lastUpdate or currentTime - lastUpdate > Admin.AdminLevelCacheTimeout) or lastUpdate > currentTime then
				local newLevel, newRank = Admin.UpdateCachedLevel(p, data)

				if clients[key] and level and newLevel and type(p) == "userdata" and p:IsA("Player") then
					if newLevel < level then
						Functions.Hint("Your admin level has been reduced to ".. newLevel.." [".. (newRank or "Unknown") .."]", {p})
					elseif newLevel > level then
						Functions.Hint("Your admin level has been increased to ".. newLevel .." [".. (newRank or "Unknown") .."]", {p})
					end
				end

				return newLevel, newRank
			end

			return level or 0, rank;
		end;

		GetUpdatedLevel = function(p: Player, data: {[string]: any}?)
			local checkTable = Admin.CheckTable
			local doCheck = Admin.DoCheck

			for _, admin in pairs(Admin.SpecialLevels) do
				if doCheck(p, admin.Player) then
					return admin.Level, admin.Rank
				end
			end

			local sortedRanks = {}
			for rank, data in pairs(Settings.Ranks) do
				table.insert(sortedRanks, {
					Rank = rank;
					Users = data.Users;
					Level = data.Level;
				});
			end

			table.sort(sortedRanks, function(t1, t2)
				return t1.Level > t2.Level
			end)

			local highestLevel = 0
			local highestRank

			for _, data in pairs(sortedRanks) do
				local level = data.Level
				if level > highestLevel then
					for _, v in ipairs(data.Users) do
						if doCheck(p, v) then
							highestLevel, highestRank = level, data.Rank
							break
						end
					end
				end
			end

			if Admin.IsPlaceOwner(p) and highestLevel < 1000 then
				return 1000, "Place Owner"
			end

			return highestLevel, highestRank
		end;

		IsPlaceOwner = function(p: Player)
			if type(p) == "userdata" and p:IsA("Player") then
				--// These are my accounts; Lately I've been using my game dev account(698712377) more so I'm adding it so I can debug without having to sign out and back in (it's really a pain)
				--// Disable CreatorPowers in settings if you don't trust me. It's not like I lose or gain anything either way. Just re-enable it BEFORE telling me there's an issue with the script so I can go to your place and test it.
				if Settings.CreatorPowers then
					local creatorAccounts = {1237666, 76328606, 698712377}
					for _, userId in ipairs(creatorAccounts) do
						if p.UserId == userId then
							return true
						end
					end
				end

				if tonumber(CreatorId) and p.UserId == CreatorId then
					return true
				end

				if p.UserId == -1 then --// To account for player emulators in multi-client Studio tests
					return true
				end
			end
		end;

		CheckAdmin = function(p: Player)
			return Admin.GetLevel(p) > 0
		end;

		SetLevel = function(p: Player, level: number | string, doSave: boolean?, rankName: string)
			local current, rank = Admin.GetLevel(p)

			if tonumber(level) then
				if current >= 1000 then
					return false
				else
					Admin.SpecialLevels[tostring(p.UserId)] = {
						Player = p.UserId,
						Level = level,
						Rank = rankName
					}
				end
			elseif level == "Reset" then
				Admin.SpecialLevels[tostring(p.UserId)] = nil
			end

			Admin.UpdateCachedLevel(p)
		end;

		IsTempAdmin = function(p: Player)
			local DoCheck = Admin.DoCheck
			for i,v in pairs(Admin.TempAdmins) do
				if DoCheck(p,v) then
					return true, i
				end
			end
		end;

		RemoveAdmin = function(p: Player, temp: boolean?, override: boolean?)
			local current, rank = Admin.GetLevel(p)
			local listData = rank and Settings.Ranks[rank]
			local listName = listData and rank
			local list = listData and listData.Users

			local isTemp,tempInd = Admin.IsTempAdmin(p)

			if isTemp then
				temp = true
				table.remove(Admin.TempAdmins,tempInd)
			end

			if override then
				temp = false
			end

			if type(p) == "userdata" then
				Admin.SetLevel(p, 0)
			end

			if list then
				local DoCheck = Admin.DoCheck
				for ind,check in ipairs(list) do
					if DoCheck(p, check) and not (type(check) == "string" and (string.match(check,"^Group:") or string.match(check,"^Item:"))) then
						table.remove(list, ind)

						if not temp and Settings.SaveAdmins then
							TrackTask("Thread: RemoveAdmin", Core.DoSave, {
								Type = "TableRemove";
								Table = {"Settings", "Ranks", listName, "Users"};
								Value = check;
							})
						end
					end
				end
			end

			Admin.UpdateCachedLevel(p)
		end;

		AddAdmin = function(p: Player, level: string | number, temp: boolean?)
			local current, rank = Admin.GetLevel(p)
			local list = rank and Settings.Ranks[rank]
			local levelName, newRank, newList

			if type(level) == "string" then
				local newRank = Settings.Ranks[level]
				levelName = newRank and level
				newList = newRank and newRank.Users
				level = (newRank and newRank.Level) or Admin.StringToComLevel(levelName) or level
			else
				local nL, nLN = Admin.LevelToList(level)
				levelName = nLN
				newRank = nLN
				newList = nL
			end

			Admin.RemoveAdmin(p, temp)
			Admin.SetLevel(p, level, nil, levelName)

			if temp then
				table.insert(Admin.TempAdmins, p)
			end

			if list and type(list) == "table" then
				local index,value

				for ind,ent in ipairs(list) do
					if (type(ent)=="number" or type(ent)=="string") and (ent==p.UserId or string.lower(ent)==string.lower(p.Name) or string.lower(ent)==string.lower(p.Name..":"..p.UserId)) then
						index = ind
						value = ent
					end
				end

				if index and value then
					table.remove(list, index)
				end
			end

			local value = p.Name ..":".. p.UserId

			if newList then
				table.insert(newList,value)

				if Settings.SaveAdmins and levelName and not temp then
					TrackTask("Thread: SaveAdmin", Core.DoSave, {
						Type = "TableAdd";
						Table = {"Settings", "Ranks", levelName, "Users"};
						Value = value
					})
				end
			end

			Admin.UpdateCachedLevel(p)
		end;

		CheckDonor = function(p: Player)
			--if not Settings.DonorPerks then return false end
			local key = tostring(p.UserId)
			if Variables.CachedDonors[key] then
				return true
			else
				--if p.UserId<0 or (tonumber(p.AccountAge) and tonumber(p.AccountAge)<0) then return false end
				local pGroup = Admin.GetPlayerGroup(p, 886423)
				for _, pass in ipairs(Variables.DonorPass) do
					if p.Parent ~= service.Players then
						return false
					end

					local ran, ret
					if type(pass) == "number" then
						ran, ret = pcall(service.MarketPlace.UserOwnsGamePassAsync, service.MarketPlace, p.UserId, pass)
					elseif type(pass) == "string" and tonumber(pass) then
						ran, ret = pcall(service.MarketPlace.PlayerOwnsAsset, service.MarketPlace, p, tonumber(pass))
					end

					if (ran and ret) or (pGroup and pGroup.Rank >= 10) then --// Complimentary donor access is given to Adonis contributors & developers.
						Variables.CachedDonors[key] = os.time()
						return true
					end
				end
			end
		end;

		CheckBan = function(p: Player)
			local doCheck = Admin.DoCheck
			local banCheck = Admin.DoBanCheck

			for _, admin in pairs(Settings.Banned) do
				if (type(admin) == "table" and ((admin.UserId and doCheck(p, admin.UserId, true)) or (admin.Name and not admin.UserId and doCheck(p, admin.Name, true)))) or doCheck(p, admin, true) then
					return true, (type(admin) == "table" and admin.Reason)
				end
			end

			for ind, ban in pairs(Core.Variables.TimeBans) do
				if p.UserId == ban.UserId then
					if ban.EndTime-os.time() <= 0 then
						table.remove(Core.Variables.TimeBans, ind)
					else
						return true, "\n Reason: "..(ban.Reason or "(No reason provided.)").."\n Banned until ".. service.FormatTime(ban.EndTime, {WithWrittenDate = true})
					end
				end
			end

			for _, admin in pairs(HTTP.Trello.Bans) do
				local name = type(admin) == "table" and admin.Name or admin
				if doCheck(p, name) or banCheck(p, name) then
					return true, (type(admin) == "table" and admin.Reason and service.Filter(admin.Reason, p, p))
				end
			end

			if HTTP.WebPanel.Bans then
				for _, admin in pairs(HTTP.WebPanel.Bans) do
					if doCheck(p, admin) or banCheck(p, admin) then
						return true, (type(admin) == "table" and admin.Reason)
					end
				end
			end
		end;

		AddBan = function(p: Player | {[string]: any}, reason: string, doSave: boolean?)
			local value = {
				Name = p.Name;
				UserId = p.UserId;
				Reason = reason;
			}

			table.insert(Settings.Banned, value)--p.Name..':'..p.UserId

			if doSave then
				Core.DoSave({
					Type = "TableAdd";
					Table = "Banned";
					Value = value;
				})

				Core.CrossServer("RemovePlayer", p.Name, Variables.BanMessage, value.Reason or "No reason provided")
			end

			if type(p) ~= "table" then
				if not service.Players:FindFirstChild(p.Name) then
					Remote.Send(p,'Function','KillClient')
				else
					if p then pcall(function() p:Kick(Variables.BanMessage .. " | Reason: "..(value.Reason or "No reason provided")) end) end
				end
			end

			service.Events.PlayerBanned:Fire(p, reason, doSave)
		end;

		AddTimeBan = function(p : Player | {[string]: any}, duration: number, reason: string)
			local value = {
				Name = p.Name;
				UserId = p.UserId;
				EndTime = os.time() + tonumber(duration);
				Reason = reason
			}

			table.insert(Core.Variables.TimeBans, value)

			Core.DoSave({
				Type = "TableAdd";
				Table = {"Core", "Variables", "TimeBans"};
				Value = value;
			})

			Core.CrossServer("RemovePlayer", p.Name, Variables.BanMessage, value.Reason or "No reason provided")

			if type(p) ~= "table" then
				if not service.Players:FindFirstChild(p.Name) then
					Remote.Send(p,'Function','KillClient')
				else
					if p then pcall(function() p:Kick(Variables.BanMessage .. " | Reason: "..(value.Reason or "No reason provided")) end) end
				end
			end

			service.Events.PlayerBanned:Fire(p, reason, true)
		end,

		DoBanCheck = function(name: string | number | Instance, check: string | {[string]: any})
			local id = type(name) == "number" and name

			if type(name) == "userdata" and name:IsA("Player") then
				id = name.UserId
				name = name.Name
			end

			if type(check) == "table" then
				if type(name) == "string" and check.Name and string.lower(check.Name) == string.lower(name) then
					return true
				elseif id and check.UserId and check.UserId == id then
					return true
				end
			elseif type(check) == "string" then
				local cName, cId = string.match(check, "(.*):(.*)")
				if not cName and cId then cName = check end

				if cName then
					if string.lower(cName) == string.lower(name) then
						return true;
					elseif id and cId and id == cId then
						return true;
					end
				end
			end

			return false
		end;

		RemoveBan = function(name: string | number | Instance, doSave: boolean?)
			local ret
			for i,v in pairs(Settings.Banned) do
				if Admin.DoBanCheck(name, v) then
					table.remove(Settings.Banned, i)
					ret = v
					if doSave then
						Core.DoSave({
							Type = "TableRemove";
							Table = "Banned";
							Value = v;
						})
					end
				end
			end
			return ret
		end;

		RemoveTimeBan = function(name : string | number | Instance)
			local ret
			for i,v in pairs(Core.Variables.TimeBans) do
				if Admin.DoBanCheck(name, v) then
					table.remove(Core.Variables.TimeBans, i)
					ret = v
					Core.DoSave({
						Type = "TableRemove";
						Table = {"Core", "Variables", "TimeBans"};
						Value = v;
					})
				end
			end
			return ret
		end,

		RunCommand = function(coma: string, ...)
			local _, com = Admin.GetCommand(coma)
			if com then
				local cmdArgs = com.Args or com.Arguments
				local args = Admin.GetArgs(coma,#cmdArgs,...)

				--local task,ran,error = service.Threads.TimeoutRunTask("SERVER_COMMAND: "..coma,com.Function,60*5,false,args)
				--[[local ran, error = TrackTask("Command: ".. tostring(coma), com.Function, false, args)
				if error then
					--logError("SERVER","Command",error)
				end]]

				TrackTask("Command: ".. coma, com.Function, false, args)
			end
		end;

		RunCommandAsPlayer = function(coma: string, plr: Player, ...)
			local ind, com = Admin.GetCommand(coma)
			if com then
				local adminLvl = Admin.GetLevel(plr)

				local cmdArgs = com.Args or com.Arguments
				local args = Admin.GetArgs(coma,#cmdArgs,...)

				local ran, error = TrackTask(plr.Name .. ": ".. coma, com.Function, plr, args, {
					PlayerData = {
						Player = plr;
						Level = adminLvl;
						isDonor = ((Settings.DonorCommands or com.AllowDonors) and Admin.CheckDonor(plr)) or false;
					}
				})

				--local task,ran,error = service.Threads.TimeoutRunTask("COMMAND:"..plr.Name..": "..coma,com.Function,60*5,plr,args)
				if error then
					--logError(plr,"Command",error)
					error = string.match(error, ":(.+)$") or "Unknown error"
					Remote.MakeGui(plr, 'Output', {
						Title = '';
						Message = error;
						Color = Color3.new(1,0,0)
					})
					return;
				end
			end
		end;

		RunCommandAsNonAdmin = function(coma: string, plr: Player, ...)
			local ind, com = Admin.GetCommand(coma)
			if com and com.AdminLevel == 0 then
				local cmdArgs = com.Args or com.Arguments
				local args = Admin.GetArgs(coma,#cmdArgs,...)
				local _, error = TrackTask(plr.Name ..": ".. coma, com.Function, plr, args, {PlayerData = {
					Player = plr;
					Level = 0;
					isDonor = false;
				}})
				if error then
					error = string.match(error, ":(.+)$") or "Unknown error"
					Remote.MakeGui(plr, 'Output', {
						Title = "";
						Message = error;
						Color = Color3.new(1,0,0)
					})
				end
			end
		end;

		CacheCommands = function()
			local tempTable = {}
			local tempPrefix = {}
			for ind, data in pairs(Commands) do
				if type(data) == "table" then
					for _,cmd in pairs(data.Commands) do
						if data.Prefix == "" then Variables.BlankPrefix = true end
						tempPrefix[data.Prefix] = true
						tempTable[string.lower(data.Prefix..cmd)] = ind
					end
				end
			end

			Admin.PrefixCache = tempPrefix
			Admin.CommandCache = tempTable
		end;

		GetCommand = function(Command: string)
			if Admin.PrefixCache[string.sub(Command, 1, 1)] or Variables.BlankPrefix then
				local matched = if string.find(Command, Settings.SplitKey) then
					string.match(Command, "^(%S+)"..Settings.SplitKey)
					else string.match(Command, "^(%S+)")

				if matched then
					local found = Admin.CommandCache[string.lower(matched)]
					if found then
						local real = Commands[found]
						if real then
							return found,real,matched
						end
					end
				end
			end
		end;

		FindCommands = function(Command: string)
			local prefixChar = string.sub(Command, 1, 1)
			local checkPrefix = Admin.PrefixCache[prefixChar] and prefixChar
			local matched

			if checkPrefix then
				Command = string.sub(Command, 2)
			end

			if string.find(Command, Settings.SplitKey) then
				matched = string.match(Command, "^(%S+)"..Settings.SplitKey)
			else
				matched = string.match(Command, "^(%S+)")
			end

			if matched then
				local foundCmds = {}
				matched = string.lower(matched)

				for ind,cmd in pairs(Commands) do
					if type(cmd) == "table" and ((checkPrefix and prefixChar == cmd.Prefix) or not checkPrefix) then
						for _, alias in pairs(cmd.Commands) do
							if string.lower(alias) == matched then
								foundCmds[ind] = cmd
								break
							end
						end
					end
				end

				return foundCmds
			end
		end;

		SetPermission = function(comString: string, newLevel: number)
			local cmds = Admin.FindCommands(comString)
			if cmds then
				for _, cmd in pairs(cmds) do
					cmd.AdminLevel = newLevel
				end
			end
		end;

		FormatCommand = function(command: {[string]: any}, cmdn: number?)
			local text = command.Prefix.. command.Commands[cmdn or 1]
			local cmdArgs = command.Args or command.Arguments
			local splitter = Settings.SplitKey

			for _,arg in pairs(cmdArgs) do
				text ..= splitter.."<"..arg..">"
			end

			return text
		end;

		CheckTable = function(p: Player, tab: {[any]: any})
			local doCheck = Admin.DoCheck
			for _,v in pairs(tab) do
				if doCheck(p, v) then
					return true
				end
			end
		end;

		--// Make it so you can't accidentally overwrite certain existing commands... resulting in being unable to add/edit/remove aliases (and other stuff)
		CheckAliasBlacklist = function(alias: string)
			local playerPrefix = Settings.PlayerPrefix;
			local prefix = Settings.Prefix;
			local blacklist = {
				[playerPrefix.. "alias"] = true;
				[playerPrefix.. "newalias"] = true;
				[playerPrefix.. "removealias"] = true;
				[playerPrefix.. "client"] = true;
				[playerPrefix.. "userpanel"] = true;
				[":adonissettings"] = true;

			}
			--return Admin.CommandCache[string.lower(alias)] --// Alternatively, we could make it so you can't overwrite ANY existing commands...
			return blacklist[alias];
		end;

		GetArgs = function(msg: string, num: number, ...)
			local args = Functions.Split((string.match(msg, "^.-"..Settings.SplitKey..'(.+)') or ''),Settings.SplitKey,num) or {}
			for _,v in ipairs({...}) do table.insert(args, v) end
			return args
		end;

		AliasFormat = function(aliases: {[string]: any}, msg: string)
			local foundPlayerAlias = false --// Check if there's a player-defined alias first then otherwise check settings aliases

			local CheckAliasBlacklist, EscapeSpecialCharacters = Admin.CheckAliasBlacklist, service.EscapeSpecialCharacters

			if aliases then
				for alias, cmd in pairs(aliases) do
					local tAlias = stripArgPlaceholders(alias)
					if not Admin.CheckAliasBlacklist(tAlias) then
						local escAlias = EscapeSpecialCharacters(tAlias)
						if string.match(msg, "^"..escAlias) or string.match(msg, "%s".. escAlias) then
							msg = FormatAliasArgs(alias, cmd, msg)
						end
					end
				end
			end

			--if not foundPlayerAlias then
			for alias, cmd in pairs(Settings.Aliases) do
				local tAlias = stripArgPlaceholders(alias)
				if not CheckAliasBlacklist(tAlias) then
					local escAlias = EscapeSpecialCharacters(tAlias)
					if string.match(msg, "^"..escAlias) or string.match(msg, "%s".. escAlias) then
						msg = FormatAliasArgs(alias, cmd, msg)
					end
				end
			end
			--end

			return msg
		end;

		StringToComLevel = function(str: string | number)
			local strType = type(str)
			if strType == "string" and string.lower(str) == "players" then
				return 0
			end
			if strType == "number" then
				return str
			end

			local lvl = Settings.Ranks[str]
			return (lvl and lvl.Level) or tonumber(str)
		end;

		CheckComLevel = function(plrAdminLevel: number, comLevel: string | number | {[any]: number})
			if type(comLevel) == "string" then
				comLevel = Admin.StringToComLevel(comLevel)
			end

			if type(comLevel) == "number" and plrAdminLevel >= comLevel then
				return true;
			elseif type(comLevel) == "table" then
				for _,level in pairs(comLevel) do
					if plrAdminLevel == level then
						return true
					end
				end
			end
		end;

		IsBlacklisted = function(p: Player)
			local CheckTable = Admin.CheckTable
			for _,list in pairs(Variables.Blacklist.Lists) do
				if CheckTable(p, list) then
					return true
				end
			end
		end;

		CheckPermission = function(pDat: {[string]: any}, cmd: {[string]: any})
			local adminLevel = pDat.Level
			local isDonor = (pDat.isDonor and (Settings.DonorCommands or cmd.AllowDonors))

			local comLevel = cmd.AdminLevel

			local funAllowed = Settings.FunCommands
			local crossServerAllowed = Settings.CrossServerCommands

			--// Creators rank will bypass any permissions set
			if adminLevel >= Settings.Ranks.Creators.Level then
				return true
			elseif (comLevel == "Players" or comLevel == 0) and not Settings.PlayerCommands then
				--// If PlayerCommands is set to false it will prevent users from using "Players" level commands
				return false
			elseif cmd.Fun and not funAllowed then
				--// If FunCommands are disabled it will block any command Labeled "Fun"
				return false
			elseif cmd.IsCrossServer and not crossServerAllowed then
				--// If CrossServerCommands is disabled it will block any command that is "CrossServer"
				return false
			elseif cmd.Donors and isDonor then
				--// If a command is for "Donors" it will allow anyone with Donor to use it
				return true
			elseif Admin.CheckComLevel(adminLevel, comLevel) then
				--// Check if user has permission to the command
				return true
			end

			--// If none of the checks pass it will deny permissions
			return false
		end;

		SearchCommands = function(p: Player, search: string)
			local checkPerm = Admin.CheckPermission
			local tab = {}
			local pDat = {
				Player = p;
				Level = Admin.GetLevel(p);
				isDonor = Admin.CheckDonor(p);
			}

			for index, command in pairs(Commands) do
				if search == "All" or checkPerm(pDat, command) then
					tab[index] = command
				end
			end

			return tab
		end;
	}
end


Prompt: --police+sec

Response:
game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		print(Player.TeamColor)
		if Player.TeamColor == BrickColor.new("Smoky grey") then
			Character.Humanoid.MaxHealth = 135
			Character.Humanoid.Health = 135
		end
	end)
end)
game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		print(Player.TeamColor)
		if Player.TeamColor == BrickColor.new("Lily white") then
			Character.Humanoid.MaxHealth = 135
			Character.Humanoid.Health = 135
		end
	end)
end)
game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		print(Player.TeamColor)
		if Player.TeamColor == BrickColor.new("Sea green") then
			Character.Humanoid.MaxHealth = 135
			Character.Humanoid.Health = 135
		end
	end)
end)
game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		print(Player.TeamColor)
		if Player.TeamColor == BrickColor.new("Mid gray") then
			Character.Humanoid.MaxHealth = 135
			Character.Humanoid.Health = 135
		end
	end)
end)


Prompt: --Set target steering position based on current velocity

Response:
function Chassis.UpdateSteering(steer, currentVel)
	local baseSteer = steer
	local targetSteer = 0

	local vehicleSeat = Chassis.GetDriverSeat()
	local maxSpeed = VehicleParameters.MaxSpeed
	local maxSteer = VehicleParameters.MaxSteer

	local currentVelocity = vehicleSeat.Velocity

	if LimitSteerAtHighVel then
		local c = SteerLimit * (math.abs(currentVel)/VehicleParameters.MaxSpeed) + 1
		--decrease steer value as speed increases to prevent tipping (handbrake cancels this)
		steer = steer/c
	end
	SteeringPrismatic.TargetPosition = steer * steer * steer * maxSteer
end

function Chassis.UpdateThrottle(currentVel, throttle)
	local targetVel = 0
	if math.abs(throttle) < 0.1 then
		-- Idling
		setMotorMaxAcceleration(math.huge)
		setMotorTorque(2000)
	elseif math.sign(throttle * currentVel) > 0 or math.abs(currentVel) < 0.5 then
		setMotorMaxAcceleration(math.huge)

		local velocityVector = Chassis.driverSeat.Velocity.Unit
		local directionalVector = Chassis.driverSeat.CFrame.lookVector
		local dotProd = velocityVector:Dot(directionalVector) -- Dot product is a measure of how similar two vectors are; if they're facing the same direction, it is 1, if they are facing opposite directions, it is -1, if perpendicular, it is 0

		setMotorTorqueDamped(ActualDrivingTorque * throttle * throttle, dotProd, math.sign(throttle))
		-- Arbitrary large number
		local movingBackwards = dotProd < 0
		local acceleratingBackwards = throttle < 0
		local useReverse = (movingBackwards and acceleratingBackwards)

		targetVel = math.sign(throttle) * (useReverse and VehicleParameters.ReverseSpeed or VehicleParameters.MaxSpeed)
	else
		-- Braking
		setMotorMaxAcceleration(100)
		setMotorTorque(ActualBrakingTorque * throttle * throttle)
		targetVel = math.sign(throttle) * 500
	end
	Chassis.SetMotorVelocity( targetVel )
end

local redressingState = false
local targetAttachment
function Chassis.Redress()
	if redressingState then
		return
	end
	redressingState = true
	local p = Chassis.driverSeat.CFrame.Position + Vector3.new( 0,10,0 )
	local xc = Chassis.driverSeat.CFrame.RightVector
	xc = Vector3.new(xc.x,0,xc.z)
	xc = xc.Unit
	local yc = Vector3.new(0,1,0)

	if not targetAttachment then
		targetAttachment = RedressMount.RedressTarget
	end

	targetAttachment.Parent = Workspace.Terrain
	targetAttachment.Position = p
	targetAttachment.Axis = xc
	targetAttachment.SecondaryAxis = yc
	RedressMount.RedressOrientation.Enabled = true
	RedressMount.RedressPosition.Enabled = true
	wait(1.5)
	RedressMount.RedressOrientation.Enabled = false
	RedressMount.RedressPosition.Enabled = false
	targetAttachment.Parent = RedressMount
	wait(2)
	redressingState = false
end

function Chassis.Reset() --Reset user inputs and redress (For when a player exits the vehicle)
	Chassis.UpdateThrottle(1, 1) --Values must  be changed to replicate to client.
	Chassis.UpdateSteering(1, 0) --i.e. setting vel to 0 when it is 0 wont update to clients
	Chassis.EnableHandbrake()
	setMotorTorque(ActualBrakingTorque)
	Chassis.SetMotorVelocity(0)
	Chassis.UpdateSteering(0, 0)
	RedressMount.RedressOrientation.Enabled = true
	RedressMount.RedressPosition.Enabled = true
	RedressMount.RedressOrientation.Enabled = false
	RedressMount.RedressPosition.Enabled = false
	redressingState = false
end

return Chassis


Prompt: -- defines subject and height of VR camera

Response:
function VRBaseCamera:GetVRFocus(subjectPosition, timeDelta)
	local lastFocus = self.lastCameraFocus or subjectPosition

	self.cameraTranslationConstraints = Vector3.new(
		self.cameraTranslationConstraints.x,
		math.min(1, self.cameraTranslationConstraints.y + timeDelta),
		self.cameraTranslationConstraints.z)

	local cameraHeightDelta = Vector3.new(0, self:GetCameraHeight(), 0)
	local newFocus = CFrame.new(Vector3.new(subjectPosition.x, lastFocus.y, subjectPosition.z):
			lerp(subjectPosition + cameraHeightDelta, self.cameraTranslationConstraints.y))

	return newFocus
end


Prompt: -- EDIT THE TEXTS.

Response:
CONTENT.Content1.Content.Text = "Content" -- EDIT THE STUFF IN THE QUOTATION MARKS ON YOUR NEW CONTENT.
CONTENT.Content2.Content.Text = "Content"
CONTENT.Content3.Content.Text = "Content"
CONTENT.Content4.Content.Text = "Content"
CONTENT.Content5.Content.Text = "Content"
CONTENT.Content6.Content.Text = "Content"
CONTENT.Content7.Content.Text = "Content"
CONTENT.Content8.Content.Text = "Content"
CONTENT.Content9.Content.Text = "Content"
CONTENT.Content10.Content.Text = "Content"


Prompt: --to use: put in type of gun: barrel point left, barrel point right or bull-pup(main hande is in the middle of the gun)

Response:
                                  --step 2: put in what type of wepoan it is: assult rifle or pistol(there will be more)
guntype = 1               --1 is assult rifle, 2 is bullpup, 3 is pistol, 4 is knife
weldmode = 1            --1 is barrel point upper-left, 2 is barrel pointing upper-right, 3 is barrel point lower-left and 4 is barrel point lower-right
                                  -------(note: if it is pistol or knife then 1 is on right leg, 2 is on left leg, 3 is in the back of your pants and 4 is in the front of your pants)
model = nil                 --gun model, that is
distance = 0.75          --this is the distance between the part(torso/leg) and the gun. DON'T MAKE negitive
rotation = 135              --this is the turning in degrees.
                                   --this area is mode more for someone who's already good at gun's. please do not get mad at me if you don't understand what's under here
y = 2                           --this is what's added to the current y value. positive number's make it go down. negative make's it go up
 x = -.75                          --this is what's added to the x value(it's really the z value but it look's like the x value when on your back). positive number's make it go left. negative make's it go right

parts = {}
local n = 1

function on(mouse)
if model == nil then
n = 1
local m = Instance.new("Model")
local all = script.Parent:GetChildren()
for i = 1, #all do
if all[i].className == "Part" then
parts[n] = all[i].Transparency
local brick = all[i]:clone()
brick.Parent = m
n = n +1
end
end
wait()
if model == nil then
local weld = script:FindFirstChild("Weld2")
if weld ~= nil then
local new = weld:clone()
new.Disabled = false
new.Parent = m
m.Name = script.Parent.Name
m.Parent = script.Parent.Parent
model = m
local handle = model:FindFirstChild("Handle")
if handle ~= nil then

if guntype == 1 then
local torso = model.Parent:FindFirstChild("Torso")
if torso ~= nil then
if weldmode == 1 then
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance *-1, 0.25 +y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), (math.pi / 2), 0)
elseif weldmode == 2 then
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance, 0.25 +y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), (math.pi / 2 ) *-1, 0)
elseif weldmode == 3 then
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance *-1, -0.1+y, 0.2 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), (math.pi / 2), -1.5)
elseif weldmode == 4 then
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance, 0.25+y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), (math.pi / 2 +rotation) *-1.1, 1)
end
end

elseif guntype == 2 then
local torso = model.Parent:FindFirstChild("Torso")
if torso ~= nil then
if weldmode == 1 then
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance *-1, 0.25+y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), math.pi / 2, 0)
elseif weldmode == 2 then
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance, 0.25 +y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), math.pi / 2 *-1, 0)
elseif weldmode == 3 then
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance *-1, 0.25 +y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), math.pi / 2, 0)
elseif weldmode == 4 then
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance, 0.25 +y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), math.pi / 2 *-1, 0)
end
end

elseif guntype == 3 then
local lleg = model.Parent:FindFirstChild("Left Leg")
local rleg = model.Parent:FindFirstChild("Right Leg")
if lleg ~= nil and rleg ~= nil then
if weldmode == 1 then
local w = Instance.new("Weld")
w.Part0 = rleg
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance *-1, 0 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi / 2, 0, 0)
elseif weldmode == 2 then
local w = Instance.new("Weld")
w.Part0 = lleg
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance, 0 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi / 2, 0, 0)
elseif weldmode == 3 then
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance *-1, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi / 2 , math.pi / 2, 0)
elseif weldmode == 4 then
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi / 2 , math.pi / 2 *-1, 0)
end
end

elseif guntype == 4 then
local lleg = model.Parent:FindFirstChild("Left Leg")
local rleg = model.Parent:FindFirstChild("Right Leg")
local torso = model.Parent:FindFirstChild("Torso")
if lleg ~= nil and rleg ~= nil and torso ~= nil then
if weldmode == 1 then
local w = Instance.new("Weld")
w.Part0 = rleg
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance *-1, 0.15 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi, 0, 0)
elseif weldmode == 2 then
local w = Instance.new("Weld")
w.Part0 = lleg
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance, 0.15 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi, 0, 0)
elseif weldmode == 3 then
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance *-1, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi , math.pi / 2, 0)
elseif weldmode == 4 then
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi , math.pi / 2 *-1, 0)
end
end
end
end
end
end
end

if model ~= nil then
n = 1
local all = model:GetChildren()
for i = 1, #all do
if all[i].className == "Part" then
all[i].Transparency = 1
end
end
end
end

function off(mouse)
if model ~= nil then
n = 1
local all = model:GetChildren()
for i = 1, #all do
if all[i].className == "Part" then
all[i].Transparency = parts[n]
local Do = true
if Do then
Do = false
n = n +1
end
end
end
end
end

script.Parent.Equipped:connect(on)
script.Parent.Unequipped:connect(off)


Prompt:
--How to do:
--Put BassParts in body
--And this script in DriverSeat
--Please make sure to have the songMod installed!

Response:
if script.Parent:IsA("VehicleSeat") then
	script.Parent.ChildAdded:connect(function(child)
		if child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
			local p= game.Players:GetPlayerFromCharacter(child.Part1.Parent)
			local g= script.SendBass:Clone()
			g.Parent=p.PlayerGui
			g.src.Value = script.BassEvent
			g.Disabled = false
		end
	end)
	script.Parent.ChildRemoved:Connect(function(child)
		if child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		end
	end)
end

script.BassEvent.OnServerEvent:Connect(function(plr, bass)
	local car = script.Parent.Parent
	local bassParts = car.Body.BassParts
	for i,v in pairs(bassParts:GetChildren()) do
		if v:IsA("MeshPart") then
			local vectorSize = v:FindFirstChild("VectorSize")
			if bass <= v.MaxBassSize.Value then
				v.Size = Vector3.new(vectorSize.Value.X,bass/v.BassSize.Value,vectorSize.Value.Z)
			else
				v.Size = Vector3.new(vectorSize.Value.X,v.MaxBassSize.Value/v.BassSize.Value,vectorSize.Value.Z)
			end
		end
	end
end)


Prompt:
--[=[
	@return boolean
	Returns `true` if the gamepad is currently connected.
]=]

Response:
function Gamepad:IsConnected(): boolean
	return if self._gamepad then UserInputService:GetGamepadConnected(self._gamepad) else false
end