Prompt: -- Current UI layout

Response:
local CurrentLayout;

function ChangeLayout(Layout)
	-- Sets the UI to the given layout

	-- Make sure the new layout isn't already set
	if CurrentLayout == Layout then
		return;
	end;

	-- Set this as the current layout
	CurrentLayout = Layout;

	-- Reset the UI
	for _, ElementName in pairs(UIElements) do
		local Element = UI[ElementName];
		Element.Visible = false;
	end;

	-- Keep track of the total vertical extents of all items
	local Sum = 0;

	-- Go through each layout element
	for ItemIndex, ItemName in ipairs(Layout) do

		local Item = UI[ItemName];

		-- Make the item visible
		Item.Visible = true;

		-- Position this item underneath the past items
		Item.Position = UDim2.new(0, 0, 0, 20) + UDim2.new(
			Item.Position.X.Scale,
			Item.Position.X.Offset,
			0,
			Sum + 10
		);

		-- Update the sum of item heights
		Sum = Sum + 10 + Item.AbsoluteSize.Y;

	end;

	-- Resize the container to fit the new layout
	UI.Size = UDim2.new(0, 200, 0, 40 + Sum);

end;

function UpdateUI()
	-- Updates information on the UI

	-- Make sure the UI's on
	if not UI then
		return;
	end;

	-- References to inputs
	local TransparencyInput = UI.TransparencyOption.Input.TextBox;
	local ReflectanceInput = UI.ReflectanceOption.Input.TextBox;

	-----------------------
	-- Update the UI layout
	-----------------------

	-- Figure out the necessary UI layout
	if #Selection.Parts == 0 then
		ChangeLayout(Layouts.EmptySelection);
		return;

	-- When the selection isn't empty
	else
		ChangeLayout(Layouts.Normal);
	end;

	-- Get the common properties
	local Material = Support.IdentifyCommonProperty(Selection.Parts, 'Material');
	local Transparency = Support.IdentifyCommonProperty(Selection.Parts, 'Transparency');
	local Reflectance = Support.IdentifyCommonProperty(Selection.Parts, 'Reflectance');

	-- Update the material dropdown
	MaterialDropdown.SetOption(Material and Materials[Material] or '*');

	-- Update inputs
	UpdateDataInputs {
		[TransparencyInput] = Transparency and Support.Round(Transparency, 2) or '*';
		[ReflectanceInput] = Reflectance and Support.Round(Reflectance, 2) or '*';
	};

end;

function TrackChange()

	-- Start the record
	HistoryRecord = {
		Before = {};
		After = {};
		Selection = Selection.Items;

		Unapply = function (Record)
			-- Reverts this change

			-- Select the changed parts
			Selection.Replace(Record.Selection)

			-- Send the change request
			Core.SyncAPI:Invoke('SyncMaterial', Record.Before);

		end;

		Apply = function (Record)
			-- Applies this change

			-- Select the changed parts
			Selection.Replace(Record.Selection)

			-- Send the change request
			Core.SyncAPI:Invoke('SyncMaterial', Record.After);

		end;

	};

end;

function RegisterChange()
	-- Finishes creating the history record and registers it

	-- Make sure there's an in-progress history record
	if not HistoryRecord then
		return;
	end;

	-- Send the change to the server
	Core.SyncAPI:Invoke('SyncMaterial', HistoryRecord.After);

	-- Register the record and clear the staging
	Core.History.Add(HistoryRecord);
	HistoryRecord = nil;

end;


Prompt: --model.Part.Touched:Connect(function(player)

Response:
wait(10)
	if triggered==false then
		triggered=true
		leftTweenOpen:Play()
		rightTweenOpen:Play()
		model.Part.DoorStart:Play()
		wait(4)
		model.Part.DoorStart:Stop()
		model.Part.DoorStop:Play()
		wait(7.5)
		--leftTweenClose:Play()
		--rightTweenClose:Play()
		--model.Part.DoorStart:Play()
		--wait(4)
		--model.Part.DoorStart:Stop()
		--model.Part.DoorStop:Play()
		--model.Part.DoorHit:Play()
		--wait(0.1)
	--triggered=false
	script.Enabled = false
	end


Prompt:
--[=[
	@param ... any
	@return args: table
	Serializes the arguments and returns the serialized values in a table.
]=]

Response:
function Ser.SerializeArgs(...: any): Args
	local args = table.pack(...)
	for i,arg in ipairs(args) do
		if type(arg) == "table" then
			local ser = Ser.Classes[arg.ClassName]
			if ser then
				args[i] = ser.Serialize(arg)
			end
		end
	end
	return args
end


Prompt: --doEvent()

Response:
print(lowered)
return
end

function raise()
print("raising")
	repeat
	wait()
		for i = 1, #a do
			if a[i].className == "Part" then
				if a[i].Mesh.Offset.Y < .5 then
				a[i].Mesh.Offset = a[i].Mesh.Offset + Vector3.new(0, .01, 0)
				end
			end
		end
	until(script.Parent.Bar.Mesh.Offset.Y >= .5)
lowered = false


Prompt: --- Drag this into "StarterCharacterScripts"

Response:
function OnDeath()
	for _,p in pairs(game.Players:GetPlayers()) do
		local Gui = script.DNGui:Clone()
		Gui.Parent = p.PlayerGui
		Gui.TextLabel.Text = script.Parent.Name.. " was killed."
		Gui.Script.Disabled = false
	end
end
script.Parent.Humanoid.Died:Connect(OnDeath)


Prompt: --		print("1!!!",hum.Health)

Response:
		if hum.Health<1 then return end
	end
	if hit.Parent:findFirstChild("Humanoid2") ~= nil then
		local hum=hit.Parent:findFirstChild("Humanoid2")


Response:
function module:CreateRanks()
	coroutine.wrap(function()

		local ranksInfo = main.signals.RetrieveRanksInfo:InvokeServer()
		local permRanksInfo = ranksInfo.PermRanks
		local ranksToSort = ranksInfo.Ranks
		local permissions = ranksInfo.Permissions

		--Organise ranks
		local rankPositions = {}
		local ranks = {}
		for i, rankDetails in pairs(ranksToSort) do
			local rankId = rankDetails[1]
			local rankName = rankDetails[2]
			table.insert(ranks, 1, {rankId, rankName, {}})
		end
		for i,v in pairs(ranks) do
			rankPositions[v[1]] = i
		end

		for pName, pDetails in pairs(permissions) do
			--Owner
			if pName == "owner" and rankPositions[5] then
				local ownerRankDetail = ranks[rankPositions[5]]
				table.insert(ownerRankDetail[3], {main.ownerName, "Owner", main:GetModule("cf"):GetUserImage(main.ownerId)})
			--SpecificUsers and PermRanks
			elseif pName == "specificusers" then
				for plrName, rankId in pairs(pDetails) do
					if #plrName > 1 then
						local rankDetail = ranks[rankPositions[rankId]]
						local boxInfo = {plrName, "Specific User", main:GetModule("cf"):GetUserImage(main:GetModule("cf"):GetUserId(plrName))}
						table.insert(rankDetail[3], boxInfo)
					end
				end
				for i, record in pairs(permRanksInfo) do
					if not record.RemoveRank then
						local rankDetail = ranks[rankPositions[record.Rank]]
						if rankDetail then
							local boxInfo = {main:GetModule("cf"):GetName(record.UserId), "PermRank", main:GetModule("cf"):GetUserImage(record.UserId), record}
							table.insert(rankDetail[3], boxInfo)
						end
					end
				end
			elseif pName == "gamepasses" then
				--Gamepasses
				for gamepassId, gamepassInfo in pairs(pDetails) do
					if not main:GetModule("cf"):FindValue(main.products, gamepassId) then
						local rankDetail = ranks[rankPositions[gamepassInfo.Rank]]
						if rankDetail then
							local boxInfo = {gamepassInfo.Name, "Gamepass", gamepassInfo.IconImageAssetId, tonumber(gamepassId), gamepassInfo.PriceInRobux}
							table.insert(rankDetail[3], boxInfo)
						end
					end
				end
			elseif pName == "assets" then
				--Assets
				for assetId, assetInfo in pairs(pDetails) do
					local rankDetail = ranks[rankPositions[assetInfo.Rank]]
					if rankDetail then
						local boxInfo = {assetInfo.Name, "Asset", main:GetModule("cf"):GetAssetImage(assetId), tonumber(assetId), assetInfo.PriceInRobux}
						table.insert(rankDetail[3], boxInfo)
					end
				end
			elseif pName == "groups" then
				--Groups
				for groupId, groupInfo in pairs(pDetails) do
					for roleName, roleInfo in pairs(groupInfo.Roles) do
						if roleInfo.Rank then
							local rankDetail = ranks[rankPositions[roleInfo.Rank]]
							if rankDetail then
								local boxInfo = {groupInfo.Name.." | "..roleName, "Group", groupInfo.EmblemUrl, tonumber(groupId)}
								table.insert(rankDetail[3], boxInfo)
							end
						end
					end
				end
			elseif otherPermissions[pName] then
				--Other
				local info = otherPermissions[pName]
				local rank = permissions[info[1]]
				if rank > 0 then
					local rankDetail = ranks[rankPositions[rank]]
					if rankDetail then
						local boxInfo = {info[2], info[3], string.upper(string.sub(info[1], 1, 1))}
						table.insert(rankDetail[3], boxInfo)
					end
				end
			end
		end
		--Can view PermRank menu
		local canModifyPermRanks = false
		if main.pdata.Rank >= (main.commandRanks.permrank or 4) then
			canModifyPermRanks = true
		end

		--Clear labels
		main:GetModule("cf"):ClearPage(pages.ranks)

		--Setup labels
		local labelCount = 0
		for i,v in pairs(ranks) do
			local rankId = v[1]
			local rankName = v[2]
			local boxes = v[3]
			--
			labelCount = labelCount + 1
			local rankTitle = templates.rankTitle:Clone()
			rankTitle.Name = "Label".. labelCount
			rankTitle.RankIdFrame.TextLabel.Text = rankId
			rankTitle.RankName.Text = rankName
			rankTitle.Visible = true
			rankTitle.Parent = pages.ranks
			--
			for _, boxInfo in pairs(boxes) do
				labelCount = labelCount + 1
				local boxTitle = boxInfo[1]
				local boxDesc = boxInfo[2]
				local boxImage = boxInfo[3]
				local rankItem = templates.rankItem:Clone()
				rankItem.Name = "Label".. labelCount
				rankItem.ItemTitle.Text = boxTitle
				rankItem.ItemDesc.Text = boxDesc
				if #tostring(boxImage) == 1 then
					rankItem.ItemIcon.Text = boxImage
					rankItem.ItemIcon.Visible = true
					rankItem.ItemImage.Visible = false
				else
					if tonumber(boxImage) then
						boxImage = "rbxassetid://"..boxImage
					end
					rankItem.ItemImage.Image = tostring(boxImage)
				end
				local xScale = 0.7
				rankItem.Unlock.Visible = false
				rankItem.ViewMore.Visible = false
				if boxDesc == "Gamepass" or boxDesc == "Asset" then
					local productId = boxInfo[4]
					local productPrice = boxInfo[5]
					rankItem.ItemImage.BackgroundTransparency = 1
					rankItem.Unlock.Visible = true
					rankItem.Unlock.MouseButton1Down:Connect(function()
						buyFrame.ProductName.Text = boxTitle
						buyFrame.ProductImage.Image = boxImage
						buyFrame.PurchaseToUnlock.TextLabel.Text = rankName
						buyFrame.InGame.TextLabel.Text = main.gameName
						buyFrame.MainButton.Price.Text = (productPrice or 0).." "
						buyFrame.MainButton.ProductId.Value = productId
						buyFrame.MainButton.ProductType.Value = boxDesc
						main:GetModule("cf"):ShowWarning("BuyFrame")
					end)
					xScale = 0.4
				elseif boxDesc == "PermRank" then
					local record = boxInfo[4]
					if canModifyPermRanks then
						local viewMore = rankItem.ViewMore
						viewMore.Visible = true
						viewMore.MouseButton1Down:Connect(function()
							main:GetModule("cf"):ShowPermRankedUser{boxTitle, record.UserId, record.RankedBy}
						end)
					end
					xScale = 0.6
				else
					xScale = 0.7
				end
				rankItem.ItemTitle.Size = UDim2.new(xScale, 0, rankItem.ItemTitle.Size.Y.Scale, 0)
				rankItem.ItemDesc.Size = UDim2.new(xScale, 0, rankItem.ItemDesc.Size.Y.Scale, 0)
				rankItem.Visible = true
				rankItem.Parent = pages.ranks
			end
		end

		--Canvas Size
		if labelCount >= 2 then
			for i = 1,2 do
				local firstLabel = pages.ranks["Label1"]
				local finalLabel = pages.ranks["Label".. labelCount]
				pages.ranks.CanvasSize = UDim2.new(0, 0, 0, (finalLabel.AbsolutePosition.Y + finalLabel.AbsoluteSize.Y - firstLabel.AbsolutePosition.Y))
			end
		end

	end)()
end


Prompt: -- Testing AC FE support

Response:
local event = script.Parent
local car=script.Parent.Parent
local LichtNum = 0

event.OnServerEvent:connect(function(player,data)
	if data['ToggleLight'] then
		if car.Body.Light.on.Value==true then
			car.Body.Light.on.Value=false
		else
			car.Body.Light.on.Value=true
		end
	elseif data['EnableBrakes'] then
		car.Body.Brakes.on.Value=true
	elseif data['DisableBrakes'] then
		car.Body.Brakes.on.Value=false
	elseif data['ToggleLeftBlink'] then
		if car.Body.Left.on.Value==true then
			car.Body.Left.on.Value=false
		else
			car.Body.Left.on.Value=true
		end
	elseif data['ToggleRightBlink'] then
		if car.Body.Right.on.Value==true then
			car.Body.Right.on.Value=false
		else
			car.Body.Right.on.Value=true
		end
	elseif data['ReverseOn'] then
		car.Body.Reverse.on.Value=true
	elseif data['ReverseOff'] then
		car.Body.Reverse.on.Value=false
	elseif data['ToggleStandlicht'] then
		if LichtNum == 0 then
			LichtNum = 2
			car.Body.Headlight.on.Value = true
		elseif LichtNum == 1 then
			LichtNum = 2
			car.Body.Headlight.on.Value = true
		elseif LichtNum == 2 then
			LichtNum = 3
			car.Body.Highlight.on.Value = true
		elseif LichtNum == 3 then
			LichtNum = 1
			car.Body.Highlight.on.Value = false
			car.Body.Headlight.on.Value = false
		end
	elseif data["ToggleHazards"] then
		if car.Body.hazards.Value == false then
			car.Body.hazards.Value = true
			car.Body.Left.on.Value=false
			car.Body.Right.on.Value=false
			car.Body.Left.on.Value=true
			car.Body.Right.on.Value=true
		elseif car.Body.hazards.Value == true then
			car.Body.hazards.Value = false
			car.Body.Left.on.Value=false
			car.Body.Right.on.Value=false
		end
	end
end)


Prompt:
-- K is a tunable parameter that changes the shape of the S-curve
-- the larger K is the more straight/linear the curve gets

Response:
local k = 0.35
local lowerK = 0.8
local function SCurveTranform(t: number)
	t = math.clamp(t, -1, 1)
	if t >= 0 then
		return (k*t) / (k - t + 1)
	end
	return -((lowerK*-t) / (lowerK + t + 1))
end

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

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

function CameraUtils.GamepadLinearToCurve(thumbstickPosition: Vector2)
	local function onAxis(axisValue)
		local sign = 1
		if axisValue < 0 then
			sign = -1
		end
		local point = fromSCurveSpace(SCurveTranform(toSCurveSpace(math.abs(axisValue))))
		point = point * sign
		return math.clamp(point, -1, 1)
	end
	return Vector2.new(onAxis(thumbstickPosition.X), onAxis(thumbstickPosition.Y))
end


Prompt: --// # key, ManOff

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


Prompt: --//Server Animations

Response:
	RightHighReady = CFrame.new(-.815, 0.55, -1.1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0));
	LeftHighReady = CFrame.new(.815,0.55,-1.15) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(0));

	RightLowReady = CFrame.new(-.815, 0.55, -1.1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0));
	LeftLowReady = CFrame.new(.815,0.55,-1.15) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(0));

	RightPatrol = CFrame.new(-.815, 0.55, -1.1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0));
	LeftPatrol = CFrame.new(.815,0.55,-1.15) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(0));

	RightAim = CFrame.new(-.815, 0.55, -1.1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0));
	LeftAim = CFrame.new(.815,0.55,-1.15) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(0));

	RightSprint = CFrame.new(-.815, 0.55, -1.1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0));
	LeftSprint = CFrame.new(.815,0.55,-1.15) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(0));

	ShootPos = CFrame.new(0,0,.25);

}

