Prompt:
-- ROBLOX deviation: matchersObject annotated as { [string]: any } for now rather than { [string]: RawMatcherFn }
-- because we cannot currently express RawMatcherFn as tuple

Response:
type MatchersObject = { [string]: any }

local spyMatchers: MatchersObject = {
	lastCalledWith = createLastCalledWithMatcher("lastCalledWith"),
	lastReturnedWith = createLastReturnedMatcher("lastReturnedWith"),
	nthCalledWith = createNthCalledWithMatcher("nthCalledWith"),
	nthReturnedWith = createNthReturnedWithMatcher("nthReturnedWith"),
	toBeCalled = createToBeCalledMatcher("toBeCalled"),
	toBeCalledTimes = createToBeCalledTimesMatcher("toBeCalledTimes"),
	toBeCalledWith = createToBeCalledWithMatcher("toBeCalledWith"),
	toHaveBeenCalled = createToBeCalledMatcher("toHaveBeenCalled"),
	toHaveBeenCalledTimes = createToBeCalledTimesMatcher("toHaveBeenCalledTimes"),
	toHaveBeenCalledWith = createToBeCalledWithMatcher("toHaveBeenCalledWith"),
	toHaveBeenLastCalledWith = createLastCalledWithMatcher("toHaveBeenLastCalledWith"),
	toHaveBeenNthCalledWith = createNthCalledWithMatcher("toHaveBeenNthCalledWith"),
	toHaveLastReturnedWith = createLastReturnedMatcher("toHaveLastReturnedWith"),
	toHaveNthReturnedWith = createNthReturnedWithMatcher("toHaveNthReturnedWith"),
	toHaveReturned = createToReturnMatcher("toHaveReturned"),
	toHaveReturnedTimes = createToReturnTimesMatcher("toHaveReturnedTimes"),
	toHaveReturnedWith = createToReturnWithMatcher("toHaveReturnedWith"),
	toReturn = createToReturnMatcher("toReturn"),
	toReturnTimes = createToReturnTimesMatcher("toReturnTimes"),
	toReturnWith = createToReturnWithMatcher("toReturnWith"),
}

function isMock(received: any)
	return received ~= nil and typeof(received) == "table" and received._isMockFunction == true
end

function isSpy(received: any)
	return received ~= nil
		and typeof(received) == "table"
		and received.calls ~= nil
		and typeof(received.calls.all) == "function"
		and typeof(received.calls.count) == "function"
end


Prompt: -- Directional tags

Response:
local Direction = 0
local Steer = 0


Response:
		if script.Parent:FindFirstChild("Leg2") then
			local g = script.Parent.Leg2:Clone()
			g.Parent = File
			for _,i in pairs(g:GetChildren()) do
				if i:IsA("Part") or i:IsA("UnionOperation") or i:IsA("MeshPart") then
					i.CanCollide = false
					i.Anchored = false
					local Y = Instance.new("Weld")
					Y.Part0 = Player.Character["Right Leg"]
					Y.Part1 = g.Middle
					Y.C0 = CFrame.new(0, 0, 0)
					Y.Parent = Player.Character["Right Leg"]
				end
			end
		end


Prompt: --for i = 2, 100 do

Response: --prevRoom = roomModule.Generate(prevRoom, i)


Prompt: --[[Dependencies]]

Response:
	local player = game.Players.LocalPlayer
	local mouse = player:GetMouse()
	local UserInputService = game:GetService("UserInputService")
	local car = script.Parent.Car.Value
	local _Tune = require(car["A-Chassis Tune"])


Prompt:
--[[**put this code into a (server) script inside of the model that contains all of the dance
floor tiles, name the floor pieces "tile" and name the circle inside of
the tile "circle"**]]


Prompt:
-- deltarager cried here
-- 27/05/2021

Response:
repeat wait() until game:IsLoaded() and game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name) ~= nil and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") ~= nil

local ReplicatedStorage	= game:GetService("ReplicatedStorage")
local UserInputService	= game:GetService("UserInputService")
local constants			= require(ReplicatedStorage["ClientModules"].Constants)

local player	= game.Players.LocalPlayer
local character	= player.Character or player.CharacterAdded:Wait()
local humanoid	= character:WaitForChild("Humanoid")
local animator	= humanoid:WaitForChild("Animator")
local oldEvent1,oldEvent2	= nil,nil
local toolEvent,toolEventDe	= nil,nil

IdleAnimation 	= animator:LoadAnimation(ReplicatedStorage.Animations.Idle)
SprintAnimation = animator:LoadAnimation(ReplicatedStorage.Animations.Sprint)
CrouchAnimation = animator:LoadAnimation(ReplicatedStorage.Animations.Crouch)

local crouching	= false
local sprinting	= false
local equipped	= false
local shooting	= false

local function Crouch()
	if sprinting then
		humanoid.WalkSpeed = 16;
		SprintAnimation:Stop()
		sprinting = false
	end
	if crouching then
		humanoid.WalkSpeed = 16
		CrouchAnimation:Stop()
	else
		if equipped then
			IdleAnimation:Play()
		end
		CrouchAnimation:Play()
		humanoid.WalkSpeed = 10
	end
	crouching	= not crouching
end

local function Sprint()
	if crouching then
		humanoid.WalkSpeed = 16
		CrouchAnimation:Stop()
		if equipped then
			IdleAnimation:Stop()
		end
		crouching = false
	end
	if sprinting then
		humanoid.WalkSpeed = 16;
		if equipped then
			SprintAnimation:Stop()
			IdleAnimation:Play()
		end
	else
		if equipped then
			IdleAnimation:Stop()
			SprintAnimation:Play()
		end
		humanoid.WalkSpeed = 24;
	end
	sprinting		= not sprinting
end

UserInputService.InputBegan:Connect(function(input,gpe)
	if gpe then return end
	if input.KeyCode == constants.sprintKey and not shooting then
		Sprint()
	elseif input.KeyCode == constants.crouchKey then
		Crouch()
	elseif input.KeyCode == Enum.KeyCode.Space then
		if crouching then
			Crouch()
		end
	end
end)


Prompt: -- DO NOT GROUP THIS WITH YOUR MODEL!

Response:
local everything = {model}
local names = {model}

local children = game.Workspace:children()
for i=1,#children do
	if (children[i].Name == "flags") then -- Replace the name with your models's name.
		table.insert(everything, children[i]:clone())
		table.insert(names, children[i].Name)
	end
end

function regen()
	for i=1,#everything do
		game.Workspace:findFirstChild(names[i]):remove() -- Dont mess with this stuff.
		new_thing = everything[i]:clone()
		new_thing.Parent = game.Workspace
		new_thing:makeJoints()
	end
end

function onTouched()
		script.Parent.BrickColor = BrickColor.new(26)

		regen()
		wait(10)-- This is how long it takes untill the regen button will work again.

		script.Parent.BrickColor = BrickColor.new(104)

		debounce = false
end

 script.Parent.ClickDetector.MouseClick:connect(onTouched)


Prompt:
--[[
    Toggles light visibility in specified group
]]

Response:
function VehicleLightsComponent:toggleLights(group, isOn)
	for _, lightPart in pairs(group) do
		lightPart.Material = isOn and Enum.Material.Neon or Enum.Material.SmoothPlastic
		lightPart:FindFirstChildWhichIsA("Light").Enabled = isOn
	end
end


Prompt: --Evento touched: Se realiza animación en NPC y se invoca eventos

Response:
script.Parent.Parent.Touched:Connect(function(IsAPlayer)
	if debounce == false then
		if IsAPlayer.Parent:FindFirstChild("Humanoid") and game.Players:GetPlayerFromCharacter(IsAPlayer.Parent) then
			local animKill = Dummy:FindFirstChildOfClass("Humanoid"):LoadAnimation(animation)
			animKill:Play()

			sound:Play()
			debounce = true
			local player = game.Players:GetPlayerFromCharacter(IsAPlayer.Parent)
			chasedEvent:FireClient(player, Dummy)
			EventFolder.HideSelf:FireClient(player)
			script.Parent.Parent.Anchored = true
			wait(0.75)

			IsAPlayer.Parent.Humanoid.Health = 0
			wait(1)

			script.Parent.Parent.Anchored = false
			debounce = false
	    end
	end
end)


Prompt: -- Don't edit anything below unless you know what you are doing.

Response:
server = nil
service = nil
return function()
	for _,command in pairs(server.Commands) do
		if command.AdminLevel then
			local changed = false
			for _,actualCommandName in pairs(command.Commands) do
				if permissions[actualCommandName] then
					changed = true
					command.AdminLevel = permissions[actualCommandName]
				end
			end
			if not changed then command.AdminLevel = defaultLevel end
		end
	end
end


Prompt:
--[[
while cur_time < total_time do
	update(cur_time / total_time)
	local e,g = wait(.5)
	cur_time = cur_time + e
end
--]]


Prompt: --// Weapon Parts

Response:
local L_56_ = L_1_:WaitForChild('AimPart')
local L_57_
local L_58_ = L_1_:WaitForChild('Grip')
local L_59_ = L_1_:WaitForChild('FirePart')
local L_60_
local L_61_ = L_1_:WaitForChild('Mag')
local L_62_ = L_1_:WaitForChild('Bolt')


Prompt: -- UI Speed Value and UI Speeds

Response:
local ClipSettings = require(game.ReplicatedFirst.ClipSettings)
local SpeedVal = ClipSettings.uiSpeed
local normalSpd = 0.2
local fastSpd = 0.1
local maxSpd = 0.05


Prompt: -- Table used to hold Observer objects in memory.

Response: local strongRefs = {}


Prompt:
--[=[
	Returns a Promise that resolves after `seconds` seconds have passed. The Promise resolves with the actual amount of time that was waited.

	This function is a wrapper around `task.delay`.

	:::warning
	Passing NaN, +Infinity, -Infinity, 0, or any other number less than the duration of a Heartbeat will cause the promise to resolve on the very next Heartbeat.
	:::

	```lua
		Promise.delay(5):andThenCall(print, "This prints after 5 seconds")
	```

	@function delay
	@within Promise
	@param seconds number
	@return Promise<number>
]=]

Response:
function Promise.delay(seconds)
	assert(type(seconds) == "number", "Bad argument #1 to Promise.delay, must be a number.")
	local startTime = Promise._getTime()
	return Promise._new(debug.traceback(nil, 2), function(resolve)
		task.delay(seconds, function()
			resolve(Promise._getTime() - startTime)
		end)
	end)
end


Prompt:
---------------------------
--[[
	--Main anchor point is the DriveSeat <car.DriveSeat>

	Usage:
		MakeWeld(Part1,Part2,WeldType*,MotorVelocity**) *default is "Weld"  **Applies to Motor welds only
		ModelWeld(Model,MainPart)
	Example:
		MakeWeld(car.DriveSeat,misc.PassengerSeat)
		MakeWeld(car.DriveSeat,misc.SteeringWheel,"Motor",.2)
		ModelWeld(car.DriveSeat,misc.Door)
]]
--Weld stuff here

Response:
MakeWeld(car.DriveSeat,misc:WaitForChild('Aero'))

car.DriveSeat.ChildAdded:connect(function(child)
	if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(13),0,0)
	end
end)


Prompt:
--////////////////////////////// Methods
--//////////////////////////////////////

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

function methods:Destroy()
	self.Destroyed = true
end

function methods:SetActive(active)
	if active == self.Active then
		return
	end
	if active == false then
		self.MessageLogDisplay:Clear()
	else
		self.MessageLogDisplay:SetCurrentChannelName(self.Name)
		for i = 1, #self.MessageLog do
			self.MessageLogDisplay:AddMessage(self.MessageLog[i])
		end
	end
	self.Active = active
end

