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("Fire")
	Gun.Bolt.Transparency = 1
Gun.BoltBack.Transparency = 0
	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
		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
			Gun.Bolt.Transparency = 1
Gun.BoltBack.Transparency = 0
			v.Enabled = true
		end
	end
		local shell = Instance.new("Part")
	shell.CFrame = Gun.Chamber.CFrame * CFrame.fromEulerAnglesXYZ(-2.5,1,1)
	shell.Size = Vector3.new(0.2,0.5,0.2)
	shell.CanCollide = false
	shell.Name = "Shell"
	shell.Velocity = Gun.Chamber.CFrame.lookVector * 10 + 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(2,2,2)
	shellmesh.MeshId = "http://www.roblox.com/asset/?id=94295100"
	shellmesh.TextureId = "http://www.roblox.com/asset/?id=94287792"
	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
			Gun.Bolt.Transparency = 0
Gun.BoltBack.Transparency = 1
				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


Prompt: -----Smoke------

Response:
for i = 1,5 do
smoke = Instance.new("Part")
smoke.Parent = game.Workspace
smoke.CFrame = script.Parent.CFrame *CFrame.new(math.random(-30,30),math.random(1,20),math.random(-30,30))
smoke.Anchored = true
smoke.CanCollide = true
smoke.BrickColor = BrickColor.new("Fossil")

mesh = Instance.new("SpecialMesh")
mesh.MeshId = "http://www.roblox.com/asset/?id=1095708"
mesh.Scale = Vector3.new(1,1,1)
mesh.Parent = smoke
fade = script.FadeScript:Clone()
fade.Parent = smoke
fade.Disabled = false

fade2 = script.FadeScript2:Clone()
fade2.Parent = smoke
fade2.Disabled = true

end


Prompt: -- track physics solver time delta separately from the render loop to correctly synchronize time delta

Response:
local worldDt = 1/60
RunService.Stepped:Connect(function(_, _worldDt)
	worldDt = _worldDt
end)

local VehicleCamera = setmetatable({}, BaseCamera)
VehicleCamera.__index = VehicleCamera

function VehicleCamera.new()
	local self = setmetatable(BaseCamera.new(), VehicleCamera)
	self:Reset()
	return self
end

function VehicleCamera:Reset()
	self.vehicleCameraCore = VehicleCameraCore.new(self:GetSubjectCFrame())
	self.pitchSpring = Spring.new(0, -math.rad(VehicleCameraConfig.pitchBaseAngle))
	self.yawSpring = Spring.new(0, YAW_DEFAULT)
	self.lastPanTick = 0

	local camera = workspace.CurrentCamera
	local cameraSubject = camera and camera.CameraSubject

	assert(camera)
	assert(cameraSubject)
	assert(cameraSubject:IsA("VehicleSeat"))

	local assemblyParts = cameraSubject:GetConnectedParts(true) -- passing true to recursively get all assembly parts
	local assemblyPosition, assemblyRadius = CameraUtils.getLooseBoundingSphere(assemblyParts)

	assemblyRadius = math.max(assemblyRadius, EPSILON)

	self.assemblyRadius = assemblyRadius
	self.assemblyOffset = cameraSubject.CFrame:Inverse()*assemblyPosition -- seat-space offset of the assembly bounding sphere center

	self:_StepInitialZoom()
end

function VehicleCamera:_StepInitialZoom()
	self:SetCameraToSubjectDistance(math.max(
		ZoomController.GetZoomRadius(),
		self.assemblyRadius*VehicleCameraConfig.initialZoomRadiusMul
	))
end

function VehicleCamera:_StepRotation(dt, vdotz): CFrame
	local yawSpring = self.yawSpring
	local pitchSpring = self.pitchSpring

	local rotationInput = CameraInput.getRotation(true)
	local dYaw = -rotationInput.X
	local dPitch = -rotationInput.Y

	yawSpring.pos = sanitizeAngle(yawSpring.pos + dYaw)
	pitchSpring.pos = sanitizeAngle(math.clamp(pitchSpring.pos + dPitch, -PITCH_LIMIT, PITCH_LIMIT))

	if CameraInput.getRotationActivated() then
		self.lastPanTick = os.clock()
	end

	local pitchBaseAngle = -math.rad(VehicleCameraConfig.pitchBaseAngle)
	local pitchDeadzoneAngle = math.rad(VehicleCameraConfig.pitchDeadzoneAngle)

	if os.clock() - self.lastPanTick > VehicleCameraConfig.autocorrectDelay then
		-- adjust autocorrect response based on forward velocity
		local autocorrectResponse = mapClamp(
			vdotz,
			VehicleCameraConfig.autocorrectMinCarSpeed,
			VehicleCameraConfig.autocorrectMaxCarSpeed,
			0,
			VehicleCameraConfig.autocorrectResponse
		)

		yawSpring.freq = autocorrectResponse
		pitchSpring.freq = autocorrectResponse

		-- zero out response under a threshold
		if yawSpring.freq < EPSILON then
			yawSpring.vel = 0
		end

		if pitchSpring.freq < EPSILON then
			pitchSpring.vel = 0
		end

		if math.abs(sanitizeAngle(pitchBaseAngle - pitchSpring.pos)) <= pitchDeadzoneAngle then
			-- do nothing within the deadzone
			pitchSpring.goal = pitchSpring.pos
		else
			pitchSpring.goal = pitchBaseAngle
		end
	else
		yawSpring.freq = 0
		yawSpring.vel = 0

		pitchSpring.freq = 0
		pitchSpring.vel = 0

		pitchSpring.goal = pitchBaseAngle
	end

	return CFrame.fromEulerAnglesYXZ(
		pitchSpring:step(dt),
		yawSpring:step(dt),
		0
	)
end

function VehicleCamera:_GetThirdPersonLocalOffset()
	return self.assemblyOffset + Vector3.new(0, self.assemblyRadius*VehicleCameraConfig.verticalCenterOffset, 0)
end

function VehicleCamera:_GetFirstPersonLocalOffset(subjectCFrame: CFrame)
	local character = localPlayer.Character

	if character and character.Parent then
		local head = character:FindFirstChild("Head")

		if head and head:IsA("BasePart") then
			return subjectCFrame:Inverse()*head.Position
		end
	end

	return self:_GetThirdPersonLocalOffset()
end

function VehicleCamera:Update()
	local camera = workspace.CurrentCamera
	local cameraSubject = camera and camera.CameraSubject
	local vehicleCameraCore = self.vehicleCameraCore

	assert(camera)
	assert(cameraSubject)
	assert(cameraSubject:IsA("VehicleSeat"))

	-- consume the physics solver time delta to account for mismatched physics/render cycles
	local dt = worldDt
	worldDt = 0

	-- get subject info
	local subjectCFrame: CFrame = self:GetSubjectCFrame()
	local subjectVel: Vector3 = self:GetSubjectVelocity()
	local subjectRotVel = self:GetSubjectRotVelocity()

	-- measure the local-to-world-space forward velocity of the vehicle
	local vDotZ = math.abs(subjectVel:Dot(subjectCFrame.ZVector))
	local yawVel = yawVelocity(subjectRotVel, subjectCFrame)
	local pitchVel = pitchVelocity(subjectRotVel, subjectCFrame)

	-- step camera components forward
	local zoom = self:StepZoom()
	local objectRotation = self:_StepRotation(dt, vDotZ)

	-- mix third and first person offsets in local space
	local firstPerson = mapClamp(zoom, ZOOM_MINIMUM, self.assemblyRadius, 1, 0)

	local tpOffset = self:_GetThirdPersonLocalOffset()
	local fpOffset = self:_GetFirstPersonLocalOffset(subjectCFrame)
	local localOffset = tpOffset:Lerp(fpOffset, firstPerson)

	-- step core forward
	vehicleCameraCore:setTransform(subjectCFrame)
	local processedRotation = vehicleCameraCore:step(dt, pitchVel, yawVel, firstPerson)

	-- calculate final focus & cframe
	local focus = CFrame.new(subjectCFrame*localOffset)*processedRotation*objectRotation
	local cf = focus*CFrame.new(0, 0, zoom)

	return cf, focus
end

function VehicleCamera:ApplyVRTransform()
	-- no-op override; VR transform is not applied in vehicles
end

function VehicleCamera:EnterFirstPerson()
	self.inFirstPerson = true
	self:UpdateMouseBehavior()
end

function VehicleCamera:LeaveFirstPerson()
	self.inFirstPerson = false
	self:UpdateMouseBehavior()
end

return VehicleCamera


Response:
wait()
Tool=script.Parent
CP,Torso,g=nil,nil,nil
necko=CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
getPos=function(Pos,TorsoPos)
	return Vector3.new(Pos.x,TorsoPos.y,Pos.z)
end
Turn=function(mouse,Torso,Gyro)
	g.cframe=CFrame.new(Torso.Position,getPos(mouse.Hit.p,Torso.Position))
	offset=(Torso.Position.y-mouse.Hit.p.y)/100
	mag=(Torso.Position-mouse.Hit.p).magnitude/80
	offset=offset/mag
	neck=Torso.Neck
	neck.C0=necko*CFrame.fromEulerAnglesXYZ(offset,0,0)
	arm=Torso:FindFirstChild("Right Shoulder")
	if arm~=nil then
		arm.C0=CFrame.new(1, 0.5, 0, 0, 0, 1, -6.48200512e-007, 1.00000274, 0, -1.00000274, -6.48200512e-007, 0)*CFrame.fromEulerAnglesXYZ(0,0,-offset)
	end
end

Equi=function(mouse)
	wait(.2)
	CP=Tool.Parent
	Torso=CP.Torso
	g=Instance.new("BodyGyro")
	g.P=18000
	g.D=600
	g.maxTorque=Vector3.new(1/0,1/0,1/0)
	g.cframe=Torso.CFrame
	g.Parent=Torso
	while true do
		if Tool.Parent.className~="Model" then
			break
		end
		Turn(mouse,Torso,g)
		wait()
	end
	Torso.Neck.C0=necko
	g:Remove()
end
Tool.Equipped:connect(Equi)


Prompt: -- Constructor/Destructor