return module


Prompt: --// SS3 controls for AC6 by Itzt, originally for 2014 Infiniti QX80. i don't know how to tune ac lol

Response:
wait(0.1)
local player = game.Players.LocalPlayer
local HUB = script.Parent.HUB

local limitButton = HUB.Name
local FE = game.Workspace.FilteringEnabled
local lightOn = false
local Camera = game.Workspace.CurrentCamera
local cam = script.Parent.nxtcam.Value
local carSeat = script.Parent.CarSeat.Value
local mouse = game.Players.LocalPlayer:GetMouse()
local windows = false
local handler = carSeat:WaitForChild('Filter')
local winfob = HUB.Parent.Music
local pal = false
local palpal = HUB.Parent.Palette
local red = 0
local green = 0
local blue = 1
local debounce = false


Prompt:
--[[
	CameraModule - This ModuleScript implements a singleton class to manage the
	selection, activation, and deactivation of the current camera controller,
	character occlusion controller, and transparency controller. This script binds to
	RenderStepped at Camera priority and calls the Update() methods on the active
	controller instances.

	The camera controller ModuleScripts implement classes which are instantiated and
	activated as-needed, they are no longer all instantiated up front as they were in
	the previous generation of PlayerScripts.

	2018 PlayerScripts Update - AllYourBlox
--]]

Response:
local CameraModule = {}
CameraModule.__index = CameraModule

local FFlagUserRemoveTheCameraApi do
	local success, result = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserRemoveTheCameraApi")
	end)
	FFlagUserRemoveTheCameraApi = success and result
end

local FFlagUserFixCameraSelectModuleWarning do
	local success, result = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserFixCameraSelectModuleWarning")
	end)
	FFlagUserFixCameraSelectModuleWarning = success and result
end

local FFlagUserFlagEnableNewVRSystem do
	local success, result = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserFlagEnableNewVRSystem")
	end)
	FFlagUserFlagEnableNewVRSystem = success and result
end


Prompt: -- Responsible for regening a player's humanoid's health


Prompt:
--[[

The following represents a raycast function suitable for guns.

The ray passes through all CanCollide = false parts unless they belong to a Humanoid.

--]]

Response:
local Utils = require(script.Parent.Parent);

local FindCharacterAncestor = Utils.Misc.GetCharacterFromPart;

function Raycast(lookRay, ignoreList)
	ignoreList = ignoreList or {};
    local target, point, normal, targetCharacter;
    repeat
        target, point, normal = workspace:FindPartOnRayWithIgnoreList(lookRay, ignoreList);
        targetCharacter = FindCharacterAncestor(target);
        if target and not target.CanCollide and not targetCharacter then
            table.insert(ignoreList, target);
            target = nil;
        else
			return target, point, normal;
        end
    until target;
end

return Raycast;


Prompt: -- Called when character is about to be removed

Response:
function BaseOcclusion:CharacterRemoving(char: Model, player: Player)
end

function BaseOcclusion:OnCameraSubjectChanged(newSubject)
end


Prompt:
-- We want to be able to override outputFunction in tests, so the shape of this
-- module is kind of unconventional.
--
-- We fix it this weird shape in init.lua.

Response:
local prettyPrint = require(script.Parent.prettyPrint)
local loggerMiddleware = {
	outputFunction = print,
}

function loggerMiddleware.middleware(nextDispatch, store)
	return function(action)
		local result = nextDispatch(action)

		loggerMiddleware.outputFunction(("Action dispatched: %s\nState changed to: %s"):format(
			prettyPrint(action),
			prettyPrint(store:getState())
		))

		return result
	end
end

return loggerMiddleware


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

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

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

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

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

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

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

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

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

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

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

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


Prompt:
-- If promise debugging is on, use a version of pcall that warns on failure.
-- This is useful for finding errors that happen within Promise itself.

Response:
local wpcall
if PROMISE_DEBUG then
	wpcall = function(f, ...)
		local result = { pcall(f, ...) }

		if not result[1] then
			warn(result[2])
		end

		return unpack(result)
	end
else
	wpcall = pcall
end


Prompt:
--[=[
	@return Promise
	Returns a promise that is resolved once Knit has started. This is useful
	for any code that needs to tie into Knit services but is not the script
	that called `Start`.
	```lua
	Knit.OnStart():andThen(function()
		local MyService = Knit.Services.MyService
		MyService:DoSomething()
	end):catch(warn)
	```
]=]

Response:
function KnitServer.OnStart()
	if startedComplete then
		return Promise.resolve()
	else
		return Promise.fromEvent(onStartedComplete.Event)
	end
end

return KnitServer


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

Response:
local v1 = {};
local v2 = require(game.ReplicatedStorage.Modules.Lightning);
local v3 = require(game.ReplicatedStorage.Modules.Xeno);
local v4 = require(game.ReplicatedStorage.Modules.CameraShaker);
local l__TweenService__5 = game.TweenService;
local l__Debris__6 = game.Debris;
local l__ReplicatedStorage__1 = game.ReplicatedStorage;
function v1.RunStompFx(p1, p2, p3, p4)
	local v7 = l__ReplicatedStorage__1.KillFX[p1].Second:Clone();
	v7.Parent = p2.Parent.UpperTorso and p2;
	v7:Play();
	game.Debris:AddItem(v7, 5);
	local v8 = l__ReplicatedStorage__1.KillFX[p1].Stomp:Clone();
	v8.Parent = p3.Character.UpperTorso and p2;
	v8:Play();
	game.Debris:AddItem(v8, 5);
	l__ReplicatedStorage__1.KillFX[p1].Yes:Clone().Parent = p2.Parent.Head;
	return nil;
end;
return v1;


Prompt:
-- This is an overloaded function for TransparencyController:SetupTransparency(character)
-- Do not call directly, or it will throw an assertion!

Response:
function FpsCamera:SetupTransparency(character, ...)
	assert(self ~= FpsCamera)
	self:BaseSetupTransparency(character, ...)

	if self.AttachmentListener then
		self.AttachmentListener:Disconnect()
	end

	self.AttachmentListener = character.DescendantAdded:Connect(function (obj)
		if obj:IsA("Attachment") and self.HeadAttachments[obj.Name] then
			self.cachedParts[obj.Parent] = true
			self.transparencyDirty = true
		end
	end)
end


Prompt: -- Constants

Response:
local DEBUG = false								-- Whether or not to use debugging features of FastCast, such as cast visualization.
local BULLET_SPEED = 100							-- Studs/second - the speed of the bullet
local BULLET_MAXDIST = 1000							-- The furthest distance the bullet can travel
local BULLET_GRAVITY = Vector3.new(0, -workspace.Gravity, 0)		-- The amount of gravity applied to the bullet in world space (so yes, you can have sideways gravity)
local MIN_BULLET_SPREAD_ANGLE = 1					-- THIS VALUE IS VERY SENSITIVE. Try to keep changes to it small. The least accurate the bullet can be. This angle value is in degrees. A value of 0 means straight forward. Generally you want to keep this at 0 so there's at least some chance of a 100% accurate shot.
local MAX_BULLET_SPREAD_ANGLE = 4					-- THIS VALUE IS VERY SENSITIVE. Try to keep changes to it small. The most accurate the bullet can be. This angle value is in degrees. A value of 0 means straight forward. This cannot be less than the value above. A value of 90 will allow the gun to shoot sideways at most, and a value of 180 will allow the gun to shoot backwards at most. Exceeding 180 will not add any more angular varience.
local FIRE_DELAY = 1								-- The amount of time that must pass after firing the gun before we can fire again.
local BULLETS_PER_SHOT = 1							-- The amount of bullets to fire every shot. Make this greater than 1 for a shotgun effect.
local PIERCE_DEMO = true							-- True if the pierce demo should be used. See the CanRayPierce function for more info.