function methods:UpdateMessageFiltered(messageData)
	local searchIndex = 1
	local searchTable = self.MessageLog
	local messageObj = nil
	while (#searchTable >= searchIndex) do
		local obj = searchTable[searchIndex]

		if (obj.ID == messageData.ID) then
			messageObj = obj
			break
		end

		searchIndex = searchIndex + 1
	end

	if messageObj then
		messageObj.Message = messageData.Message
		messageObj.IsFiltered = true
		if self.Active then
			self.MessageLogDisplay:UpdateMessageFiltered(messageObj)
		end
	else
		-- We have not seen this filtered message before, but we should still add it to our log.
		self:AddMessageToChannelByTimeStamp(messageData)
	end
end

function methods:AddMessageToChannel(messageData)
	table.insert(self.MessageLog, messageData)
	if self.Active then
		self.MessageLogDisplay:AddMessage(messageData)
	end
	if #self.MessageLog > ChatSettings.MessageHistoryLengthPerChannel then
		self:RemoveLastMessageFromChannel()
	end
end

function methods:InternalAddMessageAtTimeStamp(messageData)
	for i = 1, #self.MessageLog do
		if messageData.Time < self.MessageLog[i].Time then
			table.insert(self.MessageLog, i, messageData)
			return
		end
	end
	table.insert(self.MessageLog, messageData)
end

function methods:AddMessagesToChannelByTimeStamp(messageLog, startIndex)
	for i = startIndex, #messageLog do
		self:InternalAddMessageAtTimeStamp(messageLog[i])
	end
	while #self.MessageLog > ChatSettings.MessageHistoryLengthPerChannel do
		table.remove(self.MessageLog, 1)
	end
	if self.Active then
		self.MessageLogDisplay:Clear()
		for i = 1, #self.MessageLog do
			self.MessageLogDisplay:AddMessage(self.MessageLog[i])
		end
	end
end

function methods:AddMessageToChannelByTimeStamp(messageData)
	if #self.MessageLog >= 1 then
		-- These are the fast cases to evalutate.
		if self.MessageLog[1].Time > messageData.Time then
			return
		elseif messageData.Time >= self.MessageLog[#self.MessageLog].Time then
			self:AddMessageToChannel(messageData)
			return
		end

		for i = 1, #self.MessageLog do
			if messageData.Time < self.MessageLog[i].Time then
				table.insert(self.MessageLog, i, messageData)

				if #self.MessageLog > ChatSettings.MessageHistoryLengthPerChannel then
					self:RemoveLastMessageFromChannel()
				end

				if self.Active then
					self.MessageLogDisplay:AddMessageAtIndex(messageData, i)
				end

				return
			end
		end
	else
		self:AddMessageToChannel(messageData)
	end
end

function methods:RemoveLastMessageFromChannel()
	table.remove(self.MessageLog, 1)

	if self.Active then
		self.MessageLogDisplay:RemoveLastMessage()
	end
end

function methods:ClearMessageLog()
	self.MessageLog = {}

	if self.Active then
		self.MessageLogDisplay:Clear()
	end
end

function methods:RegisterChannelTab(tab)
	self.ChannelTab = tab
end


Prompt:
--[[
	Returns true if the canvas is currently full.
]]

Response:
function Canvas:isFull()
	for _, spot in ipairs(self.spots) do
		if not spot:hasArt() then
			return false
		end
	end

	return true
end


Prompt: ---[[ Font Settings ]]

Response:
module.DefaultFont = Enum.Font.Cartoon
module.ChatBarFont = Enum.Font.Cartoon


Prompt: -- Attack configuration

Response:
local ATTACK_DAMAGE = getValueFromConfig("AttackDamage")
local ATTACK_RADIUS = getValueFromConfig("AttackRadius")


Prompt:
--[=[
	Utility functions affecting Brios.
	@class BrioUtils
]=]

Response:
local require = require(script.Parent.loader).load(script)

local Maid = require("Maid")
local Brio = require("Brio")

local BrioUtils = {}


Prompt:
--	elseif input.UserInputType == self.activeGamepad and input.KeyCode == Enum.KeyCode.ButtonL3 then
--		if (state == Enum.UserInputState.Begin) then
--			self.L3ButtonDown = true
--		elseif (state == Enum.UserInputState.End) then
--			self.L3ButtonDown = false
--			self.currentZoomSpeed = 1.00
--		end
--	end

Response:
end

function BaseCamera:DoKeyboardZoom(name, state, input)
	if not self.hasGameLoaded and VRService.VREnabled then
		return Enum.ContextActionResult.Pass
	end

	if state ~= Enum.UserInputState.Begin then
		return Enum.ContextActionResult.Pass
	end

	if self.distanceChangeEnabled and player.CameraMode ~= Enum.CameraMode.LockFirstPerson then
		if input.KeyCode == Enum.KeyCode.I then
			self:SetCameraToSubjectDistance( self.currentSubjectDistance - 5 )
		elseif input.KeyCode == Enum.KeyCode.O then
			self:SetCameraToSubjectDistance( self.currentSubjectDistance + 5 )
		end
		return Enum.ContextActionResult.Sink
	end
	return Enum.ContextActionResult.Pass
end

function BaseCamera:BindAction(actionName, actionFunc, createTouchButton, ...)
	table.insert(self.boundContextActions, actionName)
	ContextActionService:BindActionAtPriority(actionName, actionFunc, createTouchButton,
		CAMERA_ACTION_PRIORITY, ...)
end

function BaseCamera:BindGamepadInputActions()
	self:BindAction("BaseCameraGamepadPan", function(name, state, input) return self:GetGamepadPan(name, state, input) end,
		false, Enum.KeyCode.Thumbstick2)
	self:BindAction("BaseCameraGamepadZoom", function(name, state, input) return self:DoGamepadZoom(name, state, input) end,
		false, Enum.KeyCode.DPadLeft, Enum.KeyCode.DPadRight, Enum.KeyCode.ButtonR3)
end

function BaseCamera:BindKeyboardInputActions()
	self:BindAction("BaseCameraKeyboardPanArrowKeys", function(name, state, input) return self:DoKeyboardPanTurn(name, state, input) end,
		false, Enum.KeyCode.Left, Enum.KeyCode.Right)
	self:BindAction("BaseCameraKeyboardPan", function(name, state, input) return self:DoKeyboardPan(name, state, input) end,
		false, Enum.KeyCode.Comma, Enum.KeyCode.Period, Enum.KeyCode.PageUp, Enum.KeyCode.PageDown)
	self:BindAction("BaseCameraKeyboardZoom", function(name, state, input) return self:DoKeyboardZoom(name, state, input) end,
		false, Enum.KeyCode.I, Enum.KeyCode.O)
end

local function isInDynamicThumbstickArea(input)
	local playerGui = player:FindFirstChildOfClass("PlayerGui")
	local touchGui = playerGui and playerGui:FindFirstChild("TouchGui")
	local touchFrame = touchGui and touchGui:FindFirstChild("TouchControlFrame")
	local thumbstickFrame = touchFrame and touchFrame:FindFirstChild("DynamicThumbstickFrame")

	if not thumbstickFrame then
		return false
	end

	local frameCornerTopLeft = thumbstickFrame.AbsolutePosition
	local frameCornerBottomRight = frameCornerTopLeft + thumbstickFrame.AbsoluteSize
	if input.Position.X >= frameCornerTopLeft.X and input.Position.Y >= frameCornerTopLeft.Y then
		if input.Position.X <= frameCornerBottomRight.X and input.Position.Y <= frameCornerBottomRight.Y then
			return true
		end
	end

	return false
end


Prompt:
--[[
		___      _______                _
	   / _ |____/ ___/ /  ___ ____ ___ (_)__
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]

Response:
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_Sounds")
local _Tune = require(car["A-Chassis Tune"])
local on = 0
local mult=0
local det=0
local trm=0
local trmmult=0
local trmon=0
local throt=0
local redline=0
local shift=0

script:WaitForChild("Rev")

script.Parent.Values.Gear.Changed:connect(function()
	mult=1
	if script.Parent.Values.RPM.Value>5000 then
		shift=.2
	end
end)

for i,v in pairs(car.DriveSeat:GetChildren()) do
	for _,a in pairs(script:GetChildren()) do
		if v.Name==a.Name then v:Stop() wait() v:Destroy() end
	end
end

handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)
handler:FireServer("playSound","Rev")
car.DriveSeat:WaitForChild("Rev")

while wait() do
	mult=math.max(0,mult-.1)
	local _RPM = script.Parent.Values.RPM.Value

	if script.Parent.Values.Throttle.Value <= _Tune.IdleThrottle/100 then
		throt = math.max(.3,throt-.2)
		trmmult = math.max(0,trmmult-.05)
		trmon = 1
	else
		throt = math.min(1,throt+.1)
		trmmult = 1
		trmon = 0
	end
	shift = math.min(1,shift+.2)
	if script.Parent.Values.RPM.Value > _Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value > _Tune.IdleThrottle/100 then
		redline=.5
	else
		redline=1
	end
	if not script.Parent.IsOn.Value then on=math.max(on-12,0) else on=2 end
	local Volume = (3*throt*shift*redline)+(trm*trmon*trmmult*(3-throt)*math.sin(tick()*50))
	local Pitch = math.max((((script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),script.Rev.SetPitch.Value)
	if FE then
		handler:FireServer("updateSound","Rev",script.Rev.SoundId,Pitch,Volume)
	else
		car.DriveSeat.Rev.Volume = Volume
		car.DriveSeat.Rev.Pitch = Pitch
	end
end


Prompt: --Modules

Response: local serverWorkerModule = require(serverModulesFolder.WorkerModule)


Prompt:
-- Where applicable
-- a = amplitude
-- p = period

Response:
local sin, cos, asin = math.sin, math.cos, math.asin

local function Linear(t, b, c, d)
	return c * t / d + b
end

local function Smooth(t, b, c, d)
	t = t / d
	return c * t * t * (3 - 2 * t) + b
end

local function Smoother(t, b, c, d)
	t = t / d
	return c * t * t * t * (t * (6 * t - 15) + 10) + b
end


Prompt:
--[[**
	ensures Roblox Enum type

	@param value The value to check against

	@returns True iff the condition is satisfied, false otherwise
**--]]

Response: t.Enum = t.typeof("Enum")


Prompt:
--[[

	PID stands for Proportional-Integral-Derivative. One example of PID controllers in
	real-life is to control the input to each motor of a drone to keep it stabilized.
	Another example is cruise-control on a car.

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

	Constructor:

		pid = PID.new(min, max, kP, kD, kI)

	Methods:

		pid:Calculate(dt, setpoint, pv)
		> Calculates and returns the new value
			> dt: DeltaTime
			> setpoint: The current point
			> pv: The process variable (i.e. goal)

		pid:Reset()
		> Resets the PID

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

--]]

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

function PID.new(min, max, kp, kd, ki)
	local self = setmetatable({}, PID)
	self._min = min
	self._max = max
	self._kp = kp
	self._kd = kd
	self._ki = ki
	self._preError = 0
	self._integral = 0
	return self
end

function PID:Reset()
	self._preError = 0
	self._integral = 0
end

function PID:Calculate(dt, setpoint, pv)
	local err = (setpoint - pv)
	local pOut = (self._kp * err)
	self._integral += (err * dt)
	local iOut = (self._ki * self._integral)
	local deriv = ((err - self._preError) / dt)
	local dOut = (self._kd * deriv)
	local output = math.clamp((pOut + iOut + dOut), self._min, self._max)
	self._preError = err
	return output
end

function PID:SetMinMax(min, max)
	self._min = min
	self._max = max
end

return PID


Prompt:
--[=[
	Instantly skips the spring forwards by that amount time
	@param delta number -- Time to skip forwards
	@return ()
]=]

Response:
function Spring:TimeSkip(delta)
	local now = self._clock()
	local position, velocity = self:_positionVelocity(now+delta)
	self._position0 = position
	self._velocity0 = velocity
	self._time0 = now
end


Prompt: -- map a value from one range to another

Response:
local function map(x, inMin, inMax, outMin, outMax)
	return (x - inMin)*(outMax - outMin)/(inMax - inMin) + outMin
end

local function playSound(sound)
	sound.TimePosition = 0
	sound.Playing = true
end

local function shallowCopy(t)
	local out = {}
	for k, v in pairs(t) do
		out[k] = v
	end
	return out
end

local function initializeSoundSystem(player, humanoid, rootPart)
	local sounds = {}

	-- initialize sounds
	for name, props in pairs(SOUND_DATA) do
		local sound = Instance.new("Sound")
		sound.Name = name

		-- set default values
		sound.Archivable = false
		sound.EmitterSize = 5
		sound.MaxDistance = 150
		sound.Volume = 0.65

		for propName, propValue in pairs(props) do
			sound[propName] = propValue
		end

		sound.Parent = rootPart
		sounds[name] = sound
	end

	local playingLoopedSounds = {}

	local function stopPlayingLoopedSounds(except)
		for sound in pairs(shallowCopy(playingLoopedSounds)) do
			if sound ~= except then
				sound.Playing = false
				playingLoopedSounds[sound] = nil
			end
		end
	end

	-- state transition callbacks
	local stateTransitions = {
		[Enum.HumanoidStateType.FallingDown] = function()
			stopPlayingLoopedSounds()
		end,

		[Enum.HumanoidStateType.GettingUp] = function()
			stopPlayingLoopedSounds()
			playSound(sounds.GettingUp)
		end,

		[Enum.HumanoidStateType.Jumping] = function()
			stopPlayingLoopedSounds()
			playSound(sounds.Jumping)
		end,

		[Enum.HumanoidStateType.Swimming] = function()
			local verticalSpeed = math.abs(rootPart.Velocity.Y)
			if verticalSpeed > 0.1 then
				sounds.Splash.Volume = math.clamp(map(verticalSpeed, 100, 350, 0.28, 1), 0, 1)
				playSound(sounds.Splash)
			end
			stopPlayingLoopedSounds(sounds.Swimming)
			sounds.Swimming.Playing = true
			playingLoopedSounds[sounds.Swimming] = true
		end,

		[Enum.HumanoidStateType.Freefall] = function()
			sounds.FreeFalling.Volume = 0
			stopPlayingLoopedSounds(sounds.FreeFalling)
			playingLoopedSounds[sounds.FreeFalling] = true
		end,

		[Enum.HumanoidStateType.Landed] = function()
			stopPlayingLoopedSounds()
			local verticalSpeed = math.abs(rootPart.Velocity.Y)
			if verticalSpeed > 75 then
				sounds.Landing.Volume = math.clamp(map(verticalSpeed, 50, 100, 0, 1), 0, 1)
				playSound(sounds.Landing)
			end
		end,

		[Enum.HumanoidStateType.Running] = function()
			stopPlayingLoopedSounds(sounds.Running)
			sounds.Running.Playing = true
			playingLoopedSounds[sounds.Running] = true
		end,

		[Enum.HumanoidStateType.Climbing] = function()
			local sound = sounds.Climbing
			if math.abs(rootPart.Velocity.Y) > 0.1 then
				sound.Playing = true
				stopPlayingLoopedSounds(sound)
			else
				stopPlayingLoopedSounds()
			end
			playingLoopedSounds[sound] = true
		end,

		[Enum.HumanoidStateType.Seated] = function()
			stopPlayingLoopedSounds()
		end,

		[Enum.HumanoidStateType.Dead] = function()
			stopPlayingLoopedSounds()
			playSound(sounds.Died)
		end,
	}

	-- updaters for looped sounds
	local loopedSoundUpdaters = {
		[sounds.Climbing] = function(dt, sound, vel)
			sound.Playing = vel.Magnitude > 0.1
		end,

		[sounds.FreeFalling] = function(dt, sound, vel)
			if vel.Magnitude > 75 then
				sound.Volume = math.clamp(sound.Volume + 0.9*dt, 0, 1)
			else
				sound.Volume = 0
			end
		end,

		[sounds.Running] = function(dt, sound, vel)
			sound.Playing = vel.Magnitude > 0.5 and humanoid.MoveDirection.Magnitude > 0.5
		end,
	}

	-- state substitutions to avoid duplicating entries in the state table
	local stateRemap = {
		[Enum.HumanoidStateType.RunningNoPhysics] = Enum.HumanoidStateType.Running,
	}

	local activeState = stateRemap[humanoid:GetState()] or humanoid:GetState()

	local stateChangedConn = humanoid.StateChanged:Connect(function(_, state)
		state = stateRemap[state] or state

		if state ~= activeState then
			local transitionFunc = stateTransitions[state]

			if transitionFunc then
				transitionFunc()
			end

			activeState = state
		end
	end)

	local steppedConn = RunService.Stepped:Connect(function(_, worldDt)
		-- update looped sounds on stepped
		for sound in pairs(playingLoopedSounds) do
			local updater = loopedSoundUpdaters[sound]

			if updater then
				updater(worldDt, sound, rootPart.Velocity)
			end
		end
	end)

	local humanoidAncestryChangedConn
	local rootPartAncestryChangedConn
	local characterAddedConn

	local function terminate()
		stateChangedConn:Disconnect()
		steppedConn:Disconnect()
		humanoidAncestryChangedConn:Disconnect()
		rootPartAncestryChangedConn:Disconnect()
		characterAddedConn:Disconnect()
	end

	humanoidAncestryChangedConn = humanoid.AncestryChanged:Connect(function(_, parent)
		if not parent then
			terminate()
		end
	end)

	rootPartAncestryChangedConn = rootPart.AncestryChanged:Connect(function(_, parent)
		if not parent then
			terminate()
		end
	end)

	characterAddedConn = player.CharacterAdded:Connect(terminate)
end

local function playerAdded(player)
	local function characterAdded(character)
		-- Avoiding memory leaks in the face of Character/Humanoid/RootPart lifetime has a few complications:
		-- * character deparenting is a Remove instead of a Destroy, so signals are not cleaned up automatically.
		-- ** must use a waitForFirst on everything and listen for hierarchy changes.
		-- * the character might not be in the dm by the time CharacterAdded fires
		-- ** constantly check consistency with player.Character and abort if CharacterAdded is fired again
		-- * Humanoid may not exist immediately, and by the time it's inserted the character might be deparented.
		-- * RootPart probably won't exist immediately.
		-- ** by the time RootPart is inserted and Humanoid.RootPart is set, the character or the humanoid might be deparented.

		if not character.Parent then
			waitForFirst(character.AncestryChanged, player.CharacterAdded)
		end

		if player.Character ~= character or not character.Parent then
			return
		end

		local humanoid = character:FindFirstChildOfClass("Humanoid")
		while character:IsDescendantOf(game) and not humanoid do
			waitForFirst(character.ChildAdded, character.AncestryChanged, player.CharacterAdded)
			humanoid = character:FindFirstChildOfClass("Humanoid")
		end

		if player.Character ~= character or not character:IsDescendantOf(game) then
			return
		end

		-- must rely on HumanoidRootPart naming because Humanoid.RootPart does not fire changed signals
		local rootPart = character:FindFirstChild("HumanoidRootPart")
		while character:IsDescendantOf(game) and not rootPart do
			waitForFirst(character.ChildAdded, character.AncestryChanged, humanoid.AncestryChanged, player.CharacterAdded)
			rootPart = character:FindFirstChild("HumanoidRootPart")
		end

		if rootPart and humanoid:IsDescendantOf(game) and character:IsDescendantOf(game) and player.Character == character then
			initializeSoundSystem(player, humanoid, rootPart)
		end
	end

	if player.Character then
		characterAdded(player.Character)
	end
	player.CharacterAdded:Connect(characterAdded)
end

Players.PlayerAdded:Connect(playerAdded)
for _, player in ipairs(Players:GetPlayers()) do
	playerAdded(player)
end


Prompt: -- Find the player who sent the chat message

Response:
function getPlayerFromChat(chat)
	for _,player in ipairs(Players:GetPlayers()) do
		if player.Name == chat.PlayerName then
			return player
		end
	end
end


Prompt: -- Make sure your buttons text is the same the first purple quote --


Prompt:
--[=[
	@within TableUtil
	@function Reduce
	@param tbl table
	@param predicate (accumulator: any, value: any, index: any, tbl: table) -> result: any
	@return table

	Performs a reduce operation against the given table, which can be used to
	reduce the table into a single value. This could be used to sum up a table
	or transform all the values into a compound value of any kind.

	For example:

	```lua
	local t = {10, 20, 30, 40}
	local result = TableUtil.Reduce(t, function(accum, value)
		return accum + value
	end)
	print(result) --> 100
	```
]=]

Response:
local function Reduce<T, R>(t: { T }, predicate: (R, T, any, { T }) -> R, init: R): R
	assert(type(t) == "table", "First argument must be a table")
	assert(type(predicate) == "function", "Second argument must be a function")
	local result = init :: R
	if #t > 0 then
		local start = 1
		if init == nil then
			result = (t[1] :: any) :: R
			start = 2
		end
		for i = start, #t do
			result = predicate(result, t[i], i, t)
		end
	else
		local start = nil
		if init == nil then
			result = (next(t) :: any) :: R
			start = result
		end
		for k, v in next, t, start :: any? do
			result = predicate(result, v, k, t)
		end
	end
	return result
end


Prompt: -- Returns a character ancestor and its Humanoid, or nil

Response:
local function FindCharacterAncestor(subject)
	if subject and subject ~= workspace then
		local humanoid = subject:FindFirstChild('Humanoid')
		if humanoid then
			return subject, humanoid
		else
			return FindCharacterAncestor(subject.Parent)
		end
	end
	return nil
end


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

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

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

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

return {
	ConfigurationProvider = ConfigurationProvider,
	withConfiguration = withConfiguration,
}


Prompt:
---- IconMap ----
-- Image size: 256px x 256px
-- Icon size: 16px x 16px
-- Padding between each icon: 2px
-- Padding around image edge: 1px
-- Total icons: 14 x 14 (196)

Response:
local Icon, ClassIcon do
	local iconMap = 'http://www.roblox.com/asset/?id=' .. MAP_ID
	game:GetService('ContentProvider'):Preload(iconMap)
	local iconDehash do
		-- 14 x 14, 0-based input, 0-based output
		local f=math.floor
		function iconDehash(h)
			return f(h/14%14),f(h%14)
		end
	end

	function Icon(IconFrame,index)
		local row,col = iconDehash(index)
		local mapSize = Vector2_new(256,256)
		local pad,border = 2,1
		local iconSize = 16

		local class = 'Frame'
		if type(IconFrame) == 'string' then
			class = IconFrame
			IconFrame = nil
		end

		if not IconFrame then
			IconFrame = Create(class,{
				Name = "Icon";
				BackgroundTransparency = 1;
				ClipsDescendants = true;
				Create('ImageLabel',{
					Name = "IconMap";
					Active = false;
					BackgroundTransparency = 1;
					Image = iconMap;
					Size = UDim2_new(mapSize.x/iconSize,0,mapSize.y/iconSize,0);
				});
			})
		end

		IconFrame.IconMap.Position = UDim2_new(-col - (pad*(col+1) + border)/iconSize,0,-row - (pad*(row+1) + border)/iconSize,0)
		return IconFrame
	end

	function ClassIcon(IconFrame, index)
		local offset = index * 16

		local class = 'Frame'
		if type(IconFrame) == 'string' then
			class = IconFrame
			IconFrame = nil
		end

		if not IconFrame then
			IconFrame = Create(class,{
				Name = "Icon";
				BackgroundTransparency = 1;
				ClipsDescendants = true;
				Create('ImageLabel',{
					Name = "IconMap";
					BackgroundTransparency = 1;
					Image = CLASS_MAP_ID;
					ImageRectSize = Vector2_new(16, 16);
					ImageRectOffset = Vector2_new(offset, 0);
					Size = UDim2_new(1, 0, 1, 0);
					Parent = IconFrame
				});
			})
		end

		IconFrame.IconMap.ImageRectOffset = Vector2_new(offset, 0);
		return IconFrame
	end
end


Prompt: -- Static camera utils

Response:
local CameraUtils = require(script:WaitForChild("CameraUtils"))
local CameraInput = require(script:WaitForChild("CameraInput"))


Prompt: --Front Suspension

Response:
Tune.FSusDamping	= 401		-- Spring Dampening
Tune.FSusStiffness	= 17000		-- Spring Force
Tune.FAntiRoll 		= 22.92		-- Anti-Roll (Gyro Dampening)

Tune.FSusLength		= 1.9			-- Suspension length (in studs)
Tune.FPreCompress	= .15		-- Pre-compression adds resting length force
Tune.FExtensionLim	= .3		-- Max Extension Travel (in studs)
Tune.FCompressLim	= .05		-- Max Compression Travel (in studs)
Tune.FSusAngle		= 54		-- Suspension Angle (degrees from horizontal)

Tune.FWsBoneLen		= 6			-- Wishbone Length
Tune.FWsBoneAngle	= 3			-- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	--[[Lateral]]		-.4		,	-- positive = outward
	--[[Vertical]]		-.5		,	-- positive = upward
	--[[Forward]]		0		}	-- positive = forward


Prompt:
--[=[
	Cleans up all objects in the trove. This is
	similar to calling `Remove` on each object
	within the trove.
]=]

Response:
function Trove:Clean()
	for _,obj in ipairs(self._objects) do
		self:_cleanupObject(obj[1], obj[2])
	end
	table.clear(self._objects)
end

function Trove:_findAndRemoveFromObjects(object: any, cleanup: boolean): boolean
	local objects = self._objects
	for i,obj in ipairs(objects) do
		if obj[1] == object then
			local n = #objects
			objects[i] = objects[n]
			objects[n] = nil
			if cleanup then
				self:_cleanupObject(obj[1], obj[2])
			end
			return true
		end
	end
	return true
end

function Trove:_cleanupObject(object, cleanupMethod)
	if cleanupMethod == FN_MARKER then
		object()
	elseif cleanupMethod == THREAD_MARKER then
		coroutine.close(object)
	else
		object[cleanupMethod](object)
	end
end


Prompt:
--[[
[ENCYCLOPEDIA]
-[BezierService]---------------
	BezierService almost identically mimics TweenService, but rather, it creates
	BezierBase's. A BezierBase will move an instance along a bezier curve.

	How to use:

	local ReplicatedStorage = game:GetService("ReplicatedStorage")
	local BezierService = require(ReplicatedStorage.BezierService)

	local part = workspace.Part
	local b = BezierService.Create(part, TweenInfo.new(), {
		LookVector = Vector3.one  -- some direction you want your part to look
		positions = { -- positions that will guide the bezier curve
			Vector3.new(5,5,5),
			Vector3.new(2, 25, 50),
			Vector3.new(15, 15, 15)
		}
	})

	b:Play()
	b.Completed:Connect(function()
		print("completed!")
	end)
--]]

Response:
local BezierService = {

}


Prompt: -- SERVICES --

Response:
local UIS = game:GetService("UserInputService")
local RS = game:GetService("ReplicatedStorage")
local TS = game:GetService("TweenService")


Response:
	script.Parent.Handle2.Hinge1.Transparency = 1
	script.Parent.Handle2.Interactive1.Transparency = 1
	script.Parent.Handle2.Part1.Transparency = 1


Prompt: -- Services

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


Prompt: --// Services

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


Response:
function onRunning(speed)
	if speed > 0.01 then
		playAnimation("walk", 0.1, Humanoid)
		if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
			setAnimationSpeed(speed / 14.5)
		end
		pose = "Running"
	else
		if emoteNames[currentAnim] == nil then
			playAnimation("idle", 0.1, Humanoid)
			pose = "Standing"
		end
	end
end

function onDied()
	pose = "Dead"
end

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

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

function onGettingUp()
	pose = "GettingUp"
end

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

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	pose = "Seated"
end

function onPlatformStanding()
	pose = "PlatformStanding"
end

function onSwimming(speed)
	if speed > 0 then
		pose = "Running"
	else
		pose = "Standing"
	end
end

function getTool()
	for _, kid in ipairs(Figure:GetChildren()) do
		if kid.className == "Tool" then return kid end
	end
	return nil
end

function getToolAnim(tool)
	for _, c in ipairs(tool:GetChildren()) do
		if c.Name == "toolanim" and c.className == "StringValue" then
			return c
		end
	end
	return nil
end

function animateTool()

	if (toolAnim == "None") then
		playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
		return
	end

	if (toolAnim == "Slash") then
		playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
		return
	end

	if (toolAnim == "Lunge") then
		playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
		return
	end
end

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

local lastTick = 0

function move(time)
	local amplitude = 1
	local frequency = 1
	local deltaTime = time - lastTick
	lastTick = time

	local climbFudge = 0
	local setAngles = false

	if (jumpAnimTime > 0) then
		jumpAnimTime = jumpAnimTime - deltaTime
	end

	if (pose == "FreeFall" and jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, Humanoid)
	elseif (pose == "Seated") then
		playAnimation("sit", 0.5, Humanoid)
		return
	elseif (pose == "Running") then
		playAnimation("walk", 0.1, Humanoid)
	elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
		--		print("Wha " .. pose)
		stopAllAnimations()
		amplitude = 0.1
		frequency = 1
		setAngles = true
	end

	if (setAngles) then
		local desiredAngle = amplitude * math.sin(time * frequency)

		RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
		LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
		RightHip:SetDesiredAngle(-desiredAngle)
		LeftHip:SetDesiredAngle(-desiredAngle)
	end

	-- Tool Animation handling
	local tool = getTool()
	if tool and tool:FindFirstChild("Handle") then

		local animStringValueObject = getToolAnim(tool)

		if animStringValueObject 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
		stopToolAnimations()
		toolAnim = "None"
		toolAnimInstance = nil
		toolAnimTime = 0
	end
end


Prompt: --// States

Response:
local L_61_ = false
local L_62_ = false
local L_63_ = false
local L_64_ = false
local L_65_ = false
local L_66_ = true
local L_67_ = false
local L_68_ = false
local L_69_ = false
local L_70_ = false
local L_71_ = false
local L_72_ = false
local L_73_ = false
local L_74_ = false
local L_75_ = false
local L_76_ = false

local L_77_ = false
local L_78_ = false
local L_79_ = false

local L_80_ = false
local L_81_ = true
local L_82_ = true

local L_83_ = false

local L_84_
local L_85_

local L_86_
local L_87_
local L_88_

local L_89_ = L_24_.FireMode

local L_90_ = 0
local L_91_ = false
local L_92_ = true
local L_93_ = false

local L_94_ = 70


Prompt: -- setup emote chat hook

Response:
game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
	local emote = ""
	if msg == "/e dance" then
		emote = dances[math.random(1, #dances)]
	elseif (string.sub(msg, 1, 3) == "/e ") then
		emote = string.sub(msg, 4)
	elseif (string.sub(msg, 1, 7) == "/emote ") then
		emote = string.sub(msg, 8)
	end

	if (pose == "Standing" and emoteNames[emote] ~= nil) then
		playAnimation(emote, 0.1, Humanoid)
	end

end)


Prompt:
--[[for x = 1, 50 do
s.Pitch = s.Pitch + 0.01
s:play()
wait(0.001)
end]]

Response:
for x = 50, 120 do
s:play()
wait(0.001)
end
for x = 50, 120 do
s.Pitch = s.Pitch - 0.0021
s:play()
wait(0.001)
end
wait()
end


Prompt: --------LEFT DOOR 10--------

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


Prompt: --Stickmasterluke

Response:
sp=script.Parent

damage=10
stuck=false

sp.Touched:connect(function(hit)
	if hit and hit~=nil and sp~=nil and not stuck then
		local ct=sp:FindFirstChild("creator")
		if ct.Value~=nil and ct.Value.Character~=nil then
			if hit.Parent~=ct.Value.Character and hit.Name~="Handle" and hit.Name~="Effect" then
				stuck=true
				local w=Instance.new("Weld")
				w.Part0=hit
				w.Part1=sp
				w.C0=hit.CFrame:toObjectSpace(sp.CFrame)
				w.Parent=sp
				local bf=sp:FindFirstChild("BodyForce")
				if bf then
					bf:remove()
				end
				local sound=sp:FindFirstChild("Sound")
				if sound then
					sound:Play()
				end
				sp.Transparency=1
				local h=hit.Parent:FindFirstChild("Humanoid")
				local t=hit.Parent:FindFirstChild("Torso")
				if h~=nil and t~=nil and h.Health>0 then
					for i,v in ipairs(h:GetChildren()) do
						if v.Name=="creator" then
							v:remove()
						end
					end
					ct:clone().Parent=h
					h:TakeDamage(damage)
				end
				local smoke=sp:FindFirstChild("Smoke")
				if smoke then
					smoke.Enabled=true
					wait(.1)
					if smoke then
						smoke.Enabled=false
					end
				end
				wait(5)
				if sp and sp~=nil and sp.Parent~=nil then
					sp:remove()
				end
			end
		end
	end
end)

while not stuck do
	wait(.5)
	local smoke=sp:FindFirstChild("Smoke")
	if not stuck and smoke then
		sp.Transparency=1
		smoke.Enabled=true
		wait(.3)
		if smoke then
			smoke.Enabled=false
		end
	end
	wait(1.5)
	local smoke=sp:FindFirstChild("Smoke")
	if not stuck and smoke then
		sp.Transparency=0
		smoke.Enabled=true
		wait(.3)
		if smoke then
			smoke.Enabled=false
		end
	end
end


Prompt:
--[=[
	Destroys the Touch input capturer.
]=]

Response:
function Touch:Destroy()
	self._trove:Destroy()
end

return Touch


Prompt:
--[[
		Walking NPCs
All points (Point A, B, C, D, and E) must be inside of the model.
You should be able to edit the NPC's looks.
Simply keep the Humanoid, animate, Walk, Head, Torso, and (I think) the legs.
The NPC should  be grouped with the Points
]]

Response:
--

local npc = script.Parent

local idleanim = script.Animation1
local runanim = script.RunAnim

local idleanimtrack = npc.AI:LoadAnimation(idleanim)
local runanimtrack = npc.AI:LoadAnimation(runanim)

idleanimtrack:Play()
idleanimtrack.Looped = true
script.Parent.HitBox.Script.Enabled = false

model = script.Parent.Parent
hum = script.Parent.AI
torso = script.Parent.Torso
while true do
	wait(math.random(5,7))
	if model.PointA ~= nil then
		a = model.PointA
		hum:MoveTo(a.Position, a)
		idleanimtrack:Stop()
		script.Parent.Head["Scary Scream"]:Play()
		script.Parent.HitBox.Script.Enabled = true
		runanimtrack:Play()
		repeat
			wait(0.1)
			wait(6)
			script.Parent.Parent:Destroy()

		until (a.Position - torso.Position).magnitude <= 5

	else
		print("No Point A.")
	end

end


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

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

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

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

	,MinSpread = 1.25				--- Min bullet spread value | Studs
	,MaxSpread = 40					--- Max bullet spread value | Studs
	,AimInaccuracyStepAmount = 0.75
	,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:
--[=[
	@private
	@class LoaderConstants
]=]

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

return Utils.readonly({
	GROUP_EACH_PACKAGE_INDIVIDUALLY = false;
	ALLOW_MULTIPLE_GROUPS = true;
	INCLUDE_IMPLICIT_DEPENDENCIES = true;
})


Prompt: --//# Script runs ingame!

Response:
local Lighting = game:GetService("Lighting");

local Enabled = true

local TerrainPlusEnabled = true
local BetterLightingEnabled = true


Prompt: --local distance = 40

Response:
while true do
 wait(pause) --CICLO
 for i= 0, 10/dpf do
  object:SetPrimaryPartCFrame(object:GetPrimaryPartCFrame() * CFrame.new(0, dpf, 0))
  wait(0)
 end
 wait(pause) --CICLO
 for i= 0, 10/dpf do
  object:SetPrimaryPartCFrame(object:GetPrimaryPartCFrame() * CFrame.new(0, -dpf, 0))
  wait(0)
	 end
wait(pause) --CICLO
 for i= 0, 6/dpf do
  object:SetPrimaryPartCFrame(object:GetPrimaryPartCFrame() * CFrame.new(0, dpf, 0))
  wait(0)
	 end
wait(pause) --CICLO
 for i= 0, 6/dpf do
  object:SetPrimaryPartCFrame(object:GetPrimaryPartCFrame() * CFrame.new(0, -dpf, 0))
  wait(0)
	 end
wait(pause) --CICLO
 for i= 0, 8/dpf do
  object:SetPrimaryPartCFrame(object:GetPrimaryPartCFrame() * CFrame.new(0, dpf, 0))
  wait(0)
	 end
wait(pause) --CICLO
 for i= 0, 8/dpf do
  object:SetPrimaryPartCFrame(object:GetPrimaryPartCFrame() * CFrame.new(0, -dpf, 0))
  wait(0)
	 end
end


Prompt: -- Helper function for Determinant of 3x3, not in CameraUtils for performance reasons

Response:
local function Det3x3(a: number,b: number,c: number,d: number,e: number,f: number,g: number,h: number,i: number): nemubr
	return (a*(e*i-f*h)-b*(d*i-f*g)+c*(d*h-e*g))
end


Prompt: -- Setup animation objects

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

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

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


Prompt: --  Find Player (& who else not to find).

Response:
function findNearestTorso(pos)  --  declare pos a local vector3
	local list = game.Workspace:children()
	local torso = nil
	local dist = 1000  -- Area to search
	local temp = nil
	local human = nil
	local temp2 = nil
	for x = 1, #list do
		temp2 = list[x]
		if temp2.className == "Model" then
			temp = temp2:findFirstChild("Torso")
			if temp ~= nil then
				human = temp2:findFirstChild("Humanoid")
				if human ~= nil and (human.Health > 0) and (temp2.Name ~= AIName) then -- not named the same as us.
					if (temp.Position - pos).magnitude < dist then
						torso = temp
						dist = (temp.Position - pos).magnitude
					end  --  closer?
				end   --  human? Not us.
			end -- Has torso?
		end   --  Model?
	end  --  For. Loop thru parts in Workplace

	return torso
end  -- findNearest

function DrawRay(origin, point)  -- 7 studs long
	local Ray = Ray.new(origin, (point).unit * 7) --Make the ray.
	local Hit,Position = game.Workspace:FindPartOnRay(Ray,AI) --Check for collisions along the ray, ignoring any Parts of us.

if GraphicsOn then --Graphics
	local RayPart = Instance.new("Part",AI)
	if Hit then
		if Logic == 1 then
			RayPart.BrickColor = BrickColor.new("Black") --Set its color.
		else
			RayPart.BrickColor = BrickColor.new("Bright red") --Set its color.
		end
	else
		if Logic == 1 then
			RayPart.BrickColor = BrickColor.new("White") --Set its color.
		else
			RayPart.BrickColor = BrickColor.new("Olive") --Set its color.
		end
	end
	RayPart.Transparency = 0.2 --Set its transparency.
	RayPart.Anchored = true --Set whether it will fall or not.
	RayPart.CanCollide = false --Set whether people can walk though it or not.
   RayPart.formFactor = Enum.FormFactor.Custom --Make it so it can be small.
local Distance = (Position-origin).magnitude --Find the distance between the hit and the torso.
	RayPart.Size = Vector3.new(0.4,.2,Distance) --Set its size to the distance.
	RayPart.CFrame = CFrame.new(Position, origin) * CFrame.new(0,0,-Distance/2) --Move it halfway.
	game.Debris:AddItem(RayPart,2) --Add it to the debris.
end -- Graphics

return Hit
end -- DrawRay

function FireRayToward() -- possible path, and read the Part we hit, if any.
 ClimbingLadder = false

local originPrime = origin * Vector3.new(.8,0,0) - Vector3.new(0,.4,0) -- Offset Right + OffY
local offset = origin * Vector3.new(.8,0,0) - origin * Vector3.new(-.8,0,0) -- left (I guess this is increment. I didn't WANT to do it this way)
local point = origin.lookVector * 7 -- dir
local pointPrime = point - offset + Vector3.new(0,2,0)  -- dir + OffsetLeft + OffsetY = direction of Ray

local	Hit = DrawRay(originPrime, pointPrime) -- see if we hit anything

	if Hit then

		if target.Parent == Hit.Parent then


Prompt: --------------------mods

Response:
local ModTable = {

	camRecoilMod 	= {
		RecoilTilt 	= 1,
		RecoilUp 	= 1,
		RecoilLeft 	= 1,
		RecoilRight = 1
	}

	,gunRecoilMod	= {
		RecoilUp 	= 1,
		RecoilTilt 	= 1,
		RecoilLeft 	= 1,
		RecoilRight = 1
	}

	,ZoomValue 		= 70
	,Zoom2Value 	= 70
	,AimRM 			= 1
	,SpreadRM 		= 1
	,DamageMod 		= 1
	,minDamageMod 	= 1

	,MinRecoilPower 			= 1
	,MaxRecoilPower 			= 1
	,RecoilPowerStepAmount 		= 1

	,MinSpread 					= 1
	,MaxSpread 					= 1
	,AimInaccuracyStepAmount 	= 1
	,AimInaccuracyDecrease 		= 1
	,WalkMult 					= 1
	,adsTime 					= 1
	,MuzzleVelocity 			= 1
}


Prompt:
--	local rocket = pos:Clone() -- создаём клон
--	rocket.Parent = game.Workspace
--	rocket.Name = "bullet" -- pos.Parent.Name
--	Debris :AddItem(rocket, 10) -- уничтожение по истечении таймера сколько проживёт снаряд

Response:
	 -- добавляем переменную с повреждением
	local dam	= Instance.new("IntValue")
	dam.Name	= "Damage"
	dam.Parent	= rocket
	dam.Value	= damage
	 -- добавляем переменную скорости
	local spd	= Instance.new("IntValue")
	spd.Name	= "Speed"
	spd.Parent	= rocket
	spd.Value	= speed
	 -- добавляем переменную типа
	local tpt	= Instance.new("StringValue")
	tpt.Name	= "Type"
	tpt.Parent	= rocket
	tpt.Value	= Type
	 -- добавляем переменную хозяина
	if pos:FindFirstChild("Owner") ~= nil then
		if rocket:FindFirstChild("Owner") == nil then
			local own	= pos.Owner:Clone()
			own.Parent	= rocket
		end
	end
	-- вешаем на него скрипт полёта, соприкосновения и активируем
	local scr	= script.bullet:Clone()
	scr.Parent	= rocket
	scr.Name	= "bullet"


Prompt:
--[[Config = require(script.Parent.Parent.Parent.Parent.Parent.CustomLabel)
CustomLabel = Config["CUSTOMFLOORLABEL"][tonumber(script.Parent.Parent.Name)]
script.Parent.SurfaceGui.Frame.TextLabel.Text = CustomLabel or script.Parent.Parent.Name]]

Response:
while true do
	script.Parent.SurfaceGui.Frame.TextLabel.TextColor3 = script.Parent.Parent.Light.Color
	if script.Parent.Parent.Light.Material == Enum.Material.Neon then
		script.Parent.SurfaceGui.LightInfluence = 0
	else
		script.Parent.SurfaceGui.LightInfluence = 1
	end
	wait()
end


Prompt: --------------------[ CAMERA STEADYING FUNCTIONS ]------------------------------------

Response:
function steadyCamera()
	scopeSteady.Text = "Steadying..."
	scopeSteady.TextColor3 = Color3.new(1, 1, 0)
	camSteady = true
	local originalSway = camSway
	local Increment = 1.5 / 0.6
	local X = 0
	while true do
		RS.RenderStepped:wait()
		local newX = X + Increment
		X = (newX > 90 and 90 or newX)
		if (not steadyKeyPressed) then break end
		camSway = numLerp(originalSway, 0, Sine(X))
		if X == 90 then break end
	end
	while steadyKeyPressed and Aimed do
		if currentSteadyTime > 0 then
			local NewSteadyTime = currentSteadyTime - 1
			currentSteadyTime = (NewSteadyTime < 0 and 0 or NewSteadyTime)
			camSway = 0
		elseif currentSteadyTime == 0 then
			break
		end
		RS.RenderStepped:wait()
	end
	camSteady = false
	spawn(function()
		local Increment = 1.5 / 0.25
		local X = 0
		while true do
			RS.RenderStepped:wait()
			local newX = X + Increment
			X = (newX > 90 and 90 or newX)
			if camSteady then break end
			camSway = numLerp(0, S.scopeSettings.camSwayOnBreath, 1 - COS(RAD(X)))
			if X == 90 then break end
		end
		Increment = 1.5 / S.scopeSettings.breathTime
		X = 0
		while true do
			RS.RenderStepped:wait()
			local newX = X + Increment
			X = (newX > 90 and 90 or newX)
			if camSteady then break end
			camSway = numLerp(S.scopeSettings.camSwayOnBreath, 1, Sine(X))
			if X == 90 then break end
		end
		--[[for X = 0, 90, 1.5 / 0.2 do
			local Alpha = 1 - COS(RAD(X))--math.log10(X) / math.log10(90)
			camSway = numLerp(0, 3, Alpha)
			RS.RenderStepped:wait()
		end]]
		--[[for X = 0, 90, 1.5 / S.scopeSettings.steadyTime do
			if camSteady then break end
			local Alpha = SIN(RAD(X))
			camSway = numLerp(3, 1, Alpha)
			RS.RenderStepped:wait()
		end]]
	end)
	retakeBreath()
end

function retakeBreath()
	scopeSteady.Text = "Re-taking Breath"
	scopeSteady.TextColor3 = Color3.new(1, 0, 0)
	takingBreath = true
	local Increment = S.scopeSettings.steadyTime / S.scopeSettings.breathTime
	while takingBreath do
		if currentSteadyTime < maxSteadyTime then
			local newSteadyTime = currentSteadyTime + Increment
			currentSteadyTime = (newSteadyTime > maxSteadyTime and maxSteadyTime or newSteadyTime)
		elseif currentSteadyTime >= maxSteadyTime then
			break
		end
		RS.RenderStepped:wait()
	end
	if takingBreath then
		scopeSteady.Text = "Hold "..convertKey(S.Keys.scopeSteady).." to Steady"
		scopeSteady.TextColor3 = Color3.new(1, 1, 0)
		takingBreath = false
	end
end


Prompt: ---- setup emote chat hook

Response:
game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
	local emote = ""
	if msg == "/e dance" then
		emote = dances[math.random(1, #dances)]
	elseif (string.sub(msg, 1, 3) == "/e ") then
		emote = string.sub(msg, 4)
	elseif (string.sub(msg, 1, 7) == "/emote ") then
		emote = string.sub(msg, 8)
	end

	if (pose == "Standing" and emoteNames[emote] ~= nil) then
		playAnimation(emote, 0.1, Humanoid)
	end

end)


Prompt:
-- Trying to clone something with Archivable=false will return nil for some reason
-- Helper function to enable Archivable, clone, reset Archivable to what it was before
-- and then return the clone

Response:
function safeClone(instance)
	local oldArchivable = instance.Archivable

	instance.Archivable = true
	local clone = instance:Clone()
	instance.Archivable = oldArchivable

	return clone
end

function characterAdded(player, character)
	player.CharacterAppearanceLoaded:wait()
	wait(0.1)

	local humanoid = character:FindFirstChildOfClass("Humanoid")
	buildRagdoll(humanoid)
end

function characterRemoving(character)
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	if humanoid:GetState() ~= Enum.HumanoidStateType.Dead then
		return
	end

	local clone = safeClone(character)
	local cloneHumanoid = clone:FindFirstChildOfClass("Humanoid")

	-- Don't clutter the game with nameplates / healthbars
	cloneHumanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
	-- Roblox will try to rebuild joints when the clone is parented to Workspace and
	-- break the ragdoll, so disable automatic scaling to prevent that. We don't need
	-- it anyway since the character is already scaled from when it was originally created
	cloneHumanoid.AutomaticScalingEnabled = false

	-- Clean up junk so we have less scripts running and don't have ragdolls
	-- spamming random sounds
	local animate = character:FindFirstChild("Animate")
	local sound = character:FindFirstChild("Sound")
	local health = character:FindFirstChild("Health")

	if animate then
		animate:Destroy()
	end
	if sound then
		sound:Destroy()
	end
	if health then
		health:Destroy()
	end

	clone.Parent = workspace

	-- State is not preserved when cloning. We need to set it back to Dead or the
	-- character won't ragdoll. This has to be done AFTER parenting the character
	-- to Workspace or the state change won't replicate to clients that can then
	-- start simulating the character if they get close enough
	cloneHumanoid:ChangeState(Enum.HumanoidStateType.Dead)
end

function playerAdded(player)
	player.CharacterAdded:connect(function(character)
		characterAdded(player, character)
	end)

	player.CharacterRemoving:Connect(characterRemoving)

	if player.Character then
		characterAdded(player, player.Character)
	end
end

Players.PlayerAdded:connect(playerAdded)


Prompt:
-- Replacements for RootCamera:RotateCamera() which did not actually rotate the camera
-- suppliedLookVector is not normally passed in, it's used only by Watch camera

Response:
function BaseCamera:CalculateNewLookCFrame(suppliedLookVector)
	local currLookVector = suppliedLookVector or self:GetCameraLookVector()
	local currPitchAngle = math.asin(currLookVector.y)
	local yTheta = Util.Clamp(-MAX_Y + currPitchAngle, -MIN_Y + currPitchAngle, self.rotateInput.y)
	local constrainedRotateInput = Vector2.new(self.rotateInput.x, yTheta)
	local startCFrame = CFrame.new(ZERO_VECTOR3, currLookVector)
	local newLookCFrame = CFrame.Angles(0, -constrainedRotateInput.x, 0) * startCFrame * CFrame.Angles(-constrainedRotateInput.y,0,0)
	return newLookCFrame
end
function BaseCamera:CalculateNewLookVector(suppliedLookVector)
	local newLookCFrame = self:CalculateNewLookCFrame(suppliedLookVector)
	return newLookCFrame.lookVector
end

function BaseCamera:CalculateNewLookVectorVR()
	local subjectPosition = self:GetSubjectPosition()
	local vecToSubject = (subjectPosition - game.Workspace.CurrentCamera.CFrame.p)
	local currLookVector = (vecToSubject * X1_Y0_Z1).unit
	local vrRotateInput = Vector2.new(self.rotateInput.x, 0)
	local startCFrame = CFrame.new(ZERO_VECTOR3, currLookVector)
	local yawRotatedVector = (CFrame.Angles(0, -vrRotateInput.x, 0) * startCFrame * CFrame.Angles(-vrRotateInput.y,0,0)).lookVector
	return (yawRotatedVector * X1_Y0_Z1).unit
end

function BaseCamera:GetHumanoid()
	local player = Players.LocalPlayer
	local character = player and player.Character
	if character then
		local resultHumanoid = self.humanoidCache[player]
		if resultHumanoid and resultHumanoid.Parent == character then
			return resultHumanoid
		else
			self.humanoidCache[player] = nil -- Bust Old Cache
			local humanoid = character:FindFirstChildOfClass("Humanoid")
			if humanoid then
				self.humanoidCache[player] = humanoid
			end
			return humanoid
		end
	end
	return nil
end

function BaseCamera:GetHumanoidPartToFollow(humanoid, humanoidStateType)
	if humanoidStateType == Enum.HumanoidStateType.Dead then
		local character = humanoid.Parent
		if character then
			return character:FindFirstChild("Head") or humanoid.Torso
		else
			return humanoid.Torso
		end
	else
		return humanoid.Torso
	end
end

function BaseCamera:UpdateGamepad()
	local gamepadPan = self.gamepadPanningCamera
	if gamepadPan and (self.hasGameLoaded or not VRService.VREnabled) then
		gamepadPan = Util.GamepadLinearToCurve(gamepadPan)
		local currentTime = tick()
		if gamepadPan.X ~= 0 or gamepadPan.Y ~= 0 then
			self.userPanningTheCamera = true
		elseif gamepadPan == ZERO_VECTOR2 then
			self.lastThumbstickRotate = nil
			if self.lastThumbstickPos == ZERO_VECTOR2 then
				self.currentSpeed = 0
			end
		end

		local finalConstant = 0

		if self.lastThumbstickRotate then
			if VRService.VREnabled then
				self.currentSpeed = self.vrMaxSpeed
			else
				local elapsedTime = (currentTime - self.lastThumbstickRotate) * 10
				self.currentSpeed = self.currentSpeed + (self.maxSpeed * ((elapsedTime*elapsedTime)/self.numOfSeconds))

				if self.currentSpeed > self.maxSpeed then self.currentSpeed = self.maxSpeed end

				if self.lastVelocity then
					local velocity = (gamepadPan - self.lastThumbstickPos)/(currentTime - self.lastThumbstickRotate)
					local velocityDeltaMag = (velocity - self.lastVelocity).magnitude

					if velocityDeltaMag > 12 then
						self.currentSpeed = self.currentSpeed * (20/velocityDeltaMag)
						if self.currentSpeed > self.maxSpeed then self.currentSpeed = self.maxSpeed end
					end
				end
			end

			finalConstant = UserGameSettings.GamepadCameraSensitivity * self.currentSpeed
			self.lastVelocity = (gamepadPan - self.lastThumbstickPos)/(currentTime - self.lastThumbstickRotate)
		end

		self.lastThumbstickPos = gamepadPan
		self.lastThumbstickRotate = currentTime

		return Vector2.new( gamepadPan.X * finalConstant, gamepadPan.Y * finalConstant * self.ySensitivity * UserGameSettings:GetCameraYInvertValue())
	end

	return ZERO_VECTOR2
end


Prompt:
--while wait(59) do
--	pcall(function()
--		local allPlayers = players:GetChildren()
--		for i = 1,#allPlayers,1 do
--			if allPlayers[i] ~= nil then
--				local playersMoneyChild = playerMoney:FindFirstChild(allPlayers[i].Name)
--				if playersMoneyChild then
--					PlayerStatManager:saveStat(allPlayers[i], "Money", playersMoneyChild.Value)
--				end
--			end
--		end
--	end)
--end


Prompt: --Event

Response:
ClickDetector.MouseClick:Connect(function()
	if ClickReady.Value == true then
		ClickReady.Value = false
		ButtonClick:Play()
		Button.Size = Size1
		Button.Material = Material1
		DigitNumber.Value = DigitNumber.Value - 1
		if DigitNumber.Value < Min then
			DigitNumber.Value = Max
		end
		NumberGUI.Text = DigitNumber.Value
		EnteredCode.Value = tostring(Digit1.Value)..""..tostring(Digit2.Value)..""..tostring(Digit3.Value)
		wait(.5)
		Button.Size = Size0
		Button.Material = Material0
		wait(.25)
		ClickReady.Value = true
	end
end)


Prompt:
--[[

yea i script howd u know

]]

Response:
repeat wait() until script.Parent.Parent == game:GetService("Players").LocalPlayer.Character
local remote = script.Parent:FindFirstChild("getMouse")
game:GetService("Players").LocalPlayer:GetMouse().Button1Down:Connect(function()
	if game.Players.LocalPlayer.Character:FindFirstChild("Pebble") then
		remote:InvokeServer({Hit=game.Players.LocalPlayer:GetMouse().Hit}, nil)
	end
end)


Prompt: --- Update all players every second

Response:
coroutine.wrap(function()
	--- Loop
	while true do
		--- Wait
		wait(1)

		--- Scan through all players
		for _, player in ipairs(game.Players:GetPlayers()) do
			--- Wrap in pcall just in case :/
			pcall(function()
				if player then
					--- Check player
					CheckPlayer(player)
				end
			end)
		end
	end
end)()


Prompt:
--[=[
	Converts a set from table values.
	@param tab table
	@return table
]=]

Response:
function Set.fromTableValue(tab)
	local set = {}

	for _, value in pairs(tab) do
		set[value] = true
	end

	return set
end


Prompt:
--[[
	This is a test file to demonstrate how ragdolls work. If you don't use
	this file, you need to manually apply the Ragdoll tag to humanoids that
	you want to ragdoll
--]]

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

script.KillScript.Parent = StarterPlayer.StarterCharacterScripts
script.RagdollMe.Parent = StarterPlayer.StarterCharacterScripts


Prompt: --[[ Constants ]]

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

local FFlagUserNavigationClickToMoveSkipPassedWaypointsSuccess, FFlagUserNavigationClickToMoveSkipPassedWaypointsResult = pcall(function() return UserSettings():IsUserFeatureEnabled("UserNavigationClickToMoveSkipPassedWaypoints") end)
local FFlagUserNavigationClickToMoveSkipPassedWaypoints = FFlagUserNavigationClickToMoveSkipPassedWaypointsSuccess and FFlagUserNavigationClickToMoveSkipPassedWaypointsResult

local Player = Players.LocalPlayer

local ClickToMoveDisplay = require(script.Parent:WaitForChild("ClickToMoveDisplay"))

local ZERO_VECTOR3 = Vector3.new(0,0,0)
local ALMOST_ZERO = 0.000001


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

Response:
local l__CurrentCamera__1 = game:GetService("Workspace").CurrentCamera;
return { function(p1)
		local l__ViewportSize__1 = l__CurrentCamera__1.ViewportSize;
		return { p1[1] / l__ViewportSize__1.X, p1[2] / l__ViewportSize__1.Y };
	end, function(p2)
		local l__ViewportSize__2 = l__CurrentCamera__1.ViewportSize;
		return { l__ViewportSize__2.X * p2[1], l__ViewportSize__2.Y * p2[2] };
	end };


Prompt: --DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!

Response:
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.Coffee -- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage

hitPart.Touched:Connect(function(hit)
	if debounce == true then
		if hit.Parent:FindFirstChild("Humanoid") then
			local plr = game.Players:FindFirstChild(hit.Parent.Name)
			if plr then
				debounce = false
				hitPart.BrickColor = BrickColor.new("Bright red")
				tool:Clone().Parent = plr.Backpack
				wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again
				debounce = true
				hitPart.BrickColor = BrickColor.new("Bright green")
			end
		end
	end
end)


Prompt: --CHANGE THIS LINE--

Response: Signal = script.Parent.Parent.Parent.ControlBox.SignalValues.Signal1 -- Change last word


Prompt: -- Define each RemoteEvent individually

Response:
local SpawnSegway = RemoteFolder:WaitForChild("SpawnSegway") -- Spawning segway
local ConfigTool = RemoteFolder:WaitForChild("ConfigTool") -- Coloring segway
local DestroySegway = RemoteFolder:WaitForChild("DestroySegway") -- Coloring segway
local PlaySound = RemoteFolder:WaitForChild("PlaySound")
local StopSound = RemoteFolder:WaitForChild("StopSound")
local AnchorSegway = RemoteFolder:WaitForChild("AnchorSegway")
local UndoTags = RemoteFolder:WaitForChild("UndoTags")
local UndoHasWelded = RemoteFolder:WaitForChild("UndoHasWelded")
local DeleteWelds = RemoteFolder:WaitForChild("DeleteWelds")
local ConfigHumanoid = RemoteFolder:WaitForChild("ConfigHumanoid")
local ConfigLights = RemoteFolder:WaitForChild("ConfigLights")


Prompt: -- Выводим сообщение на экран, если оно есть

Response: me=script.Parent


Prompt: -- Todo: Migrate UserInputService.ModalEnabled to GuiService.TouchControlsEnabled when it works since that's the future replacement API

Response:
function GuiController:getMobileTouchGuiEnabled()
	return not self.UserInputService.ModalEnabled
end


Prompt: -- Directions of positioning adjustment for each handle's dragged face

Response:
local AxisPositioningMultipliers = {
	[Enum.NormalId.Top] = Vector3.new(0, 1, 0);
	[Enum.NormalId.Bottom] = Vector3.new(0, -1, 0);
	[Enum.NormalId.Front] = Vector3.new(0, 0, -1);
	[Enum.NormalId.Back] = Vector3.new(0, 0, 1);
	[Enum.NormalId.Left] = Vector3.new(-1, 0, 0);
	[Enum.NormalId.Right] = Vector3.new(1, 0, 0);
};


Prompt: -- Main

Response:
local StringUtil = {}

function StringUtil.getReadLength(length: number): number
	return 5
end

function StringUtil.condenseText(str: string): string
	local finalStr: string = ""

	local isMarkdown: boolean = false

	local i = 0
	while i < #str do
		i += 1

		local currentChar: string = string.sub(str, i, i)

		if currentChar == "<" then
			isMarkdown = true
			continue
		elseif currentChar == ">" then
			isMarkdown = false
			continue
		elseif isMarkdown then
			continue
		end

		local wasEscapeCharacter: boolean = false

		if currentChar == "&" then
			-- Suspected as escape character.
			for j = i, #str do
				if string.sub(str, j, j) == ";" then
					local suspectedEscape: string = string.sub(str, i, j)

					for _, pattern: { string } in RICH_TEXT_ESCAPE_CHARACTERS do
						if suspectedEscape == pattern[1] then
							-- move i to j (end of escape character)
							i = j
							finalStr ..= pattern[2]

							wasEscapeCharacter = true
							break
						end
					end
					break
				end
			end
		end

		if not wasEscapeCharacter then
			finalStr ..= currentChar
		end
	end

	return finalStr
end

function StringUtil.countCharacters(str: string): number
	return #StringUtil.condenseText(str)
end

return StringUtil


Prompt: --// Events

Response: local L_14_ = L_4_:WaitForChild('TeamTag')


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 = "Handle"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle"
		p.formFactor = 0
		p.Size = Vector3.new(1,1,1)
		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.35, 0)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)


Prompt: -- roblox types

Response:
t.Axes = primitive("Axes")
t.BrickColor = primitive("BrickColor")
t.CFrame = primitive("CFrame")
t.Color3 = primitive("Color3")
t.ColorSequence = primitive("ColorSequence")
t.ColorSequenceKeypoint = primitive("ColorSequenceKeypoint")
t.DockWidgetPluginGuiInfo = primitive("DockWidgetPluginGuiInfo")
t.Faces = primitive("Faces")
t.Instance = primitive("Instance")
t.NumberRange = primitive("NumberRange")
t.NumberSequence = primitive("NumberSequence")
t.NumberSequenceKeypoint = primitive("NumberSequenceKeypoint")
t.PathWaypoint = primitive("PathWaypoint")
t.PhysicalProperties = primitive("PhysicalProperties")
t.Random = primitive("Random")
t.Ray = primitive("Ray")
t.Rect = primitive("Rect")
t.Region3 = primitive("Region3")
t.Region3int16 = primitive("Region3int16")
t.TweenInfo = primitive("TweenInfo")
t.UDim = primitive("UDim")
t.UDim2 = primitive("UDim2")
t.Vector2 = primitive("Vector2")
t.Vector3 = primitive("Vector3")
t.Vector3int16 = primitive("Vector3int16")
t.Enum = primitive("Enum")
t.EnumItem = primitive("EnumItem")

function t.literal(literal)
	return function(value)
		if value ~= literal then
			return false
		end
		return true
	end
end

t.exactly = t.literal

function t.integer(value)
	local success = t.number(value)
	if not success then
		return false
	end
	if value%1 == 0 then
		return true
	else
		return false
	end
end

function t.numberMin(min)
	return function(value)
		local success = t.number(value)
		if not success then
			return false
		end
		if value >= min then
			return true
		else
			return false
		end
	end
end

function t.numberMax(max)
	return function(value)
		local success = t.number(value)
		if not success then
			return false
		end
		if value <= max then
			return true
		else
			return false
		end
	end
end

function t.numberMinExclusive(min)
	return function(value)
		local success = t.number(value)
		if not success then
			return false
		end
		if min < value then
			return true
		else
			return false
		end
	end
end

function t.numberMaxExclusive(max)
	return function(value)
		local success = t.number(value)
		if not success then
			return false
		end
		if value < max then
			return true
		else
			return false
		end
	end
end

t.numberPositive = t.numberMinExclusive(0)
t.numberNegative = t.numberMaxExclusive(0)

function t.numberConstrained(min, max)
	assert(t.number(min) and t.number(max))
	local minCheck = t.numberMin(min)
	local maxCheck = t.numberMax(max)
	return function(value)
		local minSuccess = minCheck(value)
		if not minSuccess then
			return false
		end

		local maxSuccess = maxCheck(value)
		if not maxSuccess then
			return false
		end

		return true
	end
end

function t.numberConstrainedExclusive(min, max)
	assert(t.number(min) and t.number(max))
	local minCheck = t.numberMinExclusive(min)
	local maxCheck = t.numberMaxExclusive(max)
	return function(value)
		local minSuccess = minCheck(value)
		if not minSuccess then
			return false
		end

		local maxSuccess = maxCheck(value)
		if not maxSuccess then
			return false
		end

		return true
	end
end

function t.optional(check)
	assert(t.callback(check))
	return function(value)
		if value == nil then
			return true
		end
		local success = check(value)
		if success then
			return true
		else
			return false
		end
	end
end

function t.tuple(...)
	local checks = {...}
	return function(...)
		local args = {...}
		for i = 1, #checks do
			local success = checks[i](args[i])
			if success == false then
				return false
			end
		end
		return true
	end
end

function t.keys(check)
	assert(t.callback(check))
	return function(value)
		local tableSuccess = t.table(value)
		if tableSuccess == false then
			return false
		end

		for key in pairs(value) do
			local success = check(key)
			if success == false then
				return false
			end
		end

		return true
	end
end

function t.values(check)
	assert(t.callback(check))
	return function(value)
		local tableSuccess = t.table(value)
		if tableSuccess == false then
			return false
		end

		for _, val in pairs(value) do
			local success = check(val)
			if success == false then
				return false
			end
		end

		return true
	end
end

function t.map(keyCheck, valueCheck)
	assert(t.callback(keyCheck), t.callback(valueCheck))
	local keyChecker = t.keys(keyCheck)
	local valueChecker = t.values(valueCheck)
	return function(value)
		local keySuccess = keyChecker(value)
		if not keySuccess then
			return false
		end

		local valueSuccess = valueChecker(value)
		if not valueSuccess then
			return false
		end

		return true
	end
end

do
	local arrayKeysCheck = t.keys(t.integer)

	function t.array(check)
		assert(t.callback(check))
		local valuesCheck = t.values(check)
		return function(value)
			local keySuccess = arrayKeysCheck(value)
			if keySuccess == false then
				return false
			end

			-- # is unreliable for sparse arrays
			-- Count upwards using ipairs to avoid false positives from the behavior of #
			local arraySize = 0

			for _, _ in ipairs(value) do
				arraySize = arraySize + 1
			end

			for key in pairs(value) do
				if key < 1 or key > arraySize then
					return false
				end
			end

			local valueSuccess = valuesCheck(value)
			if not valueSuccess then
				return false
			end

			return true
		end
	end
end

do
	local callbackArray = t.array(t.callback)

	function t.union(...)
		local checks = {...}
		assert(callbackArray(checks))
		return function(value)
			for _, check in pairs(checks) do
				if check(value) then
					return true
				end
			end
			return false
		end
	end

	function t.intersection(...)
		local checks = {...}
		assert(callbackArray(checks))
		return function(value)
			for _, check in pairs(checks) do
				local success = check(value)
				if not success then
					return false
				end
			end
			return true
		end
	end
end

do
	local checkInterface = t.map(t.any, t.callback)

	function t.interface(checkTable)
		assert(checkInterface(checkTable))
		return function(value)
			local tableSuccess = t.table(value)
			if tableSuccess == false then
				return false
			end

			for key, check in pairs(checkTable) do
				local success = check(value[key])
				if success == false then
					return false
				end
			end
			return true
		end
	end

	function t.strictInterface(checkTable)
		assert(checkInterface(checkTable))
		return function(value)
			local tableSuccess = t.table(value)
			if tableSuccess == false then
				return false
			end

			for key, check in pairs(checkTable) do
				local success = check(value[key])
				if success == false then
					return false
				end
			end

			for key in pairs(value) do
				if not checkTable[key] then
					return false
				end
			end

			return true
		end
	end
end

function t.instance(className)
	assert(t.string(className))
	return function(value)
		local instanceSuccess = t.Instance(value)
		if not instanceSuccess then
			return false
		end

		if value.ClassName ~= className then
			return false
		end

		return true
	end
end

function t.instanceIsA(className)
	assert(t.string(className))
	return function(value)
		local instanceSuccess = t.Instance(value)
		if not instanceSuccess then
			return false
		end

		if not value:IsA(className) then
			return false
		end

		return true
	end
end

function t.enum(enum)
	assert(t.Enum(enum))
	return function(value)
		local enumItemSuccess = t.EnumItem(value)
		if not enumItemSuccess then
			return false
		end

		if value.EnumType == enum then
			return true
		else
			return false
		end
	end
end

do
	local checkWrap = t.tuple(t.callback, t.callback)

	function t.wrap(callback, checkArgs)
		assert(checkWrap(callback, checkArgs))
		return function(...)
			assert(checkArgs(...))
			return callback(...)
		end
	end
end

function t.strict(check)
	return function(...)
		assert(check(...))
	end
end

return t


Prompt: -- [[ Variables ]

Response:
local ActiveHitboxes = {}
local Handler = {}
local clock = os.clock


Prompt: --[ SERVICES ]--

Response:
local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("TimeStats")
local service = game:GetService("MarketplaceService")


Prompt: --------------| MODIFY COMMANDS |--------------

Response:
ChangeRankRequiredToUseCommand = {
	--["jump"] = "VIP";
};
SetCommandRanksByTag = {
	--["abusive"] = "Admin";
};

};


Prompt: -- Game services

Response:
local RunService = game:GetService("RunService")
local Point
local playerMousePositionDictionary = {}

script.Parent:WaitForChild("RemoteEvent").OnServerEvent:Connect(function(playerThatFired, mousePosition)
	playerMousePositionDictionary [playerThatFired] = mousePosition
end)

script.Parent:WaitForChild("SetUp").OnServerEvent:Connect(function(Player, CamCFrame, CamSubject)
	local Character = Player.Character or Player.CharacterAdded:Wait()
	--task.wait(2.69)
	--Old R15 code
	local Head = Character:WaitForChild("Head")
	--local Neck = Head:WaitForChild("Neck")

	--local Torso = Character:WaitForChild("UpperTorso")
	--local Waist = Torso:WaitForChild("Waist")

	--New R6 stuff
	local Humanoid = Character:WaitForChild("Humanoid")
	local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")

	local Torso = Character:WaitForChild("Torso")
	local Neck = Torso:WaitForChild("Neck")

	local Waist = HumanoidRootPart:WaitForChild("RootJoint")

	local RHip = Torso:WaitForChild("Right Hip")
	local LHip = Torso:WaitForChild("Left Hip")

	local LHipOriginC0 = LHip.C0
	local RHipOriginC0 = RHip.C0

	local NeckOriginC0 = Neck.C0
	local WaistOriginC0 = Waist.C0

	RunService.Heartbeat:Connect(function(dt)
		Point = playerMousePositionDictionary[Player] or Vector3.new(0,0,0)

		local CameraCFrame = CamCFrame

		if Character:FindFirstChild("Torso") and Character:FindFirstChild("Head") then
			local TorsoLookVector = Torso.CFrame.lookVector
			local HeadPosition = Head.CFrame.p

			if Neck and Waist then
				if CamSubject:IsDescendantOf(Character) or CamSubject:IsDescendantOf(Player) and HumanoidRootPart.Anchored ~= true then

					local Distance = (Head.CFrame.p - Point).magnitude

					local Difference = Head.CFrame.Y - Point.Y

					local goalNeckCFrame = CFrame.Angles(-(math.atan(Difference / Distance) * 0.5), (((HeadPosition - Point).Unit):Cross(TorsoLookVector)).Y * 1, 0)
					Neck.C0 = Neck.C0:lerp(goalNeckCFrame*NeckOriginC0, 0.5 / 2).Rotation + NeckOriginC0.Position

					local xAxisWaistRotation = -(math.atan(Difference / Distance) * 0.5)	-- Change 0.5 to change amount of rotation
					local yAxisWaistRotation = (((HeadPosition - Point).Unit):Cross(TorsoLookVector)).Y * 0.5
					local rotationWaistCFrame = CFrame.Angles(xAxisWaistRotation, yAxisWaistRotation, 0)
					local goalWaistCFrame = rotationWaistCFrame*WaistOriginC0
					Waist.C0 = Waist.C0:lerp(goalWaistCFrame, 0.5 / 2).Rotation + WaistOriginC0.Position

					local currentLegCounterCFrame = Waist.C0*WaistOriginC0:Inverse()

					local legsCounterCFrame = currentLegCounterCFrame:Inverse()

					RHip.C0 =  legsCounterCFrame*RHipOriginC0
					LHip.C0 = legsCounterCFrame*LHipOriginC0
				end
			end
		end
	end)
end)


Prompt: --connect

Response:
Tool.Equipped:connect(onEquipped)
Tool.Unequipped:connect(onUnequipped)
Remote.OnClientEvent:connect(onRemote)


Prompt:
-- ROBLOX deviation END
-- ROBLOX deviation: not ported as it doesn't seem necessary in Lua
-- exports.replacePathSepForGlob = require(script.replacePathSepForGlob).default
-- ROBLOX deviation: not ported as it doesn't seem necessary in Lua
-- exports.testPathPatternToRegExp = require(script.testPathPatternToRegExp).default

Response:
exports.globsToMatcher = require(script.globsToMatcher).default
local preRunMessageModule = require(script.preRunMessage)
Object.assign(exports, preRunMessageModule)


Prompt: --[[	STANDARDIZED STUFF: DON'T TOUCH UNLESS NEEDED	]]


Prompt:
--[=[
	@within Plasma
	@function space
	@param size number

	Blank space of a certain size.

]=]

Response:
return Runtime.widget(function(size)
	local refs = Runtime.useInstance(function(ref)
		return create("Frame", {
			[ref] = "space",
			BackgroundTransparency = 1,
		})
	end)

	Runtime.useEffect(function()
		refs.space.Size = UDim2.new(0, size, 0, size)
	end, size)
end)


Prompt:
--[[
	Contains markers for annotating the type of an element.

	Use `ElementKind` as a key, and values from it as the value.

		local element = {
			[ElementKind] = ElementKind.Host,
		}
]]

Response:
local Symbol = require(script.Parent.Symbol)
local strict = require(script.Parent.strict)
local Portal = require(script.Parent.Portal)

local ElementKind = newproxy(true)

local ElementKindInternal = {
	Portal = Symbol.named("Portal"),
	Host = Symbol.named("Host"),
	Function = Symbol.named("Function"),
	Stateful = Symbol.named("Stateful"),
}

function ElementKindInternal.of(value)
	if typeof(value) ~= "table" then
		return nil
	end

	return value[ElementKind]
end

local componentTypesToKinds = {
	["string"] = ElementKindInternal.Host,
	["function"] = ElementKindInternal.Function,
	["table"] = ElementKindInternal.Stateful,
}

function ElementKindInternal.fromComponent(component)
	if component == Portal then
		return ElementKind.Portal
	else
		return componentTypesToKinds[typeof(component)]
	end
end

getmetatable(ElementKind).__index = ElementKindInternal

strict(ElementKindInternal, "ElementKind")

return ElementKind


Prompt: -- Get list of attachments to make ballsocketconstraints between:

Response:
function RigTypes.getAttachments(model, rigType)
	if rigType == Enum.HumanoidRigType.R6 then
		return RigTypes.getR6Attachments(model)
	elseif rigType == Enum.HumanoidRigType.R15 then
		return RigTypes.getR15Attachments(model)
	else
		return {}
	end
end

function RigTypes.getR6Attachments(model)
	local rightLegAttachment = Instance.new("Attachment")
	rightLegAttachment.Name = "RagdollRightLegAttachment"
	rightLegAttachment.Position = Vector3.new(0, 1, 0)
	rightLegAttachment.Parent = model:FindFirstChild("Right Leg")

	local leftLegAttachment = Instance.new("Attachment")
	leftLegAttachment.Name = "RagdollLeftLegAttachment"
	leftLegAttachment.Position = Vector3.new(0, 1, 0)
	leftLegAttachment.Parent = model:FindFirstChild("Left Leg")

	local torsoLeftAttachment = Instance.new("Attachment")
	torsoLeftAttachment.Name = "RagdollTorsoLeftAttachment"
	torsoLeftAttachment.Position = Vector3.new(-0.5, -1, 0)
	torsoLeftAttachment.Parent = model:FindFirstChild("Torso")

	local torsoRightAttachment = Instance.new("Attachment")
	torsoRightAttachment.Name = "RagdollTorsoRightAttachment"
	torsoRightAttachment.Position = Vector3.new(0.5, -1, 0)
	torsoRightAttachment.Parent = model:FindFirstChild("Torso")

	local headAttachment = Instance.new("Attachment")
	headAttachment.Name = "RagdollHeadAttachment"
	headAttachment.Position = Vector3.new(0, -0.5, 0)
	headAttachment.Parent = model:FindFirstChild("Head")

	local leftArmAttachment = Instance.new("Attachment")
	leftArmAttachment.Name = "RagdollLeftArmAttachment"
	leftArmAttachment.Position = Vector3.new(0.3, 1, 0)
	leftArmAttachment.Parent = model:FindFirstChild("Left Arm")

	local ragdollRightArmAttachment = Instance.new("Attachment")
	ragdollRightArmAttachment.Name = "RagdollRightArmAttachment"
	ragdollRightArmAttachment.Position = Vector3.new(-0.3, 1, 0)
	ragdollRightArmAttachment.Parent = model:FindFirstChild("Right Arm")

	local query = find(model)

	return {
		Head = query(
			{"Torso", "NeckAttachment"},
			{"Head", "RagdollHeadAttachment"},
			R6_HEAD_LIMITS),
		["Left Arm"] = query(
			{"Torso", "LeftCollarAttachment"},
			{"Left Arm", "RagdollLeftArmAttachment"},
			R6_SHOULDER_LIMITS),
		["Right Arm"] = query(
			{"Torso", "RightCollarAttachment"},
			{"Right Arm", "RagdollRightArmAttachment"},
			R6_SHOULDER_LIMITS),
		["Left Leg"] = createJointData(torsoLeftAttachment, leftLegAttachment, R6_HIP_LIMITS),
		["Right Leg"] = createJointData(torsoRightAttachment, rightLegAttachment, R6_HIP_LIMITS),
	}
end

function RigTypes.getR15Attachments(model)
	local query = find(model)

	return {
		Head = query(
			{"UpperTorso", "NeckRigAttachment"},
			{"Head", "NeckRigAttachment"},
			HEAD_LIMITS),

		LowerTorso = query(
			{"UpperTorso", "WaistRigAttachment"},
			{"LowerTorso", "RootRigAttachment"},
			LOWER_TORSO_LIMITS),

		LeftUpperArm = query(
			{"UpperTorso", "LeftShoulderRigAttachment"},
			{"LeftUpperArm", "LeftShoulderRigAttachment"},
			SHOULDER_LIMITS),
		LeftLowerArm = query(
			{"LeftUpperArm", "LeftElbowRigAttachment"},
			{"LeftLowerArm", "LeftElbowRigAttachment"},
			ELBOW_LIMITS),
		LeftHand = query(
			{"LeftLowerArm", "LeftWristRigAttachment"},
			{"LeftHand", "LeftWristRigAttachment"},
			HAND_FOOT_LIMITS),

		RightUpperArm = query(
			{"UpperTorso", "RightShoulderRigAttachment"},
			{"RightUpperArm", "RightShoulderRigAttachment"},
			SHOULDER_LIMITS),
		RightLowerArm = query(
			{"RightUpperArm", "RightElbowRigAttachment"},
			{"RightLowerArm", "RightElbowRigAttachment"},
			ELBOW_LIMITS),
		RightHand = query(
			{"RightLowerArm", "RightWristRigAttachment"},
			{"RightHand", "RightWristRigAttachment"},
			HAND_FOOT_LIMITS),

		LeftUpperLeg = query(
			{"LowerTorso", "LeftHipRigAttachment"},
			{"LeftUpperLeg", "LeftHipRigAttachment"},
			HIP_LIMITS),
		LeftLowerLeg = query(
			{"LeftUpperLeg", "LeftKneeRigAttachment"},
			{"LeftLowerLeg", "LeftKneeRigAttachment"},
			KNEE_LIMITS),
		LeftFoot = query(
			{"LeftLowerLeg", "LeftAnkleRigAttachment"},
			{"LeftFoot", "LeftAnkleRigAttachment"},
			HAND_FOOT_LIMITS),

		RightUpperLeg = query(
			{"LowerTorso", "RightHipRigAttachment"},
			{"RightUpperLeg", "RightHipRigAttachment"},
			HIP_LIMITS),
		RightLowerLeg = query(
			{"RightUpperLeg", "RightKneeRigAttachment"},
			{"RightLowerLeg", "RightKneeRigAttachment"},
			KNEE_LIMITS),
		RightFoot = query(
			{"RightLowerLeg", "RightAnkleRigAttachment"},
			{"RightFoot", "RightAnkleRigAttachment"},
			HAND_FOOT_LIMITS),
	}
end

function RigTypes.getR6NoCollisions(model)
	local list = {}

	local function addPair(pair)
		local part0 = model:FindFirstChild(pair[1])
		local part1 = model:FindFirstChild(pair[2])

		if part0 and part1 then
			table.insert(list, {part0, part1})
		end
	end

	addPair({"Head", "Torso"})
	addPair({"Left Arm", "Torso"})
	addPair({"Right Arm", "Torso"})
	addPair({"Left Leg", "Torso"})
	addPair({"Right Leg", "Torso"})

	addPair({"Left Leg", "Right Leg"})

	return list
end

function RigTypes.getR15NoCollisions(model)
	local list = {}

	local function addPair(pair)
		local part0 = model:FindFirstChild(pair[1])
		local part1 = model:FindFirstChild(pair[2])

		if part0 and part1 then
			table.insert(list, {part0, part1})
		end
	end

	addPair({"Head", "UpperTorso"})
	addPair({"UpperTorso", "LowerTorso"})

	addPair({"UpperTorso", "LeftUpperArm"})
	addPair({"LowerTorso", "LeftUpperArm"})
	addPair({"LeftUpperArm", "LeftLowerArm"})
	addPair({"LeftLowerArm", "LeftHand"})
	addPair({"LeftUpperArm", "LeftHand"})

	addPair({"UpperTorso", "RightUpperArm"})
	addPair({"LowerTorso", "RightUpperArm"})
	addPair({"RightUpperArm", "RightLowerArm"})
	addPair({"RightLowerArm", "RightHand"})
	addPair({"RightUpperArm", "RightHand"})

	addPair({"LeftUpperLeg", "RightUpperLeg"})

	addPair({"UpperTorso", "RightUpperLeg"})
	addPair({"LowerTorso", "RightUpperLeg"})
	addPair({"RightUpperLeg", "RightLowerLeg"})
	addPair({"RightLowerLeg", "RightFoot"})
	addPair({"RightUpperLeg", "RightFoot"})

	addPair({"UpperTorso", "LeftUpperLeg"})
	addPair({"LowerTorso", "LeftUpperLeg"})
	addPair({"LeftUpperLeg", "LeftLowerLeg"})
	addPair({"LeftLowerLeg", "LeftFoot"})
	addPair({"LeftUpperLeg", "LeftFoot"})

	-- Support weird R15 rigs
	addPair({"UpperTorso", "LeftLowerLeg"})
	addPair({"UpperTorso", "RightLowerLeg"})
	addPair({"LowerTorso", "LeftLowerLeg"})
	addPair({"LowerTorso", "RightLowerLeg"})

	addPair({"UpperTorso", "LeftLowerArm"})
	addPair({"UpperTorso", "RightLowerArm"})

	local upperTorso = model:FindFirstChild("UpperTorso")
	if upperTorso and upperTorso.Size.x <= 1.5 then
		addPair({"Head", "LeftUpperArm"})
		addPair({"Head", "RightUpperArm"})
	end

	return list
end

return RigTypes


Prompt: -- Inject types

Response:
local TypeDefs = require(script.Parent.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

local TestService = game:GetService("TestService")
local table = require(script.Parent.Table)

local SignalStatic = {}
SignalStatic.__index = SignalStatic
SignalStatic.__type = "Signal" -- For compatibility with TypeMarshaller
local ConnectionStatic = {}
ConnectionStatic.__index = ConnectionStatic
ConnectionStatic.__type = "SignalConnection" -- For compatibility with TypeMarshaller

export type Signal = {
	Name: string,
	Connections: {[number]: Connection},
	YieldingThreads: {[number]: BindableEvent}
}

export type Connection = {
	Signal: Signal?,
	Delegate: any,
	Index: number
}


Prompt: -- Signals

Response:
action1.OnServerEvent:Connect(Actions.Punch)

return ActionManager


Prompt: --Rescripted by Luckymaxer

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

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

Speed = 100
Duration = 1

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

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

PointLight = Handle:WaitForChild("PointLight")

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

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

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

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

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

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

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

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

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

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

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

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

	humanoid.WalkSpeed = 0

	local Parts = {}

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

	local SelectionBoxes = {}

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

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

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

	wait(0.5)

	character:BreakJoints()
	humanoid.Health = 0

	Debris:AddItem(character, 2)

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

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

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

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

		InvokeClient("PlaySound", Sounds.Fire)

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

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

		wait(0.6) -- FireSound length

		InvokeClient("PlaySound", Sounds.Reload)

		wait(0.75) -- ReloadSound length

		Tool.Enabled = true
	end
end

function Unequipped()

end

game.Players.PlayerAdded:Connect(function(player)

	player.CharacterAdded:Connect(function(character)
		character:WaitForChild('Humanoid').Died:Connect(function()
			local tag = character.Humanoid:FindFirstChild("creator")
			if tag ~= nil then
				local player = tag.Value
				local bounty = 10

				local leaderstats = player:WaitForChild("leaderstats")
				leaderstats.FlagBucks.Value = leaderstats.FlagBucks.Value + bounty

			end
		end)
	end)
end)

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

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


Prompt: --Prismatic--

Response:
local prFL = Instance.new("PrismaticConstraint", SFL)
prFL.Attachment0 = SFL.Attachment
prFL.Attachment1 = SSML.Attachment

local prFR = Instance.new("PrismaticConstraint", SFR)
prFR.Attachment0 = SFR.Attachment
prFR.Attachment1 = SSMR.Attachment

local prRL = Instance.new("PrismaticConstraint", SRL)
prRL.Attachment0 = SRL.Attachment
prRL.Attachment1 = BRL.Attachment

local prRR = Instance.new("PrismaticConstraint", SRR)
prRR.Attachment0 = SRR.Attachment
prRR.Attachment1 = BRR.Attachment