Response:
function WaypointController.new(player)
	local self = setmetatable({}, WaypointController)

	-- Player variables
	self.player = player
	self.character = player.Character or player.CharacterAdded:wait()
	self.humanoid = self.character:WaitForChild("Humanoid")
	self.humanoidRoot = self.character.HumanoidRootPart
	self.isPlayerMoving = false

	-- Starting at 2 b/c it's the first waypoint after Start (1)
	self.currentWaypointIndex = 2
	self.currentWaypoint = waypoints[self.currentWaypointIndex]

	self._CooldownFinishedEvent = Instance.new("BindableEvent")
	self.CooldownFinished = self._CooldownFinishedEvent.Event

	self.waypointPath = WaypointPath.new(self.player, self.humanoidRoot.Position,
		self.currentWaypoint.Position)
	self.WaypointPathReached = self.waypointPath.WaypointReached:Connect(
		function()
			self._CooldownFinishedEvent:Fire()
			self:UpdateWaypoint()
		end)
	self.NodeReached = self.waypointPath.NodeReached:Connect(
		function()
			self._CooldownFinishedEvent:Fire()
		end)
	self.FinishedMoving = self.waypointPath.FinishedMoving:Connect(
		function()
			self:StopTracking()
		end)

	self.movingThread = nil

	return self
end

function WaypointController:Destroy()
	if self.WaypointPathReached then
		self.WaypointPathReached:Disconnect()
	end
	if self.NodeReached then
		self.NodeReached:Disconnect()
	end
	if self.FinishedMoving then
		self.FinishedMoving:Disconnect()
	end
end


Prompt: --// Ammo Settings

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


Prompt: --				{ id = "slash.xml", weight = 10 }