Prompt:
-- Modified By GraphicsSettings, Original is unknown
-- Removed Unnessecary code and improved the syntax
-- Better than toObjectSpace?

Response:
local Tool = script.Parent.Parent
local update = script.Parent:WaitForChild('Update')
local Neck_Original = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)

local RS = game:GetService("RunService").RenderStepped

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local Torso = Character:WaitForChild('Torso')

Tool.Unequipped:connect(function()
	update:FireServer('Unequip')
end)

Tool.Equipped:connect(function(curr_mouse)
	wait(.2)
	curr_mouse.TargetFilter = workspace
	while true do
		if Tool.Parent.className ~= 'Model' then
			break
		end
			update:FireServer('Turn', curr_mouse.Hit.p)

		RS:wait()
	end
end)


Prompt: --// F key, Horn

Response:
mouse.KeyUp:connect(function(key)
	if key=="f" then
		if Rumbler == false then
		veh.Lightbar.middle.WailR.Volume = 0
		veh.Lightbar.middle.YelpR.Volume = 0
		veh.Lightbar.middle.PriorityR.Volume = 0
		veh.Lightbar.middle.Wail.Volume = 1
		veh.Lightbar.middle.Yelp.Volume = 1
		veh.Lightbar.middle.Priority.Volume = 1
		elseif Rumbler == true then
		veh.Lightbar.middle.WailR.Volume = 1
		veh.Lightbar.middle.YelpR.Volume = 1
		veh.Lightbar.middle.PriorityR.Volume = 1
		veh.Lightbar.middle.Wail.Volume = 0
		veh.Lightbar.middle.Yelp.Volume = 0
		veh.Lightbar.middle.Priority.Volume = 0
		end
		veh.Lightbar.middle.Airhorn:Stop()
		end
end)

mouse.KeyDown:connect(function(key)
	if key=="j" then
		veh.Lightbar.middle.Beep:Play()
veh.Lightbar.RemoteEvent:FireServer(true)
	end
end)

mouse.KeyDown:connect(function(key)
	if key=="]" then
		Rumbler=true
		veh.Lightbar.middle.WailR.Volume = 1
		veh.Lightbar.middle.YelpR.Volume = 1
		veh.Lightbar.middle.PriorityR.Volume = 1
		veh.Lightbar.middle.Wail.Volume = 0
		veh.Lightbar.middle.Yelp.Volume = 0
		veh.Lightbar.middle.Priority.Volume = 0
		end
end)

mouse.KeyDown:connect(function(key)
	if key=="[" then
		Rumbler=false
		veh.Lightbar.middle.WailR.Volume = 0
		veh.Lightbar.middle.YelpR.Volume = 0
		veh.Lightbar.middle.PriorityR.Volume = 0
		veh.Lightbar.middle.Wail.Volume = 1
		veh.Lightbar.middle.Yelp.Volume = 1
		veh.Lightbar.middle.Priority.Volume = 1
		end
end)


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

Response:
function Click()
	script.Parent.ScrollingFrame.Visible = true;
	script.Parent.CloseButton.Visible = true;
end;
script.Parent.MouseButton1Down:connect(Click);


Prompt: --		child.C0 = CFrame.new(0,-0.6,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0) --// Reposition player

Response:
		if child.Part1.Name == "HumanoidRootPart" then
			player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
			if player and (not player.PlayerGui:FindFirstChild("Screen")) then --// The part after the "and" prevents multiple GUI's to be copied over.
				GUI.CarSeat.Value = script.Parent --// Puts a reference of the seat in this ObjectValue, now you can use this ObjectValue's value to find the car directly.
				GUI:Clone().Parent = player.PlayerGui --// Compact version
				script.Parent.Parent.Body.Dash.Screen.G.Enabled = true
				script.Parent.Parent.Body.Dash.DashSc.G.Enabled = true
				--[[script.Parent.Parent.Body.Lights.Runners.A.Material = "Neon"
				script.Parent.Parent.Body.Lights.Runners.B.Material = "Neon"]]
			end
		end
	end
end)

script.Parent.ChildRemoved:connect(function(child)
	if child:IsA("Weld") then
		if child.Part1.Name == "HumanoidRootPart" then
			game.Workspace.CurrentCamera.FieldOfView = 70
			player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
			if player and player.PlayerGui:FindFirstChild("SS3") then
				player.PlayerGui:FindFirstChild("SS3"):Destroy()
				script.Parent.Parent.Body.Dash.Screen.G.Enabled = false
				script.Parent.Parent.Body.Dash.DashSc.G.Enabled = false
				--[[script.Parent.Parent.Body.Lights.Runners.A.Material = "SmoothPlastic"
				script.Parent.Parent.Body.Lights.Runners.B.Material = "SmoothPlastic"]]
			end
		end
	end
end)


Response:
script.Parent:WaitForChild("A-Chassis Interface")
script.Parent:WaitForChild("Plugins")
script.Parent:WaitForChild("README")

local car=script.Parent.Parent
local _Tune=require(script.Parent)

local Drive=car.Wheels:GetChildren()

for _,v in pairs(Drive) do

	for _,a in pairs({"Top","Bottom","Left","Right","Front","Back"}) do
		v[a.."Surface"]=Enum.SurfaceType.SmoothNoOutlines
	end

	local WParts = {}

	local tPos = v.Position-car.DriveSeat.Position
	if v.Name=="FL" or v.Name=="RL" then
		v.CFrame = car.DriveSeat.CFrame*CFrame.Angles(math.rad(90),0,math.rad(90))
	else
		v.CFrame = car.DriveSeat.CFrame*CFrame.Angles(math.rad(90),0,math.rad(-90))
	end
	v.CFrame = v.CFrame+tPos

	if v:FindFirstChild("Parts")~=nil then
		for _,a in pairs(v.Parts:GetChildren()) do
			if a:IsA("BasePart") then
				table.insert(WParts, {a,v.CFrame:toObjectSpace(a.CFrame)})
			end
		end
	end
	if v:FindFirstChild("Fixed")~=nil then
		for _,a in pairs(v.Fixed:GetChildren()) do
			if a:IsA("BasePart") then
				table.insert(WParts, {a,v.CFrame:toObjectSpace(a.CFrame)})
			end
		end
	end
	if v.Name=="FL" or v.Name=="FR" then
		v.CFrame = v.CFrame*CFrame.Angles(math.rad(_Tune.FCamber),0,0)
		if v.Name=="FL" then
			v.CFrame = v.CFrame*CFrame.Angles(0,math.rad(-_Tune.FCaster),math.rad(_Tune.FToe))
		else
			v.CFrame = v.CFrame*CFrame.Angles(0,math.rad(_Tune.FCaster),math.rad(-_Tune.FToe))
		end
	else
		v.CFrame = v.CFrame*CFrame.Angles(math.rad(_Tune.RCamber),0,0)
		if v.Name=="RL" then
			v.CFrame = v.CFrame*CFrame.Angles(0,math.rad(-_Tune.RCaster),math.rad(_Tune.RToe))
		else
			v.CFrame = v.CFrame*CFrame.Angles(0,math.rad(_Tune.RCaster),math.rad(-_Tune.RToe))
		end
	end

	for _,a in pairs(WParts) do
		a[1].CFrame=v.CFrame:toWorldSpace(a[2])
	end

	local arm=Instance.new("Part",v)
	arm.Name="Arm"
	arm.Anchored=true
	arm.CanCollide=false
	arm.FormFactor=Enum.FormFactor.Custom
	arm.Size=Vector3.new(1,1,1)
	arm.CFrame=(v.CFrame*CFrame.new(0,_Tune.StAxisOffset,0))*CFrame.Angles(-math.pi/2,-math.pi/2,0)
	arm.TopSurface=Enum.SurfaceType.Smooth
	arm.BottomSurface=Enum.SurfaceType.Smooth
	arm.Transparency=1

	local base=arm:Clone()
	base.Parent=v
	base.Name="Base"
	base.CFrame=base.CFrame*CFrame.new(0,1,0)
	base.BottomSurface=Enum.SurfaceType.Hinge

	local axle=arm:Clone()
	axle.Parent=v
	axle.Name="Axle"
	axle.CFrame=CFrame.new(v.Position-((v.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector*((v.Size.x/2)+(axle.Size.x/2))),v.Position)*CFrame.Angles(0,math.pi,0)
	axle.BackSurface=Enum.SurfaceType.Hinge
	MakeWeld(car.DriveSeat,base)
	if v.Parent.Name == "RL" or v.Parent.Name == "RR" then
		MakeWeld(car.DriveSeat,arm)
	end

	MakeWeld(arm,axle)

	arm:MakeJoints()
	axle:MakeJoints()

	if v:FindFirstChild("Fixed")~=nil then
		ModelWeld(v.Fixed,axle)
	end

	if v:FindFirstChild("Parts")~=nil then
		ModelWeld(v.Parts,v)
	end

	if v:FindFirstChild("Steer") then
		v:FindFirstChild("Steer"):Destroy()
	end

	local gyro=Instance.new("BodyGyro",v)
	gyro.Name="Stabilizer"
	if v.Name=="FL" or v.Name=="FR" then
		gyro.D=_Tune.FGyroD
		gyro.MaxTorque=_Tune.FGyroMaxTorque
		gyro.P=_Tune.FGyroP
	else
		gyro.D=_Tune.RGyroD
		gyro.MaxTorque=_Tune.RGyroMaxTorque
		gyro.P=_Tune.RGyroP
	end

	if v.Name=="FL" or v.Name=="FR" then
		local steer=Instance.new("BodyGyro",arm)
		steer.Name="Steer"
		steer.P=_Tune.SteerP
		steer.D=_Tune.SteerD
		steer.MaxTorque=Vector3.new(0,_Tune.SteerMaxTorque,0)
		steer.cframe=base.CFrame
	else
		MakeWeld(base,axle,"Weld")
	end

	local AV=Instance.new("BodyAngularVelocity",v)
	AV.Name="#AV"
	AV.angularvelocity=Vector3.new(0,0,0)
	AV.maxTorque=Vector3.new(_Tune.PBrakeForce,0,_Tune.PBrakeForce)
	AV.P=1e9
end

for i,v in pairs(script:GetChildren()) do
	if v:IsA("ModuleScript") then
		require(v)
	end
end

wait()
ModelWeld(car.Body,car.DriveSeat)

local flipG = Instance.new("BodyGyro",car.DriveSeat)
flipG.Name = "Flip"
flipG.D = 0
flipG.MaxTorque = Vector3.new(0,0,0)
flipG.P = 0

wait()

UnAnchor(car)

script.Parent["A-Chassis Interface"].Car.Value=car
for i,v in pairs(script.Parent.Plugins:GetChildren()) do
	for _,a in pairs(v:GetChildren()) do
		if a:IsA("RemoteEvent") or v:IsA("RemoteFunction") then
			a.Parent=car
			for _,b in pairs(a:GetChildren()) do
				if b:IsA("Script") then b.Disabled=false end
			end
		end
	end
	v.Parent = script.Parent["A-Chassis Interface"]
end
script.Parent.Plugins:Destroy()

car.DriveSeat.ChildAdded:connect(function(child)
	if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		local p=game.Players:GetPlayerFromCharacter(child.Part1.Parent)
		car.DriveSeat:SetNetworkOwner(p)
		local g=script.Parent["A-Chassis Interface"]:Clone()
		g.Parent=p.PlayerGui
	end
end)
car.DriveSeat.ChildRemoved:connect(function(child)
	if child.Name=="SeatWeld" and child:IsA("Weld") then
		for i,v in pairs(car.DriveSeat:GetChildren()) do
			if v:IsA("Sound") then v:Stop() end
		end
		if car.DriveSeat:FindFirstChild("Flip")~=nil then
			car.DriveSeat.Flip.MaxTorque = Vector3.new()
		end
		for i,v in pairs(car.Wheels:GetChildren()) do
			if v:FindFirstChild("#AV")~=nil then
				if v["#AV"].AngularVelocity.Magnitude>0 then
					v["#AV"].AngularVelocity = Vector3.new()
					v["#AV"].MaxTorque = Vector3.new()
				end
			end
		end
	end
end)

ver = require(script.Parent.README)


Prompt:
--Made by ?!?!?!?!, just group with the model to get it to work.  This button also works for planes.
--Do not change anything besides the lines mentioned below.Again,Group it to anything you want(Cars,Trains,Planes Etc.)

Response:
model = script.Parent.Parent--Indicates that the script interacts with the model the button is grouped with.
messageText = "Regenerating... "--If you want a message to appear upon pressing, type it here.

message = Instance.new("Message")
message.Text = messageText
backup = model:clone()
enabled = true

function regenerate()
	message.Parent = game.Workspace
	model:remove()

	wait(3)--Change this number to display the regen message as long as you want in seconds.

	model = backup:clone()
	model.Parent = game.Workspace
	model:makeJoints()
	message.Parent = nil

	script.Disabled = true
	script.Parent.BrickColor = BrickColor.new(26)--Black
	wait(10)--Change this number to change the time in between regenerations via the button, in seconds..
	script.Parent.BrickColor = BrickColor.new(104)--Purple
	script.Disabled = false
end

function onHit(hit)
	if (hit.Parent:FindFirstChild("Humanoid") ~= nil) and enabled then
		regenerate()
	end
end

script.Parent.Touched:connect(onHit)


Prompt:
--Variable Setup
--Main Script

Response:
door.DoorButton.ClickDetector.MouseClick:connect(function()
	door.Door.Transparency = 1
	door.Door.CanCollide = false
	door.DoorButton.ClickDetector.MaxActivationDistance = 1
	light.Light1.Light.PointLight.Enabled = true
	light.Light1.Light.Transparency = 0
end)
door2.DoorButton.ClickDetector.MouseClick:connect(function()
	door2.Door.Transparency = 1
	door2.Door.CanCollide = false
	light.Light2.Light.PointLight.Enabled = true
	light.Light2.Light.Transparency = 0
end)
door3.DoorButton.ClickDetector.MouseClick:connect(function()
	door3.Door.Transparency = 1
	door3.Door.CanCollide = false
	door3.DoorButton.ClickDetector.MaxActivationDistance = 1
	light.Light3.Light.PointLight.Enabled = true
	light.Light3.Light.Transparency = 0
end)
door4.DoorButton.ClickDetector.MouseClick:connect(function()
	door4.Door.Transparency = 1
	door4.Door.CanCollide = false
	door4.DoorButton.ClickDetector.MaxActivationDistance = 1
	light.Light4.Light.PointLight.Enabled = true
	light.Light4.Light.Transparency = 0
end)


Prompt: -- << RETRIEVE FRAMEWORK >>

Response:
local main = _G.HDAdminMain
local load = main.loadModule
local cf = load("cf")
local credits = load("Credits")
local updates = load("Updates")


Prompt: -- Put this script in a Part or a ServerScriptService

Response:
local scriptToDestroy = game.Workspace.Map6.Badge.Nodead
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local humanoid = character:WaitForChild("Humanoid")

		humanoid.Died:Connect(function()
        scriptToDestroy:Destroy()
		end)
	end)
