Prompt: -- Simulate a raycast.

Response:
local function SimulateCast(origin, direction, velocity, castFunction, lengthChangedEvent, rayHitEvent, rayExitedEvent, cosmeticBulletObject, listOrIgnoreDescendantsInstance, ignoreWater, bulletAcceleration, bulletData, whizData, hitData, penetrationData)
	PrintDebug("Cast simulation requested.")
	if type(velocity) == "number" then
		velocity = direction.Unit * velocity
	end

	local penetrationPower = penetrationData ~= nil and penetrationData.penetrationDepth or 0
	local penetrationCount = penetrationData ~= nil and penetrationData.penetrationAmount or 0
	local bulletAcceleration = bulletAcceleration or Vector3.new() -- Fix bug reported by Spooce: Failing to pass in the bulletAcceleration parameter throws an error, so add a fallback of Vector3.new()
	local distance = direction.Magnitude -- This will be a unit vector multiplied by the maximum distance.
	local normalizedDir = direction.Unit
	local upgradedDir = (normalizedDir + velocity).Unit -- This rotates the direction of the bullet by the initial velocity, allowing 3D velocity to occur in the first place.
	local initialVelocity = upgradedDir * velocity.Magnitude

	local totalDelta = 0
	local distanceTravelled = 0
	local lastPoint = origin

	local self = {}
	local isRunningPenetration = false
	local didHitHumanoid = false
	local originalList = listOrIgnoreDescendantsInstance
	local originalCastFunction = castFunction

	local function Fire(delta, customAt)
		PrintDebug("Casting for frame.")
		totalDelta = totalDelta + delta
		local at = customAt or GetPositionAtTime(totalDelta, origin, initialVelocity, bulletAcceleration)
		local totalDisplacement = (at - lastPoint) -- This is the displacement from where the ray was on the last from to where the ray is now.

		-- NEW BEHAVIOR:
		-- Displacement needs to define velocity. The reason peoples' casts were going crazy was because on the line below I used to multiply by velocity.Magnitude
		-- Okay, cool, so that's effectively the initial velocity. Now say we're at the top of an arc in a physics cast. Bullet sure isn't going the same speed!
		-- We need to recalculate velocity based on displacement, NOT use the defined value.
		-- How I missed this is beyond me.
		-- Bonus ducks: This also allows me to implement GFink's request (see https://devforum.roblox.com/t/making-a-combat-game-with-ranged-weapons-fastcast-may-be-the-module-for-you/133474/282?u=etithespirit)

		local segmentVelocity = GetVelocityAtTime(totalDelta, initialVelocity, bulletAcceleration)
		-- local rayDir = totalDisplacement.Unit * segmentVelocity.Magnitude * delta -- Direction of the ray is the direction from last to now * the velocity * deltaTime
		local rayDir = totalDisplacement.Unit * segmentVelocity.Magnitude * delta
		local hit, point, normal, material = castFunction(lastPoint, rayDir, listOrIgnoreDescendantsInstance, ignoreWater)

		local rayDisplacement = (point - lastPoint).Magnitude
		-- For clarity -- totalDisplacement is how far the ray would have traveled if it hit nothing,
		-- and rayDisplacement is how far the ray really traveled (which will be identical to totalDisplacement if it did indeed hit nothing)

		lengthChangedEvent:Fire(origin, lastPoint, rayDir.Unit, rayDisplacement, segmentVelocity, cosmeticBulletObject, bulletData, whizData, hitData)

		local rayVisualization = nil
		if (delta > 0) then
			rayVisualization = DbgVisualizeSegment(CFrame.new(lastPoint, lastPoint + rayDir), rayDisplacement)
		end

		if hit and hit ~= cosmeticBulletObject then
			local start = tick()
            local unit = rayDir.Unit
            local maxExtent = hit.Size.Magnitude * unit
            local exitHit, exitPoint, exitNormal, exitMaterial = CastWithWhitelist(point + maxExtent, -maxExtent, {hit}, ignoreWater)
            --local diff = exitPoint - point
            --local dist = Vector3.new():Dot(unit, diff)
			local dist = (exitPoint - point).Magnitude

			-- SANITY CHECK: Don't allow the user to yield or run otherwise extensive code that takes longer than one frame/heartbeat to execute.
			if (penetrationData ~= nil) and (penetrationData.penetrationType == "WallPenetration" and ((penetrationData.canPenetrateFunction ~= nil) and (penetrationPower > dist)) or (penetrationData.penetrationType == "HumanoidPenetration" and ((penetrationData.canPenetrateHumanoidFunction ~= nil) and (penetrationCount > 0)))) then
				if (isRunningPenetration) then
					error("ERROR: The latest call to canPenetrateFunction/canPenetrateHumanoidFunction took too long to complete! This cast is going to suffer desyncs which WILL cause unexpected behavior and errors.")
					-- Use error. This should absolutely abort the cast.
				end
				isRunningPenetration = true
				didHitHumanoid = false
			end

			if penetrationData == nil or (penetrationData ~= nil and ((penetrationData.penetrationType == "WallPenetration" and (penetrationPower < dist)) or (penetrationData.penetrationType == "HumanoidPenetration" and ((penetrationData.canPenetrateHumanoidFunction(origin, rayDir.Unit, hit, point, normal, material, segmentVelocity, penetrationCount, hitData) == false) or (penetrationCount <= 0))))) then
				PrintDebug("Penetrating data is nil or penetrationPower is lower than dist/penetrationCount is at 0. Ending cast and firing RayHit.")
				isRunningPenetration = false
				-- Penetrate function is nil, or it's not nil and it returned false (we cannot penetrate this object).
				-- Hit.

				RemoveList[self] = true
				rayHitEvent:Fire(origin, rayDir.Unit, hit, point, normal, material, segmentVelocity, cosmeticBulletObject, hitData)
				DbgVisualizeHit(CFrame.new(point), Color3.new(0.2, 1, 0.5))
				return
			else
				if rayVisualization ~= nil then
					rayVisualization.Color3 = Color3.new(0.4, 0.05, 0.05) -- Turn it red to signify that the cast was scrapped.
				end
				DbgVisualizeHit(CFrame.new(point), Color3.new(1, 0.2, 0.2))

				PrintDebug("Penetrating returned 'penetratedHumanoid' or 'penetratedObject'/TRUE to penetrate this hit. Processing...")
				isRunningPenetration = false
				-- Nope! We want to penetrate this part.
				-- Now this is gonna be DISGUSTING.
				-- We need to run this until we fufill that lost distance, so if some guy decides to layer up like 10 parts right next to eachother, we need to handle all of those in a single frame
				-- The only way to do this isn't particularly pretty but it needs to be quick.
				if penetrationData.penetrationType == "WallPenetration" then
					local penetrationType = penetrationData ~= nil and penetrationData.canPenetrateFunction(origin, rayDir.Unit, hit, point, normal, material, segmentVelocity, hitData)
					if (castFunction == CastWithWhitelist) then
						-- User is using whitelist. We need to pull this from their list.
						-- n.b. this function is offered by the sandboxed table system. It's not stock.
						if penetrationType == "penetratedHumanoid" and (hit.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent:FindFirstChildOfClass("Humanoid").Health > 0) or (hit.Parent.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent.Parent:FindFirstChildOfClass("Humanoid").Health > 0) then
							if exitHit and FastCast.RayExit then
								rayExitedEvent:Fire(point + maxExtent, -maxExtent, exitHit, exitPoint, exitNormal, exitMaterial, segmentVelocity, hitData)
								DbgVisualizeHit(CFrame.new(exitPoint), Color3.fromRGB(13, 105, 172))
							end
							local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid") or hit.Parent.Parent:FindFirstChildOfClass("Humanoid")
							table.removeObject(listOrIgnoreDescendantsInstance, humanoid.Parent)
							--penetrationPower = penetrationPower
							local toReduce = 1-((dist/penetrationPower/1.1))
							penetrationPower = penetrationPower * toReduce
							PrintDebug("Whitelist cast detected, removed " .. tostring(humanoid.Parent) .. " from the whitelist.")
						elseif penetrationType == "penetratedObject" then
							if exitHit and FastCast.RayExit then
								rayExitedEvent:Fire(point + maxExtent, -maxExtent, exitHit, exitPoint, exitNormal, exitMaterial, segmentVelocity, hitData)
								DbgVisualizeHit(CFrame.new(exitPoint), Color3.fromRGB(13, 105, 172))
							end
							table.removeObject(listOrIgnoreDescendantsInstance, hit)
							--penetrationPower = penetrationPower - dist
							local toReduce = 1-((dist/penetrationPower/1.1))
							penetrationPower = penetrationPower * toReduce
							PrintDebug("Whitelist cast detected, removed " .. tostring(hit) .. " from the whitelist.")
						end
					elseif (castFunction == CastWithBlacklistAndNoHumPenetration) then
						if penetrationType == "penetratedHumanoid" and (hit.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent:FindFirstChildOfClass("Humanoid").Health > 0) or (hit.Parent.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent.Parent:FindFirstChildOfClass("Humanoid").Health > 0) then
							if exitHit and FastCast.RayExit then
								rayExitedEvent:Fire(point + maxExtent, -maxExtent, exitHit, exitPoint, exitNormal, exitMaterial, segmentVelocity, hitData)
								DbgVisualizeHit(CFrame.new(exitPoint), Color3.fromRGB(13, 105, 172))
							end
							local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid") or hit.Parent.Parent:FindFirstChildOfClass("Humanoid")
							table.insert(listOrIgnoreDescendantsInstance, humanoid.Parent)
							--penetrationPower = penetrationPower
							local toReduce = 1-((dist/penetrationPower/1.1))
							penetrationPower = penetrationPower * toReduce
							PrintDebug("Blacklist cast detected, added " .. tostring(humanoid.Parent) .. " to the blacklist.")
						elseif penetrationType == "penetratedObject" then
							if exitHit and FastCast.RayExit then
								rayExitedEvent:Fire(point + maxExtent, -maxExtent, exitHit, exitPoint, exitNormal, exitMaterial, segmentVelocity, hitData)
								DbgVisualizeHit(CFrame.new(exitPoint), Color3.fromRGB(13, 105, 172))
							end
							table.insert(listOrIgnoreDescendantsInstance, hit)
							--penetrationPower = penetrationPower - dist
							local toReduce = 1-((dist/penetrationPower/1.1))
							penetrationPower = penetrationPower * toReduce
							PrintDebug("Blacklist cast detected, added " .. tostring(hit) .. " to the blacklist.")
						end
					else
						-- This is where things get finnicky.
						-- We can't reparent the object. If we do this, we risk altering behavior of the developer's game which has undesirable effects.
						-- We need to swap cast functions on the fly here. This is gonna get NASTY. Oh well. It should only happen once under this new behavior.
						castFunction = CastWithBlacklistAndNoHumPenetration
						listOrIgnoreDescendantsInstance = listOrIgnoreDescendantsInstance:GetDescendants()
						if penetrationType == "penetratedHumanoid" and (hit.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent:FindFirstChildOfClass("Humanoid").Health > 0) or (hit.Parent.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent.Parent:FindFirstChildOfClass("Humanoid").Health > 0) then
							if exitHit and FastCast.RayExit then
								rayExitedEvent:Fire(point + maxExtent, -maxExtent, exitHit, exitPoint, exitNormal, exitMaterial, segmentVelocity, hitData)
								DbgVisualizeHit(CFrame.new(exitPoint), Color3.fromRGB(13, 105, 172))
							end
							local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid") or hit.Parent.Parent:FindFirstChildOfClass("Humanoid")
							table.insert(listOrIgnoreDescendantsInstance, humanoid.Parent)
							--penetrationPower = penetrationPower
							local toReduce = 1-((dist/penetrationPower/1.1))
							penetrationPower = penetrationPower * toReduce
							PrintDebug("Stock cast detected, transformed cast into blacklist cast and added " .. tostring(humanoid.Parent) .. " to the blacklist.")
						elseif penetrationType == "penetratedObject" then
							if exitHit and FastCast.RayExit then
								rayExitedEvent:Fire(point + maxExtent, -maxExtent, exitHit, exitPoint, exitNormal, exitMaterial, segmentVelocity, hitData)
								DbgVisualizeHit(CFrame.new(exitPoint), Color3.fromRGB(13, 105, 172))
							end
							table.insert(listOrIgnoreDescendantsInstance, hit)
							--penetrationPower = penetrationPower - dist
							local toReduce = 1-((dist/penetrationPower/1.1))
							penetrationPower = penetrationPower * toReduce
							PrintDebug("Stock cast detected, transformed cast into blacklist cast and added " .. tostring(hit) .. " to the blacklist.")
						end
					end
				elseif penetrationData.penetrationType == "HumanoidPenetration" then
					if (castFunction == CastWithWhitelist) then
						-- User is using whitelist. We need to pull this from their list.
						-- n.b. this function is offered by the sandboxed table system. It's not stock.
						if (hit.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent:FindFirstChildOfClass("Humanoid").Health > 0) or (hit.Parent.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent.Parent:FindFirstChildOfClass("Humanoid").Health > 0) then
							didHitHumanoid = true
							local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid") or hit.Parent.Parent:FindFirstChildOfClass("Humanoid")
							table.removeObject(listOrIgnoreDescendantsInstance, humanoid.Parent)
							PrintDebug("Whitelist cast detected, removed " .. tostring(humanoid.Parent) .. " from the whitelist.")
						else
							didHitHumanoid = false
							table.removeObject(listOrIgnoreDescendantsInstance, hit)
							PrintDebug("Whitelist cast detected, removed " .. tostring(hit) .. " from the whitelist.")
						end
					elseif (castFunction == CastWithBlacklist) then
						if (hit.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent:FindFirstChildOfClass("Humanoid").Health > 0) or (hit.Parent.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent.Parent:FindFirstChildOfClass("Humanoid").Health > 0) then
							didHitHumanoid = true
							local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid") or hit.Parent.Parent:FindFirstChildOfClass("Humanoid")
							table.insert(listOrIgnoreDescendantsInstance, humanoid.Parent)
							PrintDebug("Blacklist cast detected, added " .. tostring(humanoid.Parent) .. " to the blacklist.")
						else
							didHitHumanoid = false
							table.insert(listOrIgnoreDescendantsInstance, hit)
							PrintDebug("Blacklist cast detected, added " .. tostring(hit) .. " to the blacklist.")
						end
					else
						-- This is where things get finnicky.
						-- We can't reparent the object. If we do this, we risk altering behavior of the developer's game which has undesirable effects.
						-- We need to swap cast functions on the fly here. This is gonna get NASTY. Oh well. It should only happen once under this new behavior.
						castFunction = CastWithBlacklist
						listOrIgnoreDescendantsInstance = listOrIgnoreDescendantsInstance:GetDescendants()
						if (hit.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent:FindFirstChildOfClass("Humanoid").Health > 0) or (hit.Parent.Parent:FindFirstChildOfClass("Humanoid") and hit.Parent.Parent:FindFirstChildOfClass("Humanoid").Health > 0) then
							didHitHumanoid = true
							local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid") or hit.Parent.Parent:FindFirstChildOfClass("Humanoid")
							table.insert(listOrIgnoreDescendantsInstance, humanoid.Parent)
							PrintDebug("Stock cast detected, transformed cast into blacklist cast and added " .. tostring(humanoid.Parent) .. " to the blacklist.")
						else
							didHitHumanoid = false
							table.insert(listOrIgnoreDescendantsInstance, hit)
							PrintDebug("Stock cast detected, transformed cast into blacklist cast and added " .. tostring(hit) .. " to the blacklist.")
						end
					end
				end

				-- So now just cast again!
				-- Cast with 0 deltaTime and from the prespecified point (this saves a smidge of performance since we don't need to try to recalculate a position value that will come out to be the same thing.)
				PrintDebug("Recasting for penetration...")
				Fire(0, at)

				-- Then set lastPoint.
				lastPoint = point
				-- We used to do ^ above, but this caused undesired effects and zero-length casts. Oops.

				if penetrationData ~= nil then
					if penetrationData.penetrationType ~= "WallPenetration" then
						if didHitHumanoid then
							penetrationCount = hit and (penetrationCount - 1) or 0
							PrintDebug("penetrationCount is reduced to... "..penetrationCount.." for hitting humanoid.")
						else
							PrintDebug("penetrationCount is not reduced for not hitting humanoid (or the humanoid died).")
						end
					else
						PrintDebug("DISTANCE: "..dist.." studs")
						PrintDebug("CURRENT PENETRATION DEPTH: "..penetrationPower.." studs")
					end
				end

				-- And exit the function here too.
				return
			end
		end

		-- Then set lastPoint here as well.
		lastPoint = point
		distanceTravelled = distanceTravelled + rayDisplacement

		if distanceTravelled > distance then
			RemoveList[self] = true
			rayHitEvent:Fire(origin, rayDir.Unit, nil, lastPoint, nil, nil, Vector3.new(), cosmeticBulletObject, hitData)
		end
	end

	function self.Update(delta)
		Fire(delta)
	end

	--[[Thread:Spawn(function()
		Projectiles[self] = true
	end)]]
	-- Too fast?
	if RunService:IsClient() then
		spawn(function()
			Projectiles[self] = true
		end)
	else
		Thread:Spawn(function()
			Projectiles[self] = true
		end)
	end
end

local function BaseFireMethod(self, origin, directionWithMagnitude, velocity, cosmeticBulletObject, ignoreDescendantsInstance, ignoreWater, bulletAcceleration, bulletData, whizData, hitData, list, isWhitelist, penetrationData)
	MandateType(origin, "Vector3", "origin")
	MandateType(directionWithMagnitude, "Vector3", "directionWithMagnitude")
	assert(typeof(velocity) == "Vector3" or typeof(velocity) == "number", ERR_INVALID_TYPE:format("velocity", "Variant<Vector3, number>", typeof(velocity))) -- This one's an odd one out.
	MandateType(cosmeticBulletObject, "Instance", "cosmeticBulletObject", true)
	MandateType(ignoreDescendantsInstance, "Instance", "ignoreDescendantsInstance", true)
	MandateType(ignoreWater, "boolean", "ignoreWater", true)
	MandateType(bulletAcceleration, "Vector3", "bulletAcceleration", true)
	MandateType(list, "table", "list", true)
	-- isWhitelist is strictly internal so it doesn't need to get sanity checked, because last I checked, I'm not insane c:
	-- ... I hope
	-- However, as of Version 9.0.0, a penetrate function can be specified
	MandateType(penetrationData, "table", "penetrationData", true)

	-- Now get into the guts of this.
	local castFunction = Cast
	local ignoreOrList = ignoreDescendantsInstance
	if list ~= nil then
		ignoreOrList = list
		if isWhitelist then
			castFunction = CastWithWhitelist
		else
			castFunction = (penetrationData and penetrationData.penetrationType ~= "WallPenetration" and CastWithBlacklist or CastWithBlacklistAndNoHumPenetration) or CastWithBlacklistAndNoHumPenetration
		end
	end

	SimulateCast(origin, directionWithMagnitude, velocity, castFunction, self.LengthChanged, self.RayHit, self.RayExited, cosmeticBulletObject, ignoreOrList, ignoreWater, bulletAcceleration, bulletData, whizData, hitData, penetrationData)
end


Prompt:
--[[
	Rejects the promise after `seconds` seconds.
]]

Response:
function Promise.prototype:timeout(seconds, rejectionValue)
	local traceback = debug.traceback(nil, 2)

	return Promise.race({
		Promise.delay(seconds):andThen(function()
			return Promise.reject(rejectionValue == nil and Error.new({
				kind = Error.Kind.TimedOut,
				error = "Timed out",
				context = string.format(
					"Timeout of %d seconds exceeded.\n:timeout() called at:\n\n%s",
					seconds,
					traceback
				),
			}) or rejectionValue)
		end),
		self,
	})
end
Promise.prototype.Timeout = Promise.prototype.timeout

function Promise.prototype:getStatus()
	return self._status
end
Promise.prototype.GetStatus = Promise.prototype.getStatus


Prompt: --BlowerSwitch

Response:
function KeepBlowerActive()
	repeat wait()
		BlowerVal.Value = true
	until BlowerSwch.Value == false or Power.Value == false
	BlowerVal.Value = false
end

BlowerSwch.Changed:Connect(function()
	if BlowerSwch.Value == true then
		BlowerSwch.Parent.P1.Transparency = 1
		BlowerSwch.Parent.P2.Transparency = 0
		ClickSound:Play()
		if Power.Value == true then
			KeepBlowerActive()
		end
	else
		BlowerSwch.Parent.P1.Transparency = 0
		BlowerSwch.Parent.P2.Transparency = 1
		ClickSound:Play()
		BlowerVal.Value = false
	end
end)


Prompt: -- Put me in 'StarterGui' to hide the leaderboard.


Prompt: --	if game.ReplicatedStorage.Tools:FindFirstChild(Object.Name) then

Response:
	if Object:FindFirstChild("Handle") and not Rotation then -- Soybeen added 7/29/2020
		Rotation = Vector3.new(0,90,0)
	end

	local Cam = Instance.new("Camera",Viewport)

	Cam.FieldOfView = 50

	Object = Object:Clone()

	Object.Parent = Viewport

	Cam.CameraType = Enum.CameraType.Scriptable

	Cam.CameraSubject = Object

	Viewport.CurrentCamera = Cam

	-- Size viewport and adjust properties.
	Viewport.Size = UDim2.new(1,0,1,0)

	Viewport.Position = UDim2.new(0.5,0,0.5,0)

	Viewport.AnchorPoint = Vector2.new(0.5,0.5)

	Viewport.BackgroundTransparency = 1

	Viewport.BackgroundColor3 = Color3.fromRGB(0,0,0)

	local function GetLongestSide(VectorThree)
		local LongestSide = VectorThree.X

		if VectorThree.Y > LongestSide then
			LongestSide = VectorThree.Y
		end

		if VectorThree.Z > LongestSide then
			LongestSide = VectorThree.Z
		end

		return LongestSide
	end

	-- Position camera relative to object size average.
	if Object:IsA("BasePart") then
		local Offset = distanceOverride or GetLongestSide(Object.Size)

		--local avgsize = (Object.Size.X + Object.Size.Y + Object.Size.Z) / 3

		Object.CFrame = CFrame.new(0,0,0) * CFrame.Angles(math.rad(Rotation.X),math.rad(Rotation.Y),math.rad(Rotation.Z))

		Cam.CFrame =  CFrame.new(0,0,Offset + (1.5 * (Offset/4)))

		Cam.CFrame = CFrame.new(Cam.CFrame.p,Object.Position)

	elseif Object:IsA("Model") and Object.PrimaryPart then
		local Extents = Object:GetExtentsSize()

		local Offset = distanceOverride or GetLongestSide(Extents) --(Extents.X + Extents.Y + Extents.Z) / 3

		local ModelMiddlePos = Vector3.new(Extents.X/2,Extents.Y/2,Extents.Z/2)

		Object:SetPrimaryPartCFrame(CFrame.new(0,0,0) * CFrame.Angles(math.rad(Rotation.X),math.rad(Rotation.Y),math.rad(Rotation.Z)))

		if Offset/4 >= 1 then
			Cam.CFrame = CFrame.new(Object:GetModelCFrame().p) * CFrame.new(0,0,Offset + (1.5 * (Offset/4)))
		else
			Cam.CFrame = CFrame.new(Object:GetModelCFrame().p) * CFrame.new(0,0,Offset + 1.5)
		end

		Cam.CFrame = CFrame.new(Cam.CFrame.p,Object:GetModelCFrame().p)
	else
		Object:Destroy()
		Viewport:Destroy()
		return
	end

	if Viewport.Parent ~= parent then
		Viewport.Parent = parent
	end

	Viewport.ZIndex = parent.ZIndex

	if parent:IsA("ImageLabel") then
		parent.Image = ""
	end

	return Viewport
end

return VC


Prompt: -- Stats

Response:
local stats = {
	{
		Name = "Wins",
		Type = "IntValue",
		DefaultValue = "0",
	},
}

function LeaderboardManager.new(player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player

	for i, stat in pairs(stats) do
		local leaderstat = Instance.new(stat.Type)
		leaderstat.Name = stat.Name
		leaderstat.Value = stat.DefaultValue
		leaderstat.Parent = leaderstats
	end
end

function LeaderboardManager:getStat(player, stat)
	local leaderstats = player:FindFirstChild("leaderstats")
	if not leaderstats then return false end

	if leaderstats then
		return leaderstats:FindFirstChild(stat)
	end
end

function LeaderboardManager:setStat(player, stat, value)
	local stat = LeaderboardManager:getStat(player, stat)

	if stat then
		stat.Value = value
	end
end

function LeaderboardManager:incrementStat(player, stat, value)
	if not value then value = 1 end

	local stat = LeaderboardManager:getStat(player, stat)

	if stat then
		stat.Value = stat.Value + value
	end
end

function LeaderboardManager:decrementStat(player, stat, value)
	if not value then value = 1 end

	local stat = LeaderboardManager:getStat(player, stat)

	if stat then
		stat.Value = stat.Value - value
	end
end

function LeaderboardManager:resetStat(player, stat)
	local stat = LeaderboardManager:getStat(player, stat)

	if stat then
		for i, defaultStat in pairs(stats) do
			if stat == defaultStat.Name then
				stat.Value = defaultStat.DefaultValue
				return
			end
		end

		stat.Value = 0
	end
end

function LeaderboardManager:resetStats(player)
	local leaderstats = player:FindFirstChild("CustomLeaderstats")
	if not leaderstats then return "No leaderstats found" end

	  for i, stat in pairs(leaderstats:GetChildren()) do
          LeaderboardManager:resetState(player, stat)
      end
end

return LeaderboardManager


Prompt:
--wl2.MaxVelocity = 0.007
--wl2.Part0 = script.Parent.Parent.Misc.RL.Door.WD
--wl2.Part1 = wl2.Parent


Prompt:
--[[
	A method called by consumers of Roact to create a new component class.
	Components can not be extended beyond this point, with the exception of
	PureComponent.
]]

Response:
function Component:extend(name)
	if config.typeChecks then
		assert(Type.of(self) == Type.StatefulComponentClass, "Invalid `self` argument to `extend`.")
		assert(typeof(name) == "string", "Component class name must be a string")
	end

	local class = {}

	for key, value in pairs(self) do
		-- Roact opts to make consumers use composition over inheritance, which
		-- lines up with React.
		-- https://reactjs.org/docs/composition-vs-inheritance.html
		if key ~= "extend" then
			class[key] = value
		end
	end

	class[Type] = Type.StatefulComponentClass
	class.__index = class
	class.__componentName = name

	setmetatable(class, componentClassMetatable)

	return class
end

function Component:__getDerivedState(incomingProps, incomingState)
	if config.internalTypeChecks then
		internalAssert(Type.of(self) == Type.StatefulComponentInstance, "Invalid use of `__getDerivedState`")
	end

	local internalData = self[InternalData]
	local componentClass = internalData.componentClass

	if componentClass.getDerivedStateFromProps ~= nil then
		local derivedState = componentClass.getDerivedStateFromProps(incomingProps, incomingState)

		if derivedState ~= nil then
			if config.typeChecks then
				assert(typeof(derivedState) == "table", "getDerivedStateFromProps must return a table!")
			end

			return derivedState
		end
	end

	return nil
end

function Component:setState(mapState)
	if config.typeChecks then
		assert(Type.of(self) == Type.StatefulComponentInstance, "Invalid `self` argument to `extend`.")
	end

	local internalData = self[InternalData]
	local lifecyclePhase = internalData.lifecyclePhase

	--[[
		When preparing to update, rendering, or unmounting, it is not safe
		to call `setState` as it will interfere with in-flight updates. It's
		also disallowed during unmounting
	]]
	if lifecyclePhase == ComponentLifecyclePhase.ShouldUpdate or
		lifecyclePhase == ComponentLifecyclePhase.WillUpdate or
		lifecyclePhase == ComponentLifecyclePhase.Render or
		lifecyclePhase == ComponentLifecyclePhase.WillUnmount
	then
		local messageTemplate = invalidSetStateMessages[internalData.lifecyclePhase]

		local message = messageTemplate:format(tostring(internalData.componentClass))

		error(message, 2)
	end

	local pendingState = internalData.pendingState

	local partialState
	if typeof(mapState) == "function" then
		partialState = mapState(pendingState or self.state, self.props)

		-- Abort the state update if the given state updater function returns nil
		if partialState == nil then
			return
		end
	elseif typeof(mapState) == "table" then
		partialState = mapState
	else
		error("Invalid argument to setState, expected function or table", 2)
	end

	local newState
	if pendingState ~= nil then
		newState = assign(pendingState, partialState)
	else
		newState = assign({}, self.state, partialState)
	end

	if lifecyclePhase == ComponentLifecyclePhase.Init then
		-- If `setState` is called in `init`, we can skip triggering an update!
		local derivedState = self:__getDerivedState(self.props, newState)
		self.state = assign(newState, derivedState)

	elseif lifecyclePhase == ComponentLifecyclePhase.DidMount or
		lifecyclePhase == ComponentLifecyclePhase.DidUpdate or
		lifecyclePhase == ComponentLifecyclePhase.ReconcileChildren
	then
		--[[
			During certain phases of the component lifecycle, it's acceptable to
			allow `setState` but defer the update until we're done with ones in flight.
			We do this by collapsing it into any pending updates we have.
		]]
		local derivedState = self:__getDerivedState(self.props, newState)
		internalData.pendingState = assign(newState, derivedState)

	elseif lifecyclePhase == ComponentLifecyclePhase.Idle then
		-- Outside of our lifecycle, the state update is safe to make immediately
		self:__update(nil, newState)

	else
		local messageTemplate = invalidSetStateMessages.default

		local message = messageTemplate:format(tostring(internalData.componentClass))

		error(message, 2)
	end
end


Prompt: -- ReplicatedStorage --

Response:
function CircleClick(Button, X, Y)
	coroutine.resume(coroutine.create(function()

		Button.ClipsDescendants = true

		local Circle = script:WaitForChild("Circle"):Clone()
			Circle.Parent = Button
			local NewX = X - Circle.AbsolutePosition.X
			local NewY = Y - Circle.AbsolutePosition.Y
			Circle.Position = UDim2.new(0, NewX, 0, NewY)

		local Size = 0
			if Button.AbsoluteSize.X > Button.AbsoluteSize.Y then
				 Size = Button.AbsoluteSize.X*1.5
			elseif Button.AbsoluteSize.X < Button.AbsoluteSize.Y then
				 Size = Button.AbsoluteSize.Y*1.5
			elseif Button.AbsoluteSize.X == Button.AbsoluteSize.Y then																										Size = Button.AbsoluteSize.X*1.5
			end

		local Time = 0.5
			Circle:TweenSizeAndPosition(UDim2.new(0, Size, 0, Size), UDim2.new(0.5, -Size/2, 0.5, -Size/2), "Out", "Quad", Time, false, nil)
			for i=1,10 do
				Circle.ImageTransparency = Circle.ImageTransparency + 0.01
				wait(Time/10)
			end
			Circle:Destroy()

	end))
end

return CircleClick


Prompt: -- Detect input to run or crawl

Response:
UIS.InputBegan:Connect(function(input)
	-- Detect input to run
	if input.KeyCode==Enum.KeyCode.LeftShift then
		-- Make sure not crawling or running already
		if shiftDown==false and not cDown then
			-- Run
			shiftDown=true
			hum.WalkSpeed=32
		end
	-- Detect input to crawl
	else if input.KeyCode==Enum.KeyCode.C then
			-- Make sure not running or crawling already
			if cDown==false and not shiftDown then
				-- Crawl
				cDown=true
				hum.WalkSpeed=5
				--crawlAnm:Play()
			end
		end
	end
end)


Prompt: --Check if the player is holding down left click

Response:
mouse.Button1Down:Connect(function()
	down = true
end)
mouse.Button1Up:Connect(function()
	down = false
end)


Prompt:
--while true do
--	local newpos = getnewposition()
--		Attachment.Orientation = newpos
--	print(newpos)
--	wait(0.2)
--end


Prompt: --local Screen = carSeat.Parent.AudioPlayerScreen.SurfaceGui <-- soon

Response:
local Song = script.Parent.AudioPlayerGui.Song
local Audio = carSeat.Audio

vol = 5

function changeSong()

	local effect = carSeat.Audio.EqualizerSoundEffect
	if effect.HighGain == 5 then
		effect.HighGain = -80
		effect.MidGain = -25
		onOff.Text = "IN"
	else
		effect.HighGain = 5
		effect.MidGain = 7
		onOff.Text = "OUT"
	end

end

function playSong()

	local id = player.PlayerGui.AudioPlayer.AudioPlayerGui.TextBox.Text
	Audio:Stop()
	Audio.SoundId = "http://www.roblox.com/asset/?id="..id
	Audio:Play()
	--Screen.Song.Text = game:GetService("MarketplaceService"):GetProductInfo(id).Name
	Song.Text = game:GetService("MarketplaceService"):GetProductInfo(id).Name
	--Screen.ID.Text = id

end

function stopSong()

	Audio:Stop()

end

function volUp()

	if vol + 0.1 <= 5 then
		vol = vol + 0.1
		Audio.Volume = vol
		player.PlayerGui.AudioPlayer.AudioPlayerGui.Vol.Text = tostring(vol*1) .. "%"
		--Screen.Vol.Text = tostring(vol*100) .. "%"
	end

end

function volDown()

	if vol - 0.1 >= 0 then
		vol = vol - 0.1
		Audio.Volume = vol
		player.PlayerGui.AudioPlayer.AudioPlayerGui.Vol.Text = tostring(vol*1) .. "%"
		--Screen.Vol.Text = tostring(vol*100) .. "%"
	end

end

ChangeButton.MouseButton1Click:connect(function()

	changeSong()

end)

VolUpButton.MouseButton1Click:connect(function()

	volUp()

end)

VolDownButton.MouseButton1Click:connect(function()

	volDown()

end)

PlayButton.MouseButton1Click:connect(function()

	playSong()

end)

PauseButton.MouseButton1Click:connect(function()

	stopSong()

end)


Prompt:
--///////////////// Internal-Use Methods
--//////////////////////////////////////
--DO NOT REMOVE THIS. Chat must be filtered or your game will face
--moderation.

Response:
function methods:InternalApplyRobloxFilter(speakerName, message, toSpeakerName)
	if (RunService:IsServer() and not RunService:IsStudio()) then
		local fromSpeaker = self:GetSpeaker(speakerName)
		local toSpeaker = self:GetSpeaker(toSpeakerName)
		if (fromSpeaker and toSpeaker) then
			local fromPlayerObj = fromSpeaker:GetPlayer()
			local toPlayerObj = toSpeaker:GetPlayer()
			if (fromPlayerObj and toPlayerObj) then
				local filterStartTime = tick()
				local filterRetries = 0
				while true do
					local success, message = pcall(function()
						return Chat:FilterStringAsync(message, fromPlayerObj, toPlayerObj)
					--[[ To uncensor the chat, turn the line above into the following:
						Chat:FilterStringAsync(message, fromPlayerObj, toPlayerObj)
						return message
					--]]
					end)
					if success then
						return message
					else
						warn("Error filtering message:", message)
					end
					filterRetries = filterRetries + 1
					if filterRetries > MAX_FILTER_RETRIES or (tick() - filterStartTime) > MAX_FILTER_DURATION then
						self:InternalNotifyFilterIssue()
						return nil
					end
				end
			end
		end
	else
		--// Simulate filtering latency.
		--// There is only latency the first time the message is filtered, all following calls will be instant.
		if not StudioMessageFilteredCache[message] then
			StudioMessageFilteredCache[message] = true
			wait(0.2)
		end
		return message
	end

	return nil
end

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

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

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

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

	for funcId, func, priority in commandsIterator do
		local success, returnValue = pcall(function()
			local ret = func(speakerName, message, channel)
			assert(type(ret) == "boolean")
			return ret
		end)

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

	return false
end

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

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

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

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

	return speaker
end

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


Prompt: -- This is to store other things that may require our radar attention

Response:
local Camera = workspace.CurrentCamera

local SaveList = {MinhaVisao = 1, RosaDosVentos = 1, UIAspectRatioConstraint = 1, FoeBlip = 1, FriendBlip = 1}
local SquadSave = {UIGridLayout = 1}

Character.Humanoid.Died:Connect(function()
	script.Parent.Enabled = false
end)

game:GetService("RunService").RenderStepped:connect(function()

	local Direction = (Vector2.new(Camera.Focus.x,Camera.Focus.z)-Vector2.new(Camera.CoordinateFrame.x,Camera.CoordinateFrame.z)).unit
	local theta = (math.atan2(Direction.y,Direction.x))*(-180/math.pi) - 90

	if Saude.FireTeam.SquadName.Value ~= "" then
		MinhasVisao.ImageColor3 = Saude.FireTeam.SquadColor.Value
	else
		MinhasVisao.ImageColor3 = Color3.fromRGB(255,255,255)
	end

	local frame = Vector3.new(Camera.CoordinateFrame.x, 0, Camera.CoordinateFrame.z)
	local focus = Vector3.new(Camera.Focus.x, 0, Camera.Focus.z)
	local frame = CFrame.new(focus, frame)

	script.Parent.Frame.RosaDosVentos.Rotation = theta
	local players = game.Players:GetChildren()

	if Saude.FireTeam.SquadName.Value ~= "" and Player then
		script.Parent.Squad.Visible = true
		script.Parent.Squad.Esquadrao.Text = Saude.FireTeam.SquadName.Value
	else
		script.Parent.Squad.Visible = false
	end

	local Nomes = script.Parent.Squad.Membros:GetChildren()
	for i = 1, #Nomes do
		if not SquadSave[Nomes[i].Name] then
			Nomes[i]:Destroy()
		end
	end

	for i = 1, #players do
		if players[i] ~= Player and players[i].Character and Player and Player.Character then
			local unit = script.Parent.Squad.Membros:FindFirstChild(players[i].Name)
			if not unit then
				if players[i].TeamColor == Player.TeamColor and players[i].Character.Saude.FireTeam.SquadName.Value == Player.Character.Saude.FireTeam.SquadName.Value and Player.Character.Saude.FireTeam.SquadName.Value ~= "" then
					unit = script.Parent.Squad.Exemplo:Clone()
					unit.Visible = true
					unit.Text = players[i].Name
					unit.Name = players[i].Name
					unit.Parent = script.Parent.Squad.Membros
				end
			end
		end
	end

	local labels = RadarFrame:GetChildren()
	for i = 1, #labels do
		if not SaveList[labels[i].Name] then
			labels[i]:Destroy()
		end
	end

	for i = 1, #players do
		if players[i] ~= Player and players[i].Character and Player and Player.Character then
			local unit = RadarFrame:FindFirstChild(players[i].Name)
			if not unit then
				if players[i].TeamColor == Player.TeamColor then
					unit = FriendBlip:Clone()
				else
					unit = FoeBlip:Clone()
				end
				unit.Visible = false
				unit.Name = players[i].Name
				unit.Parent = RadarFrame
			end

			if players[i].Character:FindFirstChild('Humanoid') and players[i].Character:FindFirstChild('HumanoidRootPart') then

				-- Get the relative position of the players
				local pos = CFrame.new(players[i].Character.HumanoidRootPart.Position.X, 0, players[i].Character.HumanoidRootPart.Position.Z)
				local relativeCFrame = frame:inverse() * pos
				local distanceRatio = relativeCFrame.p.Magnitude/RANGE
				if distanceRatio < 0.9 then
					local xScale = 0.5 - ((relativeCFrame.x/RANGE)/2)
					local yScale = 0.5 - ((relativeCFrame.z/RANGE)/2)
					unit.Position = UDim2.new(xScale, 0, yScale, 0)
					unit.Rotation = -players[i].Character.HumanoidRootPart.Orientation.Y + theta

				if players[i].TeamColor == Player.TeamColor then
					if players[i].Character.Saude.FireTeam.SquadName.Value ~= "" then
						unit.ImageColor3 = players[i].Character.Saude.FireTeam.SquadColor.Value
					else
						unit.ImageColor3 = FriendBlip.ImageColor3
					end
				else
					unit.ImageColor3 = FoeBlip.ImageColor3
				end
					unit.Visible = true

				else
					unit.Visible = false
				end
			else
				unit.Visible = false
			end
		end
	end
end)


Prompt: -- special damage when the Ninja slash occurs

Response:
local slash_damage = 10

local damage = nonslash_damage


Prompt: --//Suspension//--

Response:
RideHeightFront = 2.3 --{This value will increase the ride height for front}
RideHeightRear = 2.9--{This value will increase the ride height for rear}

StiffnessFront = 5 --[0-10]{HIGHER STIFFNESS DECREASES SPAWNING STABILITY}
StiffnessRear = 4 --[0-10]{This value will increase the stiffness for rear} (S/A)

AntiRollFront = 2 --[0-10]{HIGHER STIFFNESS DECREASES SPAWNING STABILITY}
AntiRollRear = 3 --[0-10]{This value will reduce roll on the rear} (S/A)

CamberFront = -0.2 --[0-10]{Camber to the front in degrees}
CamberRear = -1.3 --[0-10]{Camber to the rear in degrees}


Prompt: --/ Initialization /--

Response: require(script.MainModule).start(script,config)


Prompt:
-- ================================================================================
-- LOCAL FUNCTIONS
-- ================================================================================

Response:
local function CheckNAN(value, returnIfNan)
	return (value == value and value or returnIfNan)
end -- CheckNAN

local function DeltaAngle(current, target)
	local num = (target - current) % TAU
	if num > PI then
		num = (num - TAU)
	end
	return num
end -- DeltaAngle()

local function DeltaAngleV3(pos1, pos2)
	local x = DeltaAngle(pos1.X, pos2.X)
	local y = DeltaAngle(pos1.Y, pos2.Y)
	local z = DeltaAngle(pos1.Z, pos2.Z)
	return V3(x, y, z)
end -- DeltaAngleV3()


Prompt: --	carSeat.Parent.Body.Dash.Screen.G.Radio.VOLMENU.VolumeText.Text = "VOLUME: "..carSeat.Parent.Body.MP.Sound.Volume

Response:
end

F.updateValue = function(Val, Value)
	if Val then
		Val.Value = Value
	end
end

F.FMSwitch = function(FM)
	if carSeat.Stations.mood.Value == 5 then
		carSeat.Parent.Body.MP.Sound:Stop()
		carSeat.Stations.mood.Value = 2


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

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

local Tool = script.Parent

local Animations = {}
local MyHumanoid
local MyCharacter

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

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

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

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

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


Prompt:
---////==========================================\\\---
--Controller for: Railroad Crossing Sounder

Response: Sounder = script.Parent.Parent.ControlBox.CrossingValues.Bell


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

local Figure = script.Parent
local Torso = waitForChild(Figure, "Torso")
local RightShoulder = waitForChild(Torso, "Right Shoulder")
local LeftShoulder = waitForChild(Torso, "Left Shoulder")
local RightHip = waitForChild(Torso, "Right Hip")
local LeftHip = waitForChild(Torso, "Left Hip")
local Neck = waitForChild(Torso, "Neck")
local Humanoid = waitForChild(Figure, "Monster") -- Don't tutch.
local pose = "Standing"

local toolAnim = "None"
local toolAnimTime = 0

local isSeated = false

function onRunning(speed)
	if isSeated then return end

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

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

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

function onClimbing()
	pose = "Climbing"
end

function onGettingUp()
	pose = "GettingUp"
end

function onFreeFall()
	pose = "FreeFall"
end

function onDancing()
	pose = "Dancing"
end

function onFallingDown()
	pose = "FallingDown"
end

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

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

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

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

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

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

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

end

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

end

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

end

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

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

function getTool()

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

	return nil
end

function getToolAnim(tool)

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

function animateTool()

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

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

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

function move(time)
	local amplitude
	local frequency

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

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

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

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

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

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

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

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

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

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

		amplitude = 0.1
		frequency = 1

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

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

	local tool = getTool()

	if tool ~= nil then

		animStringValueObject = getToolAnim(tool)

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

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

		animateTool()

	else
		toolAnim = "None"
		toolAnimTime = 0
	end
end


Prompt:
--	local dir = pos.CFrame.lookVector
--	local pos1 = pos.Position + (dir * 6)
--	rocket.CFrame = CFrame.new(pos1,  pos1 + dir)

Response:
	scr.Disabled= false
	rocket.Parent = game.Workspace

	-- т.е. дальше он живёт сам по себе
end

return module


Prompt:
--// All global vars will be wiped/replaced except script
--// All guis are autonamed client.Variables.CodeName..gui.Name

Response:
return function(data, env)
	if env then
		setfenv(1, env)
	end

	local gui = script.Parent.Parent
	local playergui = service.PlayerGui
	local str = data.Message
	local time = data.Time or 15

	local log  = {
		Type = "Hint";
		Title = "Hint";
		Message = str;
		Icon = "rbxassetid://7501175708";
		Time = os.date("%X");
		Function = nil;
	}

	table.insert(client.Variables.CommunicationsHistory, log)
	service.Events.CommsPanel:Fire(log)

	--client.UI.Make("HintHolder")
	local container = client.UI.Get("HintHolder",nil,true)
	if not container then
		local holder = service.New("ScreenGui")
		holder.IgnoreGuiInset = not client.Variables.TopBarShift
		holder.ClipToDeviceSafeArea = true

		local hTable = client.UI.Register(holder)
		local frame = service.New("ScrollingFrame", holder)
		client.UI.Prepare(holder)
		hTable.Name = "HintHolder"
		frame.Name = "Frame"
		frame.BackgroundTransparency = 1
		frame.Size = UDim2.new(1, 0, 0,150)
		frame.CanvasSize = UDim2.new(0, 0, 0, 0)
		frame.ChildAdded:Connect(function(c)
			if #frame:GetChildren() == 0 then
				frame.Visible = false
			else
				frame.Visible = true
			end
		end)

		frame.ChildRemoved:Connect(function(c)
			if #frame:GetChildren() == 0 then
				frame.Visible = false
			else
				frame.Visible = true
			end
		end)

		container = hTable
		hTable:Ready()
	end
	container = container.Object.Frame

	--// First things first account for notif :)
	local notif = client.UI.Get("Notif")

	if (container:IsA("ScreenGui")) then
		container.IgnoreGuiInset, container.ClipToDeviceSafeArea = not client.Variables.TopBarShift, true
	end

	container.Position = UDim2.new(0, 0, 0, (notif and 30 or 0))

	local children = container:GetChildren()

	gui.Position = UDim2.new(0,0,0,-100)
	gui.Frame.msg.Text = str
	local bounds = gui.Frame.msg.TextBounds.X

	local function moveGuis(m,ignore)
		m = m or 0
		local max = #container:GetChildren()
		for i,v in pairs(container:GetChildren()) do
			if v~=ignore then
				local y = (i+m)*28
				v.Position = UDim2.new(0,0,0,y)
				if i~=max then v.Size = UDim2.new(1,0,0,28) end
			end
		end
	end

	local lom = -1
	moveGuis(-1)
	gui.Parent = container
	if #container:GetChildren()>5 then lom = -2 end
	UDim2.new(0,0,0,(#container:GetChildren()+lom)*28)
	moveGuis(-1)
	--gui:TweenPosition(UDim2.new(0,0,0,(#container:GetChildren()+lom)*28),nil,nil,0.3,true,function() if gui and gui.Parent then moveGuis(-1) end end)

	if #container:GetChildren()>5 then
		local gui = container:GetChildren()[1]
		moveGuis(-2,gui)
		gui:Destroy()
		--gui:TweenPosition(UDim2.new(0,0,0,-100),nil,nil,0.2,true,function() if gui and gui.Parent then gui:Destroy() end end)
	end

	wait(data.Time or 5)

	if gui and gui.Parent then
		moveGuis(-2,gui)
		gui:Destroy()
		--gui:TweenPosition(UDim2.new(0,0,0,-100),nil,nil,0.2,true,function() if gui and gui.Parent then gui:Destroy() end end)
	end
end


Prompt: -- Initialize the tool

Response:
local NewPartTool = {

	Name = 'New Part Tool';
	Color = BrickColor.new 'Really black';

	-- Default options
	Type = 'Normal';

};


Prompt: --[[ The Module ]]

Response:
--
local BaseCharacterController = require(script.Parent:WaitForChild("BaseCharacterController"))
local Gamepad = setmetatable({}, BaseCharacterController)
Gamepad.__index = Gamepad

function Gamepad.new(CONTROL_ACTION_PRIORITY)
	local self = setmetatable(BaseCharacterController.new(), Gamepad)

	self.CONTROL_ACTION_PRIORITY = CONTROL_ACTION_PRIORITY

	self.forwardValue  = 0
	self.backwardValue = 0
	self.leftValue = 0
	self.rightValue = 0

	self.activeGamepad = NONE	-- Enum.UserInputType.Gamepad1, 2, 3...
	self.gamepadConnectedConn = nil
	self.gamepadDisconnectedConn = nil
	return self
end

function Gamepad:Enable(enable)
	if not UserInputService.GamepadEnabled then
		return false
	end

	if enable == self.enabled then
		-- Module is already in the state being requested. True is returned here since the module will be in the state
		-- expected by the code that follows the Enable() call. This makes more sense than returning false to indicate
		-- no action was necessary. False indicates failure to be in requested/expected state.
		return true
	end

	self.forwardValue  = 0
	self.backwardValue = 0
	self.leftValue = 0
	self.rightValue = 0
	self.moveVector = ZERO_VECTOR3
	self.isJumping = false

	if enable then
		self.activeGamepad = self:GetHighestPriorityGamepad()
		if self.activeGamepad ~= NONE then
			self:BindContextActions()
			self:ConnectGamepadConnectionListeners()
		else
			-- No connected gamepads, failure to enable
			return false
		end
	else
		self:UnbindContextActions()
		self:DisconnectGamepadConnectionListeners()
		self.activeGamepad = NONE
	end

	self.enabled = enable
	return true
end


Prompt:
--[=[
	@within Shake
	@prop TimeFunction () -> number
	The function used to get the current time. This defaults to
	`time` during runtime, and `os.clock` otherwise. Usually this
	will not need to be set, but it can be optionally configured
	if desired.
]=]


Prompt: ---@class Database

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


Response:
	,Distance = 10000
	,BDrop = .25
	,BSpeed = 2300

	,SuppressMaxDistance = 25	--- Studs
	,SuppressTime = 10			--- Seconds

	,BulletWhiz = true
	,BWEmitter = 25
	,BWMaxDistance = 200

	,BulletFlare = false
	,BulletFlareColor = Color3.fromRGB(255,255,255)

	,Tracer = true
	,TracerColor = Color3.fromRGB(255,255,255)
	,TracerLightEmission = 1
	,TracerLightInfluence = 0
	,TracerLifeTime = .2
	,TracerWidth = .1
	,RandomTracer = false
	,TracerEveryXShots = 1
	,TracerChance = 100

	,BulletLight = false
	,BulletLightBrightness = 1
	,BulletLightColor = Color3.fromRGB(255,255,255)
	,BulletLightRange = 10

	,ExplosiveHit = false
	,ExPressure = 500
	,ExpRadius = 25
	,DestroyJointRadiusPercent = 0	--- Between 0 & 1
	,ExplosionDamage = 100

	,LauncherDamage = 100
	,LauncherRadius = 25
	,LauncherPressure = 500
	,LauncherDestroyJointRadiusPercent = 0


Prompt: -- FUNCTIONS --

Response:
humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)

local head = char:WaitForChild("Head")
head.Shape = Enum.PartType.Ball
head.Size = Vector3.new(1,1,1)

CS:GetInstanceAddedSignal("Ragdoll"):Connect(function(v)
	if v == char then
		humanoid:ChangeState(Enum.HumanoidStateType.Physics)
		hrp:ApplyAngularImpulse(Vector3.new(90, 0, 0))
	end
end)

CS:GetInstanceRemovedSignal("Ragdoll"):Connect(function(v)
	if v == char then
		humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
	end
end)


Prompt: -- dayLength defines how long, in minutes, a day in your game is. Feel free to alter it.

Response:
local dayLength = 15

local cycleTime = dayLength*60
local minutesInADay = 24*60

local lighting = game:GetService("Lighting")

local startTime = tick() - (lighting:getMinutesAfterMidnight() / minutesInADay)*cycleTime
local endTime = startTime + cycleTime

local timeRatio = minutesInADay / cycleTime

if dayLength == 0 then
	dayLength = 1
end

repeat
	local currentTime = tick()

	if currentTime > endTime then
		startTime = endTime
		endTime = startTime + cycleTime
	end

	lighting:setMinutesAfterMidnight((currentTime - startTime)*timeRatio)
	wait(1/15)
until false


Prompt: --	carSeat.Parent.Body.Dash.Screen.G.Radio.Song.Text = "Music off"

Response:
end

F.pitc = function(v)
	carSeat.Parent.Body.MP.Sound.Pitch = v
end

script.Parent.OnServerEvent:connect(function(Player, Func, ...)
	if F[Func] then
		F[Func](...)
	end
end)


Prompt:
--[[

	CameraShakePresets.Bump
	CameraShakePresets.Explosion
	CameraShakePresets.Earthquake
	CameraShakePresets.BadTrip
	CameraShakePresets.HandheldCamera
	CameraShakePresets.Vibration
	CameraShakePresets.RoughDriving

--]]

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

local CameraShakePresets = {
	-- A high-magnitude, short, yet smooth shake.
	-- Should happen once.
	Bump = function()
		local c = CameraShakeInstance.new(2.5, 4, 0.1, 0.75)
		c.PositionInfluence = Vector3.new(0.15, 0.15, 0.15)
		c.RotationInfluence = Vector3.new(1, 1, 1)
		return c
	end;

	-- An intense and rough shake.
	-- Should happen once.
	Explosion = function()
		local c = CameraShakeInstance.new(5, 10, 0, 1.5)
		c.PositionInfluence = Vector3.new(0.25, 0.25, 0.25)
		c.RotationInfluence = Vector3.new(4, 1, 1)
		return c
	end;

	-- A continuous, rough shake
	-- Sustained.
	Earthquake = function()
		local c = CameraShakeInstance.new(0.6, 3.5, 2, 10)
		c.PositionInfluence = Vector3.new(0.25, 0.25, 0.25)
		c.RotationInfluence = Vector3.new(1, 1, 4)
		return c
	end;

	-- A bizarre shake with a very high magnitude and low roughness.
	-- Sustained.
	BadTrip = function()
		local c = CameraShakeInstance.new(10, 0.15, 5, 10)
		c.PositionInfluence = Vector3.new(0, 0, 0.15)
		c.RotationInfluence = Vector3.new(2, 1, 4)
		return c
	end;

	-- A subtle, slow shake.
	-- Sustained.
	HandheldCamera = function()
		local c = CameraShakeInstance.new(1, 0.25, 5, 10)
		c.PositionInfluence = Vector3.new(0, 0, 0)
		c.RotationInfluence = Vector3.new(1, 0.5, 0.5)
		return c
	end;

	-- A very rough, yet low magnitude shake.
	-- Sustained.
	Vibration = function()
		local c = CameraShakeInstance.new(0.4, 20, 2, 2)
		c.PositionInfluence = Vector3.new(0, 0.15, 0)
		c.RotationInfluence = Vector3.new(1.25, 0, 4)
		return c
	end;

	-- A slightly rough, medium magnitude shake.
	-- Sustained.
	RoughDriving = function()
		local c = CameraShakeInstance.new(1, 2, 1, 1)
		c.PositionInfluence = Vector3.new(0, 0, 0)
		c.RotationInfluence = Vector3.new(1, 1, 1)
		return c
	end;
}

return setmetatable({}, {
	__index = function(t, i): (() -> ())?
		local f = CameraShakePresets[i]
		if (type(f) == "function") then
			return f()
		end

		error("No preset found with index \"" .. i .. "\"")
	end;
})


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

Response:
game.Workspace.doorleft.l11.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(106)

game.Workspace.doorleft.l12.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(1013)

game.Workspace.doorleft.l13.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l31.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(1023)

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


Prompt:
--[[**
	<description>
	Run this once to combine all keys provided into one "main key".
	Internally, this means that data will be stored in a table with the key mainKey.
	This is used to get around the 2-DataStore2 reliability caveat.
	</description>

	<parameter name = "mainKey">
	The key that will be used to house the table.
	</parameter>

	<parameter name = "...">
	All the keys to combine under one table.
	</parameter>
**--]]

Response:
function DataStore2.Combine(mainKey, ...)
	for _, name in ipairs({...}) do
		combinedDataStoreInfo[name] = mainKey
	end
end

function DataStore2.ClearCache()
	DataStoreCache = {}
end

function DataStore2.SaveAll(player)
	if DataStoreCache[player] then
		for _, dataStore in pairs(DataStoreCache[player]) do
			if dataStore.combinedStore == nil then
				dataStore:Save()
			end
		end
	end
end

DataStore2.SaveAllAsync = Promise.promisify(DataStore2.SaveAll)

function DataStore2.PatchGlobalSettings(patch)
	for key, value in pairs(patch) do
		assert(Settings[key] ~= nil, "No such key exists: " .. key)
		-- TODO: Implement type checking with this when osyris' t is in
		Settings[key] = value
	end
end

function DataStore2.__call(_, dataStoreName, player)
	assert(
		typeof(dataStoreName) == "string" and IsPlayer.Check(player),
		("DataStore2() API call expected {string dataStoreName, Player player}, got {%s, %s}")
		:format(
			typeof(dataStoreName),
			typeof(player)
		)
	)

	if DataStoreCache[player] and DataStoreCache[player][dataStoreName] then
		return DataStoreCache[player][dataStoreName]
	elseif combinedDataStoreInfo[dataStoreName] then
		local dataStore = DataStore2(combinedDataStoreInfo[dataStoreName], player)

		dataStore:BeforeSave(function(combinedData)
			for key in pairs(combinedData) do
				if combinedDataStoreInfo[key] then
					local combinedStore = DataStore2(key, player)
					local value = combinedStore:Get(nil, true)
					if value ~= nil then
						if combinedStore.combinedBeforeSave then
							value = combinedStore.combinedBeforeSave(clone(value))
						end
						combinedData[key] = value
					end
				end
			end

			return combinedData
		end)

		local combinedStore = setmetatable({
			combinedName = dataStoreName,
			combinedStore = dataStore,
		}, {
			__index = function(_, key)
				return CombinedDataStore[key] or dataStore[key]
			end,
		})

		if not DataStoreCache[player] then
			DataStoreCache[player] = {}
		end

		DataStoreCache[player][dataStoreName] = combinedStore
		return combinedStore
	end

	local dataStore = {
		Name = dataStoreName,
		UserId = player.UserId,
		callbacks = {},
		beforeInitialGet = {},
		afterSave = {},
		bindToClose = {},
	}

	dataStore.savingMethod = SavingMethods[Settings.SavingMethod].new(dataStore)

	setmetatable(dataStore, DataStoreMetatable)

	local saveFinishedEvent, isSaveFinished = Instance.new("BindableEvent"), false
	local bindToCloseEvent = Instance.new("BindableEvent")

	local bindToCloseCallback = function()
		if not isSaveFinished then
			-- Defer to avoid a race between connecting and firing "saveFinishedEvent"
			Promise.defer(function()
				bindToCloseEvent:Fire() -- Resolves the Promise.race to save the data
			end)

			saveFinishedEvent.Event:Wait()
		end

		local value = dataStore:Get(nil, true)

		for _, bindToClose in ipairs(dataStore.bindToClose) do
			bindToClose(player, value)
		end
	end

	local success, errorMessage = pcall(function()
		game:BindToClose(function()
			if bindToCloseCallback == nil then
				return
			end

			bindToCloseCallback()
		end)
	end)
	if not success then
		warn("DataStore2 could not BindToClose", errorMessage)
	end

	Promise.race({
		Promise.fromEvent(bindToCloseEvent.Event),
		Promise.fromEvent(player.AncestryChanged, function()
			return not player:IsDescendantOf(game)
		end),
	}):andThen(function()
		dataStore:SaveAsync():andThen(function()
			--print("player left, saved", dataStoreName)
		end):catch(function(error)
			-- TODO: Something more elegant
			--warn("error when player left!", error)
		end):finally(function()
			isSaveFinished = true
			saveFinishedEvent:Fire()
		end)

		--Give a long delay for people who haven't figured out the cache :^(
		return Promise.delay(40):andThen(function()
			DataStoreCache[player] = nil
			bindToCloseCallback = nil
		end)
	end)

	if not DataStoreCache[player] then
		DataStoreCache[player] = {}
	end

	DataStoreCache[player][dataStoreName] = dataStore

	return dataStore
end

DataStore2.Constants = Constants

return setmetatable(DataStore2, DataStore2)


Prompt: -- If you want to know how to retexture a hat, read this:  http://www.roblox.com/Forum/ShowPost.aspx?PostID=10502388

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 = "Hat"   -- It doesn't make a difference, but if you want to make your place in Explorer neater, change this to the name of your hat.
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle"
		p.formFactor = 0
		p.Size = Vector3.new(-0,-0,-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.73,0.02) -- Change these to change the positiones of your hat, as I said earlier.
		wait(5)		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)


Prompt: -- Get the character and humanoid

Response:
local character = game.Players.LocalPlayer.Character
local humanoid = character:WaitForChild("Humanoid")


Prompt: -- ROBLOX upstream: https://github.com/facebook/jest/tree/v27.4.7/packages/jest-util/src/isPromise.ts


Prompt: -- Make signal strict

Response:
setmetatable(Signal, {
	__index = function(tb, key)
		error(("Attempt to get Signal::%s (not a valid member)"):format(tostring(key)), 2)
	end,
	__newindex = function(tb, key, value)
		error(("Attempt to set Signal::%s (not a valid member)"):format(tostring(key)), 2)
	end
})

return Signal


Response:
_L.Services.MarketplaceService.ProcessReceipt = function(receiptInfo)
	--- Reciept info
	local playerId = receiptInfo.PlayerId
	local productId, purchaseId = receiptInfo.ProductId, receiptInfo.PurchaseId
	local currencySpent, currencyType = receiptInfo.CurrencySpent, receiptInfo.CurrencyType
	local placeId = receiptInfo.PlaceIdWherePurchased

	--- Find the player instance from playerId (scans several times just in case)
	local function FindPlayer()
		local player = game.Players:GetPlayerByUserId(playerId)
		local attempts = 0
		while (not player) and attempts < 20 do
			wait(.2)
			player = game.Players:GetPlayerByUserId(playerId)
			attempts = attempts + 1
		end
		return player
	end

	--- Process product reciept
	local player = FindPlayer()
	if player then
		local productDir = Products.GetDir(productId)
		local playerStats = _L.Saving.Get(player)
		if productDir and playerStats then
			--- Reward the player for purchasing this product based on the callback!
			local pass = false
			local pass2 = pcall(function()
				pass = productDir.Callback(player, receiptInfo)
			end)

			--- Success!
			if pass and pass2 then
				pcall(function()
					_L.Network.Fire("Product Bought", player, receiptInfo)
					_L.Signal.Fire("Product Bought", player, receiptInfo)
					_L.Analytics.Purchase("product", player.Name, productId)
				end)
				return Enum.ProductPurchaseDecision.PurchaseGranted
			end
		end
	end

	--- Failed, for some reason. Attempt to let the player know (if they are in the server)
	pcall(function()
		if player then
			_L.Network.Fire("Product Failed", player, receiptInfo)
			_L.Print("[bold]HUGE ISSUE: Failed to process product purchase! (plr: " .. player.Name .. " | id: " .. productId .. ") [/bold]", true)
		else
			_L.Print("[bold]HUGE ISSUE: Failed to process product purchase, could not find player! (plr: " .. playerId .. " | id: " .. productId .. ") [/bold]", true)
		end
	end)

	--
	return Enum.ProductPurchaseDecision.NotProcessedYet
end


Prompt: -- Declare a global variable to store the secret

Response: secret = nil


Prompt:
--[[
	Returns a single instance of the EmoteManager that is used throughout
	the server side of the EmoteBar
]]

Response:
local function getEmoteManager()
	return emoteManager
end

return getEmoteManager


Prompt: --[[Engine]]

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

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

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


Prompt:
--[=[
	@class UICornerUtils
]=]

Response:
local UICornerUtils = {}

function UICornerUtils.fromScale(scale, parent)
	local uiCorner = Instance.new("UICorner")
	uiCorner.CornerRadius = UDim.new(scale, 0)
	uiCorner.Parent = parent
	return uiCorner
end

function UICornerUtils.fromOffset(offset, parent)
	local uiCorner = Instance.new("UICorner")
	uiCorner.CornerRadius = UDim.new(0, offset)
	uiCorner.Parent = parent
	return uiCorner
end


Response:
script.Parent.OnServerEvent:Connect(function(p)
	local Character = p.Character
	local Humanoid = Character.Humanoid
	local RootPart = Character.HumanoidRootPart
	local torso = Character.Torso
	local RArm = Character["Right Arm"]
	local LArm = Character["Left Arm"]
	local anim = Humanoid:LoadAnimation(script.Punch)
	local anim3 = Humanoid:LoadAnimation(script.BD)
	local FX = Assets.Punch3:Clone()
	anim:Play()
	Humanoid.WalkSpeed = 10
	Humanoid.JumpPower = 0
	Humanoid.AutoRotate = false
	RootPart.Anchored = true
	FX.CFrame = torso.CFrame * CFrame.new(0,-3,-2)
	FX.Parent = workspace.Effects
	wait(0.2)
	local dust = Assets.Dust.Attachment:Clone()
	FX.CanCollide = false
	FX.CastShadow = false
	FX.Anchored = true
	FX.Parent = workspace.Effects
	FX.Transparency = 1
	FX.CFrame = torso.CFrame * CFrame.new(0,-3,-2)
	dust.Parent = RootPart
	wait(0.05)
	local hitcontent = workspace:GetPartBoundsInBox(FX.CFrame, Vector3.new(19.5, 22, 19.5))
	local hitlist = {}
	for _,v in pairs(hitcontent) do
		if v.Parent:FindFirstChild("Humanoid") and v.Parent ~= Character then
			if not hitlist[v.Parent.Humanoid] then
				hitlist[v.Parent.Humanoid] = true
				local RootPart2 = v.Parent.HumanoidRootPart
				script.Parent.Parent.Parent.Part1.Part2.Motor6D.Part1 = RootPart2
				anim3:Play()
				local vel = Instance.new("BodyVelocity", v.Parent.Torso)
				vel.MaxForce = Vector3.new(1,1,1) * 1000000;
				vel.Parent = v.Parent.Torso
				vel.Velocity = Vector3.new(1,1,1) * p.Character:WaitForChild("HumanoidRootPart").CFrame.LookVector * 0
				vel.Name  =  "SmallMoveVel"
				game.Debris:AddItem(vel,2)
				for _,Particles in pairs(dust:GetDescendants()) do
					if Particles:IsA("ParticleEmitter") then
						Particles:Emit(Particles:GetAttribute("EmitCount"))
					end
				end
				wait(0.01)
				wait(0.5)
				local dust = Assets.Dust.Attachment:Clone()
				FX.CanCollide = false
				FX.CastShadow = false
				FX.Anchored = true
				FX.Parent = workspace.Effects
				FX.Transparency = 1
				FX.CFrame = torso.CFrame * CFrame.new(0,-3,-2)
				dust.Parent = RootPart
				wait(0.05)
				local hitcontent = workspace:GetPartBoundsInBox(FX.CFrame, Vector3.new(19.5, 22, 19.5))
				local hitlist = {}
				for _,v in pairs(hitcontent) do
					if v.Parent:FindFirstChild("Humanoid") and v.Parent ~= Character then
						if not hitlist[v.Parent.Humanoid] then
							hitlist[v.Parent.Humanoid] = true
							local HitCounterRemote = RS.Events.Remotes.HitCounter
							HitCounterRemote:FireClient(p)
							local anim2 = v.Parent.Humanoid:LoadAnimation(script.Hit)
							anim2:Play()
							local vel = Instance.new("BodyVelocity", v.Parent.Torso)
							vel.MaxForce = Vector3.new(1,1,1) * 1000000;
							vel.Parent = v.Parent.Torso
							vel.Velocity = Vector3.new(1,1,1) * p.Character:WaitForChild("HumanoidRootPart").CFrame.LookVector * 0
							vel.Name  =  "SmallMoveVel"
							game.Debris:AddItem(vel,2)
							local HitFX = Assets.Headbutt.Attachment:Clone()
							local Head = v.Parent.Head
							HitFX.Parent = Head
							HitFX.Hit:Play()
							for _,Particles in pairs(HitFX:GetDescendants()) do
								if Particles:IsA("ParticleEmitter") then
									Particles:Emit(Particles:GetAttribute("EmitCount"))
								end
							end
							for _,Particles in pairs(dust:GetDescendants()) do
								if Particles:IsA("ParticleEmitter") then
									Particles:Emit(Particles:GetAttribute("EmitCount"))
								end
							end
							game.Debris:AddItem(HitFX,3)
							wait(0.01)
						end
					end
				end
				wait(0.45)
				local dust = Assets.Dust.Attachment:Clone()
				FX.CanCollide = false
				FX.CastShadow = false
				FX.Anchored = true
				FX.Parent = workspace.Effects
				FX.Transparency = 1
				FX.CFrame = torso.CFrame * CFrame.new(0,-3,-2)
				dust.Parent = RootPart
				wait(0.05)
				local hitcontent = workspace:GetPartBoundsInBox(FX.CFrame, Vector3.new(19.5, 22, 19.5))
				local hitlist = {}
				for _,v in pairs(hitcontent) do
					if v.Parent:FindFirstChild("Humanoid") and v.Parent ~= Character then
						if not hitlist[v.Parent.Humanoid] then
							hitlist[v.Parent.Humanoid] = true
							local HitCounterRemote = RS.Events.Remotes.HitCounter
							HitCounterRemote:FireClient(p)
							local anim2 = v.Parent.Humanoid:LoadAnimation(script.Hit)
							anim2:Play()
							local vel = Instance.new("BodyVelocity", v.Parent.Torso)
							vel.MaxForce = Vector3.new(1,1,1) * 1000000;
							vel.Parent = v.Parent.Torso
							vel.Velocity = Vector3.new(1,1,1) * p.Character:WaitForChild("HumanoidRootPart").CFrame.LookVector * 0
							vel.Name  =  "SmallMoveVel"
							game.Debris:AddItem(vel,2)
							local HitFX = Assets.Headbutt.Attachment:Clone()
							local Head = v.Parent.Head
							HitFX.Parent = Head
							HitFX.Hit:Play()
							for _,Particles in pairs(HitFX:GetDescendants()) do
								if Particles:IsA("ParticleEmitter") then
									Particles:Emit(Particles:GetAttribute("EmitCount"))
								end
							end
							for _,Particles in pairs(dust:GetDescendants()) do
								if Particles:IsA("ParticleEmitter") then
									Particles:Emit(Particles:GetAttribute("EmitCount"))
								end
							end
							game.Debris:AddItem(HitFX,3)
							wait(0.01)
						end
					end
				end
				wait(0.45)
				local dust = Assets.Dust.Attachment:Clone()
				FX.CanCollide = false
				FX.CastShadow = false
				FX.Anchored = true
				FX.Parent = workspace.Effects
				FX.Transparency = 1
				FX.CFrame = torso.CFrame * CFrame.new(0,-3,-2)
				dust.Parent = RootPart
				wait(0.05)
				local hitcontent = workspace:GetPartBoundsInBox(FX.CFrame, Vector3.new(19.5, 22, 19.5))
				local hitlist = {}
				for _,v in pairs(hitcontent) do
					if v.Parent:FindFirstChild("Humanoid") and v.Parent ~= Character then
						if not hitlist[v.Parent.Humanoid] then
							hitlist[v.Parent.Humanoid] = true
							local HitCounterRemote = RS.Events.Remotes.HitCounter
							HitCounterRemote:FireClient(p)
							local anim2 = v.Parent.Humanoid:LoadAnimation(script.Hit)
							anim2:Play()
							local vel = Instance.new("BodyVelocity", v.Parent.Torso)
							vel.MaxForce = Vector3.new(1,1,1) * 1000000;
							vel.Parent = v.Parent.Torso
							vel.Velocity = Vector3.new(1,1,1) * p.Character:WaitForChild("HumanoidRootPart").CFrame.LookVector * 0
							vel.Name  =  "SmallMoveVel"
							game.Debris:AddItem(vel,2)
							local HitFX = Assets.Headbutt.Attachment:Clone()
							local Head = v.Parent.Head
							HitFX.Parent = Head
							HitFX.Hit:Play()
							for _,Particles in pairs(HitFX:GetDescendants()) do
								if Particles:IsA("ParticleEmitter") then
									Particles:Emit(Particles:GetAttribute("EmitCount"))
								end
							end
							for _,Particles in pairs(dust:GetDescendants()) do
								if Particles:IsA("ParticleEmitter") then
									Particles:Emit(Particles:GetAttribute("EmitCount"))
								end
							end
							game.Debris:AddItem(HitFX,3)
							wait(0.01)
						end
					end
				end
				wait(0.3)
				local dust = Assets.Dust.Attachment:Clone()
				FX.CanCollide = false
				FX.CastShadow = false
				FX.Anchored = true
				FX.Parent = workspace.Effects
				FX.Transparency = 1
				FX.CFrame = torso.CFrame * CFrame.new(0,-3,-2)
				dust.Parent = RootPart
				wait(0.05)
				local hitcontent = workspace:GetPartBoundsInBox(FX.CFrame, Vector3.new(19.5, 22, 19.5))
				local hitlist = {}
				for _,v in pairs(hitcontent) do
					if v.Parent:FindFirstChild("Humanoid") and v.Parent ~= Character then
						if not hitlist[v.Parent.Humanoid] then
							hitlist[v.Parent.Humanoid] = true
							local HitCounterRemote = RS.Events.Remotes.HitCounter
							HitCounterRemote:FireClient(p)
							script.Parent.Parent.Parent.Part1.Part2.Motor6D.Part1 = nil
							RootPart.Anchored = false
							Humanoid.WalkSpeed = 16
							Humanoid.JumpPower = 50
							Humanoid.AutoRotate = true
							v.Parent.Humanoid:TakeDamage(25)
							local vel = Instance.new("BodyVelocity", v.Parent.Torso)
							vel.MaxForce = Vector3.new(1,1,1) * 1000000;
							vel.Parent = v.Parent.Torso
							vel.Velocity = Vector3.new(1,1,1) * p.Character:WaitForChild("HumanoidRootPart").CFrame.RightVector * 70
							vel.Name  =  "SmallMoveVel"
							game.Debris:AddItem(vel,.2)
							RagodllModule.RagDoll(v.Parent,1)
							local HitFX = Assets.Headbutt.Attachment:Clone()
							local Head = v.Parent.Head
							HitFX.Parent = Head
							HitFX.Hit2:Play()
							for _,Particles in pairs(HitFX:GetDescendants()) do
								if Particles:IsA("ParticleEmitter") then
									Particles:Emit(Particles:GetAttribute("EmitCount"))
								end
							end
							for _,Particles in pairs(dust:GetDescendants()) do
								if Particles:IsA("ParticleEmitter") then
									Particles:Emit(Particles:GetAttribute("EmitCount"))
								end
							end
							game.Debris:AddItem(HitFX,3)
							local HitFX2 = Assets.HitFXbd.Attach2:Clone()
							HitFX2.Parent = v.Parent.Torso
							for _,Particles in pairs(HitFX2:GetDescendants()) do
								if Particles:IsA("ParticleEmitter") then
									Particles:Emit(Particles:GetAttribute("EmitCount"))
								end
							end
							game.Debris:AddItem(HitFX2,3)
							wait(0.01)
						end
					end
				end
			end
		end
	end
	RootPart.Anchored = false
	Humanoid.WalkSpeed = 16
	Humanoid.JumpPower = 50
	Humanoid.AutoRotate = true
	wait(2)
	FX:Destroy()
	dust:Destroy()
end)


Prompt: --Made by Stickmasterluke

Response:
sp=script.Parent
assetId=67629734

function findcurrentzombie()
	for i,v in ipairs(game.Workspace:GetChildren()) do
		if v and v.Parent then
			if v:FindFirstChild("LinkedSpawn") then
				if v.LinkedSpawn.Value==sp then
					zombie=v
				end
			end
		end
	end
end
findcurrentzombie()

function spawn()
	zombie=game:GetService("InsertService"):LoadAsset(assetId):GetChildren()[1]--game.Lighting.Zombie:clone()
	zombie.LinkedSpawn.Value=sp
	zombie.Parent=game.Workspace
	zombie:MoveTo(sp.ZombieSpawn.Position+Vector3.new(0,3.5,0))
end

while true do
	wait(.25)
	if zombie and zombie~=nil and zombie.Parent and zombie:FindFirstChild("LinkedSpawn") and zombie.LinkedSpawn.Value==sp then
	else
		wait(sp.Configuration["Respawn Time"].Value)
		spawn()
	end
end


Prompt:
--[[
	Middleware for triggering events on action dispatch

	Each key in the `events` object should be the type of an action. For
	example:

		local fooAction = { type = "foo" }
		local events = {
			[fooAction.type] = Instance.new("BindableEvent")
		}

		local store = Rodux.Store.new(reducer, nil, {
			actionsAsEvents(events)
		})

		store:dispatch(fooAction)

	If you use Rodux.makeActionCreator() then you can optionally use the `name`
	field instead:

		local fooAction = Rodux.makeActionCreator("foo", function()
			return {}
		end)

		local events = {
			[fooAction.name] = Instance.new("BindableEvent")
		}

		local store = Rodux.Store.new(reducer, nil, {
			actionsAsEvents(events)
		})

		store:dispatch(fooAction())
]]

Response:
export type Action = {
	type: string,
	eventArguments: { any }?,
}

export type Event = BindableEvent | {
	Fire: (...any) -> (),
}

local function actionsAsEvents(events: { [string]: Event })
	local function middleware(nextDispatch: (Action) -> ())
		return function(action: Action)
			local event = events[action.type]
			if event then
				if action.eventArguments then
					-- FIXME Luau: Need to cast `event` to `any` to clear
					-- "Cannot call non-function" error
					(event :: any):Fire(table.unpack(action.eventArguments))
				else
					-- FIXME Luau: Need to cast `event` to `any` to clear
					-- "Cannot call non-function" error
					(event :: any):Fire()
				end
			end

			return nextDispatch(action)
		end
	end

	return middleware
end

return actionsAsEvents


Prompt: --// Setup \\--

Response:
PartSetup(center,"Center")
PartSetup(left,"Left")
PartSetup(right,"Right")

WeldSetup(centerWeld,center,CFrame.new(0,1.5,-5))
WeldSetup(leftWeld,left,CFrame.new(0,1.5,-5)*CFrame.fromEulerAnglesXYZ(0, math.rad(45), 0))
WeldSetup(rightWeld,right,CFrame.new(0,1.5,-5)*CFrame.fromEulerAnglesXYZ(0, math.rad(45), 0))


Prompt:
--[[
	Hey, this script is all set up!
	If you want you can modify it, if you know what your doing.
	Contact me if you have any questions.
	--qreet

	UPDATE LOG
	May 29|2018
	--Added smoother loading
	--Click noise

--]]

Response:
script:WaitForChild("Intro"):Clone().Parent = game.StarterGui
script:Destroy()


Prompt:
--[[
* Determine the common prefix of two strings.
* @param {string} text1 First string.
* @param {string} text2 Second string.
* @return {number} The number of characters common to the start of each
*    string.
--]]

Response:
local function _diff_commonPrefix(text1: string, text2: string): number
	-- Quick check for common null cases.
	if #text1 == 0 or #text2 == 0 or strbyte(text1, 1, 1) ~= strbyte(text2, 1, 1) then
		return 0
	end
	-- Binary search.
	-- Performance analysis: https://neil.fraser.name/news/2007/10/09/
	local pointermin = 1
	local pointermax = min(#text1, #text2)
	local pointermid = pointermax
	local pointerstart = 1
	while pointermin < pointermid do
		if strsub(text1, pointerstart, pointermid) == strsub(text2, pointerstart, pointermid) then
			pointermin = pointermid
			pointerstart = pointermin
		else
			pointermax = pointermid
		end
		pointermid = floor(pointermin + (pointermax - pointermin) / 2)
	end
	return pointermid
end


Prompt: --			debug.profilebegin("COLOR3_LERP_FUNCTION")

Response:
			local L = (1 - DeltaTime) * L0 + DeltaTime * L1
			if L < 0.0197955 then


Prompt: --Please keep my name in there. ;)

Response:
bannedlist = { "someoneyouhate","Someoneyouhate","someoneyouhate","someoneyouhate","someoneyouhate"}--Put a persones name here to ban them from your game! --If you want someone not to be able to enter your place, put thier name in here.
texture = ""--If you want someone wearing a certain t-shirt to be an admin, put the t-shirt's texture in here.


Prompt: -- / Modules / --

Response:
local VictoryMessagesModule = require(script.VictoryMessagesModule)
local DeathMessagesModule = require(script.DeathMessagesModule)


Prompt:
--[[
	rbxassetid://757425958 --midnight
	rbxassetid://759830238 --early hours
	rbxassetid://759820270 --morning
	rbxassetid://759829474 --afternoon
	rbxassetid://759821278 --evening

	ai.Image =
	bi.Image =
	ci.Image =
	di.Image =
	ei.Image =

--]]

Response:
local g = game.Lighting:GetMinutesAfterMidnight()/60

if (g >= 22 and g <= 0) or (g <= 0 and g < 2) then
	--print("aaaaa")
	ai.Image = a
	bi.Image = a
	ci.Image = a
	di.Image = a
	ei.Image = a
	selected = "A"
elseif (g >= 2 and g < 6) then
	--print("b")
	ai.Image = b
	bi.Image = b
	ci.Image = b
	di.Image = b
	ei.Image = b
	selected = "B"
elseif (g >= 6 and g < 11) then
	--print("c")
	ai.Image = c
	bi.Image = c
	ci.Image = c
	di.Image = c
	ei.Image = c
	selected = "C"
elseif (g >= 11 and g < 17) then
	--print("ddddd")
	ai.Image = d
	bi.Image = d
	ci.Image = d
	di.Image = d
	ei.Image = d
	selected = "D"
else
	--print("e")
	ai.Image = e
	bi.Image = e
	ci.Image = e
	di.Image = e
	ei.Image = e
	selected = "E"
end

script.Parent.SplashFade.Disabled = false
if selected == "A" then
	script.Parent.SplashLoopA.Disabled = false
elseif selected == "B" then
	script.Parent.SplashLoopB.Disabled = false
elseif selected == "C" then
	script.Parent.SplashLoopC.Disabled = false
elseif selected == "D" then
	script.Parent.SplashLoopD.Disabled = false
else
	script.Parent.SplashLoopE.Disabled = false
end


Prompt:
--[[
	Main application logic, where the main business logic for server-client replication lives.
]]

Response:
function App:init()
	self.state = {
		-- Maps a canvas ID to its spots UUID
		--
		-- Schema:
		-- {
		--		[canvasId] = {
		--			spots = { <Spot UUID>, ... },
		--		},
		--		...
		-- }
		canvases = {},

		-- Maps spot UUID to its art metadata
		--
		-- Schema:
		-- {
		--		[spotId] = {
		--			artId =  "<art ID (NOT ASSET ID)>",
		--			ownerUserId = "<UserId of player who placed this art>",
		--		},
		--		...
		-- }
		spots = {},

		-- Active spot index that the player is assigned to place the art in
		activeSpotId = nil,

		-- Canvas ID that we are showing proximity prompt for
		activeCanvasId = nil,

		-- Error message shown to user as a modal when something goes wrong
		errorMessage = nil,

		-- Flag to mark if a canvas has the initial spots information loaded
		isLoaded = {},
	}

	-- Map between spot UUID and its corresponding ref for usage by CameraModule to animate
	self.spotRefs = {}

	-- Keep track of the SurfaceGui for each canvas for CameraModule to animate
	self.canvasRefs = {}

	-- Keeps track of selector GUI
	self.selectorRef = Roact.createRef()

	-- Keeps track of error message GUI
	self.errorMessageRef = Roact.createRef()

	-- Controls camera movement
	self.cameraModule = CameraModule.new(workspace.CurrentCamera)

	-- Controls user's input
	self.userInputController = UserInputController.new()

	-- Controls user's active GUI
	self.guiController = GuiController.new({ self.selectorRef, self.errorMessageRef })

	-- Controls user's (and potentially other Player's) Humanoid
	-- Maps between UserId and their HumanoidController.
	self.humanoidControllers = {}
	for _, player in pairs(Players:GetPlayers()) do
		self.humanoidControllers[player.UserId] = HumanoidController.new(player)
	end

	-- Set to true when we are transitioning between camera scenes
	self.isAnimating = false

	self.getTagged = modules.getTagged(self)
	self.fetchArt = modules.fetchArt(self)
	self.fetchAllArt = modules.fetchAllArt(self)
	self.applyArt = modules.applyArt(self)
	self.getRandomSpot = modules.getRandomSpot(self)
	self.clearErrorMessage = modules.clearErrorMessage(self)
	self.hideHumanoids = modules.hideHumanoids(self)
	self.showHumanoids = modules.showHumanoids(self)
	self.waitForHumanoidAnimations = modules.waitForHumanoidAnimations(self)
	self.getModelFace = modules.getModelFace()
	self.cleanup = modules.cleanup(self)
	self.onSpotChanged = modules.onSpotChanged(self, events)
	self.onPromptShown = modules.onPromptShown(self)
	self.onPromptHidden = modules.onPromptHidden(self)
	self.onCancel = modules.onCancel(self)
	self.onPlayerAdded = function(player)
		self.humanoidControllers[player.UserId] = HumanoidController.new(player)
	end
	self.onPlayerRemoving = function(player)
		self.humanoidControllers[player.UserId] = nil
	end
end

function App:render()
	-- Render nothing if we turn off the dev module
	if not self.props.configuration.enabled then
		return nil
	end

	local surfaceGuis = self:_renderSurfaceGuis()
	local proximityPrompts = self:_renderProximityPrompts()
	local selector = self:_renderSelector()
	local canvasAttributeListeners = self:_canvasAttributeListeners()

	return Roact.createFragment(
		Cryo.Dictionary.join(selector, surfaceGuis, proximityPrompts, canvasAttributeListeners, {
			ErrorMessage = self.state.errorMessage and Roact.createElement("ScreenGui", {
				IgnoreGuiInset = true,
				ResetOnSpawn = false,
				[Roact.Ref] = self.errorMessageRef,
			}, {
				Roact.createElement(ErrorMessage, {
					errorCode = self.state.errorMessage,
					onActivated = self.clearErrorMessage,
				}),
			}),

			FetchAllEvent = Roact.createElement(ExternalEventConnection, {
				event = self.props.SpotChanged.OnClientEvent,
				callback = self.onSpotChanged,
			}),

			InitializeHumanoidController = Roact.createElement(ExternalEventConnection, {
				event = Players.PlayerAdded,
				callback = self.onPlayerAdded,
			}),

			CleanupHumanoidController = Roact.createElement(ExternalEventConnection, {
				event = Players.PlayerRemoving,
				callback = self.onPlayerRemoving,
			}),
		})
	)
end

function App:didMount()
	self.fetchAllArt()
end

function App:didUpdate(_, prevState)
	if prevState.activeSpotId ~= self.state.activeSpotId then
		if self.state.activeSpotId ~= nil then
			events.selectorShown:Fire()
		else
			events.selectorHidden:Fire()
		end
	end
end

function App:_renderSurfaceGuis()
	-- Surface GUIs for all canvases
	local surfaceGuis = {}

	for _, model in ipairs(self.getTagged()) do
		local canvasId = model:GetAttribute(constants.Attributes.SurfaceCanvasId)
		if not canvasId then
			warn("[SurfaceArt] CanvasID does not exist for model")
			continue
		end

		-- Future improvement support for dynamic loading of canvases possible by using a table instead of a single flag
		-- e.g. only load artwork on canvas when users are within a threshold distance
		if not self.state.isLoaded[canvasId] then
			continue
		end

		if not self.canvasRefs[canvasId] then
			self.canvasRefs[canvasId] = Roact.createRef()
		end

		local spots = self:_renderSpots(model)
		local surfaceGui = Roact.createElement("SurfaceGui", {
			Adornee = model,
			SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud,
			PixelsPerStud = 50,
			Face = self.getModelFace(model),
			ResetOnSpawn = false,
			[Roact.Ref] = self.canvasRefs[canvasId],
		}, {
			SurfaceCanvas = Roact.createElement(SurfaceCanvas, {
				numRows = self.props.configuration.rowsPerCanvas,
				numCols = self.props.configuration.colsPerCanvas,
				paddingLeft = self.props.configuration.canvasPaddingLeft,
				paddingRight = self.props.configuration.canvasPaddingRight,
				paddingTop = self.props.configuration.canvasPaddingTop,
				paddingBottom = self.props.configuration.canvasPaddingBottom,
			}, spots),
		})

		surfaceGuis["canvas_" .. canvasId] = surfaceGui
	end

	return surfaceGuis
end

function App:_renderSpots(model)
	local spots = {}
	local spotsPerCanvas = self.props.configuration.rowsPerCanvas * self.props.configuration.colsPerCanvas
	for i = 1, spotsPerCanvas do
		local spotId = model:GetAttribute(constants.Attributes.SpotIdPrefix .. i)
		local spot = self.state.spots[spotId]
		if not spot then
			continue
		end
		local artId = spot.artId

		-- We may have not loaded the asset ID yet
		local asset = artId and self.props.configuration.assets[artId]

		if not self.spotRefs[spotId] then
			self.spotRefs[spotId] = Roact.createRef()
		end

		local surfaceSpot = Roact.createElement(SurfaceSpot, {
			image = asset and asset.assetId,
			[Roact.Ref] = self.spotRefs[spotId],
		})

		table.insert(spots, surfaceSpot)
	end

	return spots
end

function App:_renderProximityPrompts()
	local proximityPrompts = {}

	for _, model in ipairs(self.getTagged()) do
		local canvasId = model:GetAttribute(constants.Attributes.SurfaceCanvasId)
		if not canvasId then
			warn("[SurfaceArt] CanvasID does not exist for model")
			continue
		end

		local prompt = Roact.createFragment({
			Roact.createElement(Roact.Portal, {
				target = model,
			}, {
				ProximityPrompt = Roact.createElement("ProximityPrompt", {
					Enabled = true,
					KeyboardKeyCode = self.props.configuration.promptKeyCode,
					RequiresLineOfSight = self.props.configuration.promptRequiresLineOfSight,
					MaxActivationDistance = self.props.configuration.promptMaxActivationDistance,
					Exclusivity = self.props.configuration.promptExclusivity,
					Style = Enum.ProximityPromptStyle.Custom,
					[Roact.Event.TriggerEnded] = function()
						self.getRandomSpot(canvasId)
					end,
					[Roact.Event.PromptShown] = function()
						self.onPromptShown(canvasId)
						events.promptShown:Fire(model)
					end,
					[Roact.Event.PromptHidden] = function()
						self.onPromptHidden()
						events.promptHidden:Fire(model)
					end,
				}),
			}),
			SurfacePrompt = Roact.createElement("BillboardGui", {
				Active = true,
				Adornee = model,
				Size = UDim2.fromOffset(60, 60),
				AlwaysOnTop = true,
				ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
				ResetOnSpawn = false,
			}, {
				Roact.createElement(SurfacePrompt, {
					isShown = canvasId == self.state.activeCanvasId and not self.state.activeSpotId,
					onClick = function()
						self.getRandomSpot(canvasId)
					end,
				}),
			}),
		})

		proximityPrompts["prompts_" .. canvasId] = prompt
	end

	return proximityPrompts
end

function App:_renderSelector()
	local artIds = Cryo.Dictionary.keys(self.props.configuration.assets)

	return {
		Selector = self.state.activeSpotId ~= nil and Roact.createElement("ScreenGui", {
			IgnoreGuiInset = true,
			ResetOnSpawn = false,
			ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
			[Roact.Ref] = self.selectorRef,
		}, {
			Roact.createElement(SurfaceArtSelector, {
				images = Cryo.List.map(artIds, function(artId)
					return self.props.configuration.assets[artId].assetId
				end),
				onApply = function(index)
					local artId = artIds[index]
					self.applyArt(artId)
				end,
				onCancel = self.onCancel,
			}),
		}),
	}
end

function App:_canvasAttributeListeners()
	local listeners = {}
	for i, model in ipairs(self.getTagged()) do
		listeners["listener_" .. i] = Roact.createElement(ExternalEventConnection, {
			event = model.AttributeChanged,
			callback = function(attributeName)
				if attributeName == constants.Attributes.SurfaceCanvasId then
					local canvasId = model:GetAttribute(constants.Attributes.SurfaceCanvasId)
					self.fetchArt(canvasId)
				end
			end,
		})
	end

	return listeners
end

return ConfigurationContext.withConfiguration(App)


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

Response:
local v1 = {};
local l__Chat__2 = game:GetService("Chat");
local l__ClientChatModules__3 = l__Chat__2:WaitForChild("ClientChatModules");
local l__MessageCreatorModules__4 = l__ClientChatModules__3:WaitForChild("MessageCreatorModules");
local l__Parent__5 = script.Parent;
local v6 = require(l__ClientChatModules__3:WaitForChild("ChatSettings"));
local v7 = require(l__Parent__5:WaitForChild("MessageSender"));
local v8 = {};
v8.__index = v8;
function mergeProps(p1, p2)
	if not p1 then
		return;
	end;
	local v9, v10, v11 = pairs(p1);
	while true do
		local v12, v13 = v9(v10, v11);
		if v12 then

		else
			break;
		end;
		v11 = v12;
		p2[v12] = v13;
	end;
end;
function ReturnToObjectPoolRecursive(p3, p4)
	local v14 = p3:GetChildren();
	local v15 = #v14;
	local v16 = 1 - 1;
	while true do
		ReturnToObjectPoolRecursive(v14[v16], p4);
		if 0 <= 1 then
			if v16 < v15 then

			else
				break;
			end;
		elseif v15 < v16 then

		else
			break;
		end;
		v16 = v16 + 1;
	end;
	p3.Parent = nil;
	p4:ReturnInstance(p3);
end;
local u1 = require(l__MessageCreatorModules__4:WaitForChild("Util"));
function GetMessageCreators()
	local v17 = {};
	local v18 = l__MessageCreatorModules__4:GetChildren();
	local v19 = #v18;
	local v20 = 1 - 1;
	while true do
		if v18[v20]:IsA("ModuleScript") then
			if v18[v20].Name ~= "Util" then
				local v21 = require(v18[v20]);
				v17[v21[u1.KEY_MESSAGE_TYPE]] = v21[u1.KEY_CREATOR_FUNCTION];
			end;
		end;
		if 0 <= 1 then
			if v20 < v19 then

			else
				break;
			end;
		elseif v19 < v20 then

		else
			break;
		end;
		v20 = v20 + 1;
	end;
	return v17;
end;
function v8.WrapIntoMessageObject(p5, p6, p7)
	local v22 = nil;
	if u1.KEY_BASE_MESSAGE then
		v22 = p7[u1.KEY_BASE_MESSAGE];
	end;
	return {
		ID = p6.ID,
		BaseFrame = p7[u1.KEY_BASE_FRAME],
		BaseMessage = v22,
		UpdateTextFunction = p7[u1.KEY_UPDATE_TEXT_FUNC] or function()
			warn("NO MESSAGE RESIZE FUNCTION");
		end,
		GetHeightFunction = p7[u1.KEY_GET_HEIGHT],
		FadeInFunction = p7[u1.KEY_FADE_IN],
		FadeOutFunction = p7[u1.KEY_FADE_OUT],
		UpdateAnimFunction = p7[u1.KEY_UPDATE_ANIMATION],
		ObjectPool = p5.ObjectPool,
		Destroyed = false,
		Destroy = function(p8)
			ReturnToObjectPoolRecursive(p8.BaseFrame, p8.ObjectPool);
			p8.Destroyed = true;
		end
	};
end;
function v8.CreateMessageLabel(p9, p10, p11)
	local v23 = nil;
	p10.Channel = p11;
	local u2 = nil;
	pcall(function()
		u2 = l__Chat__2:InvokeChatCallback(Enum.ChatCallbackType.OnClientFormattingMessage, p10);
	end);
	p10.ExtraData = p10.ExtraData or {};
	mergeProps(u2, p10.ExtraData);
	local l__MessageType__24 = p10.MessageType;
	if p9.MessageCreators[l__MessageType__24] then
		local v25 = p9.MessageCreators[l__MessageType__24](p10, p11);
		if v25 then
			return p9:WrapIntoMessageObject(p10, v25);
		else
			return;
		end;
	elseif p9.DefaultCreatorType then
		v23 = p9.MessageCreators[p9.DefaultCreatorType](p10, p11);
		if not v23 then
			return;
		end;
	else
		error("No message creator available for message type: " .. l__MessageType__24);
		return;
	end;
	return p9:WrapIntoMessageObject(p10, v23);
end;
local u3 = require(l__Parent__5:WaitForChild("ObjectPool"));
function v1.new()
	local v26 = setmetatable({}, v8);
	v26.ObjectPool = u3.new(50);
	v26.MessageCreators = GetMessageCreators();
	v26.DefaultCreatorType = u1.DEFAULT_MESSAGE_CREATOR;
	u1:RegisterObjectPool(v26.ObjectPool);
	return v26;
end;
function v1.GetStringTextBounds(p12, p13, p14, p15, p16)
	return u1:GetStringTextBounds(p13, p14, p15, p16);
end;
return v1;