Response:
			},
	toollunge = {
				{ id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
			},
	wave = {
				{ id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
			},
	point = {
				{ id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
			},
	dance = {
				{ id = "http://www.roblox.com/asset/?id=130018893", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=132546839", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=132546884", weight = 10 }
			},
	dance2 = {
				{ id = "http://www.roblox.com/asset/?id=160934142", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=160934298", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=160934376", weight = 10 }
			},
	dance3 = {
				{ id = "http://www.roblox.com/asset/?id=160934458", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=160934530", weight = 10 },
				{ id = "http://www.roblox.com/asset/?id=160934593", weight = 10 }
			},
	laugh = {
				{ id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
			},
	cheer = {
				{ id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
			},
}


Prompt: --[[ Constants ]]

Response:
--
local RECALCULATE_PATH_THRESHOLD = 4
local NO_PATH_THRESHOLD = 12
local MAX_PATHING_DISTANCE = 200
local POINT_REACHED_THRESHOLD = 1
local OFFTRACK_TIME_THRESHOLD = 2
local THUMBSTICK_DEADZONE = 0.22

local ZERO_VECTOR3 = Vector3.new(0,0,0)
local XZ_VECTOR3 = Vector3.new(1,0,1)


Prompt:
-- Do not edit these values, they are not the developer-set limits, they are limits
-- to the values the camera system equations can correctly handle

Response:
local MIN_ALLOWED_ELEVATION_DEG = -80
local MAX_ALLOWED_ELEVATION_DEG = 80

local externalProperties = {}
externalProperties["InitialDistance"]  = 25
externalProperties["MinDistance"]      = 10
externalProperties["MaxDistance"]      = 100
externalProperties["InitialElevation"] = 35
externalProperties["MinElevation"]     = 35
externalProperties["MaxElevation"]     = 35
externalProperties["ReferenceAzimuth"] = -45	-- Angle around the Y axis where the camera starts. -45 offsets the camera in the -X and +Z directions equally
externalProperties["CWAzimuthTravel"]  = 90	-- How many degrees the camera is allowed to rotate from the reference position, CW as seen from above
externalProperties["CCWAzimuthTravel"] = 90	-- How many degrees the camera is allowed to rotate from the reference position, CCW as seen from above
externalProperties["UseAzimuthLimits"] = false -- Full rotation around Y axis available by default

local Util = require(script.Parent:WaitForChild("CameraUtils"))
local CameraInput = require(script.Parent:WaitForChild("CameraInput"))


Prompt: --Rescripted by Luckymaxer

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

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

Speed = 100
Duration = 1

NozzleOffset = Vector3.new(0, 0.4, -1.1)

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

PointLight = Handle:WaitForChild("PointLight")

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

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

ServerControl.OnServerInvoke = (function(player, Mode, Value, arg)
	if player ~= Player or Humanoid.Health == 0 or not Tool.Enabled then
		return
	end
	if Mode == "Click" and Value then
		Activated(arg)
	end
end)

function InvokeClient(Mode, Value)
	pcall(function()
		ClientControl:InvokeClient(Player, Mode, Value)
	end)
end

function TagHumanoid(humanoid, player)
	local Creator_Tag = Instance.new("ObjectValue")
	Creator_Tag.Name = "creator"
	Creator_Tag.Value = player
	Debris:AddItem(Creator_Tag, 2)
	Creator_Tag.Parent = humanoid
end

function UntagHumanoid(humanoid)
	for i, v in pairs(humanoid:GetChildren()) do
		if v:IsA("ObjectValue") and v.Name == "creator" then
			v:Destroy()
		end
	end
end

function FindCharacterAncestor(Parent)
	if Parent and Parent ~= game:GetService("Workspace") then
		local humanoid = Parent:FindFirstChild("Humanoid")
		if humanoid then
			return Parent, humanoid
		else
			return FindCharacterAncestor(Parent.Parent)
		end
	end
	return nil
end

function GetTransparentsRecursive(Parent, PartsTable)
	local PartsTable = (PartsTable or {})
	for i, v in pairs(Parent:GetChildren()) do
		local TransparencyExists = false
		pcall(function()
			local Transparency = v["Transparency"]
			if Transparency then
				TransparencyExists = true
			end
		end)
		if TransparencyExists then
			table.insert(PartsTable, v)
		end
		GetTransparentsRecursive(v, PartsTable)
	end
	return PartsTable
end

function SelectionBoxify(Object)
	local SelectionBox = Instance.new("SelectionBox")
	SelectionBox.Adornee = Object
	SelectionBox.Color = BrickColor.new("Really black")
	SelectionBox.Parent = Object
	return SelectionBox
end

local function Light(Object)
	local Light = PointLight:Clone()
	Light.Range = (Light.Range + 2)
	Light.Parent = Object
end

function FadeOutObjects(Objects, FadeIncrement)
	repeat
		local LastObject = nil
		for i, v in pairs(Objects) do
			v.Transparency = (v.Transparency + FadeIncrement)
			LastObject = v
		end
		wait()
	until LastObject.Transparency >= 1 or not LastObject
end

function Dematerialize(character, humanoid, FirstPart)
	if not character or not humanoid then
		return
	end

	humanoid.WalkSpeed = 0

	local Parts = {}

	for i, v in pairs(character:GetChildren()) do
		if v:IsA("BasePart") then
			v.Anchored = true
			table.insert(Parts, v)
		elseif v:IsA("LocalScript") or v:IsA("Script") then
			v:Destroy()
		end
	end

	local SelectionBoxes = {}

	local FirstSelectionBox = SelectionBoxify(FirstPart)
	Light(FirstPart)
	wait(0.05)

	for i, v in pairs(Parts) do
		if v ~= FirstPart then
			table.insert(SelectionBoxes, SelectionBoxify(v))
			Light(v)
		end
	end

	local ObjectsWithTransparency = GetTransparentsRecursive(character)
	FadeOutObjects(ObjectsWithTransparency, 0.1)

	wait(4)

	character:BreakJoints()
	humanoid.Health = 0

	Debris:AddItem(character, 2)

	local FadeIncrement = 0.05
	Delay(0.2, function()
		FadeOutObjects({FirstSelectionBox}, FadeIncrement)
		if character and character.Parent then
			character:Destroy()
		end
	end)
	FadeOutObjects(SelectionBoxes, FadeIncrement)
end

function Touched(Projectile, Hit)
	if not Hit or not Hit.Parent then
		return
	end
	local character, humanoid = FindCharacterAncestor(Hit)
	if character and humanoid and character ~= Character then
		local ForceFieldExists = false
		for i, v in pairs(character:GetChildren()) do
			if v:IsA("ForceField") then
				ForceFieldExists = true
			end
		end
		if not ForceFieldExists then
			if Projectile then
				local HitFadeSound = Projectile:FindFirstChild(Sounds.HitFade.Name)
				local torso = humanoid.Torso
				if HitFadeSound and torso then
					HitFadeSound.Parent = torso
					HitFadeSound:Play()
				end
			end
			Dematerialize(character, humanoid, Hit)
		end
		if Projectile and Projectile.Parent then
			Projectile:Destroy()
		end
	end
end

function Equipped()
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChild("Humanoid")
	if not Player or not Humanoid or Humanoid.Health == 0 then
		return
	end
end

function Activated(target)
	if Tool.Enabled and Humanoid.Health > 0 then
		Tool.Enabled = false

		InvokeClient("PlaySound", Sounds.Fire)

		local HandleCFrame = Handle.CFrame
		local FiringPoint = HandleCFrame.p + HandleCFrame:vectorToWorldSpace(NozzleOffset)
		local ShotCFrame = CFrame.new(FiringPoint, target)

		local LaserShotClone = BaseShot:Clone()
		LaserShotClone.CFrame = ShotCFrame + (ShotCFrame.lookVector * (BaseShot.Size.Z / 2))
		local BodyVelocity = Instance.new("BodyVelocity")
		BodyVelocity.velocity = ShotCFrame.lookVector * Speed
		BodyVelocity.Parent = LaserShotClone
		LaserShotClone.Touched:connect(function(Hit)
			if not Hit or not Hit.Parent then
				return
			end
			Touched(LaserShotClone, Hit)
		end)
		Debris:AddItem(LaserShotClone, Duration)
		LaserShotClone.Parent = game:GetService("Workspace")

		wait(0.6) -- FireSound length

		InvokeClient("PlaySound", Sounds.Reload)
		Player.Character.Humanoid:LoadAnimation(script.Parent.Reload):Play()

		wait(3.5) -- ReloadSound length

		Tool.Enabled = true
	end
end

function Unequipped()

end

BaseShot = Instance.new("Part")
BaseShot.Name = "Effect"
BaseShot.BrickColor = BrickColor.new("Institutional white")
BaseShot.Material = Enum.Material.Neon
BaseShot.Shape = Enum.PartType.Block
BaseShot.TopSurface = Enum.SurfaceType.Smooth
BaseShot.BottomSurface = Enum.SurfaceType.Smooth
BaseShot.FormFactor = Enum.FormFactor.Custom
BaseShot.Size = Vector3.new(0.2, 0.2, 3)
BaseShot.CanCollide = false
BaseShot.Locked = true
SelectionBoxify(BaseShot)
Light(BaseShot)
BaseShotSound = Sounds.HitFade:Clone()
BaseShotSound.Parent = BaseShot

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


Prompt: -- Spawn a new firefly from the center when one flew too far

Response:
local Model = script.Parent

local Fly = Model.FireFly:Clone() -- Clone a fly from the start

Model.ChildRemoved:connect(function() -- When a fly got removed when he flew too far, paste a clone to spawn a new one
	if Model:FindFirstChild("Center") then
		local newFly = Fly:Clone()
		newFly.Position = Model.Center.CenterPart.Position
		newFly.Parent = Model
	end
end)


Response:
local Laserdebounce = false

Mouse.KeyDown:connect(function(key)
if (key == "v") and Equipped and Settings.FireModes.ChangeFiremode  then
	FireMode()
end
if (key == "t") and Equipped and (not NVG or ArmaClone.AimPart:FindFirstChild("NVAim") == nil) then
	if Aiming then
		if ArmaClone:FindFirstChild("AimPart2") ~= nil then
			if AimPartMode == 1 then
				AimPartMode = 2
				tweenFoV(Settings.ChangeFOV[2],120)
				if Settings.FocusOnSight2 and Aiming then
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
				else
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
				end
				if Settings.ZoomAnim then
					ZoomAnim()
					Sprint()
				end
			elseif AimPartMode == 2 then
				AimPartMode = 1
				tweenFoV(Settings.ChangeFOV[1],120)
				if Settings.FocusOnSight and Aiming then
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
				else
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
				end
				if Settings.ZoomAnim then
					UnZoomAnim()
					Sprint()
				end
			end
		else
			if AimPartMode == 1 then
				AimPartMode = 2
				tweenFoV(Settings.ChangeFOV[2], 120)
				if Settings.FocusOnSight2 and Aiming then
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
				else
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
				end
				if Settings.ZoomAnim then
					ZoomAnim()
					Sprint()
				end
			elseif AimPartMode == 2 then
				AimPartMode = 1
				tweenFoV(Settings.ChangeFOV[1], 120)
				if Settings.FocusOnSight and Aiming then
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
				else
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
				end
				if Settings.ZoomAnim then
					UnZoomAnim()
					Sprint()
				end
			end
		end
	else
		if AimPartMode == 1 then
			AimPartMode = 2
			if Settings.FocusOnSight2 and Aiming then
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
				else
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
				end
			if Settings.ZoomAnim then
				ZoomAnim()
				Sprint()
			end
		elseif AimPartMode == 2 then
			AimPartMode = 1
			if Settings.FocusOnSight and Aiming then
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
				else
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
				end
			if Settings.ZoomAnim then
				UnZoomAnim()
				Sprint()
			end
		end
	end
end
if (key == "[") and Equipped then
	if Zeroing.Value > Zeroing.MinValue then
		Zeroing.Value = Zeroing.Value - 50
		ArmaClone.Handle.Click:play()
		Update_Gui()
	end
end
if (key == "]" ) and Equipped then
	if Zeroing.Value < Zeroing.MaxValue then
		Zeroing.Value = Zeroing.Value + 50
		ArmaClone.Handle.Click:play()
		Update_Gui()
	end
end
if (key == "r") and Equipped and stance > -2 then
	Reload()
end
if (key == "f") and Equipped and not Reloading and stance > -2  then
	Chamber()
end
if (key == "m") and Equipped and Settings.CanCheckMag and not Reloading and stance > -2 then
			MouseHeld = false
			Can_Shoot = false
			Reloading = true

			if Safe then
				Safe = false
				stance = 0
				Evt.Stance:FireServer(stance,Settings,Anims)
				IdleAnim()
				Update_Gui()
				--wait(.25)
			end
			CheckAnim()
			Sprint()
			Update_Gui()
			Can_Shoot = true
			Reloading = false
end
if (key == "h") and Equipped and ArmaClone:FindFirstChild("LaserPoint") then

	if ServerConfig.RealisticLaser and ArmaClone.LaserPoint:FindFirstChild("IR") ~= nil then
		if not LaserAtivo and not IRmode then
			LaserAtivo = not LaserAtivo
			IRmode = not IRmode

			if LaserAtivo then

				Evt.SVLaser:FireServer(Vector3.new(0,0,0),1,ArmaClone.LaserPoint.Color,ArmaClient)
				Pointer = Instance.new('Part')
				Pointer.Shape = 'Ball'
				Pointer.Size = Vector3.new(0.2, 0.2, 0.2)
				Pointer.Parent = ArmaClone.LaserPoint
				Pointer.CanCollide = false
				Pointer.Color = ArmaClone.LaserPoint.Color
				Pointer.Material = Enum.Material.Neon

				if ArmaClone.LaserPoint:FindFirstChild("IR") ~= nil then
					Pointer.Transparency = 1
				end

				LaserSP = Instance.new('Attachment')
				LaserSP.Parent = ArmaClone.LaserPoint

				LaserEP = Instance.new('Attachment')
				LaserEP.Parent = ArmaClone.LaserPoint

				Laser = Instance.new('Beam')
				Laser.Parent = ArmaClone.LaserPoint
				Laser.Transparency = NumberSequence.new(0)
				Laser.LightEmission = 1
				Laser.LightInfluence = 0
				Laser.Attachment0 = LaserSP
				Laser.Attachment1 = LaserEP
				Laser.Color = ColorSequence.new(ArmaClone.LaserPoint.Color,IRmode)
				Laser.FaceCamera = true
				Laser.Width0 = 0.01
				Laser.Width1 = 0.01

				if ServerConfig.RealisticLaser then
					Laser.Enabled = false
				end

			else
				Evt.SVLaser:FireServer(Vector3.new(0,0,0),2,nil,ArmaClient,IRmode)
				Pointer:Destroy()
				LaserSP:Destroy()
				LaserEP:Destroy()
				Laser:Destroy()
			end

			elseif LaserAtivo and IRmode then
			IRmode = not IRmode
		elseif LaserAtivo and not IRmode then
			LaserAtivo = not LaserAtivo

			if LaserAtivo then

				Evt.SVLaser:FireServer(Vector3.new(0,0,0),1,ArmaClone.LaserPoint.Color,ArmaClient)
				Pointer = Instance.new('Part')
				Pointer.Shape = 'Ball'
				Pointer.Size = Vector3.new(0.2, 0.2, 0.2)
				Pointer.Parent = ArmaClone.LaserPoint
				Pointer.CanCollide = false
				Pointer.Color = ArmaClone.LaserPoint.Color
				Pointer.Material = Enum.Material.Neon

				if ArmaClone.LaserPoint:FindFirstChild("IR") ~= nil then
					Pointer.Transparency = 1
				end

				LaserSP = Instance.new('Attachment')
				LaserSP.Parent = ArmaClone.LaserPoint

				LaserEP = Instance.new('Attachment')
				LaserEP.Parent = ArmaClone.LaserPoint

				Laser = Instance.new('Beam')
				Laser.Parent = ArmaClone.LaserPoint
				Laser.Transparency = NumberSequence.new(0)
				Laser.LightEmission = 1
				Laser.LightInfluence = 0
				Laser.Attachment0 = LaserSP
				Laser.Attachment1 = LaserEP
				Laser.Color = ColorSequence.new(ArmaClone.LaserPoint.Color,IRmode)
				Laser.FaceCamera = true
				Laser.Width0 = 0.01
				Laser.Width1 = 0.01

				if ServerConfig.RealisticLaser then
					Laser.Enabled = false
				end

			else
				Evt.SVLaser:FireServer(Vector3.new(0,0,0),2,nil,ArmaClient,IRmode)
				Pointer:Destroy()
				LaserSP:Destroy()
				LaserEP:Destroy()
				Laser:Destroy()
			end

		end
	else
		LaserAtivo = not LaserAtivo

		if LaserAtivo then

				Evt.SVLaser:FireServer(Vector3.new(0,0,0),1,ArmaClone.LaserPoint.Color,ArmaClient)
				Pointer = Instance.new('Part')
				Pointer.Shape = 'Ball'
				Pointer.Size = Vector3.new(0.2, 0.2, 0.2)
				Pointer.Parent = ArmaClone.LaserPoint
				Pointer.CanCollide = false
				Pointer.Color = ArmaClone.LaserPoint.Color
				Pointer.Material = Enum.Material.Neon

				if ArmaClone.LaserPoint:FindFirstChild("IR") ~= nil then
					Pointer.Transparency = 1
				end

				LaserSP = Instance.new('Attachment')
				LaserSP.Parent = ArmaClone.LaserPoint

				LaserEP = Instance.new('Attachment')
				LaserEP.Parent = ArmaClone.LaserPoint

				Laser = Instance.new('Beam')
				Laser.Parent = ArmaClone.LaserPoint
				Laser.Transparency = NumberSequence.new(0)
				Laser.LightEmission = 1
				Laser.LightInfluence = 0
				Laser.Attachment0 = LaserSP
				Laser.Attachment1 = LaserEP
				Laser.Color = ColorSequence.new(ArmaClone.LaserPoint.Color,IRmode)
				Laser.FaceCamera = true
				Laser.Width0 = 0.01
				Laser.Width1 = 0.01

				if ServerConfig.RealisticLaser then
					Laser.Enabled = false
				end

			else
				Evt.SVLaser:FireServer(Vector3.new(0,0,0),2,nil,ArmaClient,IRmode)
				Pointer:Destroy()
				LaserSP:Destroy()
				LaserEP:Destroy()
				Laser:Destroy()
			end

	end
	ArmaClone.Handle.Click:play()

end
if (key == "j") and Equipped and ArmaClone:FindFirstChild("FlashPoint") then
	LanternaAtiva = not LanternaAtiva
	ArmaClone.Handle.Click:play()
			if LanternaAtiva then
				Evt.SVFlash:FireServer(true,ArmaClient,ArmaClone.FlashPoint.Light.Angle,ArmaClone.FlashPoint.Light.Brightness,ArmaClone.FlashPoint.Light.Color,ArmaClone.FlashPoint.Light.Range)
				ArmaClone.FlashPoint.Light.Enabled = true
			else
				Evt.SVFlash:FireServer(false,ArmaClient,nil,nil,nil,nil)
				ArmaClone.FlashPoint.Light.Enabled = false
			end
end
if (key == "u") and Equipped and ArmaClone:FindFirstChild("Silenciador") then
	Silencer.Value = not Silencer.Value
	ArmaClone.Handle.Click:play()
			if Silencer.Value == true then
				ArmaClone.Silenciador.Transparency = 0
				ArmaClone.SmokePart.FlashFX.Brightness = 0
				ArmaClone.SmokePart:FindFirstChild("FlashFX[Flash]").Rate = 0

				Evt.SilencerEquip:FireServer(ArmaClient,Silencer.Value)

			else
				ArmaClone.Silenciador.Transparency = 1
				ArmaClone.SmokePart.FlashFX.Brightness = 5
				ArmaClone.SmokePart:FindFirstChild("FlashFX[Flash]").Rate = 1000

				Evt.SilencerEquip:FireServer(ArmaClient,Silencer.Value)
			end
end
if (key == "b") and Equipped and BipodEnabled and ArmaClone:FindFirstChild("BipodPoint") then
	Bipod = not Bipod
	if Bipod == true then
		if ArmaClone.BipodPoint:FindFirstChild("BipodDeploy") ~= nil then
			ArmaClone.BipodPoint.BipodDeploy:play()
		end
	else
		if ArmaClone.BipodPoint:FindFirstChild("BipodRetract") ~= nil then
			ArmaClone.BipodPoint.BipodRetract:play()
		end
	end
end
if (key == "n") and Laserdebounce == false then

		if Player.Character then
		local helmet = Player.Character:FindFirstChild("Helmet")
		if helmet then
			local nvg = helmet:FindFirstChild("Up")
			if nvg then
				Laserdebounce = true
				delay(.8,function()
					NVG = not NVG

		if Aiming and ArmaClone.AimPart:FindFirstChild("NVAim") ~= nil then
		if NVG then
			tweenFoV(70,120)
			TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
		else
			if AimPartMode == 1 then
			tweenFoV(Settings.ChangeFOV[1],120)
			if Settings.FocusOnSight then
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
				else
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
				end
		elseif AimPartMode == 2 then
			tweenFoV(Settings.ChangeFOV[2],120)
			if Settings.FocusOnSight2 then
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
				else
					TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
				end
			end
		end
	end
	Laserdebounce = false
end)

				end
			end
		end
	end
end)


Prompt: --// Rest of code after waiting for correct events.

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

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer

while not LocalPlayer do
	Players.ChildAdded:wait()
	LocalPlayer = Players.LocalPlayer
end

local canChat = true

local ChatDisplayOrder = 6
if ChatSettings.ScreenGuiDisplayOrder ~= nil then
	ChatDisplayOrder = ChatSettings.ScreenGuiDisplayOrder
end

local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
local GuiParent = Instance.new("ScreenGui")
GuiParent.Name = "Chat"
GuiParent.ResetOnSpawn = false
GuiParent.DisplayOrder = ChatDisplayOrder
GuiParent.Parent = PlayerGui

local DidFirstChannelsLoads = false

local modulesFolder = script

local moduleChatWindow = require(modulesFolder:WaitForChild("ChatWindow"))
local moduleChatBar = require(modulesFolder:WaitForChild("ChatBar"))
local moduleChannelsBar = require(modulesFolder:WaitForChild("ChannelsBar"))
local moduleMessageLabelCreator = require(modulesFolder:WaitForChild("MessageLabelCreator"))
local moduleMessageLogDisplay = require(modulesFolder:WaitForChild("MessageLogDisplay"))
local moduleChatChannel = require(modulesFolder:WaitForChild("ChatChannel"))
local moduleCommandProcessor = require(modulesFolder:WaitForChild("CommandProcessor"))

local ChatWindow = moduleChatWindow.new()
local ChannelsBar = moduleChannelsBar.new()
local MessageLogDisplay = moduleMessageLogDisplay.new()
local CommandProcessor = moduleCommandProcessor.new()
local ChatBar = moduleChatBar.new(CommandProcessor, ChatWindow)

ChatWindow:CreateGuiObjects(GuiParent)

ChatWindow:RegisterChatBar(ChatBar)
ChatWindow:RegisterChannelsBar(ChannelsBar)
ChatWindow:RegisterMessageLogDisplay(MessageLogDisplay)

MessageCreatorUtil:RegisterChatWindow(ChatWindow)

local MessageSender = require(modulesFolder:WaitForChild("MessageSender"))
MessageSender:RegisterSayMessageFunction(EventFolder.SayMessageRequest)

if (UserInputService.TouchEnabled) then
	ChatBar:SetTextLabelText(ChatLocalization:Get("GameChat_ChatMain_ChatBarTextTouch",'Tap here to chat'))
else
	ChatBar:SetTextLabelText(ChatLocalization:Get("GameChat_ChatMain_ChatBarText",'To chat click here or press "/" key'))
end

spawn(function()
	local CurveUtil = require(modulesFolder:WaitForChild("CurveUtil"))
	local animationFps = ChatSettings.ChatAnimationFPS or 20.0

	local updateWaitTime = 1.0 / animationFps
	local lastTick = tick()
	while true do
		local currentTick = tick()
		local tickDelta = currentTick - lastTick
		local dtScale = CurveUtil:DeltaTimeToTimescale(tickDelta)

		if dtScale ~= 0 then
			ChatWindow:Update(dtScale)
		end

		lastTick = currentTick
		wait(updateWaitTime)
	end
end)


Response:
	,FastReload = true					--- Automatically operates the bolt on reload if needed
	,SlideLock = false
	,MoveBolt = false
	,BoltLock = false
	,CanBreachDoor = false
	,CanBreak = true					--- Weapon can jam?
	,JamChance = 1000					--- This old piece of brick doesn't work fine >;c
	,IncludeChamberedBullet = true		--- Include the chambered bullet on next reload
	,Chambered = false					--- Start with the gun chambered?
	,LauncherReady = false				--- Start with the GL ready?
	,CanCheckMag = true					--- You can check the magazine
	,ArcadeMode = false					--- You can see the bullets left in magazine
	,RainbowMode = false				--- Operation: Party Time xD
	,ModoTreino = false					--- Surrender enemies instead of killing them
	,GunSize = 7
	,GunFOVReduction = 6.5

	,BoltExtend = Vector3.new(0, 0, 0.4)
	,SlideExtend = Vector3.new(0, 0, 0.4)


Prompt:
--[=[
	@within Shake
	@type UpdateCallbackFn () -> (position: Vector3, rotation: Vector3, completed: boolean)
]=]

Response:
type UpdateCallbackFn = () -> (Vector3, Vector3, boolean)

local RunService = game:GetService("RunService")

local Trove = require(script.Parent.Trove)

local rng = Random.new()
local renderId = 0


Prompt:
--!nonstrict
--[[
	ControlModule - This ModuleScript implements a singleton class to manage the
	selection, activation, and deactivation of the current character movement controller.
	This script binds to RenderStepped at Input priority and calls the Update() methods
	on the active controller instances.

	The character 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 ControlModule = {}
ControlModule.__index = ControlModule


Prompt:
--// If this module returns a ScreenGui object, the script will use that as the gui and
--// take care of registering and running the code module n all that.
--// RETURNED SCREENGUI MUST CONTAIN A "Config" FOLDER;
--// If no Code module is given the default code module will be used.


Prompt:
--L3 = me.L3
--L4 = me.L4
-- клонируем скрипт урона и активируем

Response:
local tmp = hits:Clone()
tmp.Disabled=false
tmp.Parent=L1
local tmp = hits:Clone()
tmp.Disabled=false
tmp.Parent=L2


Prompt: --Setup script (It's automatic, you don't need to edit)

Response:
local MODEL = script.Parent

local CONFIG = MODEL.Configuration
local CAMERA1 = MODEL.Camera3
local CAMERA2 = MODEL.Camera4
local TRIGGER = MODEL.CutscenePart
local SCRIPT = MODEL.CutsceneScript

CONFIG.Parent = SCRIPT
CAMERA1.Parent = workspace
CAMERA1.Transparency = 1
CAMERA2.Parent = workspace
CAMERA2.Transparency = 1
TRIGGER.Parent = workspace
SCRIPT.Parent = game.StarterPlayer.StarterPlayerScripts
MODEL:Destroy()


Prompt: --[[[Default Controls]]

Response:
	--Peripheral Deadzones
	Tune.Peripherals = {
		MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
		MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)

		ControlLDZone			= 5			,	-- Controller steering L-deadzone (0 - 100%)
		ControlRDZone			= 5			,	-- Controller steering R-deadzone (0 - 100%)
	}

	--Control Mapping
	Tune.Controls = {

	--Keyboard Controls
		--Mode Toggles
		ToggleTCS				= Enum.KeyCode.T					,
		ToggleABS				= Enum.KeyCode.Y					,
		ToggleTransMode			= Enum.KeyCode.N					,
		ToggleMouseDrive		= Enum.KeyCode.R					,

		--Primary Controls
		Throttle				= Enum.KeyCode.Up					,
		Brake					= Enum.KeyCode.Down					,
		SteerLeft				= Enum.KeyCode.Left					,
		SteerRight				= Enum.KeyCode.Right				,

		--Secondary Controls
		Throttle2				= Enum.KeyCode.W					,
		Brake2					= Enum.KeyCode.S					,
		SteerLeft2				= Enum.KeyCode.A					,
		SteerRight2				= Enum.KeyCode.D					,

		--Manual Transmission
		ShiftUp					= Enum.KeyCode.E					,
		ShiftDown				= Enum.KeyCode.Q					,
		Clutch					= Enum.KeyCode.LeftShift			,

		--Handbrake
		PBrake					= Enum.KeyCode.P					,

	--Mouse Controls
		MouseThrottle			= Enum.UserInputType.MouseButton1	,
		MouseBrake				= Enum.UserInputType.MouseButton2	,
		MouseClutch				= Enum.KeyCode.W					,
		MouseShiftUp			= Enum.KeyCode.E					,
		MouseShiftDown			= Enum.KeyCode.Q					,
		MousePBrake				= Enum.KeyCode.LeftShift			,

	--Controller Mapping
		ContlrThrottle			= Enum.KeyCode.ButtonR2				,
		ContlrBrake				= Enum.KeyCode.ButtonL2				,
		ContlrSteer				= Enum.KeyCode.Thumbstick1			,
		ContlrShiftUp			= Enum.KeyCode.ButtonY				,
		ContlrShiftDown			= Enum.KeyCode.ButtonX				,
		ContlrClutch			= Enum.KeyCode.ButtonR1				,
		ContlrPBrake			= Enum.KeyCode.ButtonL1				,
		ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
		ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
		ContlrToggleABS			= Enum.KeyCode.DPadRight			,
	}


Prompt: --[[Weld functions]]

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

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

	function ModelWeld(a,b)
		if a:IsA("BasePart") then
			MakeWeld(b,a,"Weld")
		elseif a:IsA("Model") then
			for i,v in pairs(a:GetChildren()) do
				ModelWeld(v,b)
			end
		end
	end

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


Prompt: -- Open

Response:
game.ReplicatedStorage.GiveSystem.HandToSystem.OnClientEvent:Connect(function(plr, From, Text)
	script.Parent:TweenPosition(UDim2.new(0.26, 0,0.263, 0))
end)


Prompt:
--////////////////////////////////////////////////////////////////////////////////////////////
--///////////// Code to talk to topbar and maintain set/get core backwards compatibility stuff
--////////////////////////////////////////////////////////////////////////////////////////////

Response:
local Util = {}
do
	function Util.Signal()
		local sig = {}

		local mSignaler = Instance.new('BindableEvent')

		local mArgData = nil
		local mArgDataCount = nil

		function sig:fire(...)
			mArgData = {...}
			mArgDataCount = select('#', ...)
			mSignaler:Fire()
		end

		function sig:connect(f)
			if not f then error("connect(nil)", 2) end
			return mSignaler.Event:connect(function()
				f(unpack(mArgData, 1, mArgDataCount))
			end)
		end

		function sig:wait()
			mSignaler.Event:wait()
			assert(mArgData, "Missing arg data, likely due to :TweenSize/Position corrupting threadrefs.")
			return unpack(mArgData, 1, mArgDataCount)
		end

		return sig
	end
end

function SetVisibility(val)
	ChatWindow:SetVisible(val)
	moduleApiTable.VisibilityStateChanged:fire(val)
	moduleApiTable.Visible = val

	if (moduleApiTable.IsCoreGuiEnabled) then
		if (val) then
			InstantFadeIn()
		else
			InstantFadeOut()
		end
	end
end

do
	moduleApiTable.TopbarEnabled = true
	moduleApiTable.MessageCount = 0
	moduleApiTable.Visible = true
	moduleApiTable.IsCoreGuiEnabled = true

	function moduleApiTable:ToggleVisibility()
		SetVisibility(not ChatWindow:GetVisible())
	end

	function moduleApiTable:SetVisible(visible)
		if (ChatWindow:GetVisible() ~= visible) then
			SetVisibility(visible)
		end
	end

	function moduleApiTable:FocusChatBar()
		ChatBar:CaptureFocus()
	end

	function moduleApiTable:GetVisibility()
		return ChatWindow:GetVisible()
	end

	function moduleApiTable:GetMessageCount()
		return self.MessageCount
	end

	function moduleApiTable:TopbarEnabledChanged(enabled)
		self.TopbarEnabled = enabled
		self.CoreGuiEnabled:fire(game:GetService("StarterGui"):GetCoreGuiEnabled(Enum.CoreGuiType.Chat))
	end

	function moduleApiTable:IsFocused(useWasFocused)
		return ChatBar:IsFocused()
	end

	moduleApiTable.ChatBarFocusChanged = Util.Signal()
	moduleApiTable.VisibilityStateChanged = Util.Signal()
	moduleApiTable.MessagesChanged = Util.Signal()

	moduleApiTable.MessagePosted = Util.Signal()
	moduleApiTable.CoreGuiEnabled = Util.Signal()

	moduleApiTable.ChatMakeSystemMessageEvent = Util.Signal()
	moduleApiTable.ChatWindowPositionEvent = Util.Signal()
	moduleApiTable.ChatWindowSizeEvent = Util.Signal()
	moduleApiTable.ChatBarDisabledEvent = Util.Signal()

	function moduleApiTable:fChatWindowPosition()
		return ChatWindow.GuiObject.Position
	end

	function moduleApiTable:fChatWindowSize()
		return ChatWindow.GuiObject.Size
	end

	function moduleApiTable:fChatBarDisabled()
		return not ChatBar:GetEnabled()
	end

	function moduleApiTable:SpecialKeyPressed(key, modifiers)
		if (key == Enum.SpecialKey.ChatHotkey) then
			if canChat then
				DoChatBarFocus()
			end
		end
	end
end

moduleApiTable.CoreGuiEnabled:connect(function(enabled)
	moduleApiTable.IsCoreGuiEnabled = enabled

	enabled = enabled and (moduleApiTable.TopbarEnabled or ChatSettings.ChatOnWithTopBarOff)

	ChatWindow:SetCoreGuiEnabled(enabled)

	if (not enabled) then
		ChatBar:ReleaseFocus()
		InstantFadeOut()
	else
		InstantFadeIn()
	end
end)

function trimTrailingSpaces(str)
	local lastSpace = #str
	while lastSpace > 0 do
		--- The pattern ^%s matches whitespace at the start of the string. (Starting from lastSpace)
		if str:find("^%s", lastSpace) then
			lastSpace = lastSpace - 1
		else
			break
		end
	end
	return str:sub(1, lastSpace)
end

moduleApiTable.ChatMakeSystemMessageEvent:connect(function(valueTable)
	if (valueTable["Text"] and type(valueTable["Text"]) == "string") then
		while (not DidFirstChannelsLoads) do wait() end

		local channel = ChatSettings.GeneralChannelName
		local channelObj = ChatWindow:GetChannel(channel)

		if (channelObj) then
			local messageObject = {
				ID = -1,
				FromSpeaker = nil,
				SpeakerUserId = 0,
				OriginalChannel = channel,
				IsFiltered = true,
				MessageLength = string.len(valueTable.Text),
				Message = trimTrailingSpaces(valueTable.Text),
				MessageType = ChatConstants.MessageTypeSetCore,
				Time = os.time(),
				ExtraData = valueTable,
			}
			channelObj:AddMessageToChannel(messageObject)
			ChannelsBar:UpdateMessagePostedInChannel(channel)

			moduleApiTable.MessageCount = moduleApiTable.MessageCount + 1
			moduleApiTable.MessagesChanged:fire(moduleApiTable.MessageCount)
		end
	end
end)

moduleApiTable.ChatBarDisabledEvent:connect(function(disabled)
	if canChat then
		ChatBar:SetEnabled(not disabled)
		if (disabled) then
			ChatBar:ReleaseFocus()
		end
	end
end)

moduleApiTable.ChatWindowSizeEvent:connect(function(size)
	ChatWindow.GuiObject.Size = size
end)

moduleApiTable.ChatWindowPositionEvent:connect(function(position)
	ChatWindow.GuiObject.Position = position
end)


Prompt: --- Sets the command bar visible or not

Response:
function Window:SetVisible(visible)
	Gui.Visible = visible

	if visible then
		Entry.TextBox:CaptureFocus()
		self:SetEntryText("")

		if self.Cmdr.ActivationUnlocksMouse then
			self.PreviousMouseBehavior = UserInputService.MouseBehavior
			UserInputService.MouseBehavior = Enum.MouseBehavior.Default
		end
	else
		Entry.TextBox:ReleaseFocus()
		self.AutoComplete:Hide()

		if self.PreviousMouseBehavior then
			UserInputService.MouseBehavior = self.PreviousMouseBehavior
			self.PreviousMouseBehavior = nil
		end
	end
end


Prompt:
--local player = game:GetService("Players").PlayerAdded:Connect(function(plr)
--	plr.CharacterAdded:Connect(function(char)
--local char = script.Parent.Parent.Parent
--local Params = RaycastParams.new()
--	Params.FilterDescendantsInstances = {char}
--	Params.FilterType = Enum.RaycastFilterType.Blacklist
--	print(Params.FilterDescendantsInstances)
--	end)
--end)

Response:
local newHitbox = RaycastHitbox.new(script.Parent)
newHitbox.Visualizer = true

newHitbox.OnHit:Connect(function(hit, humanoid)
	if humanoid.Parent.Name ~= script.Parent.Parent.Parent.Name then
		humanoid:TakeDamage(35)
	end
end)

event.OnServerEvent:Connect(function(db)
		newHitbox:HitStart()
		wait(1)
		newHitbox:HitStop()
end)


Prompt: --// Weapon Parts

Response:
local L_53_ = L_1_:WaitForChild('AimPart')
local L_54_
local L_55_ = L_1_:WaitForChild('Grip')
local L_56_ = L_1_:WaitForChild('FirePart')
local L_57_
local L_58_ = L_1_:WaitForChild('Mag')
local L_59_ = L_1_:WaitForChild('Bolt')


Prompt: -- Stage değeri değiştiğinde fonksiyonu çağırmak için bir olay tetikleyici oluşturun

Response: stageValue:GetPropertyChangedSignal("Value"):Connect(UpdateVisibility)


Prompt: -- Listener for changes to workspace.CurrentCamera

Response:
function BaseCamera:OnCurrentCameraChanged()
	if UserInputService.TouchEnabled then
		if self.viewportSizeChangedConn then
			self.viewportSizeChangedConn:Disconnect()
			self.viewportSizeChangedConn = nil
		end

		local newCamera = game.Workspace.CurrentCamera

		if newCamera then
			self:OnViewportSizeChanged()
			self.viewportSizeChangedConn = newCamera:GetPropertyChangedSignal("ViewportSize"):Connect(function()
				self:OnViewportSizeChanged()
			end)
		end
	end

	-- VR support additions
	if self.cameraSubjectChangedConn then
		self.cameraSubjectChangedConn:Disconnect()
		self.cameraSubjectChangedConn = nil
	end

	local camera = game.Workspace.CurrentCamera
	if camera then
		self.cameraSubjectChangedConn = camera:GetPropertyChangedSignal("CameraSubject"):Connect(function()
			self:OnNewCameraSubject()
		end)
		self:OnNewCameraSubject()
	end
end

function BaseCamera:OnDynamicThumbstickEnabled()
	if UserInputService.TouchEnabled then
		self.isDynamicThumbstickEnabled = true
	end
end

function BaseCamera:OnDynamicThumbstickDisabled()
	self.isDynamicThumbstickEnabled = false
end

function BaseCamera:OnGameSettingsTouchMovementModeChanged()
	if player.DevTouchMovementMode == Enum.DevTouchMovementMode.UserChoice then
		if (UserGameSettings.TouchMovementMode == Enum.TouchMovementMode.DynamicThumbstick
			or UserGameSettings.TouchMovementMode == Enum.TouchMovementMode.Default) then
			self:OnDynamicThumbstickEnabled()
		else
			self:OnDynamicThumbstickDisabled()
		end
	end
end

function BaseCamera:OnDevTouchMovementModeChanged()
	if player.DevTouchMovementMode == Enum.DevTouchMovementMode.DynamicThumbstick then
		self:OnDynamicThumbstickEnabled()
	else
		self:OnGameSettingsTouchMovementModeChanged()
	end
end

function BaseCamera:OnPlayerCameraPropertyChange()
	-- This call forces re-evaluation of player.CameraMode and clamping to min/max distance which may have changed
	self:SetCameraToSubjectDistance(self.currentSubjectDistance)
end

function BaseCamera:GetCameraHeight()
	if VRService.VREnabled and not self.inFirstPerson then
		return math.sin(VR_ANGLE) * self.currentSubjectDistance
	end
	return 0
end

function BaseCamera:InputTranslationToCameraAngleChange(translationVector, sensitivity)
	return translationVector * sensitivity
end

function BaseCamera:GamepadZoomPress()
	local dist = self:GetCameraToSubjectDistance()

	if dist > (GAMEPAD_ZOOM_STEP_2 + GAMEPAD_ZOOM_STEP_3)/2 then
		self:SetCameraToSubjectDistance(GAMEPAD_ZOOM_STEP_2)
	elseif dist > (GAMEPAD_ZOOM_STEP_1 + GAMEPAD_ZOOM_STEP_2)/2 then
		self:SetCameraToSubjectDistance(GAMEPAD_ZOOM_STEP_1)
	else
		self:SetCameraToSubjectDistance(GAMEPAD_ZOOM_STEP_3)
	end
end

function BaseCamera:Enable(enable: boolean)
	if self.enabled ~= enable then
		self.enabled = enable
		if self.enabled then
			CameraInput.setInputEnabled(true)

			self.gamepadZoomPressConnection = CameraInput.gamepadZoomPress:Connect(function()
				self:GamepadZoomPress()
			end)

			if player.CameraMode == Enum.CameraMode.LockFirstPerson then
				self.currentSubjectDistance = 0.5
				if not self.inFirstPerson then
					self:EnterFirstPerson()
				end
			end
		else
			CameraInput.setInputEnabled(false)

			if self.gamepadZoomPressConnection then
				self.gamepadZoomPressConnection:Disconnect()
				self.gamepadZoomPressConnection = nil
			end
			-- Clean up additional event listeners and reset a bunch of properties
			self:Cleanup()
		end
	end
end

function BaseCamera:GetEnabled(): boolean
	return self.enabled
end

function BaseCamera:Cleanup()
	if self.subjectStateChangedConn then
		self.subjectStateChangedConn:Disconnect()
		self.subjectStateChangedConn = nil
	end
	if self.viewportSizeChangedConn then
		self.viewportSizeChangedConn:Disconnect()
		self.viewportSizeChangedConn = nil
	end

	self.lastCameraTransform = nil
	self.lastSubjectCFrame = nil

	-- Unlock mouse for example if right mouse button was being held down
	if UserInputService.MouseBehavior ~= Enum.MouseBehavior.LockCenter then
		UserInputService.MouseBehavior = Enum.MouseBehavior.Default
	end
end

function BaseCamera:UpdateMouseBehavior()
	if self.isCameraToggle then
		CameraUI.setCameraModeToastEnabled(true)
		CameraInput.enableCameraToggleInput()
		CameraToggleStateController(self.inFirstPerson)
	else
		CameraUI.setCameraModeToastEnabled(false)
		CameraInput.disableCameraToggleInput()

		-- first time transition to first person mode or mouse-locked third person
		if self.inFirstPerson or self.inMouseLockedMode then
			UserGameSettings.RotationType = Enum.RotationType.CameraRelative
			UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
		else
			UserGameSettings.RotationType = Enum.RotationType.MovementRelative
			UserInputService.MouseBehavior = Enum.MouseBehavior.Default
		end
	end
end

function BaseCamera:UpdateForDistancePropertyChange()
	-- Calling this setter with the current value will force checking that it is still
	-- in range after a change to the min/max distance limits
	self:SetCameraToSubjectDistance(self.currentSubjectDistance)
end

function BaseCamera:SetCameraToSubjectDistance(desiredSubjectDistance: number): number
	local lastSubjectDistance = self.currentSubjectDistance

	-- By default, camera modules will respect LockFirstPerson and override the currentSubjectDistance with 0
	-- regardless of what Player.CameraMinZoomDistance is set to, so that first person can be made
	-- available by the developer without needing to allow players to mousewheel dolly into first person.
	-- Some modules will override this function to remove or change first-person capability.
	if player.CameraMode == Enum.CameraMode.LockFirstPerson then
		self.currentSubjectDistance = 0.5
		if not self.inFirstPerson then
			self:EnterFirstPerson()
		end
	else
		local newSubjectDistance = math.clamp(desiredSubjectDistance, player.CameraMinZoomDistance, player.CameraMaxZoomDistance)
		if newSubjectDistance < FIRST_PERSON_DISTANCE_THRESHOLD then
			self.currentSubjectDistance = 0.5
			if not self.inFirstPerson then
				self:EnterFirstPerson()
			end
		else
			self.currentSubjectDistance = newSubjectDistance
			if self.inFirstPerson then
				self:LeaveFirstPerson()
			end
		end
	end

	-- Pass target distance and zoom direction to the zoom controller
	ZoomController.SetZoomParameters(self.currentSubjectDistance, math.sign(desiredSubjectDistance - lastSubjectDistance))

	-- Returned only for convenience to the caller to know the outcome
	return self.currentSubjectDistance
end

function BaseCamera:SetCameraType( cameraType )
	--Used by derived classes
	self.cameraType = cameraType
end

function BaseCamera:GetCameraType()
	return self.cameraType
end


Prompt: --- Updates the current instance state.

Response:
function ScopeHierarchyItemButton:UpdateInstanceState()
    local NewName = self.props.Instance.Name
    local MaxTextBounds = Vector2.new(math.huge, math.huge)
    local TextBounds = TextService:GetTextSize(NewName, 33/2, Enum.Font.SourceSans, MaxTextBounds)

    -- Update instance state
    self:setState({
        InstanceName = NewName;
        InstanceNameLength = TextBounds.X;
    })
end


Prompt:
--[[**
	<description>
	Takes a function to be called when :Get() is first called and there is a value in the data store. This function must return a value to set to. Used for deserializing.
	</description>

	<parameter name = "modifier">
	The modifier function.
	</parameter>
**--]]

Response:
function DataStore:BeforeInitialGet(modifier)
	table.insert(self.beforeInitialGet, modifier)
end


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

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

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

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

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

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

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

local cameraModuleObject = CameraModule.new()
local cameraApi = {}

if FFlagUserRemoveTheCameraApi then
	return cameraApi
else
	return cameraModuleObject
end


Prompt: -- Debug Message options

Response:
local DEFAULT_DEBUG_LOGGER_PREFIX: string = "[ Raycast Hitbox V4 ]\n"
local DEFAULT_MISSING_ATTACHMENTS: string = "No attachments found in object: %s. Can be safely ignored if using SetPoints."
local DEFAULT_ATTACH_COUNT_NOTICE: string = "%s attachments found in object: %s."


Prompt:
--[[
	Races a set of Promises and returns the first one that resolves,
	cancelling the others.
]]

Response:
function Promise.race(promises)
	assert(type(promises) == "table", string.format(ERROR_NON_LIST, "Promise.race"))

	for i, promise in pairs(promises) do
		assert(Promise.is(promise), string.format(ERROR_NON_PROMISE_IN_LIST, "Promise.race", tostring(i)))
	end

	return Promise._new(debug.traceback(nil, 2), function(resolve, reject, onCancel)
		local newPromises = {}
		local finished = false

		local function cancel()
			for _, promise in ipairs(newPromises) do
				promise:cancel()
			end
		end

		local function finalize(callback)
			return function (...)
				cancel()
				finished = true
				return callback(...)
			end
		end

		if onCancel(finalize(reject)) then
			return
		end

		for i, promise in ipairs(promises) do
			newPromises[i] = promise:andThen(finalize(resolve), finalize(reject))
		end

		if finished then
			cancel()
		end
	end)
end


Prompt:
--[[
	Higher order component that lets the wrapped component consume the EmoteContext.
]]

Response:
local function withEmoteContext(component)
	return function(props)
		if props.emoteContext then
			warn("Child component has a prop named `emoteContext` and will be overriden by EmoteContext.")
		end

		return Roact.createElement(Context.Consumer, {
			render = function(emoteContext)
				local mergedProps = Cryo.Dictionary.join({ emoteContext = emoteContext }, props)

				return Roact.createElement(component, mergedProps)
			end,
		})
	end
end

local EmoteContext = {
	Consumer = Context.Consumer,
	Provider = withConfiguration(EmoteContextProvider),
	withEmoteContext = withEmoteContext,
}

return EmoteContext


Prompt: -- Original values

Response:
local Lighting = game:GetService("Lighting")
local OLC = Lighting.ExposureCompensation

local function PlaySound()
	model.Lighting_Bolt.Transparency = 0
	wait(.05)
	Lighting.ExposureCompensation = 7
	wait(.25)
	Lighting.ExposureCompensation = OLC
	model.Lighting_Bolt.Transparency = 1
	sound:Play()
end

local function touched(otherPart)
	if(otherPart.Name == "HumanoidRootPart" ) then
		local player = game.Players:FindFirstChild(otherPart.Parent.Name)
		if(player) then
			trigger.CanTouch = false

			PlaySound()
		end
	end
end

trigger.Touched:Connect(touched)


Prompt: -- Remove the default loading screen

Response:
ReplicatedFirst:RemoveDefaultLoadingScreen()

wait(5)  -- Force screen to appear for a minimum number of seconds
if not game:IsLoaded() then
	game.Loaded:Wait()
end
screenGui:Destroy()


Prompt: -- Repeat every 5 seconds

Response:
while wait(5) do
	-- Create a new explosion object with the 'Example' template
	local NewExplosion = Explosion.new("Example")

	-- Set the explosion lifetime to 4 seconds so that the sound (3.75s long) can finish playing.
	NewExplosion.Lifetime = 4

	-- Set the explosion's position
	NewExplosion:SetPosition(Vector3.new(-25, 5, 0))

	-- EffectFunction will be called after this.
	NewExplosion:SetParent(workspace)
end


Prompt: --[[Weight and CG]]

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

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

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


Prompt: --throttle.Value = TCount

Response:
if carSeat.Throttle == 1 then
if autoF - 1 > autoR or clutch.Clutch.Value ~= 1 then
	TCount = 1
	else
	if TCount >= 1 then
		TCount = 1
	else
		if speed > 50 then
		TCount = TCount + 0.167

		elseif speed < 20 then
		TCount = TCount + 0.3334

			else
		TCount = TCount + 0.02
		end
	end

	end
else
	if TCount <= 0 then
		TCount = 0
	else
		TCount = 0
	end
end

if currentgear.Value ~= 1 then tlR = 0
	if clutch.Clutch.Value ~= 1 then
		if throttle.Value ~= 0 then
			if engine.Value > redline.Value * (1-clutch.Clutch.Value) then --------------?? WE DONT NEED A 'FOR' IN THE CLUTCH CODE
				engine.Value = engine.Value - 300
				else
				engine.Value = engine.Value + (((600+decay.Value) * throttle.Value) - decay.Value)
			end else engine.Value = engine.Value - decay.Value
		end
		rpm.Value = engine.Value
	else
		engine.Value = rpm.Value
	end
else
	tlR = tlR + 0.05
	if tlR > 20 then
		script.Parent.Functions.Engine.Value = false
		first = 0.333
	end
	engine.Value = engine.Value + (((600+decay.Value) * first) - decay.Value)
	if engine.Value > idle.Value*2 then
		first = 0
	end
		--engine.Value = (idle.Value-decay.Value)

end

drive = "x"


Prompt: --<<--Enable/Disable Chat menu-->>--

Response: game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false) --Set 'false' to disable the Chat, or set 'true' to enable the Chat


Prompt: -- Container for temporary connections (disconnected automatically)

Response:
local Connections = {};

function LightingTool.Equip()
	-- Enables the tool's equipped functionality

	-- Start up our interface
	ShowUI();
	EnableSurfaceClickSelection();

end;

function LightingTool.Unequip()
	-- Disables the tool's equipped functionality

	-- Clear unnecessary resources
	HideUI();
	ClearConnections();

end;

function ClearConnections()
	-- Clears out temporary connections

	for ConnectionKey, Connection in pairs(Connections) do
		Connection:disconnect();
		Connections[ConnectionKey] = nil;
	end;

end;

function ShowUI()
	-- Creates and reveals the UI

	-- Reveal UI if already created
	if LightingTool.UI then

		-- Reveal the UI
		LightingTool.UI.Visible = true;

		-- Update the UI every 0.1 seconds
		UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);

		-- Skip UI creation
		return;

	end;

	-- Create the UI
	LightingTool.UI = Core.Tool.Interfaces.BTLightingToolGUI:Clone();
	LightingTool.UI.Parent = Core.UI;
	LightingTool.UI.Visible = true;

	-- Enable each light type UI
	EnableLightSettingsUI(LightingTool.UI.PointLight);
	EnableLightSettingsUI(LightingTool.UI.SpotLight);
	EnableLightSettingsUI(LightingTool.UI.SurfaceLight);

	-- Update the UI every 0.1 seconds
	UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);

end;

function EnableSurfaceClickSelection(LightType)
	-- Allows for the setting of the face for the given light type by clicking

	-- Clear out any existing connection
	if Connections.SurfaceClickSelection then
		Connections.SurfaceClickSelection:disconnect();
		Connections.SurfaceClickSelection = nil;
	end;

	-- Add the new click connection
	Connections.SurfaceClickSelection = UserInputService.InputEnded:connect(function (Input, GameProcessedEvent)
		if not GameProcessedEvent and Input.UserInputType == Enum.UserInputType.MouseButton1 and Selection.IsSelected(Core.Mouse.Target) then
			SetSurface(LightType, Core.Mouse.TargetSurface);
		end;
	end);

end;

function EnableLightSettingsUI(LightSettingsUI)
	-- Sets up the UI for the given light type settings UI

	-- Get the type of light this settings UI is for
	local LightType = LightSettingsUI.Name;

	-- Option input references
	local Options = LightSettingsUI.Options;
	local RangeInput = Options.RangeOption.Input.TextBox;
	local BrightnessInput = Options.BrightnessOption.Input.TextBox;
	local ColorPicker = Options.ColorOption.HSVPicker;
	local ShadowsCheckbox = Options.ShadowsOption.Checkbox;

	-- Add/remove/show button references
	local AddButton = LightSettingsUI.AddButton;
	local RemoveButton = LightSettingsUI.RemoveButton;
	local ShowButton = LightSettingsUI.ArrowButton;

	-- Enable range input
	RangeInput.FocusLost:connect(function ()
		SetRange(LightType, tonumber(RangeInput.Text));
	end);

	-- Enable brightness input
	BrightnessInput.FocusLost:connect(function ()
		SetBrightness(LightType, tonumber(BrightnessInput.Text));
	end);

	-- Enable color input
	ColorPicker.MouseButton1Click:connect(function ()
		Core.Cheer(Core.Tool.Interfaces.BTHSVColorPicker, Core.UI).Start(
			Support.IdentifyCommonProperty(GetLights(LightType), 'Color') or Color3.new(1, 1, 1),
			function (Color) SetColor(LightType, Color) end,
			Core.Targeting.CancelSelecting
		);
	end);

	-- Enable shadows input
	ShadowsCheckbox.MouseButton1Click:connect(function ()
		ToggleShadows(LightType);
	end);

	-- Enable light addition button
	AddButton.MouseButton1Click:connect(function ()
		AddLights(LightType);
	end);

	-- Enable light removal button
	RemoveButton.MouseButton1Click:connect(function ()
		RemoveLights(LightType);
	end);

	-- Enable light options UI show button
	ShowButton.MouseButton1Click:connect(function ()
		OpenLightOptions(LightType);
	end);

	-- Enable light type-specific features
	if LightType == 'SpotLight' or LightType == 'SurfaceLight' then

		-- Create a surface selection dropdown
		Surfaces = { 'Top', 'Bottom', 'Front', 'Back', 'Left', 'Right' };
		local SurfaceDropdown = Core.Cheer(Options.SideOption.Dropdown).Start(Surfaces, '', function (Surface)
			SetSurface(LightType, Enum.NormalId[Surface]);
		end);

		-- Enable angle input
		local AngleInput = Options.AngleOption.Input.TextBox;
		AngleInput.FocusLost:connect(function ()
			SetAngle(LightType, tonumber(AngleInput.Text));
		end);

	end;

end;

function HideUI()
	-- Hides the tool UI

	-- Make sure there's a UI
	if not LightingTool.UI then
		return;
	end;

	-- Hide the UI
	LightingTool.UI.Visible = false;

	-- Stop updating the UI
	UIUpdater:Stop();

end;

function GetLights(LightType)
	-- Returns all the lights of the given type in the selection

	local Lights = {};

	-- Get any lights from any selected parts
	for _, Part in pairs(Selection.Items) do
		table.insert(Lights, Support.GetChildOfClass(Part, LightType));
	end;

	-- Return the lights
	return Lights;

end;


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

Response:
local l__RunService__1 = game:GetService("RunService");
if game:GetService("UserInputService").TouchEnabled then
	local v2 = Instance.new("Frame");
	v2.Name = "BottomLeftControl";
	v2.Size = UDim2.new(0.1, 0, 0.1, 0);
	v2.Position = UDim2.new(1, 0, 1, 0);
	v2.AnchorPoint = Vector2.new(1, 1);
	v2.BackgroundTransparency = 1;
	v2.ZIndex = 10;
	v2.Parent = script.Parent;
	local v3 = Instance.new("ImageButton");
	v3.Name = "MouseLockLabel";
	v3.Size = UDim2.new(1, 0, 1, 0);
	v3.Position = UDim2.new(0, 0, 0, 0);
	v3.BackgroundTransparency = 1;
	v3.Image = "rbxasset://textures/ui/mouseLock_off.png";
	v3.Visible = true;
	v3.Parent = v2;
	local v4 = Instance.new("Frame");
	v4.Name = "MiddleIcon";
	v4.Size = UDim2.new(0.075, 0, 0.075, 0);
	v4.Position = UDim2.new(0.5, 0, 0.5, 0);
	v4.AnchorPoint = Vector2.new(0.5, 0.5);
	v4.BackgroundTransparency = 1;
	v4.ZIndex = 10;
	v4.Visible = true;
	v4.Parent = script.Parent;
	local v5 = Instance.new("ImageLabel");
	v5.Name = "MouseLockLabel";
	v5.Size = UDim2.new(1, 0, 1, 0);
	v5.Position = UDim2.new(0, 0, 0, 0);
	v5.BackgroundTransparency = 1;
	v5.Image = "rbxasset://textures/MouseLockedCursor.png";
	v5.Visible = false;
	v5.Parent = v4;
	local v6 = Instance.new("UIAspectRatioConstraint");
	v6.AspectRatio = 1;
	v6.DominantAxis = "Height";
	v6.Parent = v2;
	v6:Clone().Parent = v4;
	local u1 = false;
	v3.Activated:connect(function()
		u1 = not u1;
		if u1 then
			local v7 = "rbxasset://textures/ui/mouseLock_on.png";
		else
			v7 = "rbxasset://textures/ui/mouseLock_off.png";
		end;
		v3.Image = v7;
		v5.Visible = u1 or false;
	end);
	local l__LocalPlayer__2 = game.Players.LocalPlayer;
	l__RunService__1:BindToRenderStep("MobileShiftLock", Enum.RenderPriority.Camera.Value + 1, function()
		if u1 then
			local l__CurrentCamera__8 = workspace.CurrentCamera;
			if l__CurrentCamera__8 then
				local l__Character__9 = l__LocalPlayer__2.Character;
				local v10 = l__Character__9 and l__Character__9:FindFirstChild("Humanoid");
				local v11 = l__Character__9 and l__Character__9:FindFirstChild("HumanoidRootPart");
				local v12 = l__Character__9 and l__Character__9:FindFirstChild("Head");
				if v10 and v10.Health > 0 and v11 then
					local l__LookVector__13 = l__CurrentCamera__8.CFrame.LookVector;
					v11.CFrame = CFrame.new(v11.Position) * CFrame.Angles(0, math.atan2(-l__LookVector__13.X, -l__LookVector__13.Z), 0);
				end;
				if v12 and (v12.Position - l__CurrentCamera__8.CFrame.Position).Magnitude >= 1 then
					l__CurrentCamera__8.CFrame = l__CurrentCamera__8.CFrame * CFrame.new(1.75, 0, 0);
				end;
			end;
		end;
	end);
end;


Prompt: --!strict

Response: local _T = require(script.Parent.Parent.Types)


Prompt: --------|    Variables    |--------

Response: local cachedGamepassInfo = {}


Prompt:
--[=[
	Options for the broadcast middleware.
]=]

Response:
export type BroadcasterOptions = {
	--[=[
		The producers that will be tracked.
	]=]
	producers: ProducerMap,

	--[=[
		The rate in seconds at which the server should hydrate the
		clients with the latest state.
		@default 60
	]=]
	hydrateRate: number?,

	--[=[
		The rate in seconds at which the server should dispatch
		actions to the clients. If set to `0`, actions will be
		dispatched within the next frame.
		@default 0
	]=]
	dispatchRate: number?,

	--[=[
		Runs before actions are dispatched to a player. Can be used to
		filter actions or manipulate them before sending.

		Avoid directly mutating the action. Instead, return a new action
		if you need to change it. Return `nil` to not share the action
		with this player.
	]=]
	beforeDispatch: ((player: Player, action: BroadcastAction) -> BroadcastAction?)?,

	--[=[
		Runs before the client is hydrated with the latest state. Can be
		used to filter the state or hide certain values from the client.

		Do not mutate the state in this function! Treat it as a read-only
		object, and return a new object if you need to change it.
	]=]
	beforeHydrate: ((player: Player, state: { [string]: any }) -> { [string]: any })?,

	--[=[
		An optional custom hydration function. If provided, this function
		will be called instead of being implicitly handled in 'dispatch'.

		Useful for reducing load on a single remote if your state is large.
	]=]
	hydrate: ((player: Player, state: { [string]: any }) -> ())?,

	--[=[
		The function that will send the actions to the client.
	]=]
	dispatch: (player: Player, actions: { BroadcastAction }) -> (),
}


Prompt:
-- Disconnect all handlers. Since we use a linked list it suffices to clear the
-- reference to the head handler.

Response:
function Signal:DisconnectAll()
	self._handlerListHead = false
end


Prompt:
--[[
	Shorthand for a done handler that returns the given value.
]]

Response:
function Promise.prototype:doneReturn(...)
	local length, values = pack(...)
	return self:_finally(debug.traceback(nil, 2), function()
		return unpack(values, 1, length)
	end, true)
end


Prompt:
-----------------
--| Variables |--
-----------------

Response:
local DebrisService = Game:GetService('Debris')

local Rocket = script.Parent

local CreatorTag = WaitForChild(Rocket, 'creator')

local SwooshSound = WaitForChild(Rocket, 'Swoosh')


Prompt: -- Made by Yarik, you are allowed to take it, but please favorite it first


Prompt: -- When key pressed

Response:
function onKeyDown(key)
	if key == nil then return end
	key = key:lower()

	-- Coaxial Machine Gun Control
	if key == 'f' then
		if firingMg then return end

		firingMg = true;

		while firingMg do
			if not fireCoax() then
				firingMg = false;
			wait()
			end
			updateAmmo();
		end
	end

	-- Switch ammo type
	if key == 'e' then
		parts.Engine.BodyGyro.MaxTorque = Vector3.new(0,0,100)
		print("Flipping Vehicle")
		wait(5)
		parts.Engine.BodyGyro.MaxTorque = Vector3.new(0,0,0)
	end
	if key == 'q' then
		if braking then return end

		braking = true;

		while braking do
			if not Brakes() then
				braking = false;
			end
			updateAmmo();
		end
	end
end


Prompt: --[[ Roblox Services ]]

Response:
--
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local StarterGui = game:GetService("StarterGui")
local VRService = game:GetService("VRService")
local UserGameSettings = UserSettings():GetService("UserGameSettings")

local player = Players.LocalPlayer


Prompt: --EDIT BELOW----------------------------------------------------------------------

Response:
settings.PianoSoundRange = 45

settings.KeyAesthetics = true

settings.PianoSounds = {
	"269058581",
	"269058744",
	"269058842",
	"269058899",
	"269058974",
	"269059048"
}


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

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

local Tool = script.Parent

local Animations = {}
local MyHumanoid
local MyCharacter

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

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

function OnEquipped(mouse)
	MyCharacter = Tool.Parent
	MyHumanoid = WaitForChild(MyCharacter, 'Humanoid')
	if MyHumanoid then
				Animations['IdleAnim'] = MyHumanoid:LoadAnimation(WaitForChild(script, 'idle'))
					end
	PlayAnimation('IdleAnim')
end

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

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


Prompt: -- Mimic the enabling of the topbar when StarterGui:SetCore("TopbarEnabled", state) is called

Response:
coroutine.wrap(function()
	local chatScript = players.LocalPlayer.PlayerScripts:WaitForChild("ChatScript", 4) or game:GetService("Chat"):WaitForChild("ChatScript", 4)
	if not chatScript then return end
	local chatMain = chatScript:FindFirstChild("ChatMain")
	if not chatMain then return end
	local ChatMain = require(chatMain)
	ChatMain.CoreGuiEnabled:connect(function()
		local topbarEnabled = checkTopbarEnabled()
		if topbarEnabled == IconController.previousTopbarEnabled then
			IconController.updateTopbar()
			return "SetCoreGuiEnabled was called instead of SetCore"
		end
		if IconController.mimicCoreGui then
			IconController.previousTopbarEnabled = topbarEnabled
			if IconController.controllerModeEnabled then
				IconController.setTopbarEnabled(false,false)
			else
				IconController.setTopbarEnabled(topbarEnabled,false)
			end
		end
		IconController.updateTopbar()
	end)
	local makeVisible = checkTopbarEnabled()
	if not makeVisible and not IconController.mimicCoreGui then
		makeVisible = true
	end
	IconController.setTopbarEnabled(makeVisible, false)
end)()


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

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

return main


Prompt: -- Define the variables for the dash ability

Response:
local isDashing = false
local dashSpeed = 125


Prompt: --// Return values: bool filterSuccess, bool resultIsFilterObject, variant result

Response:
function methods:InternalApplyRobloxFilterNewAPI(speakerName, message, textFilterContext) --// USES FFLAG
	local alwaysRunFilter = false
	local runFilter = RunService:IsServer() and not RunService:IsStudio()
	if (alwaysRunFilter or runFilter) then

		local fromSpeaker = self:GetSpeaker(speakerName)
		if fromSpeaker == nil then
			return false, nil, nil
		end

		local fromPlayerObj = fromSpeaker:GetPlayer()
		if fromPlayerObj == nil then
			return true, false, message
		end

		if allSpaces(message) then
			return true, false, message
		end

		local success, filterResult = pcall(function()
			local ts = game:GetService("TextService")
			local result = ts:FilterStringAsync(message, fromPlayerObj.UserId, textFilterContext)
			return result
		end)
		if (success) then
			return true, true, filterResult
		else
			warn("Error filtering message:", message, filterResult)
			self:InternalNotifyFilterIssue()
			return false, nil, nil
		end
	end

	--// Simulate filtering latency.
	wait()
	return true, false, message
end

function methods:InternalDoMessageFilter(speakerName, messageObj, channel)
	local filtersIterator = self.FilterMessageFunctions:GetIterator()

	for funcId, func, priority in filtersIterator do
		local success, errorMessage = pcall(function()
			func(speakerName, messageObj, channel)
		end)

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

function methods:InternalDoProcessCommands(speakerName, message, channel)
	local commandsIterator = self.ProcessCommandsFunctions:GetIterator()

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

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

	return false
end

function methods:InternalGetUniqueMessageId()
	local id = self.MessageIdCounter
	self.MessageIdCounter = id + 1
	return id
end

function methods:InternalAddSpeakerWithPlayerObject(speakerName, playerObj, fireSpeakerAdded)
	if (self.Speakers[speakerName:lower()]) then
		error("Speaker \"" .. speakerName .. "\" already exists!")
	end

	local speaker = Speaker.new(self, speakerName)
	speaker:InternalAssignPlayerObject(playerObj)
	self.Speakers[speakerName:lower()] = speaker

	if fireSpeakerAdded then
		local success, err = pcall(function() self.eSpeakerAdded:Fire(speakerName) end)
		if not success and err then
			print("Error adding speaker: " ..err)
		end
	end

	return speaker
end

function methods:InternalFireSpeakerAdded(speakerName)
	local success, err = pcall(function() self.eSpeakerAdded:Fire(speakerName) end)
	if not success and err then
		print("Error firing speaker added: " ..err)
	end
end


Prompt: -- MUSIC/SOUNDS

Response:
print("DOORS 👁 Sound Pack: Installing Musics/Ambiences Sounds...")

if SoundsInSoundService == true then
	script.Parent.Parent = game.SoundService
end

if MusicLobbyEnabled == false then
	script.Parent.Music.Lobby:Destroy()
end

if GuidingLightMusicEnabled == false then
	script.Parent.Music["Guiding Light"]:Destroy()
end

if EndingMusicEnabled == false then
	script.Parent.Music.Ending:Destroy()
end

if ElevatorJamMusicEnabled == false then
	script.Parent.Music["Elevator Jam"]:Destroy()
end

if UnhingedMusicEnabled == false then
	script.Parent.Music.Unhinged:Destroy()
end

if AmbienceSoundEnabled == false then
	script.Parent.Ambience.Ambience:Destroy()
end


Prompt: -- Helpers

Response:
local function updateCheckbox()
	local checked = CheckedValue.Value

	if checked then
		Checkbox.Image = Assets.Checkbox.Checked
		Checkbox.ImageColor3 = checkedColor
	else
		Checkbox.Image = Assets.Checkbox.Unchecked
		Checkbox.ImageColor3 = defaultImageColor
	end
end

CheckedValue.Changed:Connect(updateCheckbox)

local function selectCheckbox()
	CheckedValue.Value = not CheckedValue.Value
end


Prompt: -- Expose GetLibraries function

Response:
_G.GetLibraries = GetLibraries;
return GetLibraries


Prompt: -- obtain goals based on Center part

Response:
center.BodyPosition.position = beacon.Center.Position
teamColor = center.Color
vel = center.BodyVelocity
vel.velocity = Vector3.new(0, -2, 0)

healerIsResting = false

function restHealer()
	healerIsResting = true
	wait(5)
	healerIsResting = false
end

function onTouchHumanoid(humanoid)
	if not healerIsResting then
		-- Heal the player
		humanoid.Health = humanoid.Health + 50
		coroutine.resume(coroutine.create(restHealer))
	end
end

goingUp = false
function goUp(speed)
	if goingUp then
		return
	end
	goingUp = true
	vel.velocity = Vector3.new(0,speed,0)
	wait(20/speed)
	vel.velocity = Vector3.new(0,-2,0)
	goingUp = false
end

function onTouch(touchedPart)
	-- see if a character touched it
	local parent = touchedPart.Parent
	if parent ~= nil then
		local humanoid = parent:findFirstChild("Humanoid", false);
		if humanoid ~= nil then
			onTouchHumanoid(humanoid)
			goUp(10)
			return
		end
	end

	-- change direction
	if touchedPart.Position.y > beacon.Center.Position.y then
		vel.velocity = Vector3.new(0,-2,0)
		goingUp = false
	elseif touchedPart.Position.y < beacon.Center.Position.y then
		goUp(2)
	end
end

function connectPart(part)
	part.Color = teamColor
	part.Touched:connect(onTouch)
end


Prompt: -- at max range

Response:
script.Parent.Explosion.PlayOnRemove = false
swoosh:stop()
shaft:remove()