end)


Prompt:
-- // Constants \\ --
-- Services --

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


Response:
mouse.KeyDown:connect(function (key)
    key = string.lower(key)
        if key == "a" then
            	a = true
        elseif key == "d" then
                d = true
        elseif key == "w" then
                w = true
                rwd.Throttle = 1
				rwd.Torque = tq
				lwd.Throttle = 1
				lwd.Torque = ftq
				rrwd.Throttle = 1
				rrwd.Torque = ftq
				rwd.MaxSpeed = 400
				lwd.MaxSpeed = 400
				rrwd.MaxSpeed = 400
                carSeat.Throttle = 1
                carSeat.Torque = 0
                elseif key == "s" then
                s = true
                carSeat.Throttle = 0
                carSeat.Torque = 0
				rwd.Throttle = -1
				rwd.Torque = brk
				lwd.Throttle = -1
				lwd.Torque = brk
				rrwd.Throttle = -1
				rrwd.Torque = brk
				rwd.MaxSpeed = 25
				lwd.MaxSpeed = 25
				rrwd.MaxSpeed = 25
                end
end)

mouse.KeyUp:connect(function (key)
    key = string.lower(key)
        if key == "a" then
                print("a up")
                if d == false then
                m.DesiredAngle = 0
                        n.DesiredAngle = m.DesiredAngle
                end
        elseif key == "d" then
                print("d up")
                if a == false then
                m.DesiredAngle = 0
                        n.DesiredAngle = m.DesiredAngle
end
        end
        a = false
        d = false
end)

mouse.KeyUp:connect(function (key)
    key = string.lower(key)
if key == "w" or key == "s" then
        rwd.Throttle = 0
        rwd.Torque = 0
	    lwd.Throttle = 0
		lwd.Torque = 0
		rrwd.Throttle = 0
		rrwd.Torque = 0

       carSeat.Throttle = 0
carSeat.Torque = cst
        end
end)

limitButton.MouseButton1Click:connect(function()


Prompt: --// Ammo Settings

Response:
	Ammo = 10;
	StoredAmmo = 1;
	MagCount = math.huge; --  If you want infinate ammo, set to math.huge EX. MagCount = math.huge;
	ExplosiveAmmo = 3;


Prompt: --Mobile support

Response:
local mobileGui = script.MobileGui
if userInputService.TouchEnabled then
	userInputService.ModalEnabled = true
	mobileGui.Parent = player.PlayerGui

	mobileGui.DrivePad.Up.MouseButton1Down:connect(function()
		movement = Vector2.new(movement.X, 1)
	end)
	mobileGui.DrivePad.Up.MouseButton1Up:connect(function()
		movement = Vector2.new(movement.X, 0)
	end)
	mobileGui.DrivePad.Down.MouseButton1Down:connect(function()
		movement = Vector2.new(movement.X, -1)
	end)
	mobileGui.DrivePad.Down.MouseButton1Up:connect(function()
		movement = Vector2.new(movement.X, 0)
	end)
	mobileGui.TurnPad.Left.MouseButton1Down:connect(function()
		movement = Vector2.new(-1, movement.Y)
	end)
	mobileGui.TurnPad.Left.MouseButton1Up:connect(function()
		movement = Vector2.new(0, movement.Y)
	end)
	mobileGui.TurnPad.Right.MouseButton1Down:connect(function()
		movement = Vector2.new(1, movement.Y)
	end)
	mobileGui.TurnPad.Right.MouseButton1Up:connect(function()
		movement = Vector2.new(0, movement.Y)
	end)

	mobileGui.ExitButton.Text = "Exit " .. car.Name
	mobileGui.ExitButton.MouseButton1Click:connect(function()
		character.Humanoid.Jump = true
	end)
else
	mobileGui:Destroy()
end


Prompt: --Made by Luckymaxer

Response:
Figure = script.Parent

BasePart = Instance.new("Part")
BasePart.Material = Enum.Material.Plastic
BasePart.Shape = Enum.PartType.Block
BasePart.TopSurface = Enum.SurfaceType.Smooth
BasePart.BottomSurface = Enum.SurfaceType.Smooth
BasePart.FormFactor = Enum.FormFactor.Custom
BasePart.Size = Vector3.new(0.2, 0.2, 0.2)
BasePart.CanCollide = true
BasePart.Locked = true
BasePart.Anchored = false

Humanoid = Figure:WaitForChild("Humanoid")
Head = Figure:WaitForChild("Head")

Logo = Head:FindFirstChild("Logo")

Spawn(function()
	if Logo then
		Logo.Enabled = true
		wait(5)
		Logo.Enabled = false
	end
end)

Humanoid.MaxHealth = 250
Humanoid.Health = Humanoid.MaxHealth


Prompt: -- Modules

Response:
local Data = ServerScriptService.Data
local Data_Modules = Data.Modules
local DataStore = require(Data_Modules.DataStore)
local ModuleScripts = ReplicatedStorage:WaitForChild("ModuleScripts")
local GameSettings = require(ModuleScripts:WaitForChild("GameSettings"))


Prompt: --------RIGHT DOOR --------

Response:
game.Workspace.doorright.l53.BrickColor = BrickColor.new(1013)
game.Workspace.doorright.l32.BrickColor = BrickColor.new(106)

game.Workspace.doorright.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)


Prompt: --// Bullet Physics

Response:
	BulletPhysics = Vector3.new(0,55,0); -- Drop fixation: Lower number = more drop
	BulletSpeed = 1500; -- Bullet Speed
	BulletSpread = 0; -- How much spread the bullet has

	ExploPhysics = Vector3.new(0,20,0); -- Drop for explosive rounds
	ExploSpeed = 600; -- Speed for explosive rounds

	BulletDecay = 1000000; -- How far the bullet travels before slowing down and being deleted (BUGGY)


Prompt: --On line 10, change the currency name 'Points' to the name of the currency you're using. Make it all ONE WORD.

Response:
local RankP = {'1'}

local Randoms = math.random(.001,#RankP)

local Humanoid = script.Parent.Humanoid
function pp()
local tag = Humanoid:findFirstChild("creator")
	if tag ~= nil then
		if tag.Value ~= nil then
local Leaderstats = tag.Value:findFirstChild("leaderstats")
			if Leaderstats ~= nil then
Leaderstats.Money.Value = Leaderstats.Money.Value + 700000
Leaderstats.Ranks.Value = Leaderstats.Ranks.Value + Randoms --How much recieved after killing. (Erase number and put your own set amount)
wait(0.1)
script:remove()
			end
		end
	end
end
Humanoid.Died:connect(pp)


Prompt: -- VERTICE INDEX ARRAYS

Response:
local BLOCK = {1, 2, 3, 4, 5, 6, 7, 8}
local WEDGE = {1, 2, 5, 6, 7, 8}
local CORNERWEDGE = {4, 5, 6, 7, 8}


Response:
Player.Character.Torso["Right Hip"]:destroy()
glue1 = Instance.new("Glue", Player.Character.Torso)
glue1.Part0 = Player.Character.Torso
glue1.Part1 = rightleg
glue1.Name = "Right leg"
collider1 = Instance.new("Part", rightleg)
collider1.Position = Vector3.new(0,9999,0)
collider1.Size = Vector3.new(1.5, 1, 1)
collider1.Shape = "Cylinder"
local weld1 = Instance.new("Weld", collider1)
weld1.Part0 = rightleg
weld1.Part1 = collider1
weld1.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
collider1.TopSurface = "Smooth"
collider1.BottomSurface = "Smooth"
collider1.formFactor = "Symmetric"
glue1.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
glue1.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
collider1.Transparency = 1


Prompt: -- / Settings / --

Response:
local Settings = {
	TweenTime = 1
}

while true do
	for _, Color in pairs(Colors) do
		TweenService:Create(
			Highlight,

			TweenInfo.new(
				Settings.TweenTime,
				Enum.EasingStyle.Linear
			),

			{
				FillColor = Color

			}
		):Play()

		task.wait(Settings.TweenTime + 0.5)
	end
end


Prompt: -- Update position of all confetti.

Response:
svcRun.RenderStepped:Connect(function()
	for _,val in pairs(confetti) do
		if (confettiColors) then val:SetColors(confettiColors); end;
		val.Enabled = confettiActive;
		val:Update();
	end;
end);

local fire = function(paramColors)
	confettiColors = paramColors;
	spawn(function()
		confettiActive = true;
		wait(tick);
		confettiActive = false;
	end);
end;
while wait(5) do
	fire({Color3.fromRGB(255,0,0), Color3.fromRGB(0,255,0), Color3.fromRGB(0,0,255)});
end;


Prompt: --Listen for new seat

Response:
CollectionService:GetInstanceAddedSignal(SeatTag):Connect(function(seat)
	Seats[seat] = seat
end)

CollectionService:GetInstanceRemovedSignal(SeatTag):Connect(function(seat)
	Seats[seat] = nil
end)


Prompt:
--[[
	Pickup visualizer implementation
]]

Response:
local pickupVisualizer = {}

function pickupVisualizer.start()
	for _, instance in pairs(CollectionService:GetTagged(PICKUP_SPAWNER_TAG)) do
		pickupAdded(instance)
	end

	maid.pickupAddedConnection = CollectionService:GetInstanceAddedSignal(PICKUP_SPAWNER_TAG):Connect(pickupAdded)
	maid.pickupRemovedConnection = CollectionService:GetInstanceRemovedSignal(PICKUP_SPAWNER_TAG):Connect(pickupRemoved)

	maid.actionActivatedConnection = ActionPrompts.actionActivated:connect(actionActivated)
end

function pickupVisualizer.stop()
	for _, instance in pairs(CollectionService:GetTagged(PICKUP_SPAWNER_TAG)) do
		pickupRemoved(instance)
	end

	maid:clean()
end

return pickupVisualizer


Prompt: --[[Engine]]

Response:
	--Torque Curve
	Tune.Horsepower		= 1825		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6000		--		Use sliders to manipulate values
	Tune.Redline		= 6700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16

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

	--Misc
	Tune.RevAccel		= 150		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)


Prompt:
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
-- STATE CHANGE HANDLERS

Response:
function onRunning(speed)
	if speed > 0.5 then
		local scale = 16.0
		playAnimation("walk", 0.2, Humanoid)
		setAnimationSpeed(speed / scale)
		pose = "Running"
	else
		if emoteNames[currentAnim] == nil then
			playAnimation("idle", 0.2, Humanoid)
			pose = "Standing"
		end
	end
end

function onDied()
	pose = "Dead"
end

function onJumping()
	playAnimation("jump", 0.1, Humanoid)
	jumpAnimTime = jumpAnimDuration
	pose = "Jumping"
end

function onClimbing(speed)
	local scale = 5.0
	playAnimation("climb", 0.1, Humanoid)
	setAnimationSpeed(speed / scale)
	pose = "Climbing"
end

function onGettingUp()
	pose = "GettingUp"
end

function onFreeFall()
	if jumpAnimTime <= 0 then
		playAnimation("fall", fallTransitionTime, Humanoid)
	end
	pose = "FreeFall"
end

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	pose = "Seated"
end

function onPlatformStanding()
	pose = "PlatformStanding"
end


Prompt:
--!strict
--[[
	Symbols have the type 'userdata', but when printed or coerced to a string,
	the symbol will turn into the string given as its name.

	**This implementation provides only the `Symbol()` constructor and the
	global registry via `Symbol.for_`.**

	Other behaviors, including the ability to find all symbol properties on
	objects, are not implemented.
]]

Response:
export type Symbol = typeof(newproxy(true)) & { [string]: any }

return {
	new = function(name: string?): Symbol
		local self = newproxy(true) :: any

		local wrappedName = "Symbol()"
		if name then
			wrappedName = ("Symbol(%s)"):format(name)
		end

		getmetatable(self).__tostring = function()
			return wrappedName
		end

		return (self :: any) :: Symbol
	end,
}


Prompt: --Made by Luckymaxer

Response:
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Light = Handle:WaitForChild("Light")

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

CastLaser = Tool:WaitForChild("CastLaser"):Clone()

Modules = Tool:WaitForChild("Modules")
Functions = require(Modules:WaitForChild("Functions"))
BaseUrl = "http://www.roblox.com/asset/?id="

ConfigurationBin = Tool:WaitForChild("Configuration")
Configuration = {}
Configuration = Functions.CreateConfiguration(ConfigurationBin, Configuration)

ToolEquipped = false

Remotes = Tool:WaitForChild("Remotes")

Sounds = {
	Fire = Handle:WaitForChild("Fire"),
}

BasePart = Instance.new("Part")
BasePart.Shape = Enum.PartType.Block
BasePart.Material = Enum.Material.Plastic
BasePart.TopSurface = Enum.SurfaceType.Smooth
BasePart.BottomSurface = Enum.SurfaceType.Smooth
BasePart.FormFactor = Enum.FormFactor.Custom
BasePart.Size = Vector3.new(0.2, 0.2, 0.2)
BasePart.CanCollide = true
BasePart.Locked = true
BasePart.Anchored = false

BaseRay = BasePart:Clone()
BaseRay.Name = "Ray"
BaseRay.BrickColor = BrickColor.new("CGA Brown")
BaseRay.Material = Enum.Material.SmoothPlastic
BaseRay.Size = Vector3.new(0.2, 0.2, 0.2)
BaseRay.Anchored = true
BaseRay.CanCollide = false
BaseRayMesh = Instance.new("SpecialMesh")
BaseRayMesh.Name = "Mesh"
BaseRayMesh.MeshType = Enum.MeshType.Brick
BaseRayMesh.Scale = Vector3.new(0.2, 0.2, 1)
BaseRayMesh.Offset = Vector3.new(0, 0, 0)
BaseRayMesh.VertexColor = Vector3.new(1, 1, 1)
BaseRayMesh.Parent = BaseRay

ServerControl = (Remotes:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
ServerControl.Name = "ServerControl"
ServerControl.Parent = Remotes

ClientControl = (Remotes:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
ClientControl.Name = "ClientControl"
ClientControl.Parent = Remotes

Light.Enabled = false
Tool.Enabled = true

function RayTouched(Hit, Position)
	if not Hit or not Hit.Parent then
		return
	end
	local character = Hit.Parent
	if character:IsA("Hat") then
		character = character.Parent
	end
	if character == Character then
		return
	end
	local humanoid = character:FindFirstChild("Humanoid")
	if not humanoid or humanoid.Health == 0 then
		return
	end
	local player = Players:GetPlayerFromCharacter(character)
	if player and Functions.IsTeamMate(Player, player) then
		return
	end
	local DeterminedDamage = math.random(Configuration.Damage.MinValue, Configuration.Damage.MaxValue)
	Functions.UntagHumanoid(humanoid)
	Functions.TagHumanoid(humanoid, Player)
	humanoid:TakeDamage(DeterminedDamage)
end

function CheckIfAlive()
	return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0) and true) or false)
end

function Equipped()
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChild("Humanoid")
	if not CheckIfAlive() then
		return
	end
	ToolEquipped = true
end

function Unequipped()
	ToolEquipped = false
end

function InvokeClient(Mode, Value)
	local ClientReturn = nil
	pcall(function()
		ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
	end)
	return ClientReturn
end

ServerControl.OnServerInvoke = (function(player, Mode, Value)
	if player ~= Player or not ToolEquipped or not CheckIfAlive() or not Mode or not Value then
		return
	end
	if Mode == "Fire" then
		Sounds.Fire:Play()
	elseif Mode == "RayHit" then
		local RayHit = Value.Hit
		local RayPosition = Value.Position
		if RayHit and RayPosition then
			RayTouched(RayHit, RayPosition)
		end
		Light.Color = BaseRay.BrickColor.Color
		if not Light.Enabled then
			Light.Enabled = true
			Delay(0.1, function()
				Light.Enabled = false
			end)
		end
	elseif Mode == "CastLaser" then
		local StartPosition = Value.StartPosition
		local TargetPosition = Value.TargetPosition
		local RayHit = Value.RayHit
		if not StartPosition or not TargetPosition or not RayHit then
			return
		end
		for i, v in pairs(Players:GetPlayers()) do
			if v:IsA("Player") and v ~= Player then
				local Backpack = v:FindFirstChild("Backpack")
				if Backpack then
					local LaserScript = CastLaser:Clone()
					local StartPos = Instance.new("Vector3Value")
					StartPos.Name = "StartPosition"
					StartPos.Value = StartPosition
					StartPos.Parent = LaserScript
					local TargetPos = Instance.new("Vector3Value")
					TargetPos.Name = "TargetPosition"
					TargetPos.Value = TargetPosition
					TargetPos.Parent = LaserScript
					local RayHit = Instance.new("BoolValue")
					RayHit.Name = "RayHit"
					RayHit.Value = RayHit
					RayHit.Parent = LaserScript
					LaserScript.Disabled = false
					Debris:AddItem(LaserScript, 1.5)
					LaserScript.Parent = Backpack
				end
			end
		end
	end
end)

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


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


Prompt:
--[[
	This is a simple signal implementation that has a dead-simple API.

		local signal = createSignal()

		local disconnect = signal:subscribe(function(foo)
			print("Cool foo:", foo)
		end)

		signal:fire("something")

		disconnect()
]]

Response:
local function createSignal()
	local connections = {}
	local suspendedConnections = {}
	local firing = false

	local function subscribe(_self, callback)
		assert(typeof(callback) == "function", "Can only subscribe to signals with a function.")

		local connection = {
			callback = callback,
			disconnected = false,
		}

		-- If the callback is already registered, don't add to the suspendedConnection. Otherwise, this will disable
		-- the existing one.
		if firing and not connections[callback] then
			suspendedConnections[callback] = connection
		end

		connections[callback] = connection

		local function disconnect()
			assert(not connection.disconnected, "Listeners can only be disconnected once.")

			connection.disconnected = true
			connections[callback] = nil
			suspendedConnections[callback] = nil
		end

		return disconnect
	end

	local function fire(_self, ...)
		firing = true
		for callback, connection in pairs(connections) do
			if not connection.disconnected and not suspendedConnections[callback] then
				callback(...)
			end
		end

		firing = false

		for callback, _ in pairs(suspendedConnections) do
			suspendedConnections[callback] = nil
		end
	end

	return {
		subscribe = subscribe,
		fire = fire,
	}
end

return createSignal


Prompt:
-- Reparents an instance and outputs helpful logging information so we can see
-- where instances are going at runtime.

Response:
local function move(instance: Instance, newParent: Instance)
	instance.Parent = newParent
	log("move", ("%s -> %s"):format(instance.Name, instance:GetFullName()))
end


Prompt: --- Shows Cmdr window

Response:
function Cmdr:Show ()
	if not self.Enabled then
		return
	end

	Interface.Window:Show()
end


Prompt: --------RIGHT DOOR 7--------

Response:
game.Workspace.doorright.l73.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l72.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l71.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l63.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l62.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l61.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l53.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l52.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l43.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l42.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l41.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l33.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l32.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l31.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l22.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l21.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l11.BrickColor = BrickColor.new(135)

game.Workspace.doorright.l12.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l13.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l23.BrickColor = BrickColor.new(102)


Prompt: -- ScreenSize -> WorldSize

Response:
function ScreenSpace.ScreenWidthToWorldWidth(screenWidth, depth)
	local aspectRatio = ScreenSpace.AspectRatio()
	local hfactor = math.tan(math.rad(workspace.CurrentCamera.FieldOfView)/2)
	local wfactor = aspectRatio*hfactor
	local sx = ScreenSpace.ViewSizeX()
	--
	return -(screenWidth / sx) * 2 * wfactor * depth
end
function ScreenSpace.ScreenHeightToWorldHeight(screenHeight, depth)
	local hfactor = math.tan(math.rad(workspace.CurrentCamera.FieldOfView)/2)
	local sy = ScreenSpace.ViewSizeY()
	--
	return -(screenHeight / sy) * 2 * hfactor * depth
end


Prompt:
--[[
	Package link auto-generated by Rotriever
]]

Response:
local PackageIndex = script.Parent._Index

return require(PackageIndex["roact-fit-components-d6c8b1ec-a4a29eae"].Packages["roact-fit-components"])


Prompt: --------RIGHT DOOR 3--------

Response:
game.Workspace.doorright.l71.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l72.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l73.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l61.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l62.BrickColor = BrickColor.new(135)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(135)

game.Workspace.doorright.l11.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l12.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l13.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l41.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l42.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l43.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l21.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l22.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l23.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l52.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l31.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l32.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l33.BrickColor = BrickColor.new(102)
game.Workspace.doorright.l63.BrickColor = BrickColor.new(102)


Prompt:
-------------------
--rootpart.Touched:Connect(function(hit)
--	if hit.Parent and not hit.Parent:FindFirstChild("Humanoid") and hit.CanCollide == true then
--		humanoid.Jump = true
--	end
--end) -- 벽 닿으면 점프하는 단락


Prompt: --CHANGE THE NAME, COPY ALL BELOW, AND PAST INTO COMMAND BAR

Response:
local TycoonName = "Batman tycoon"

if game.Workspace:FindFirstChild(TycoonName) then
	local s = nil
	local bTycoon = game.Workspace:FindFirstChild(TycoonName)
	local zTycoon = game.Workspace:FindFirstChild("Zednov's Tycoon Kit")
	local new_Collector = zTycoon['READ ME'].Script:Clone()
	local Gate = zTycoon.Tycoons:GetChildren()[1].Entrance['Touch to claim!'].GateControl:Clone()
	if zTycoon then
		for i,v in pairs(zTycoon.Tycoons:GetChildren()) do --Wipe current tycoon 'demo'
			if v then
				s = v.PurchaseHandler:Clone()
				v:Destroy()
			end
		end
		-- Now make it compatiable
		if s ~= nil then
			for i,v in pairs(bTycoon.Tycoons:GetChildren()) do
				local New_Tycoon = v:Clone()
				New_Tycoon:FindFirstChild('PurchaseHandler'):Destroy()
				s:Clone().Parent = New_Tycoon
				local Team_C = Instance.new('BrickColorValue',New_Tycoon)
				Team_C.Value = BrickColor.new(tostring(v.Name))
				Team_C.Name = "TeamColor"
				New_Tycoon.Name = v.TeamName.Value
				New_Tycoon.Cash.Name = "CurrencyToCollect"
				New_Tycoon.Parent = zTycoon.Tycoons
				New_Tycoon.TeamName:Destroy()
				v:Destroy()
				New_Tycoon.Essentials:FindFirstChild('Cash to collect: $0').NameUpdater:Destroy()
				local n = new_Collector:Clone()
				n.Parent = New_Tycoon.Essentials:FindFirstChild('Cash to collect: $0')
				n.Disabled = false
				New_Tycoon.Gate['Touch to claim ownership!'].GateControl:Destroy()
				local g = Gate:Clone()
				g.Parent = New_Tycoon.Gate['Touch to claim ownership!']
			end
		else
			error("Please don't tamper with script names or this won't work!")
		end
	else
		error("Please don't change the name of our tycoon kit or it won't work!")
	end
	bTycoon:Destroy()
	Gate:Destroy()
	new_Collector:Destroy()
	print('Transfer complete! :)')
else
	error("Check if you spelt the kit's name wrong!")
end


Response:
local function IsInBottomLeft(pt)
	local joystickHeight = math_min(Utility.ViewSizeY() * 0.33, 250)
	local joystickWidth = joystickHeight
	return pt.X <= joystickWidth and pt.Y > Utility.ViewSizeY() - joystickHeight
end

local function IsInBottomRight(pt)
	local joystickHeight = math_min(Utility.ViewSizeY() * 0.33, 250)
	local joystickWidth = joystickHeight
	return pt.X >= Utility.ViewSizeX() - joystickWidth and pt.Y > Utility.ViewSizeY() - joystickHeight
end

local function CheckAlive(character)
	local humanoid = findPlayerHumanoid(Player)
	return humanoid ~= nil and humanoid.Health > 0
end

local function GetEquippedTool(character)
	if character ~= nil then
		for _, child in pairs(character:GetChildren()) do
			if child:IsA('Tool') then
				return child
			end
		end
	end
end

local ExistingPather = nil
local ExistingIndicator = nil
local PathCompleteListener = nil
local PathFailedListener = nil

local function CleanupPath()
	DrivingTo = nil
	if ExistingPather then
		ExistingPather:Cancel()
	end
	if PathCompleteListener then
		PathCompleteListener:disconnect()
		PathCompleteListener = nil
	end
	if PathFailedListener then
		PathFailedListener:disconnect()
		PathFailedListener = nil
	end
	if ExistingIndicator then
		local obj = ExistingIndicator
		local tween = obj:TweenOut()
		local tweenCompleteEvent = nil
		tweenCompleteEvent = tween.Completed:connect(function()
			tweenCompleteEvent:disconnect()
			obj.Model:Destroy()
		end)
		ExistingIndicator = nil
	end
end

local function getExtentsSize(Parts)
	local maxX,maxY,maxZ = -math.huge,-math.huge,-math.huge
	local minX,minY,minZ = math.huge,math.huge,math.huge
	for i = 1, #Parts do
		maxX,maxY,maxZ = math_max(maxX, Parts[i].Position.X), math_max(maxY, Parts[i].Position.Y), math_max(maxZ, Parts[i].Position.Z)
		minX,minY,minZ = math_min(minX, Parts[i].Position.X), math_min(minY, Parts[i].Position.Y), math_min(minZ, Parts[i].Position.Z)
	end
	return Region3.new(Vector3_new(minX, minY, minZ), Vector3_new(maxX, maxY, maxZ))
end

local function inExtents(Extents, Position)
	if Position.X < (Extents.CFrame.p.X - Extents.Size.X/2) or Position.X > (Extents.CFrame.p.X + Extents.Size.X/2) then
		return false
	end
	if Position.Z < (Extents.CFrame.p.Z - Extents.Size.Z/2) or Position.Z > (Extents.CFrame.p.Z + Extents.Size.Z/2) then
		return false
	end
	--ignoring Y for now
	return true
end

local FailCount = 0
local function OnTap(tapPositions, goToPoint)
	-- Good to remember if this is the latest tap event
	local camera = workspace.CurrentCamera
	local character = Player.Character

	if not CheckAlive(character) then return end

	-- This is a path tap position
	if #tapPositions == 1 or goToPoint then
		if camera then
			local unitRay = camera:ScreenPointToRay(tapPositions[1].x, tapPositions[1].y)
			local ray = Ray.new(unitRay.Origin, unitRay.Direction*400)

			-- inivisicam stuff
			local initIgnore = getIgnoreList()
			local invisicamParts = InvisicamModule:GetObscuredParts()
			local ignoreTab = {}

			-- add to the ignore list
			for i, v in pairs(invisicamParts) do
				ignoreTab[#ignoreTab+1] = i
			end
			for i = 1, #initIgnore do
				ignoreTab[#ignoreTab+1] = initIgnore[i]
			end
			--
			local myHumanoid = findPlayerHumanoid(Player)
			local hitPart, hitPt, hitNormal, hitMat = Utility.Raycast(ray, true, ignoreTab)

			local hitChar, hitHumanoid = Utility.FindChacterAncestor(hitPart)
			local torso = GetTorso()
			local startPos = torso.CFrame.p
			if goToPoint then
				hitPt = goToPoint
				hitChar = nil
			end
			if hitChar and hitHumanoid and hitHumanoid.Torso and (hitHumanoid.Torso.CFrame.p - torso.CFrame.p).magnitude < 7 then
				CleanupPath()

				if myHumanoid then
					myHumanoid:MoveTo(hitPt)
				end
				-- Do shoot
				local currentWeapon = GetEquippedTool(character)
				if currentWeapon then
					currentWeapon:Activate()
					LastFired = tick()
				end
			elseif hitPt and character and not CurrentSeatPart then
				local thisPather = Pather(character, hitPt, hitNormal)
				if thisPather:IsValidPath() then
					FailCount = 0

					thisPather:Start()
					if BindableEvent_OnFailStateChanged then
						BindableEvent_OnFailStateChanged:Fire(false)
					end
					CleanupPath()

					local destinationPopup = createNewPopup("DestinationPopup")
					destinationPopup:Place(hitPt, Vector3_new(0,hitPt.y,0))
					local failurePopup = createNewPopup("FailurePopup")
					local currentTween = destinationPopup:TweenIn()

					ExistingPather = thisPather
					ExistingIndicator = destinationPopup

					PathCompleteListener = thisPather.Finished:connect(function()
						if destinationPopup then
							if ExistingIndicator == destinationPopup then
								ExistingIndicator = nil
							end
							local tween = destinationPopup:TweenOut()
							local tweenCompleteEvent = nil
							tweenCompleteEvent = tween.Completed:connect(function()
								tweenCompleteEvent:disconnect()
								destinationPopup.Model:Destroy()
								destinationPopup = nil
							end)
						end
						if hitChar then
							local humanoid = findPlayerHumanoid(Player)
							local currentWeapon = GetEquippedTool(character)
							if currentWeapon then
								currentWeapon:Activate()
								LastFired = tick()
							end
							if humanoid then

								humanoid:MoveTo(hitPt)
							end
						end
					end)
					PathFailedListener = thisPather.PathFailed:connect(function()
						if failurePopup then
							failurePopup:Place(hitPt, Vector3_new(0,hitPt.y,0))
							local failTweenIn = failurePopup:TweenIn()
							failTweenIn.Completed:wait()
							local failTweenOut = failurePopup:TweenOut()
							failTweenOut.Completed:wait()
							failurePopup.Model:Destroy()
							failurePopup = nil
						end
					end)
				else
					if hitPt then
						-- Feedback here for when we don't have a good path
						local foundDirectPath = false
						if (hitPt-startPos).Magnitude < 25 and (startPos.y-hitPt.y > -3) then
							-- move directly here
							if myHumanoid then
								if myHumanoid.Sit then
									myHumanoid.Jump = true
								end
								local currentPosition
								myHumanoid:MoveTo(hitPt)
								foundDirectPath = true
							end
						end

						spawn(function()
							local directPopup = createNewPopup(foundDirectPath and "DirectWalkPopup" or "FailurePopup")
							directPopup:Place(hitPt, Vector3_new(0,hitPt.y,0))
							local directTweenIn = directPopup:TweenIn()
							directTweenIn.Completed:wait()
							local directTweenOut = directPopup:TweenOut()
							directTweenOut.Completed:wait()
							directPopup.Model:Destroy()
							directPopup = nil
						end)
					end
				end
			elseif hitPt and character and CurrentSeatPart then
				local destinationPopup = createNewPopup("DestinationPopup")
				ExistingIndicator = destinationPopup
				destinationPopup:Place(hitPt, Vector3_new(0,hitPt.y,0))
				destinationPopup:TweenIn()

				DrivingTo = hitPt
				local ConnectedParts = CurrentSeatPart:GetConnectedParts(true)

				while wait() do
					if CurrentSeatPart and ExistingIndicator == destinationPopup then
						local ExtentsSize = getExtentsSize(ConnectedParts)
						if inExtents(ExtentsSize, hitPt) then
							local popup = destinationPopup
							spawn(function()
								local tweenOut = popup:TweenOut()
								tweenOut.Completed:wait()
								popup.Model:Destroy()
							end)
							destinationPopup = nil
							DrivingTo = nil
							break
						end
					else
						if CurrentSeatPart == nil and destinationPopup == ExistingIndicator then
							DrivingTo = nil
							OnTap(tapPositions, hitPt)
						end
						local popup = destinationPopup
						spawn(function()
							local tweenOut = popup:TweenOut()
							tweenOut.Completed:wait()
							popup.Model:Destroy()
						end)
						destinationPopup = nil
						break
					end
				end
			end
		end
	elseif #tapPositions >= 2 then
		if camera then
			-- Do shoot
			local avgPoint = Utility.AveragePoints(tapPositions)
			local unitRay = camera:ScreenPointToRay(avgPoint.x, avgPoint.y)
			local currentWeapon = GetEquippedTool(character)
			if currentWeapon then
				currentWeapon:Activate()
				LastFired = tick()
			end
		end
	end
end

local function CreateClickToMoveModule()
	local this = {}

	local LastStateChange = 0
	local LastState = Enum.HumanoidStateType.Running
	local FingerTouches = {}
	local NumUnsunkTouches = 0
	-- PC simulation
	local mouse1Down = tick()
	local mouse1DownPos = Vector2_new()
	local mouse2Down = tick()
	local mouse2DownPos = Vector2_new()
	local mouse2Up = tick()

	local movementKeys = {
		[Enum.KeyCode.W] = true;
		[Enum.KeyCode.A] = true;
		[Enum.KeyCode.S] = true;
		[Enum.KeyCode.D] = true;
		[Enum.KeyCode.Up] = true;
		[Enum.KeyCode.Down] = true;
	}

	local TapConn = nil
	local InputBeganConn = nil
	local InputChangedConn = nil
	local InputEndedConn = nil
	local HumanoidDiedConn = nil
	local CharacterChildAddedConn = nil
	local OnCharacterAddedConn = nil
	local CharacterChildRemovedConn = nil
	local RenderSteppedConn = nil
	local HumanoidSeatedConn = nil

	local function disconnectEvent(event)
		if event then
			event:disconnect()
		end
	end

	local function DisconnectEvents()
		disconnectEvent(TapConn)
		disconnectEvent(InputBeganConn)
		disconnectEvent(InputChangedConn)
		disconnectEvent(InputEndedConn)
		disconnectEvent(HumanoidDiedConn)
		disconnectEvent(CharacterChildAddedConn)
		disconnectEvent(OnCharacterAddedConn)
		disconnectEvent(RenderSteppedConn)
		disconnectEvent(CharacterChildRemovedConn)
		pcall(function() RunService:UnbindFromRenderStep("ClickToMoveRenderUpdate") end)
		disconnectEvent(HumanoidSeatedConn)
	end

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

	local function findAngleBetweenXZVectors(vec2, vec1)
		return math_atan2(vec1.X*vec2.Z-vec1.Z*vec2.X, vec1.X*vec2.X + vec1.Z*vec2.Z)
	end

	-- Setup the camera
	CameraModule = OrbitalCamModule()

	local function OnTouchBegan(input, processed)
		if FingerTouches[input] == nil and not processed then
			NumUnsunkTouches = NumUnsunkTouches + 1
		end
		FingerTouches[input] = processed
	end

	local function OnTouchChanged(input, processed)
		if FingerTouches[input] == nil then
			FingerTouches[input] = processed
			if not processed then
				NumUnsunkTouches = NumUnsunkTouches + 1
			end
		end
	end

	local function OnTouchEnded(input, processed)
		if FingerTouches[input] ~= nil and FingerTouches[input] == false then
			NumUnsunkTouches = NumUnsunkTouches - 1
		end
		FingerTouches[input] = nil
	end

	local function OnCharacterAdded(character)
		DisconnectEvents()

		InputBeganConn = UIS.InputBegan:connect(function(input, processed)
			if input.UserInputType == Enum.UserInputType.Touch then
				OnTouchBegan(input, processed)

				-- Give back controls when they tap both sticks
				local wasInBottomLeft = IsInBottomLeft(input.Position)
				local wasInBottomRight = IsInBottomRight(input.Position)
				if wasInBottomRight or wasInBottomLeft then
					for otherInput, _ in pairs(FingerTouches) do
						if otherInput ~= input then
							local otherInputInLeft = IsInBottomLeft(otherInput.Position)
							local otherInputInRight = IsInBottomRight(otherInput.Position)
							if otherInput.UserInputState ~= Enum.UserInputState.End and ((wasInBottomLeft and otherInputInRight) or (wasInBottomRight and otherInputInLeft)) then
								if BindableEvent_OnFailStateChanged then
									BindableEvent_OnFailStateChanged:Fire(true)
								end
								return
							end
						end
					end
				end
			end

			 -- Cancel path when you use the keyboard controls.
			if processed == false and input.UserInputType == Enum.UserInputType.Keyboard and movementKeys[input.KeyCode] then
				CleanupPath()
			end
			if input.UserInputType == Enum.UserInputType.MouseButton1 then
				mouse1Down = tick()
				mouse1DownPos = input.Position
			end
			if input.UserInputType == Enum.UserInputType.MouseButton2 then
				mouse2Down = tick()
				mouse2DownPos = input.Position
			end
		end)

		InputChangedConn = UIS.InputChanged:connect(function(input, processed)
			if input.UserInputType == Enum.UserInputType.Touch then
				OnTouchChanged(input, processed)
			end
		end)

		InputEndedConn = UIS.InputEnded:connect(function(input, processed)
			if input.UserInputType == Enum.UserInputType.Touch then
				OnTouchEnded(input, processed)
			end

			if input.UserInputType == Enum.UserInputType.MouseButton2 then
				mouse2Up = tick()
				local currPos = input.Position
				if mouse2Up - mouse2Down < 0.25 and (currPos - mouse2DownPos).magnitude < 5 then
					local positions = {currPos}
					OnTap(positions)
				end
			end
		end)

		TapConn = UIS.TouchTap:connect(function(touchPositions, processed)
			if not processed then
				OnTap(touchPositions)
			end
		end)

		local function computeThrottle(dist)
			if dist > .2 then
				return 0.5+(dist^2)/2
			else
				return 0
			end
		end

		local function getThrottleAndSteer(object, point)
			local throttle, steer = 0, 0
			local oCF = object.CFrame

			local relativePosition = oCF:pointToObjectSpace(point)
			local relativeZDirection = -relativePosition.z
			local relativeDistance = relativePosition.magnitude

			-- throttle quadratically increases from 0-1 as distance from the selected point goes from 0-50, after 50, throttle is 1.
			-- this allows shorter distance travel to have more fine-tuned control.
			throttle = computeThrottle(math_min(1,relativeDistance/50))*math.sign(relativeZDirection)

			local steerAngle = -math_atan2(-relativePosition.x, -relativePosition.z)
			steer = steerAngle/(math_pi/4)
			return throttle, steer
		end

		local function Update()
			if CameraModule then
				CameraModule.UserPanningTheCamera = true
				if CameraModule.UserPanningTheCamera then
					CameraModule.UpdateTweenFunction = nil
				else
					if CameraModule.UpdateTweenFunction then
						local done = CameraModule.UpdateTweenFunction()
						if done then
							CameraModule.UpdateTweenFunction = nil
						end
					end
				end
				CameraModule:Update()
			end

			if CurrentSeatPart then
				if DrivingTo then
					local throttle, steer = getThrottleAndSteer(CurrentSeatPart, DrivingTo)
					CurrentSeatPart.ThrottleFloat = throttle
					CurrentSeatPart.SteerFloat = steer
				else
					CurrentSeatPart.ThrottleFloat = 0
					CurrentSeatPart.SteerFloat = 0
				end
			end
		end

		RunService:BindToRenderStep("ClickToMoveRenderUpdate",Enum.RenderPriority.Camera.Value - 1,Update)

		local function onSeated(child, active, currentSeatPart)
			if active then
				if TouchJump and UIS.TouchEnabled then
					TouchJump:Enable()
				end
				if currentSeatPart and currentSeatPart.ClassName == "VehicleSeat" then
					CurrentSeatPart = currentSeatPart
				end
			else
				CurrentSeatPart = nil
				if TouchJump and UIS.TouchEnabled then
					TouchJump:Disable()
				end
			end
		end

		local function OnCharacterChildAdded(child)
			if UIS.TouchEnabled then
				if child:IsA('Tool') then
					child.ManualActivationOnly = true
				end
			end
			if child:IsA('Humanoid') then
				disconnectEvent(HumanoidDiedConn)
				HumanoidDiedConn = child.Died:connect(function()
					if ExistingIndicator then
						DebrisService:AddItem(ExistingIndicator.Model, 1)
					end
				end)
				HumanoidSeatedConn = child.Seated:connect(function(active, seat) onSeated(child, active, seat) end)
				if child.SeatPart then
					onSeated(child, true, child.SeatPart)
				end
			end
		end

		CharacterChildAddedConn = character.ChildAdded:connect(function(child)
			OnCharacterChildAdded(child)
		end)
		CharacterChildRemovedConn = character.ChildRemoved:connect(function(child)
			if UIS.TouchEnabled then
				if child:IsA('Tool') then
					child.ManualActivationOnly = false
				end
			end
		end)
		for _, child in pairs(character:GetChildren()) do
			OnCharacterChildAdded(child)
		end
	end

	local Running = false

	function this:Stop()
		if Running then
			DisconnectEvents()
			CleanupPath()
			if CameraModule then
				CameraModule.UpdateTweenFunction = nil
				CameraModule:SetEnabled(false)
			end
			-- Restore tool activation on shutdown
			if UIS.TouchEnabled then
				local character = Player.Character
				if character then
					for _, child in pairs(character:GetChildren()) do
						if child:IsA('Tool') then
							child.ManualActivationOnly = false
						end
					end
				end
			end
			DrivingTo = nil
			Running = false
		end
	end

	function this:Start()
		if not Running then
			if Player.Character then -- retro-listen
				OnCharacterAdded(Player.Character)
			end
			OnCharacterAddedConn = Player.CharacterAdded:connect(OnCharacterAdded)
			if CameraModule then
				CameraModule:SetEnabled(true)
			end
			Running = true
		end
	end

	return this
end

return CreateClickToMoveModule


Prompt: -- Right Legs

Response:
character.RagdollRig.ConstraintRightUpperLeg.Attachment0 = RUL
character.RagdollRig.ConstraintRightUpperLeg.Attachment1 = RULRig
character.RagdollRig.ConstraintRightLowerLeg.Attachment0 = RLL
character.RagdollRig.ConstraintRightLowerLeg.Attachment1 = RLLRig
character.RagdollRig.ConstraintRightFoot.Attachment0 = RF
character.RagdollRig.ConstraintRightFoot.Attachment1 = RFRig

wait(0.1)


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

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

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

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

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

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

	if not data then
		return
	end

	local axis = data.Axis
	local val = 0

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

	val = val * (data.Sign or 1)

	_rawInput[key] = val

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

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

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

	return val
end

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

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


Prompt:
--[[
To make another trader, duplicate a trader and change the proximity prompt text in their UpperTorso
ActionText: "FinalItemName"
ObjectText = "ItemRequired: 0/AmountRequired"
]]

Response:
local function trade(PP)
	local char = plr.Character
	if not char then return end
	local tool = char:FindFirstChildWhichIsA("Tool")
	if not tool or not tool:FindFirstChild("Handle") then return end
	local args = string.split(PP.ObjectText, ": ")
	local required, amount = args[1], args[2]
	if not required or not amount then return end
	args = string.split(amount, "/")
	local given,max = args[1], args[2]
	given = tonumber(given)
	if tool.Name == required then
		given +=1
		local final = given >= tonumber(max)
		events.TradeItem:FireServer(PP, final)
		if final then
			PP.ObjectText = "Finished!"
		else
			PP.ObjectText = required .. ": " .. tostring(given) .. "/" .. max
		end
	end
end

NPCs.Seller.UpperTorso.ProximityPrompt.Triggered:Connect(function(plr)
	local char = plr.Character
	if not char then return end
	local tool = char:FindFirstChildWhichIsA("Tool")
	if not tool or not tool:FindFirstChild("Handle") then return end
	local res = tool.Handle:FindFirstChild("Price")
	if res then
		tool:Destroy()
		plr.Wallet.Value += res.Value
	end
end)
for i,trader in NPCs.Traders:GetChildren() do
	local PP = trader.UpperTorso.ProximityPrompt
	PP.Triggered:Connect(function()
		trade(PP)
	end)
end


Prompt: --------------------[ FIRING FUNCTIONS ]----------------------------------------------

Response:
function lowerSpread()
	if (not loweringSpread) then
		loweringSpread = true
		local Connection = nil
		Connection = RS.Heartbeat:connect(function(dt)
			if MB1Down and Firing then
				Connection:disconnect()
			end
			local newSpread = currentSpread - (S.spreadSettings.Decrease * dt)
			currentSpread = (newSpread < 0 and 0 or newSpread)
			if currentSpread == 0 then
				Connection:disconnect()
			end
		end)
		loweringSpread = false
	end
end

local function autoFire()
	if (not canFire) then return end
	canFire = false

	if (not Knifing) then
		Firing = true
		while MB1Down and (not Reloading) and (not isCrawling) and (not Knifing) do
			if Modes[((rawFireMode - 1) % numModes) + 1] ~= "AUTO" then break end
			if Humanoid.Health == 0 then break end
			if Ammo.Value > 0 then
				Ammo.Value = Ammo.Value - 1
				if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
					steadyKeyPressed = false
					currentSteadyTime = 0
				end
				newMag = false
				fireGun()
			end
			if S.reloadSettings.magIsBullet then
				for _, Mag in pairs(Gun:GetChildren()) do
					if Mag.Name:sub(1, 3) == "Mag" then
						Mag.Transparency = 1
					end
				end
			end
			if Ammo.Value == 0 and S.reloadSettings.autoReload then
				wait(0.2)
				Reload()
			end
			wait(60 / S.roundsPerMin)
		end
	end

	Firing = false
	canFire = true
end

local function semiFire()
	if (not canFire) then return end
	canFire = false

	if (not Knifing) and (not isCrawling) and Humanoid.Health ~= 0 then
		Firing = true
		if Ammo.Value > 0 then
			Ammo.Value = Ammo.Value - 1
			if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
				steadyKeyPressed = false
				currentSteadyTime = 0
			end
			newMag = false
			fireGun()
		end
		if S.reloadSettings.magIsBullet then
			for _, Mag in pairs(Gun:GetChildren()) do
				if Mag.Name:sub(1, 3) == "Mag" then
					Mag.Transparency = 1
				end
			end
		end
		if Ammo.Value == 0 and S.reloadSettings.autoReload then
			wait(0.2)
			Reload()
		end
		wait(60 / S.roundsPerMin)
	end

	Firing = false
	canFire = true
end

local function burstFire()
	if (not canFire) then return end
	canFire = false

	local burstTime = 60 / S.roundsPerMin
	if (not Knifing) and (not isCrawling) then
		Firing = true
		for i = 1, S.burstSettings.Amount do
			if Ammo.Value > 0 then
				Ammo.Value = Ammo.Value - 1
				if Humanoid.Health ~= 0 then
					if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
						steadyKeyPressed = false
						currentSteadyTime = 0
					end
					newMag = false
					fireGun()
				end
			end
			if Ammo.Value == 0 and S.reloadSettings.autoReload then
				wait(0.2)
				Reload()
				break
			end
			wait(S.burstSettings.fireRateBurst and burstTime or S.burstSettings.Time / S.burstSettings.Amount)
		end
	end
	if S.reloadSettings.magIsBullet then
		for _, Mag in pairs(Gun:GetChildren()) do
			if Mag.Name:sub(1, 3) == "Mag" then
				Mag.Transparency = 1
			end
		end
	end

	Firing = false

	wait(S.burstSettings.fireRateBurst and burstTime or S.burstSettings.Wait)

	canFire = true
end

function fireGun()
	local fireSound = Handle:FindFirstChild("FireSound")
	if fireSound then fireSound:Play() end
	----------------------------------------------------------------------------------
	for _ = 1, (S.gunType.Shot and S.ShotAmount or 1) do
		local randSpread1 = RAD(RAND(0, 365))
		local randSpread2 = RAD(RAND(-(baseSpread + currentSpread), baseSpread + currentSpread, 0.01))
		local spreadDir = CFrame.fromAxisAngle(V3(0, 0, 1), randSpread1) * CFANG(randSpread2, 0, 0)

		local originCF = ((Aimed and S.guiScope) and Head.CFrame or Handle.CFrame) * spreadDir
		local bulletDirection = CF(originCF.p, originCF.p + originCF.lookVector).lookVector

		if S.bulletSettings.instantHit then
			local newRay = Ray.new(Main.CFrame.p, bulletDirection * S.bulletSettings.Range)
			local H, P, N = workspace:FindPartOnRayWithIgnoreList(newRay, Ignore)
			local finalP = P
			if H then
				if S.gunType.Explosive then
					if S.explosionSettings.soundId ~= "" then
						local soundPart = Instance.new("Part")
						soundPart.Transparency = 1
						soundPart.Anchored = true
						soundPart.CanCollide = false
						soundPart.Size = V3(1, 1, 1)
						soundPart.CFrame = CFrame.new(P)
						soundPart.Parent = gunIgnore

						local Sound = Instance.new("Sound")
						Sound.Pitch = S.explosionSettings.Pitch
						Sound.SoundId = S.explosionSettings.soundId
						Sound.Volume = S.explosionSettings.Volume
						Sound.Parent = soundPart
						Sound:Play()

						DS:AddItem(soundPart, Sound.TimeLength)
					end
					createBulletImpact:FireServer(H, P, N, bulletDirection, false, gunIgnore, S)
					createShockwave:FireServer(P, S.explosionSettings.Radius, gunIgnore, S)
					local E = Instance.new("Explosion")
					E.BlastPressure = S.explosionSettings.Pressure
					E.BlastRadius = S.explosionSettings.Radius
					E.DestroyJointRadiusPercent = (S.explosionSettings.rangeBasedDamage and 0 or 1)
					E.ExplosionType = S.explosionSettings.Type
					E.Position = P
					E.Hit:connect(function(Obj, Dist)
						if Obj.Name == "Torso" and (not Obj:IsDescendantOf(Char)) then
							if S.explosionSettings.rangeBasedDamage then
								local Dir = (Obj.Position - P).unit
								local expH, _ = workspace:FindPartOnRayWithIgnoreList(
									Ray.new(P - Dir * 0.1, Dir * 999),
									Ignore
								)
								local rayHitHuman = expH:IsDescendantOf(Obj.Parent)
								if (S.explosionSettings.rayCastExplosions and rayHitHuman) or (not S.explosionSettings.rayCastExplosions) then
									local hitHumanoid = findFirstClass(Obj.Parent, "Humanoid")
									if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
										local distFactor = Dist / S.explosionSettings.Radius
										local distInvert = math.max(1 - distFactor,0)
										local newDamage = distInvert * getBaseDamage((P - Main.CFrame.p).magnitude)

										local Tag = Instance.new("ObjectValue")
										Tag.Value = Player
										Tag.Name = "creator"
										Tag.Parent = hitHumanoid
										DS:AddItem(Tag, 0.3)
										hitHumanoid:TakeDamage(newDamage)
										markHit()
									end
								end
							else
								local hitHumanoid = findFirstClass(Obj.Parent, "Humanoid")
								if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
									local Tag = Instance.new("ObjectValue")
									Tag.Value = Player
									Tag.Name = "creator"
									Tag.Parent = hitHumanoid
									DS:AddItem(Tag, 0.3)
									markHit()
								end
							end
						end
					end)
					E.Parent = game.Workspace
				else
					_, finalP = penetrateWall(H, P, bulletDirection, N, {Char, ignoreModel}, 0, (P - Main.CFrame.p).magnitude, nil)
				end
			end
			if S.bulletTrail and S.trailSettings.Transparency ~= 1 then
				createTrail:FireServer(Main.CFrame.p, finalP, gunIgnore, S)
			end
		else
				local shell = Instance.new("Part")
	shell.CFrame = Gun.Chamber.CFrame * CFrame.fromEulerAnglesXYZ(-1.5,0,0)
	shell.Size = Vector3.new(1,1,1)
	shell.BrickColor = BrickColor.new(24)
	shell.Reflectance = .5
	shell.CanCollide = false
	shell.BottomSurface = 0
	shell.TopSurface = 0
	shell.Name = "Shell"
	shell.Velocity = Gun.Chamber.CFrame.lookVector * 30 + Vector3.new(math.random(-10,10),20,math.random(-10,10))
	shell.RotVelocity = Vector3.new(0,200,0)
	local shellmesh = Instance.new("CylinderMesh")
	shellmesh.Scale = Vector3.new(0.1, 0.8, 0.1)
	shellmesh.Parent = shell
	shell.Parent = game.Workspace
	game:GetService("Debris"):addItem(shell,2)

	local shellmesh = Instance.new("SpecialMesh")
	shellmesh.Scale = Vector3.new(0.9,0.9,3)
	shellmesh.MeshId = "http://www.roblox.com/asset/?id=95387759"
	shellmesh.TextureId = "http://www.roblox.com/asset/?id=95387789"
	shellmesh.MeshType = "FileMesh"
	shellmesh.Parent = shell
		end
	end
	function MarkHit()
	spawn(function()
		if Gui_Clone:IsDescendantOf(game) then
			Gui_Clone.HitMarker.Visible = true
			local StartMark = tick()
			LastMark = StartMark
			wait(0.5)
			if LastMark <= StartMark then
				Gui_Clone.HitMarker.Visible = false
			end
		end
	end)
end

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

	currentSpread = currentSpread + S.spreadSettings.Increase

	for _, Plugin in pairs(Plugins.Firing) do
		spawn(function()
			Plugin()
		end)
	end

	local backRecoil = RAND(S.recoilSettings.Recoil.Back.Min, S.recoilSettings.Recoil.Back.Max, 0.01) --Get the kickback recoil
	local upRecoil = RAND(S.recoilSettings.Recoil.Up.Min, S.recoilSettings.Recoil.Up.Max, 0.01) --Get the up recoil
	local sideRecoilAlpha = 0
	if lastSideRecoil[1] < 0 and lastSideRecoil[2] < 0 then --This conditional basically makes sure the gun tilt isn't in the same direction for more than 2 shots
		sideRecoilAlpha = RAND(0, 1, 0.1)
	elseif lastSideRecoil[1] > 0 and lastSideRecoil[2] > 0 then
		sideRecoilAlpha = RAND(-1, 0, 0.1)
	else
		sideRecoilAlpha = RAND(-1, 1, 0.1)
	end
	local sideRecoil = numLerp(S.recoilSettings.Recoil.Side.Left, S.recoilSettings.Recoil.Side.Right, sideRecoilAlpha / 2 + 0.5) --Get the side recoil
	local tiltRecoil = numLerp(S.recoilSettings.Recoil.Tilt.Left, S.recoilSettings.Recoil.Tilt.Right, sideRecoilAlpha / 2 + 0.5) --Get the tilt recoil
	local recoilPos = V3(
		0,---sideRecoil,
		0,
		-backRecoil
	) * (Aimed and S.recoilSettings.aimedMultiplier or 1)
	local recoilRot = V3(
		(Aimed and 0 or (-RAD(upRecoil * 10) * (firstShot and S.recoilSettings.firstShotMultiplier or 1))),
		RAD(sideRecoil * 10),
		RAD(tiltRecoil * 10)
	) * (Aimed and S.recoilSettings.aimedMultiplier or 1)
	local camRecoilRot = V3(
		-RAD(sideRecoil * 10),
		RAD(upRecoil * 10) * (firstShot and S.recoilSettings.firstShotMultiplier or 1) * S.recoilSettings.camMultiplier,
		0
	) * (Aimed and S.recoilSettings.aimedMultiplier or 1) * stanceSway
	tweenRecoil(recoilPos, recoilRot, Sine, 0.2)
	tweenCam("Recoil", camRecoilRot, Sine, 0.15 * (firstShot and S.recoilSettings.firstShotMultiplier or 1))

	for _, v in pairs(Main:GetChildren()) do
		if v.Name:sub(1, 7) == "FlashFX" then
			v.Enabled = true
		end
	end
			local shell = Instance.new("Part")
	shell.CFrame = Gun.Chamber.CFrame * CFrame.fromEulerAnglesXYZ(-1.5,0,0)
	shell.Size = Vector3.new(0.2,0.5,0.2)
	shell.CanCollide = true
	shell.Name = "Shell"
	shell.Velocity = Gun.Chamber.CFrame.lookVector * 30 + Vector3.new(math.random(-10,10),20,math.random(-10,10))
	shell.RotVelocity = Vector3.new(0,200,0)
	shell.Parent = game.Workspace
	game:GetService("Debris"):addItem(shell,2)
	local shellmesh = Instance.new("SpecialMesh")
	shellmesh.Scale = Vector3.new(0.5,0.5,0.5)
	shellmesh.MeshId = "http://www.roblox.com/asset/?id=94248124"
	shellmesh.TextureId = "http://www.roblox.com/asset/?id=94219470"
	shellmesh.MeshType = "FileMesh"
	shellmesh.Parent = shell
	delay(1 / 20, function()
		tweenRecoil(V3(), V3(), Sine, 0.2)
		tweenCam("Recoil", V3(), Sine, 0.2)
		for _, v in pairs(Main:GetChildren()) do
			if v.Name:sub(1, 7) == "FlashFX" then
				v.Enabled = false
			end
		end
	end)

	updateClipAmmo()
	firstShot = false
	shotCount = shotCount + 1
	lastSideRecoil[(shotCount % 2) + 1] = sideRecoilAlpha
end

function markHit()
	spawn(function()
		if mainGUI:IsDescendantOf(game) then
			hitMarker.Visible = true
			local startMark = tick()
			hitMarker.lastMark.Value = startMark

			wait(0.5)

			if hitMarker.lastMark.Value <= startMark then
				hitMarker.Visible = false
			end
		end
	end)
end