Prompt: -- List of actions that could be requested

Response:
Actions = {

	['RecolorHandle'] = function (NewColor)
		-- Recolors the tool handle
		Tool.Handle.BrickColor = NewColor;
	end;

	['Clone'] = function (Items, Parent)
		-- Clones the given items

		-- Validate arguments
		assert(type(Items) == 'table', 'Invalid items')
		assert(typeof(Parent) == 'Instance', 'Invalid parent')
		assert(Security.IsLocationAllowed(Parent, Player), 'Permission denied for client')

		-- Check if items modifiable
		if not CanModifyItems(Items) then
			return {}
		end

		-- Check if parts intruding into private areas
		local Parts = GetPartsFromSelection(Items)
		if Security.ArePartsViolatingAreas(Parts, Player, false) then
			return {}
		end

		local Clones = {}

		-- Clone items
		for _, Item in pairs(Items) do
			local Clone = Item:Clone()
			Clone.Parent = Parent

			-- Register the clone
			table.insert(Clones, Clone)
			CreatedInstances[Item] = Item
		end

		-- Return the clones
		return Clones
	end;

	['CreatePart'] = function (PartType, Position, Parent)
		-- Creates a new part based on `PartType`

		-- Validate requested parent
		assert(typeof(Parent) == 'Instance', 'Invalid parent')
		assert(Security.IsLocationAllowed(Parent, Player), 'Permission denied for client')

		-- Create the part
		local NewPart = CreatePart(PartType);

		-- Position the part
		NewPart.CFrame = Position;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas({ NewPart }), Player);

		-- Make sure the player is allowed to create parts in the area
		if Security.ArePartsViolatingAreas({ NewPart }, Player, false, AreaPermissions) then
			return;
		end;

		-- Parent the part
		NewPart.Parent = Parent

		-- Register the part
		CreatedInstances[NewPart] = NewPart;

		-- Return the part
		return NewPart;
	end;

	['CreateGroup'] = function (Type, Parent, Items)
		-- Creates a new group of type `Type`

		local ValidGroupTypes = {
			Model = true,
			Folder = true
		}

		-- Validate arguments
		assert(ValidGroupTypes[Type], 'Invalid group type')
		assert(typeof(Parent) == 'Instance', 'Invalid parent')
		assert(Security.IsLocationAllowed(Parent, Player), 'Permission denied for client')

		-- Check if items selectable
		if not CanModifyItems(Items) then
			return
		end

		-- Check if parts intruding into private areas
		local Parts = GetPartsFromSelection(Items)
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player)
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return
		end

		-- Create group
		local Group = Instance.new(Type)

		-- Attach children
		for _, Item in pairs(Items) do
			Item.Parent = Group
		end

		-- Parent group
		Group.Parent = Parent

		-- Make joints
		if Type == 'Model' then
			Group:MakeJoints()
		elseif Type == 'Folder' then
			local Parts = Support.GetDescendantsWhichAreA(Group, 'BasePart')
			for _, Part in pairs(Parts) do
				Part:MakeJoints()
			end
		end

		-- Return the new group
		return Group

	end,

	['Ungroup'] = function (Groups)

		-- Validate arguments
		assert(type(Groups) == 'table', 'Invalid groups')

		-- Check if items modifiable
		if not CanModifyItems(Groups) then
			return
		end

		-- Check if parts intruding into private areas
		local Parts = GetPartsFromSelection(Groups)
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player)
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return
		end

		local Results = {}

		-- Check each group
		for Key, Group in ipairs(Groups) do
			assert(typeof(Group) == 'Instance', 'Invalid group')

			-- Track group children
			local Children = {}
			Results[Key] = Children

			-- Unpack group children into parent
			local NewParent = Group.Parent
			for _, Child in pairs(Group:GetChildren()) do
				LastParents[Child] = Group
				Children[#Children + 1] = Child
				Child.Parent = NewParent
				if Child:IsA 'BasePart' then
					Child:MakeJoints()
				elseif Child:IsA 'Folder' then
					local Parts = Support.GetDescendantsWhichAreA(Child, 'BasePart')
					for _, Part in pairs(Parts) do
						Part:MakeJoints()
					end
				end
			end

			-- Track removing group
			LastParents[Group] = Group.Parent
			CreatedInstances[Group] = Group

			-- Remove group
			Group.Parent = nil
		end

		return Results
	end,

	['SetParent'] = function (Items, Parent)

		-- Validate arguments
		assert(type(Items) == 'table', 'Invalid items')
		assert(type(Parent) == 'table' or typeof(Parent) == 'Instance', 'Invalid parent')

		-- Check if items modifiable
		if not CanModifyItems(Items) then
			return
		end

		-- Check if parts intruding into private areas
		local Parts = GetPartsFromSelection(Items)
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player)
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return
		end

		-- Move each item to different parent
		if type(Parent) == 'table' then
			for Key, Item in pairs(Items) do
				local Parent = Parent[Key]

				-- Check if parent allowed
				assert(Security.IsLocationAllowed(Parent, Player), 'Permission denied for client')

				-- Move item
				Item.Parent = Parent
				if Item:IsA 'BasePart' then
					Item:MakeJoints()
				elseif Item:IsA 'Folder' then
					local Parts = Support.GetDescendantsWhichAreA(Item, 'BasePart')
					for _, Part in pairs(Parts) do
						Part:MakeJoints()
					end
				end
			end

		-- Move to single parent
		elseif typeof(Parent) == 'Instance' then
			assert(Security.IsLocationAllowed(Parent, Player), 'Permission denied for client')

			-- Reparent items
			for _, Item in pairs(Items) do
				Item.Parent = Parent
				if Item:IsA 'BasePart' then
					Item:MakeJoints()
				elseif Item:IsA 'Folder' then
					local Parts = Support.GetDescendantsWhichAreA(Item, 'BasePart')
					for _, Part in pairs(Parts) do
						Part:MakeJoints()
					end
				end
			end
		end

	end,

	['SetName'] = function (Items, Name)

		-- Validate arguments
		assert(type(Items) == 'table', 'Invalid items')
		assert(type(Name) == 'table' or type(Name) == 'string', 'Invalid name')

		-- Check if items modifiable
		if not CanModifyItems(Items) then
			return
		end

		-- Check if parts intruding into private areas
		local Parts = GetPartsFromSelection(Items)
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player)
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return
		end

		-- Rename each item to a different name
		if type(Name) == 'table' then
			for Key, Item in pairs(Items) do
				local Name = Name[Key]
				Item.Name = Name
			end

		-- Rename to single name
		elseif type(Name) == 'string' then
			for _, Item in pairs(Items) do
				Item.Name = Name
			end
		end

	end,

	['Remove'] = function (Objects)
		-- Removes the given objects

		-- Get the relevant parts for each object, for permission checking
		local Parts = {};

		-- Go through the selection
		for _, Object in pairs(Objects) do

			-- Make sure the object still exists
			if Object then

				if Object:IsA 'BasePart' then
					table.insert(Parts, Object);

				elseif Object:IsA 'Smoke' or Object:IsA 'Fire' or Object:IsA 'Sparkles' or Object:IsA 'DataModelMesh' or Object:IsA 'Decal' or Object:IsA 'Texture' or Object:IsA 'Light' then
					table.insert(Parts, Object.Parent);

				elseif Object:IsA 'Model' or Object:IsA 'Folder' then
					Support.ConcatTable(Parts, Support.GetDescendantsWhichAreA(Object, 'BasePart'))
				end

			end;

		end;

		-- Check if items modifiable
		if not CanModifyItems(Objects) then
			return
		end

		-- Check if parts intruding into private areas
		if Security.ArePartsViolatingAreas(Parts, Player, true) then
			return
		end

		-- After confirming permissions, perform each removal
		for _, Object in pairs(Objects) do

			-- Store the part's current parent
			LastParents[Object] = Object.Parent;

			-- Register the object
			CreatedInstances[Object] = Object;

			-- Set the object's current parent to `nil`
			Object.Parent = nil;

		end;

	end;

	['UndoRemove'] = function (Objects)
		-- Restores the given removed objects to their last parents

		-- Get the relevant parts for each object, for permission checking
		local Parts = {};

		-- Go through the selection
		for _, Object in pairs(Objects) do

			-- Make sure the object still exists, and that its last parent is registered
			if Object and LastParents[Object] then

				if Object:IsA 'BasePart' then
					table.insert(Parts, Object);

				elseif Object:IsA 'Smoke' or Object:IsA 'Fire' or Object:IsA 'Sparkles' or Object:IsA 'DataModelMesh' or Object:IsA 'Decal' or Object:IsA 'Texture' or Object:IsA 'Light' then
					table.insert(Parts, Object.Parent);

				elseif Object:IsA 'Model' or Object:IsA 'Folder' then
					Support.ConcatTable(Parts, Support.GetDescendantsWhichAreA(Object, 'BasePart'))
				end

			end;

		end;

		-- Check if items modifiable
		if not CanModifyItems(Objects) then
			return
		end

		-- Check if parts intruding into private areas
		if Security.ArePartsViolatingAreas(Parts, Player, false) then
			return
		end

		-- After confirming permissions, perform each removal
		for _, Object in pairs(Objects) do

			-- Store the part's current parent
			local LastParent = LastParents[Object];
			LastParents[Object] = Object.Parent;

			-- Register the object
			CreatedInstances[Object] = Object;

			-- Set the object's parent to the last parent
			Object.Parent = LastParent;

			-- Make joints
			if Object:IsA 'BasePart' then
				Object:MakeJoints()
			else
				local Parts = Support.GetDescendantsWhichAreA(Object, 'BasePart')
				for _, Part in pairs(Parts) do
					Part:MakeJoints()
				end
			end

		end;

	end;

	['SyncMove'] = function (Changes)
		-- Updates parts server-side given their new CFrames

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				Change.InitialState = { Anchored = Change.Part.Anchored, CFrame = Change.Part.CFrame };
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Preserve joints
		for Part, Change in pairs(ChangeSet) do
			Change.Joints = PreserveJoints(Part, ChangeSet);
		end;

		-- Perform each change
		for Part, Change in pairs(ChangeSet) do

			-- Stabilize the parts and maintain the original anchor state
			Part.Anchored = true;
			Part:BreakJoints();
			Part.Velocity = Vector3.new();
			Part.RotVelocity = Vector3.new();

			-- Set the part's CFrame
			Part.CFrame = Change.CFrame;

		end;

		-- Make sure the player is authorized to move parts into this area
		if Security.ArePartsViolatingAreas(Parts, Player, false, AreaPermissions) then

			-- Revert changes if unauthorized destination
			for Part, Change in pairs(ChangeSet) do
				Part.CFrame = Change.InitialState.CFrame;
			end;

		end;

		-- Restore the parts' original states
		for Part, Change in pairs(ChangeSet) do
			Part:MakeJoints();
			RestoreJoints(Change.Joints);
			Part.Anchored = Change.InitialState.Anchored;
		end;

	end;

	['SyncResize'] = function (Changes)
		-- Updates parts server-side given their new sizes and CFrames

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				Change.InitialState = { Anchored = Change.Part.Anchored, Size = Change.Part.Size, CFrame = Change.Part.CFrame };
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Perform each change
		for Part, Change in pairs(ChangeSet) do

			-- Stabilize the parts and maintain the original anchor state
			Part.Anchored = true;
			Part:BreakJoints();
			Part.Velocity = Vector3.new();
			Part.RotVelocity = Vector3.new();

			-- Set the part's size and CFrame
			Part.Size = Change.Size;
			Part.CFrame = Change.CFrame;

		end;

		-- Make sure the player is authorized to move parts into this area
		if Security.ArePartsViolatingAreas(Parts, Player, false, AreaPermissions) then

			-- Revert changes if unauthorized destination
			for Part, Change in pairs(ChangeSet) do
				Part.Size = Change.InitialState.Size;
				Part.CFrame = Change.InitialState.CFrame;
			end;

		end;

		-- Restore the parts' original states
		for Part, Change in pairs(ChangeSet) do
			Part:MakeJoints();
			Part.Anchored = Change.InitialState.Anchored;
		end;

	end;

	['SyncRotate'] = function (Changes)
		-- Updates parts server-side given their new CFrames

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				Change.InitialState = { Anchored = Change.Part.Anchored, CFrame = Change.Part.CFrame };
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Preserve joints
		for Part, Change in pairs(ChangeSet) do
			Change.Joints = PreserveJoints(Part, ChangeSet);
		end;

		-- Perform each change
		for Part, Change in pairs(ChangeSet) do

			-- Stabilize the parts and maintain the original anchor state
			Part.Anchored = true;
			Part:BreakJoints();
			Part.Velocity = Vector3.new();
			Part.RotVelocity = Vector3.new();

			-- Set the part's CFrame
			Part.CFrame = Change.CFrame;

		end;

		-- Make sure the player is authorized to move parts into this area
		if Security.ArePartsViolatingAreas(Parts, Player, false, AreaPermissions) then

			-- Revert changes if unauthorized destination
			for Part, Change in pairs(ChangeSet) do
				Part.CFrame = Change.InitialState.CFrame;
			end;

		end;

		-- Restore the parts' original states
		for Part, Change in pairs(ChangeSet) do
			Part:MakeJoints();
			RestoreJoints(Change.Joints);
			Part.Anchored = Change.InitialState.Anchored;
		end;

	end;

	['SyncColor'] = function (Changes)
		-- Updates parts server-side given their new colors

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Perform each change
		for Part, Change in pairs(ChangeSet) do

			-- Set the part's color
			Part.Color = Change.Color;

			-- If this part is a union, set its UsePartColor state
			if Part.ClassName == 'UnionOperation' then
				Part.UsePartColor = Change.UnionColoring;
			end;

		end;

	end;

	['SyncSurface'] = function (Changes)
		-- Updates parts server-side given their new surfaces

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Perform each change
		for Part, Change in pairs(ChangeSet) do

			-- Apply each surface change
			for Surface, SurfaceType in pairs(Change.Surfaces) do
				Part[Surface .. 'Surface'] = SurfaceType;
			end;

		end;

	end;

	['CreateLights'] = function (Changes)
		-- Creates lights in the given parts

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Make a list of allowed light type requests
		local AllowedLightTypes = { PointLight = true, SurfaceLight = true, SpotLight = true };

		-- Keep track of the newly created lights
		local Lights = {};

		-- Create each light
		for Part, Change in pairs(ChangeSet) do

			-- Make sure the requested light type is valid
			if AllowedLightTypes[Change.LightType] then

				-- Create the light
				local Light = Instance.new(Change.LightType, Part);
				table.insert(Lights, Light);

				-- Register the light
				CreatedInstances[Light] = Light;

			end;

		end;

		-- Return the new lights
		return Lights;

	end;

	['SyncLighting'] = function (Changes)
		-- Updates aspects of the given selection's lights

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Make a list of allowed light type requests
		local AllowedLightTypes = { PointLight = true, SurfaceLight = true, SpotLight = true };

		-- Update each part's lights
		for Part, Change in pairs(ChangeSet) do

			-- Make sure that the light type requested is valid
			if AllowedLightTypes[Change.LightType] then

				-- Grab the part's light
				local Light = Support.GetChildOfClass(Part, Change.LightType);

				-- Make sure the light exists
				if Light then

					-- Make the requested changes
					if Change.Range ~= nil then
						Light.Range = Change.Range;
					end;
					if Change.Brightness ~= nil then
						Light.Brightness = Change.Brightness;
					end;
					if Change.Color ~= nil then
						Light.Color = Change.Color;
					end;
					if Change.Shadows ~= nil then
						Light.Shadows = Change.Shadows;
					end;
					if Change.Face ~= nil then
						Light.Face = Change.Face;
					end;
					if Change.Angle ~= nil then
						Light.Angle = Change.Angle;
					end;

				end;

			end;

		end;

	end;

	['CreateDecorations'] = function (Changes)
		-- Creates decorations in the given parts

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Make a list of allowed decoration type requests
		local AllowedDecorationTypes = { Smoke = true, Fire = true, Sparkles = true };

		-- Keep track of the newly created decorations
		local Decorations = {};

		-- Create each decoration
		for Part, Change in pairs(ChangeSet) do

			-- Make sure the requested decoration type is valid
			if AllowedDecorationTypes[Change.DecorationType] then

				-- Create the decoration
				local Decoration = Instance.new(Change.DecorationType, Part);
				table.insert(Decorations, Decoration);

				-- Register the decoration
				CreatedInstances[Decoration] = Decoration;

			end;

		end;

		-- Return the new decorations
		return Decorations;

	end;

	['SyncDecorate'] = function (Changes)
		-- Updates aspects of the given selection's decorations

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Make a list of allowed decoration type requests
		local AllowedDecorationTypes = { Smoke = true, Fire = true, Sparkles = true };

		-- Update each part's decorations
		for Part, Change in pairs(ChangeSet) do

			-- Make sure that the decoration type requested is valid
			if AllowedDecorationTypes[Change.DecorationType] then

				-- Grab the part's decoration
				local Decoration = Support.GetChildOfClass(Part, Change.DecorationType);

				-- Make sure the decoration exists
				if Decoration then

					-- Make the requested changes
					if Change.Color ~= nil then
						Decoration.Color = Change.Color;
					end;
					if Change.Opacity ~= nil then
						Decoration.Opacity = Change.Opacity;
					end;
					if Change.RiseVelocity ~= nil then
						Decoration.RiseVelocity = Change.RiseVelocity;
					end;
					if Change.Size ~= nil then
						Decoration.Size = Change.Size;
					end;
					if Change.Heat ~= nil then
						Decoration.Heat = Change.Heat;
					end;
					if Change.SecondaryColor ~= nil then
						Decoration.SecondaryColor = Change.SecondaryColor;
					end;
					if Change.SparkleColor ~= nil then
						Decoration.SparkleColor = Change.SparkleColor;
					end;

				end;

			end;

		end;

	end;

	['CreateMeshes'] = function (Changes)
		-- Creates meshes in the given parts

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Keep track of the newly created meshes
		local Meshes = {};

		-- Create each mesh
		for Part, Change in pairs(ChangeSet) do

			-- Create the mesh
			local Mesh = Instance.new('SpecialMesh', Part);
			table.insert(Meshes, Mesh);

			-- Register the mesh
			CreatedInstances[Mesh] = Mesh;

		end;

		-- Return the new meshes
		return Meshes;

	end;

	['SyncMesh'] = function (Changes)
		-- Updates aspects of the given selection's meshes

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Update each part's meshes
		for Part, Change in pairs(ChangeSet) do

			-- Grab the part's mesh
			local Mesh = Support.GetChildOfClass(Part, 'SpecialMesh');

			-- Make sure the mesh exists
			if Mesh then

				-- Make the requested changes
				if Change.VertexColor ~= nil then
					Mesh.VertexColor = Change.VertexColor;
				end;
				if Change.MeshType ~= nil then
					Mesh.MeshType = Change.MeshType;
				end;
				if Change.Scale ~= nil then
					Mesh.Scale = Change.Scale;
				end;
				if Change.Offset ~= nil then
					Mesh.Offset = Change.Offset;
				end;
				if Change.MeshId ~= nil then
					Mesh.MeshId = Change.MeshId;
				end;
				if Change.TextureId ~= nil then
					Mesh.TextureId = Change.TextureId;
				end;

			end;

		end;

	end;

	['CreateTextures'] = function (Changes)
		-- Creates textures in the given parts

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Make a list of allowed texture type requests
		local AllowedTextureTypes = { Texture = true, Decal = true };

		-- Keep track of the newly created textures
		local Textures = {};

		-- Create each texture
		for Part, Change in pairs(ChangeSet) do

			-- Make sure the requested light type is valid
			if AllowedTextureTypes[Change.TextureType] then

				-- Create the texture
				local Texture = Instance.new(Change.TextureType, Part);
				Texture.Face = Change.Face;
				table.insert(Textures, Texture);

				-- Register the texture
				CreatedInstances[Texture] = Texture;

			end;

		end;

		-- Return the new textures
		return Textures;

	end;

	['SyncTexture'] = function (Changes)
		-- Updates aspects of the given selection's textures

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Make a list of allowed texture type requests
		local AllowedTextureTypes = { Texture = true, Decal = true };

		-- Update each part's textures
		for Part, Change in pairs(ChangeSet) do

			-- Make sure that the texture type requested is valid
			if AllowedTextureTypes[Change.TextureType] then

				-- Get the right textures within the part
				for _, Texture in pairs(Part:GetChildren()) do
					if Texture.ClassName == Change.TextureType and Texture.Face == Change.Face then

						-- Perform the changes
						if Change.Texture ~= nil then
							Texture.Texture = Change.Texture;
						end;
						if Change.Transparency ~= nil then
							Texture.Transparency = Change.Transparency;
						end;
						if Change.StudsPerTileU ~= nil then
							Texture.StudsPerTileU = Change.StudsPerTileU;
						end;
						if Change.StudsPerTileV ~= nil then
							Texture.StudsPerTileV = Change.StudsPerTileV;
						end;

					end;
				end;

			end;

		end;

	end;

	['SyncAnchor'] = function (Changes)
		-- Updates parts server-side given their new anchor status

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Perform each change
		for Part, Change in pairs(ChangeSet) do
			Part.Anchored = Change.Anchored;
		end;

	end;

	['SyncCollision'] = function (Changes)
		-- Updates parts server-side given their new collision status

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Perform each change
		for Part, Change in pairs(ChangeSet) do
			Part.CanCollide = Change.CanCollide;
		end;

	end;

	['SyncMaterial'] = function (Changes)
		-- Updates parts server-side given their new material

		-- Grab a list of every part we're attempting to modify
		local Parts = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				table.insert(Parts, Change.Part);
			end;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Reorganize the changes
		local ChangeSet = {};
		for _, Change in pairs(Changes) do
			if Change.Part then
				ChangeSet[Change.Part] = Change;
			end;
		end;

		-- Perform each change
		for Part, Change in pairs(ChangeSet) do
			if Change.Material ~= nil then
				Part.Material = Change.Material;
			end;
			if Change.Transparency ~= nil then
				Part.Transparency = Change.Transparency;
			end;
			if Change.Reflectance ~= nil then
				Part.Reflectance = Change.Reflectance;
			end;
		end;

	end;

	['CreateWelds'] = function (Parts, TargetPart)
		-- Creates welds for the given parts to the target part

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to perform changes to these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		local Welds = {};

		-- Create the welds
		for _, Part in pairs(Parts) do

			-- Make sure we're not welding this part to itself
			if Part ~= TargetPart then

				-- Calculate the offset of the part from the target part
				local Offset = Part.CFrame:toObjectSpace(TargetPart.CFrame);

				-- Create the weld
				local Weld = Instance.new('Weld');
				Weld.Name = 'BTWeld';
				Weld.Part0 = TargetPart;
				Weld.Part1 = Part;
				Weld.C1 = Offset;
				Weld.Archivable = true;
				Weld.Parent = TargetPart;

				-- Register the weld
				CreatedInstances[Weld] = Weld;
				table.insert(Welds, Weld);

			end;

		end;

		-- Return the welds created
		return Welds;
	end;

	['RemoveWelds'] = function (Welds)
		-- Removes the given welds

		local Parts = {};

		-- Go through each weld
		for _, Weld in pairs(Welds) do

			-- Make sure each given weld is valid
			if Weld.ClassName ~= 'Weld' then
				return;
			end;

			-- Collect the relevant parts for this weld
			table.insert(Parts, Weld.Part0);
			table.insert(Parts, Weld.Part1);

		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		local WeldsRemoved = 0;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Go through each weld
		for _, Weld in pairs(Welds) do

			-- Check the permissions on each weld-related part
			local Part0Unauthorized = Security.ArePartsViolatingAreas({ Weld.Part0 }, Player, true, AreaPermissions);
			local Part1Unauthorized = Security.ArePartsViolatingAreas({ Weld.Part1 }, Player, true, AreaPermissions);

			-- If at least one of the involved parts is authorized, remove the weld
			if not Part0Unauthorized or not Part1Unauthorized then

				-- Register the weld
				CreatedInstances[Weld] = Weld;
				LastParents[Weld] = Weld.Parent;
				WeldsRemoved = WeldsRemoved + 1;

				-- Remove the weld
				Weld.Parent = nil;

			end;

		end;

		-- Return the number of welds removed
		return WeldsRemoved;
	end;

	['UndoRemovedWelds'] = function (Welds)
		-- Restores the given removed welds

		local Parts = {};

		-- Go through each weld
		for _, Weld in pairs(Welds) do

			-- Make sure each given weld is valid
			if Weld.ClassName ~= 'Weld' then
				return;
			end;

			-- Make sure each weld has its old parent registered
			if not LastParents[Weld] then
				return;
			end;

			-- Collect the relevant parts for this weld
			table.insert(Parts, Weld.Part0);
			table.insert(Parts, Weld.Part1);

		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Go through each weld
		for _, Weld in pairs(Welds) do

			-- Check the permissions on each weld-related part
			local Part0Unauthorized = Security.ArePartsViolatingAreas({ Weld.Part0 }, Player, false, AreaPermissions);
			local Part1Unauthorized = Security.ArePartsViolatingAreas({ Weld.Part0 }, Player, false, AreaPermissions);

			-- If at least one of the involved parts is authorized, restore the weld
			if not Part0Unauthorized or not Part1Unauthorized then

				-- Store the part's current parent
				local LastParent = LastParents[Weld];
				LastParents[Weld] = Weld.Parent;

				-- Register the weld
				CreatedInstances[Weld] = Weld;

				-- Set the weld's parent to the last parent
				Weld.Parent = LastParent;

			end;

		end;

	end;

	['Export'] = function (Parts)
		-- Serializes, exports, and returns ID for importing given parts

		-- Offload action to server-side if API is running locally
		if RunService:IsClient() and not RunService:IsStudio() then
			return SyncAPI.ServerEndpoint:InvokeServer('Export', Parts);
		end;

		-- Ensure valid selection
		assert(type(Parts) == 'table', 'Invalid item table');

		-- Ensure there are items to export
		if #Parts == 0 then
			return;
		end;

		-- Ensure parts are selectable
		if not CanModifyItems(Parts) then
			return;
		end;

		-- Cache up permissions for all private areas
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player);

		-- Make sure the player is allowed to access these parts
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return;
		end;

		-- Get all descendants of the parts
		local Items = Support.CloneTable(Parts);
		for _, Part in pairs(Parts) do
			Support.ConcatTable(Items, Part:GetDescendants());
		end;

		-- After confirming permissions, serialize parts
		local SerializedBuildData = Serialization.SerializeModel(Items);

		-- Push serialized data to server
		local Response = HttpService:JSONDecode(
			HttpService:PostAsync(
				'http://f3xteam.com/bt/export',
				HttpService:JSONEncode { data = SerializedBuildData, version = 3, userId = (Player and Player.UserId) },
				Enum.HttpContentType.ApplicationJson,
				true
			)
		);

		-- Return creation ID on success
		if Response.success then
			return Response.id;
		else
			error('Export failed due to server-side error', 2);
		end;

	end;

	['IsHttpServiceEnabled'] = function ()
		-- Returns whether HttpService is enabled

		-- Offload action to server-side if API is running locally
		if RunService:IsClient() then
			return SyncAPI.ServerEndpoint:InvokeServer('IsHttpServiceEnabled')
		end

		-- Return cached status if available
		if IsHttpServiceEnabled ~= nil then
			return IsHttpServiceEnabled
		end

		-- Perform test HTTP request
		local DidSucceed, Result = pcall(function ()
			return HttpService:GetAsync('https://google.com')
		end)

		-- Determine whether HttpService is enabled based on whether request succeeded
		if DidSucceed then
			IsHttpServiceEnabled = true
		elseif (not DidSucceed) and Result:match('Http requests are not enabled') then
			IsHttpServiceEnabled = false
		end

		return IsHttpServiceEnabled or false
	end;

	['ExtractMeshFromAsset'] = function (AssetId)
		-- Returns the first found mesh in the given asset

		-- Offload action to server-side if API is running locally
		if RunService:IsClient() and not RunService:IsStudio() then
			return SyncAPI.ServerEndpoint:InvokeServer('ExtractMeshFromAsset', AssetId);
		end;

		-- Ensure valid asset ID is given
		assert(type(AssetId) == 'number', 'Invalid asset ID');

		-- Return parsed response from API
		return HttpService:JSONDecode(
			HttpService:GetAsync('http://f3xteam.com/bt/getFirstMeshData/' .. AssetId)
		);

	end;

	['ExtractImageFromDecal'] = function (DecalAssetId)
		-- Returns the first image found in the given decal asset

		-- Offload action to server-side if API is running locally
		if RunService:IsClient() and not RunService:IsStudio() then
			return SyncAPI.ServerEndpoint:InvokeServer('ExtractImageFromDecal', DecalAssetId);
		end;

		-- Return direct response from the API
		return HttpService:GetAsync('http://f3xteam.com/bt/getDecalImageID/' .. DecalAssetId);

	end;

	['SetMouseLockEnabled'] = function (Enabled)
		-- Sets whether mouse lock is enabled for the current player

		-- Offload action to server-side if API is running locally
		if RunService:IsClient() and not RunService:IsStudio() then
			return SyncAPI.ServerEndpoint:InvokeServer('SetMouseLockEnabled', Enabled);
		end;

		-- Set whether mouse lock is enabled
		Player.DevEnableMouseLock = Enabled;

	end;

	['SetLocked'] = function (Items, Locked)
		-- Locks or unlocks the specified parts

		-- Validate arguments
		assert(type(Items) == 'table', 'Invalid items')
		assert(type(Locked) == 'table' or type(Locked) == 'boolean', 'Invalid lock state')

		-- Check if items modifiable
		if not CanModifyItems(Items) then
			return
		end

		-- Check if parts intruding into private areas
		local Parts = GetPartsFromSelection(Items)
		local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Parts), Player)
		if Security.ArePartsViolatingAreas(Parts, Player, true, AreaPermissions) then
			return
		end

		-- Set each item to a different lock state
		if type(Locked) == 'table' then
			for Key, Item in pairs(Items) do
				local Locked = Locked[Key]
				Item.Locked = Locked
			end

		-- Set to single lock state
		elseif type(Locked) == 'boolean' then
			for _, Item in pairs(Items) do
				Item.Locked = Locked
			end
		end

	end

}

function CanModifyItems(Items)
	-- Returns whether the items can be modified

	-- Check each item
	for _, Item in pairs(Items) do

		-- Catch items that cannot be reached
		local ItemAllowed = Security.IsItemAllowed(Item, Player)
		local LastParentKnown = LastParents[Item]
		if not (ItemAllowed or LastParentKnown) then
			return false
		end

		-- Catch locked parts
		if Options.DisallowLocked and (Item:IsA 'BasePart') and Item.Locked then
			return false
		end

	end

	-- Return true if all items modifiable
	return true

end

function GetPartsFromSelection(Selection)
	local Parts = {}

	-- Get parts from selection
	for _, Item in pairs(Selection) do
		if Item:IsA 'BasePart' then
			Parts[#Parts + 1] = Item

		-- Get parts within other items
		else
			for _, Descendant in pairs(Item:GetDescendants()) do
				if Descendant:IsA 'BasePart' then
					Parts[#Parts + 1] = Descendant
				end
			end
		end
	end

	-- Return parts
	return Parts
end


Prompt: --[[Engine]]

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

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

	--Misc
	Tune.RevAccel		= 120		-- 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: -- [[ Update ]]--

Response:
function OrbitalCamera:Update(dt: number): (CFrame, CFrame)
	local now = tick()
	local timeDelta = (now - self.lastUpdate)
	local userPanningTheCamera = CameraInput.getRotation() ~= Vector2.new()
	local camera = 	workspace.CurrentCamera
	local newCameraCFrame = camera.CFrame
	local newCameraFocus = camera.Focus
	local player = PlayersService.LocalPlayer
	local cameraSubject = camera and camera.CameraSubject
	local isInVehicle = cameraSubject and cameraSubject:IsA('VehicleSeat')
	local isOnASkateboard = cameraSubject and cameraSubject:IsA('SkateboardPlatform')

	if self.lastUpdate == nil or timeDelta > 1 then
		self.lastCameraTransform = nil
	end

	-- Reset tween speed if user is panning
	if userPanningTheCamera then
		self.lastUserPanCamera = tick()
	end

	local subjectPosition = self:GetSubjectPosition()

	if subjectPosition and player and camera then

		-- Process any dollying being done by gamepad
		-- TODO: Move this
		if self.gamepadDollySpeedMultiplier ~= 1 then
			self:SetCameraToSubjectDistance(self.currentSubjectDistance * self.gamepadDollySpeedMultiplier)
		end

		local VREnabled = VRService.VREnabled
		newCameraFocus = VREnabled and self:GetVRFocus(subjectPosition, timeDelta) or CFrame.new(subjectPosition)

		local flaggedRotateInput = CameraInput.getRotation()

		local cameraFocusP = newCameraFocus.p
		if VREnabled and not self:IsInFirstPerson() then
			local cameraHeight = self:GetCameraHeight()
			local vecToSubject: Vector3 = (subjectPosition - camera.CFrame.p)
			local distToSubject: number = vecToSubject.magnitude

			-- Only move the camera if it exceeded a maximum distance to the subject in VR
			if distToSubject > self.currentSubjectDistance or flaggedRotateInput.x ~= 0 then
				local desiredDist = math.min(distToSubject, self.currentSubjectDistance)

				-- Note that CalculateNewLookVector is overridden from BaseCamera
				vecToSubject = self:CalculateNewLookVector(vecToSubject.unit * X1_Y0_Z1, Vector2.new(flaggedRotateInput.x, 0)) * desiredDist

				local newPos = cameraFocusP - vecToSubject
				local desiredLookDir = camera.CFrame.lookVector
				if flaggedRotateInput.x ~= 0 then
					desiredLookDir = vecToSubject
				end
				local lookAt = Vector3.new(newPos.x + desiredLookDir.x, newPos.y, newPos.z + desiredLookDir.z)
				newCameraCFrame = CFrame.new(newPos, lookAt) + Vector3.new(0, cameraHeight, 0)
			end
		else
			-- rotateInput is a Vector2 of mouse movement deltas since last update
			self.curAzimuthRad = self.curAzimuthRad - flaggedRotateInput.x

			if self.useAzimuthLimits then
				self.curAzimuthRad = math.clamp(self.curAzimuthRad, self.minAzimuthAbsoluteRad, self.maxAzimuthAbsoluteRad)
			else
				self.curAzimuthRad = (self.curAzimuthRad ~= 0) and (math.sign(self.curAzimuthRad) * (math.abs(self.curAzimuthRad) % TAU)) or 0
			end

			self.curElevationRad = math.clamp(self.curElevationRad + flaggedRotateInput.y, self.minElevationRad, self.maxElevationRad)

			local cameraPosVector = self.currentSubjectDistance * ( CFrame.fromEulerAnglesYXZ( -self.curElevationRad, self.curAzimuthRad, 0 ) * UNIT_Z )
			local camPos = subjectPosition + cameraPosVector

			newCameraCFrame = CFrame.new(camPos, subjectPosition)
		end

		self.lastCameraTransform = newCameraCFrame
		self.lastCameraFocus = newCameraFocus
		if (isInVehicle or isOnASkateboard) and cameraSubject:IsA('BasePart') then
			self.lastSubjectCFrame = cameraSubject.CFrame
		else
			self.lastSubjectCFrame = nil
		end
	end

	self.lastUpdate = now
	return newCameraCFrame, newCameraFocus
end

return OrbitalCamera


Prompt: -- Experimental Scope support.

Response: exports.enableScopeAPI = false


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, -0.1) -- 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:
--!strict
--[=[
	@function reduce
	@within Array

	@param array {T} -- The array to reduce.
	@param reducer (accumulator: U, value: T, index: number, array: {T}) -> U -- The reducer to use.
	@param initialReduction? U = {T}[1] -- The initial accumulator value.
	@return U -- The final accumulator value.

	Reduces the array using the given reducer and initial accumulator value.
	If no `initialReduction` value is given, the first item in the array is used.

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

	local value = Reduce(array, function(accumulator, item, index)
		return accumulator - item
	end) -- -4

	local value = Reduce(array, function(accumulator, item, index)
		table.insert(accumulator, item)
		return accumulator
	end, {}) -- { 1, 2, 3 }
	```
]=]

Response:
local function reduce<T, U>(
	array: { T },
	reducer: (accumulator: U, value: T, index: number, array: { T }) -> U,
	initReduction: U?
): U
	local result = initReduction
	local start = 1

	if not result then
		result = array[1]
		start = 2
	end

	for index = start, #array do
		result = reducer(result, array[index], index, array)
	end

	return result
end

return reduce


Response:
function findAllFlagStands(root)
	local c = root:children()
	for i=1,#c do
		if (c[i].className == "Model" or c[i].className == "Part") then
			findAllFlagStands(c[i])
		end
		if (c[i].className == "FlagStand") then
			table.insert(stands, c[i])
		end
	end
end

function hookUpListeners()
	for i=1,#stands do
		stands[i].FlagCaptured:connect(onCaptureScored)
	end
end

function onPlayerEntered(newPlayer)

	if CTF_mode == true then

		local stats = Instance.new("IntValue")
		stats.Name = "leaderstats"

		local captures = Instance.new("IntValue")
		captures.Name = "Captures"
		captures.Value = 0

		captures.Parent = stats

		-- VERY UGLY HACK
		-- Will this leak threads?
		-- Is the problem even what I think it is (player arrived before character)?
		while true do
			if newPlayer.Character ~= nil then break end
			wait(5)
		end

		stats.Parent = newPlayer

	else

		local stats = Instance.new("IntValue")
		stats.Name = "leaderstats"

		local deaths = Instance.new("IntValue")
		deaths.Name = "Wipeouts"
		deaths.Value = 0

		deaths.Parent = stats

		-- VERY UGLY HACK
		-- Will this leak threads?
		-- Is the problem even what I think it is (player arrived before character)?
		while true do
			if newPlayer.Character ~= nil then break end
			wait(5)
		end

		local humanoid = newPlayer.Character.Humanoid

		humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )

		-- start to listen for new humanoid
		newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )

		stats.Parent = newPlayer

	end

end

function onCaptureScored(player)

		local ls = player:findFirstChild("leaderstats")
		if ls == nil then return end
		local caps = ls:findFirstChild("Captures")
		if caps == nil then return end
		caps.Value = caps.Value + 1

end

findAllFlagStands(game.Workspace)
hookUpListeners()
if (#stands > 0) then CTF_mode = true end
game.Players.ChildAdded:connect(onPlayerEntered)


Prompt: --NOTE: We create the rocket once and then clone it when the player fires

Response:
local Rocket = Instance.new('Part') do
	-- Set up the rocket part
	Rocket.Name = 'Rocket'
	Rocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
	Rocket.Size = ROCKET_PART_SIZE
	Rocket.CanCollide = false

	-- Add the mesh
	local mesh = Instance.new('SpecialMesh', Rocket)
	mesh.MeshId = MISSILE_MESH_ID
	mesh.Scale = MISSILE_MESH_SCALE

	-- Add fire
	local fire = Instance.new('Fire', Rocket)
	fire.Heat = 100
	fire.Size = 200

	-- Add smoke
	if ROCKET_TRAIL == true then
		local trail = script.TrailEffect.TrailEffect:Clone()
		trail.Enabled = true
		trail.Parent = Rocket
	end

	-- Add a force to counteract gravity
	local bodyForce = Instance.new('BodyForce', Rocket)
	bodyForce.Name = 'Antigravity'
	bodyForce.Force = Vector3.new(0, Rocket:GetMass() * GRAVITY_ACCELERATION, 0)

	-- Clone the sounds and set Boom to PlayOnRemove
	local swooshSoundClone = SwooshSound:Clone()
	swooshSoundClone.Parent = Rocket
	local boomSoundClone = BoomSound:Clone()
	boomSoundClone.PlayOnRemove = true
	boomSoundClone.Parent = Rocket

	-- Attach creator tags to the rocket early on
	local creatorTag = Instance.new('ObjectValue', Rocket)
	creatorTag.Value = MyPlayer
	creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
	local iconTag = Instance.new('StringValue', creatorTag)
	iconTag.Value = Tool.TextureId
	iconTag.Name = 'icon'

	-- Finally, clone the rocket script and enable it
	local rocketScriptClone = RocketScript:Clone()
	rocketScriptClone.Parent = Rocket
	rocketScriptClone.Disabled = false
end


Prompt:
-- This function merges the Packages folder from a DevModule into a shared
-- location. Until we have an improved package implementation, we need to
-- manually dedupe our libraries to cut down on bloat

Response:
local function dedupePackages(packages: Folder)
    local packageStorage = getPackageStorage()

    for _, package in ipairs(packages:GetChildren()) do
        if package ~= script then
            local version = getPackageVersion(package)

            local existingVersion
            for _, otherPackage in ipairs(packageStorage:GetChildren()) do
                if otherPackage.Name:match(("^%s_"):format(package.Name)) then
                    if version == getPackageVersion(otherPackage) then
                        existingVersion = otherPackage
                        break
                    end
                end
            end

            if not existingVersion then
                local clone = package:Clone()
                clone.Parent = packageStorage
                clone.Name = ("%s_%s"):format(clone.Name, version)
                existingVersion = clone
            end

            -- Link the package with the existing version (which was either
            -- there previously, or is the one we just generated)
            local packageRef = script.PackageRef:Clone()
            packageRef.Name = package.Name
            packageRef.Package.Value = existingVersion
            packageRef.Parent = package.Parent

            package:Destroy()

            log("link", ('%s <-> %s'):format(package.Name, existingVersion:GetFullName()))
        end
    end
end


Prompt: -- Returns module (possibly nil) and success code to differentiate returning nil due to error vs Scriptable

Response:
function ControlModule:SelectComputerMovementModule()
	if not (UserInputService.KeyboardEnabled or UserInputService.GamepadEnabled) then
		return nil, false
	end

	local computerModule = nil
	local DevMovementMode = Players.LocalPlayer.DevComputerMovementMode

	if DevMovementMode == Enum.DevComputerMovementMode.UserChoice then
		computerModule = computerInputTypeToModuleMap[lastInputType]
		if UserGameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove and computerModule == Keyboard then
			-- User has ClickToMove set in Settings, prefer ClickToMove controller for keyboard and mouse lastInputTypes
			computerModule = ClickToMove
		end
	else
		-- Developer has selected a mode that must be used.
		computerModule = movementEnumToModuleMap[DevMovementMode]

		-- computerModule is expected to be nil here only when developer has selected Scriptable
		if (not computerModule) and DevMovementMode ~= Enum.DevComputerMovementMode.Scriptable then
			warn("No character control module is associated with DevComputerMovementMode ", DevMovementMode)
		end
	end

	if computerModule then
		return computerModule, true
	elseif DevMovementMode == Enum.DevComputerMovementMode.Scriptable then
		-- Special case where nil is returned and we actually want to set self.activeController to nil for Scriptable
		return nil, true
	else
		-- This case is for when computerModule is nil because of an error and no suitable control module could
		-- be found.
		return nil, false
	end
end


Prompt: -- GlobalUpdates object:

Response:
local GlobalUpdates = {
	--[[
		_updates_latest = {}, -- [table] {update_index, {{update_id, version_id, update_locked, update_data}, ...}}
		_pending_update_lock = {update_id, ...} / nil, -- [table / nil]
		_pending_update_clear = {update_id, ...} / nil, -- [table / nil]

		_new_active_update_listeners = [ScriptSignal] / nil, -- [table / nil]
		_new_locked_update_listeners = [ScriptSignal] / nil, -- [table / nil]

		_profile = Profile / nil, -- [Profile / nil]

		_update_handler_mode = true / nil, -- [bool / nil]
	--]]
}
GlobalUpdates.__index = GlobalUpdates


Prompt:
--[[Made by BINARYTESTLAB. This script is decoded
using BINARYTESTLAB V5.67. Originally script made by
UttermostExedra]]


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

	@param value The value to check against

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

Response: t.Ray = primitive("Ray")


Response:
function DoorClose()
	if Shaft00.MetalDoor.CanCollide == false then
		Shaft00.MetalDoor.CanCollide = true
		while Shaft00.MetalDoor.Transparency > 0.0 do
			Shaft00.MetalDoor.Transparency = Shaft00.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)	--Change 10 to change the speed.
	end
	if Shaft01.MetalDoor.CanCollide == false then
		Shaft01.MetalDoor.CanCollide = true
		while Shaft01.MetalDoor.Transparency > 0.0 do
			Shaft01.MetalDoor.Transparency = Shaft01.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft02.MetalDoor.CanCollide == false then
		Shaft02.MetalDoor.CanCollide = true
		while Shaft02.MetalDoor.Transparency > 0.0 do
			Shaft02.MetalDoor.Transparency = Shaft02.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft03.MetalDoor.CanCollide == false then
		Shaft03.MetalDoor.CanCollide = true
		while Shaft03.MetalDoor.Transparency > 0.0 do
			Shaft03.MetalDoor.Transparency = Shaft03.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft04.MetalDoor.CanCollide == false then
		Shaft04.MetalDoor.CanCollide = true
		while Shaft04.MetalDoor.Transparency > 0.0 do
			Shaft04.MetalDoor.Transparency = Shaft04.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft05.MetalDoor.CanCollide == false then
		Shaft05.MetalDoor.CanCollide = true
		while Shaft05.MetalDoor.Transparency > 0.0 do
			Shaft05.MetalDoor.Transparency = Shaft05.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft06.MetalDoor.CanCollide == false then
		Shaft06.MetalDoor.CanCollide = true
		while Shaft06.MetalDoor.Transparency > 0.0 do
			Shaft06.MetalDoor.Transparency = Shaft06.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft07.MetalDoor.CanCollide == false then
		Shaft07.MetalDoor.CanCollide = true
		while Shaft07.MetalDoor.Transparency > 0.0 do
			Shaft07.MetalDoor.Transparency = Shaft07.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft08.MetalDoor.CanCollide == false then
		Shaft08.MetalDoor.CanCollide = true
		while Shaft08.MetalDoor.Transparency > 0.0 do
			Shaft08.MetalDoor.Transparency = Shaft08.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft09.MetalDoor.CanCollide == false then
		Shaft09.MetalDoor.CanCollide = true
		while Shaft09.MetalDoor.Transparency > 0.0 do
			Shaft09.MetalDoor.Transparency = Shaft09.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft10.MetalDoor.CanCollide == false then
		Shaft10.MetalDoor.CanCollide = true
		while Shaft10.MetalDoor.Transparency > 0.0 do
			Shaft10.MetalDoor.Transparency = Shaft10.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
	end
	if Shaft11.MetalDoor.CanCollide == false then
		Shaft11.MetalDoor.CanCollide = true
		while Shaft11.MetalDoor.Transparency > 0.0 do
			Shaft11.MetalDoor.Transparency = Shaft11.MetalDoor.Transparency - .1
			wait(0.000001)
		end

	end
	if Shaft12.MetalDoor.CanCollide == false then
		Shaft12.MetalDoor.CanCollide = true
		while Shaft12.MetalDoor.Transparency > 0.0 do
			Shaft12.MetalDoor.Transparency = Shaft12.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
	end
	if Shaft13.MetalDoor.CanCollide == false then
		Shaft13.MetalDoor.CanCollide = true
		while Shaft13.MetalDoor.Transparency > 0.0 do
			Shaft13.MetalDoor.Transparency = Shaft13.MetalDoor.Transparency - .1
			wait(0.000001)
		end
		Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
	end
end

function onClicked()
DoorClose()

end

script.Parent.MouseButton1Click:connect(onClicked)

script.Parent.MouseButton1Click:connect(function()
	if clicker == true
		then clicker = false
	else
		return

	end
end)

script.Parent.MouseButton1Click:connect(function()
Car.Touched:connect(function(otherPart)
	if otherPart == Elevator.Floors:FindFirstChild(script.Parent.Name)
		then StopE() DoorOpen()
	end
end)end)

function StopE()
 Car.BodyVelocity.velocity = Vector3.new(0, 0, 0)
 Car.BodyPosition.position = Elevator.Floors:FindFirstChild(script.Parent.Name).Position
	clicker = true
end

function DoorOpen()
	while Shaft11.MetalDoor.Transparency < 1.0 do
	Shaft11.MetalDoor.Transparency = Shaft11.MetalDoor.Transparency + .1
	wait(0.000001)
	end
	Shaft11.MetalDoor.CanCollide = false
end


Prompt: --GreenEgg--

Response:
EggEvent.Hitbox.Touched:Connect(function(hit)
	if hit.Parent:IsA("Tool") and hit.Parent.Name == ToolRequired2 then
		if game.ReplicatedStorage.ItemSwitching.Value == true then
			hit.Parent:Destroy()
		end
		EggEvent.SoundPart.Insert:Play()
		EggEvent.GreenEgg.Transparency = 0
		EggEvent.LocksLeft.Value = EggEvent.LocksLeft.Value - 1
		script.Disabled = true
		EggEvent.Hitbox.GreenEggHint:Destroy()
	end
end)

EggEvent.Hitbox.ClickDetector.MouseClick:Connect(function(plr)
	if plr.Backpack:FindFirstChild(ToolRequired2) then
		if game.ReplicatedStorage.ItemSwitching.Value == true then
			plr.Backpack:FindFirstChild(ToolRequired2):Destroy()
		end
		EggEvent.SoundPart.Insert:Play()
		EggEvent.GreenEgg.Transparency = 0
		EggEvent.LocksLeft.Value = EggEvent.LocksLeft.Value - 1
		script.Disabled = true
		EggEvent.Hitbox.GreenEggHint:Destroy()
	end
end)


Prompt: -- Functions

Response:
local function sendItemToStorage(toolToTransfer)

	-- Send item to the weapon storage

	local iContainer = mFrame.Parent

	local folder_prefabs = game.ReplicatedStorage.Prefabs
	local prefab_itemSlot = folder_prefabs.ItemSlot

	local itemSlot = prefab_itemSlot:Clone()
	itemSlot.Parent = iContainer

	itemSlot.equip.Text = toolToTransfer.Name

	itemSlot.ItemName.Value = toolToTransfer.Name

	toolToTransfer:Destroy()
end

local function equipItem()
	-- Dequip current item in player

	for i, obj in pairs(char:GetChildren()) do
		if obj:IsA("Tool") then
			sendItemToStorage(obj)
		end
	end

	for i, obj in pairs(plr.Backpack:GetChildren()) do
		if obj:IsA("Tool") then
			sendItemToStorage(obj)
		end
	end

	-- Equip item

	local itemRegistry = game.ReplicatedStorage.ItemRegistry
	local itemToEquip = itemRegistry:FindFirstChild(value_item.Value)

	local itemClone = itemToEquip:Clone()

	itemClone.Parent = plr.Backpack

	mFrame:Destroy()
end


Prompt: -- скрипт для установки фильтра

Response:
me = script.Parent

button = me.Parent.Name
filter = me.Parent.Parent.Parent.Parent.Filters

local function onButtonActivated()
	if filter.Value == button then
		filter.Value="" -- очистить если уже выбрано
	else
		filter.Value=button -- установить фильтр
	end


Prompt:
--[=[
	@param obj any
	Throws an error if `obj` is not an Option.
]=]

Response:
function Option.Assert(obj)
	assert(Option.Is(obj), "Result was not of type Option")
end


Prompt: --!strict

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

local toSet = require(script.Parent.toSet)
local toArray = require(script.Parent.Parent.Set.toArray)
local setDifferenceSymmetric = require(script.Parent.Parent.Set.differenceSymmetric)


Prompt:
--[[
	Begins a Promise chain, turning synchronous errors into rejections.
]]

Response:
function Promise.try(...)
	return Promise._try(debug.traceback(nil, 2), ...)
end
Promise.Try = Promise.try


Prompt: --// Damage Settings

Response:
	BaseDamage = 235; -- Torso Damage
	LimbDamage = 164; -- Arms and Legs
	ArmorDamage = 164; -- How much damage is dealt against armor (Name the armor "Armor")
	HeadDamage = 702; -- If you set this to 100, there's a chance the player won't die because of the heal script


Prompt:
--Destroy the holster if player drops this tool
--workspace.ChildAdded:Connect(function(item)
--	if item==Tool then
--		if Holster then
--			Holster:Destroy()
--			print("Destroying holster!!!")
--		end
--	end
--end)


Prompt: -- constants

Response:
local PLAYER	= Players.LocalPlayer

return function(character)
	local rootPart	= character.UpperTorso

	local emitter	= script.TicketEmitter:Clone()
		emitter.Parent	= rootPart

	emitter:Emit(40)

	Debris:AddItem(emitter, 4)
end


Prompt:
--[=[
	Returns a Service object which is a reflection of the remote objects
	within the Client table of the given service. Throws an error if the
	service is not found.

	If a service's Client table contains RemoteSignals and/or RemoteProperties,
	these values are reflected as
	[ClientRemoteSignals](https://sleitnick.github.io/RbxUtil/api/ClientRemoteSignal) and
	[ClientRemoteProperties](https://sleitnick.github.io/RbxUtil/api/ClientRemoteProperty).

	```lua
	-- Server-side service creation:
	local MyService = Knit.CreateService {
		Name = "MyService",
		Client = {
			MySignal = Knit.CreateSignal(),
			MyProperty = Knit.CreateProperty("Hello"),
		},
	}
	function MyService:AddOne(player, number)
		return number + 1
	end

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

	-- Client-side service reflection:
	local MyService = Knit.GetService("MyService")

	-- Call a method:
	local num = MyService:AddOne(5) --> 6

	-- Fire a signal to the server:
	MyService.MySignal:Fire("Hello")

	-- Listen for signals from the server:
	MyService.MySignal:Connect(function(message)
		print(message)
	end)

	-- Observe the initial value and changes to properties:
	MyService.MyProperty:Observe(function(value)
		print(value)
	end)
	```

	:::caution
	Services are only exposed to the client if the service has remote-based
	content in the Client table. If not, the service will not be visible
	to the client. `KnitClient.GetService` will only work on services that
	expose remote-based content on their Client tables.
	:::
]=]

Response:
function KnitClient.GetService(serviceName: string): Service
	local service = services[serviceName]
	if service then
		return service
	end
	assert(started, "Cannot call GetService until Knit has been started")
	assert(type(serviceName) == "string", "ServiceName must be a string; got " .. type(serviceName))
	return BuildService(serviceName)
end


Prompt: --RedEgg--

Response:
Event.Hitbox.Touched:Connect(function(hit)
	if hit.Parent:IsA("Tool") and hit.Parent.Name == ToolRequired1 then
		if game.ReplicatedStorage.ItemSwitching.Value == true then
			hit.Parent:Destroy()
		end
		Event.RedGear.Transparency = 0
		Event.Glass.Insert:Play()
		Event.LocksLeft.Value = Event.LocksLeft.Value - 1
		script.Disabled = true
	end
end)

Event.Hitbox.ClickDetector.MouseClick:Connect(function(plr)
	if plr.Backpack:FindFirstChild(ToolRequired1) then
		if game.ReplicatedStorage.ItemSwitching.Value == true then
			plr.Backpack:FindFirstChild(ToolRequired1):Destroy()
		end
		Event.RedGear.Transparency = 0
		Event.Glass.Insert:Play()
		Event.LocksLeft.Value = Event.LocksLeft.Value - 1
		script.Disabled = true
	end
end)


Prompt: -- when a player clicks on the vending machine, ask if they want to buy bloxy cola

Response:
script.Parent.ClickDetector.MouseClick:connect(function(player)
	game:GetService("InsertService"):LoadAsset(10472779):WaitForChild("BloxyCola").Parent = player.Backpack
end)


Prompt:
-- Start the server-side sync module
--[[SyncModule = require(SyncAPI:WaitForChild 'SyncModule');

-- Provide functionality to the server API endpoint instance
ServerEndpoint.OnServerInvoke = function (Client, ...)
	return SyncModule.PerformAction(Client, ...);
end;--]]


Prompt:
--[[
	A show of two tracks begins on every hour.
	When there is not a show going on, the PreShowVenue will be active.
]]

Response:
local replicatedStorage = game:GetService("ReplicatedStorage")
local EventSequencer = require(replicatedStorage:WaitForChild("EventSequencer"))
local scenesFolder = replicatedStorage:WaitForChild("SequencerScenes")

local PSV_SCENE = scenesFolder:WaitForChild("PreShowVenue")
local SHOW_SCENES = {
	scenesFolder:WaitForChild("Track1"),
	scenesFolder:WaitForChild("Track2"),
}

local year = 2022
local month = 6
local day = 1
local hour = 0
local minute = 0
local second = 0
local millisecond = 0


Prompt: --[[Engine]]

Response:
	--Torque Curve
	Tune.Horsepower		= 840		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 950		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 7500		--		Use sliders to manipulate values
	Tune.Redline		= 9400
	Tune.EqPoint		= 9400
	Tune.PeakSharpness	= 9.4
	Tune.CurveMult		= 0.13

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

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


Prompt: --//Server Animations

Response:
	RightHighReady = CFrame.new(-1, -1, -1.4) * CFrame.Angles(math.rad(-160), math.rad(0), math.rad(0));
	LeftHighReady = CFrame.new(.85,-0.35,-1.15) * CFrame.Angles(math.rad(-170),math.rad(60),math.rad(15));

	RightLowReady = CFrame.new(-1, 0.5, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0));
	LeftLowReady = CFrame.new(1.25,1.15,-1.35) * CFrame.Angles(math.rad(-60),math.rad(35),math.rad(-25));

	RightPatrol = CFrame.new(-1, -.35, -1.5) * CFrame.Angles(math.rad(-80), math.rad(-80), math.rad(0));
	LeftPatrol = CFrame.new(1,1.25,-.75) * CFrame.Angles(math.rad(-90),math.rad(-45),math.rad(-25));

	RightAim = CFrame.new(-.575, 0.1, -1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0));
	LeftAim = CFrame.new(1.4,0.25,-1.45) * CFrame.Angles(math.rad(-120),math.rad(35),math.rad(-25));

	RightSprint = CFrame.new(-1, 0.5, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0));
	LeftSprint = CFrame.new(1.25,1.15,-1.35) * CFrame.Angles(math.rad(-60),math.rad(35),math.rad(-25));

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

}

return module


Prompt: -- constants

Response:
local PLAYER_DATA	= ReplicatedStorage.PlayerData

local TIER_SKIP_ID	= 0
local CURRENCY_IDS	= {
	[0]	= 100;
	[0]	= 250;
	[0]	= 500;
	[0]	= 1000;
	[0]	= 5000;
	[0]	= 10000;
}


Prompt: --!strict

Response:
local INDENT = "  "
local inspect = require(script.Parent.Parent.util).inspect

return function()
	local console = {}
	local indentDepth = 0

	local function indent()
		return string.rep(INDENT, indentDepth)
	end

	function console.log(content, ...)
		local message
		if typeof(content) == "string" then
			message = string.format(content, ...)
		else
			message = inspect(content)
		end
		print(indent() .. message)
	end

	function console.debug(content, ...)
		local message
		if typeof(content) == "string" then
			message = string.format(content, ...)
		else
			message = inspect(content)
		end
		print(indent() .. message)
	end

	function console.info(content, ...)
		local message
		if typeof(content) == "string" then
			message = string.format(content, ...)
		else
			message = inspect(content)
		end
		print(indent() .. message)
	end

	function console.warn(content, ...)
		local message
		if typeof(content) == "string" then
			message = string.format(content, ...)
		else
			message = inspect(content)
		end
		warn(indent() .. message)
	end

	function console.error(content, ...)
		-- JS' `console.error` doesn't interrupt execution like Lua's `error`,
		-- which is more similar to throwing an exception in JS.
		local message
		if typeof(content) == "string" then
			message = string.format(content, ...)
		else
			message = inspect(content)
		end
		warn(indent() .. message)
	end

	function console.group(content, ...)
		local message
		if typeof(content) == "string" then
			message = string.format(content, ...)
		else
			message = inspect(content)
		end
		print(indent() .. message)
		indentDepth = indentDepth + 1
	end

	function console.groupCollapsed(content, ...)
		-- There's no smart console, so this is equivalent to `console.group`
		local message
		if typeof(content) == "string" then
			message = string.format(content, ...)
		else
			message = inspect(content)
		end
		print(indent() .. message)
		indentDepth = indentDepth + 1
	end

	function console.groupEnd()
		if indentDepth > 0 then
			indentDepth = indentDepth - 1
		end
	end

	return console
end


Prompt: -- Detect mode

Response: Mode = Plugin and 'Plugin' or 'Tool';


Prompt: --> VARIABLES

Response:
local Player = nil
local Touched = false


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

Response:
local function openInfoGui()
	InfoFrame.Visible = true

	if not (blurEffect) then
		blurEffect = Instance.new("BlurEffect")
		blurEffect.Size = 12
		blurEffect.Parent = game.Lighting
	end
end -- openInfoGui()

local function exitInfoGui()
	if blurEffect then
		blurEffect:Destroy()
		blurEffect = false
	end
	InfoFrame.Visible = false
end -- exitInfoGui

local function moveModelForViewport(model)
	-- Performed only to reset model orientation, position does not matter
	model:MoveTo(MODEL_POSITION)

	-- Set position so that all models have the same orientation and position
	model.PrimaryPart = model:FindFirstChild("Body")
	if model.PrimaryPart then
		model:SetPrimaryPartCFrame(MODEL_CFRAME)
	end
end -- moveModelForViewport()

local function highlightViewport(viewport)
	for _, child in ipairs(Container:GetChildren()) do
		if child:IsA("ViewportFrame") then
			if child == viewport then
				child.BorderColor3 = Color3.new(15/255, 128/255, 255/255)
			else
				child.BorderColor3 = Color3.new(1, 1, 1)
			end
		end
	end
end

local function unselectButtons()
	local viewports = Container:GetChildren()

	for _, viewport in ipairs(viewports) do
		if viewport:IsA("ViewportFrame") then
			local button = viewport:FindFirstChild("Button")
			if button ~= nil then
				button.Image = "rbxassetid://4079511969"
			end
		end
	end
end -- unselectButton()

local function clearSelected()
	highlightViewport(nil)

	Selected:FindFirstChild("Garage").Value = nil

	local selectedModels = Selected:GetChildren()
	for _, child in ipairs(selectedModels) do
		if child:IsA("Model") then
			child:Destroy()
		end
	end

	SelectedName.Text = ""
end -- clearSelected()

local function exit()
	if InfoFrame.Visible == true then return end

	SelectionFrame.Visible = false

	unselectButtons()
	highlightViewport(nil)
	clearSelected()

	SelectedMode.Value = ""
end -- exit()

local function exitSpeeder()
	ContextActionService:UnbindAction("ExitSpeeder")
	RemoveActivePlayer:FireServer()

	local raceStatus = RaceManager:GetRaceStatus()
	if not TopBar.Enabled or (raceStatus ~= RaceManager.Status.WaitingForPlayers and
		raceStatus ~= RaceManager.Status.WaitingForRaceToStart) then
		PlayerConverter:SpeederToPlayer()
	end
end -- exit()

local function makeSelection()
	-- Get selection
	local selection = Selected:FindFirstChild("Garage").Value
	if not selection then return end

	-- Act according to selected game mode
	if SelectedMode.Value == "FreeFlight" then
		PlayerConverter:PlayerToSpeeder(selection)
	elseif SelectedMode.Value == "Racing" then
		-- Add player to ActivePlayer of PlayerManager for the RaceModules
		AddActivePlayer:FireServer(selection)

		-- Show racing GUIs
		local PlayerGui = player.PlayerGui
		local TopBar = PlayerGui:FindFirstChild("TopBar")
		TopBar.Enabled = true
	end

	-- Keybinding to exit
	ContextActionService:BindAction("ExitSpeeder", exitSpeeder, false, KEY1)

	-- Close window
	exit()
end -- makeSelection()

local function populateList(folder)
	local count = 0

	for index, item in ipairs(folder:GetChildren()) do
		if item:IsA("Model") then
			count = count + 1

			-- List is populated with ViewportFrames displaying the folder's models
			local viewport = Instance.new("ViewportFrame")
			viewport.Name = tostring(count)
			viewport.Parent = Container
			viewport.LayoutOrder = 5
			viewport.ZIndex = 2
			viewport.BackgroundTransparency = 1
			viewport.ClipsDescendants = true

			-- Create camera for ViewportFrame
			local camera = Instance.new("Camera")
			camera.Parent = viewport
			camera.FieldOfView = 30
			viewport.CurrentCamera = camera

			-- Point to (server-side) model
			local newGarageModel = Instance.new("ObjectValue")
			newGarageModel.Parent = viewport
			newGarageModel.Name = "Garage"
			newGarageModel.Value = item

			-- Clone model and part it to the ViewportFrame
			local newItem = item:clone()
			newItem.Parent = viewport

			-- Move model so that all model viewports are from the same angle
			moveModelForViewport(newItem)

			local primary = newItem.PrimaryPart
			local primarySize = primary.Size

			-- Adjust camera to look at the model
			local cameraPosition = primary.Position + Vector3.new(0, primarySize.Y + 10, -primarySize.Z*1.8)
			camera.CFrame = CFrame.new(cameraPosition, newItem.PrimaryPart.Position)

			-- Overlay viewport with a button
			local button = Instance.new("ImageButton")
			button.Name = "Button"
			button.Parent = viewport
			button.Size = UDim2.new(1,0,1,0)
			button.BackgroundTransparency = 1
			button.Image = "rbxassetid://4079511969"
			button.HoverImage = "rbxassetid://4079512099"
			button.PressedImage = "rbxassetid://4079512099"
			button.Activated:Connect(function()
				local selection = Selected:FindFirstChild(SelectedName.Text)
				local garageModel = Selected:FindFirstChild("Garage")
				clearSelected()

				unselectButtons()
				button.Image = "rbxassetid://4079512099"

				garageModel.Value = newGarageModel.Value

				local selectedItem = newItem:clone()
				selectedItem.Parent = Selected

				SelectedName.Text = string.upper(selectedItem.Name)

				local primary = selectedItem.PrimaryPart
				local primarySize = primary.Size

				local cameraPosition = newItem.PrimaryPart.Position + Vector3.new(0, primarySize.Y + 15, -primarySize.Z*1.8)
				SelectedCamera.CFrame = CFrame.new(cameraPosition, newItem.PrimaryPart.Position)
			end)
		end

		-- Scale ScrollingFrame to fit list
		Container.CanvasSize = UDim2.new(1*math.ceil(count/6), 0, 0, 0)
		UIGridLayout.CellSize = UDim2.new((1/3)/math.ceil(count/6), -4, 0.5, -2)
	end
end -- populateList()


Prompt: -- Expanding the blood part size function

Response:
local expandBlood = function(part)

    local randomIncrement = math.random(5, 10) / 10

    local tween = tweenPartSize(part, 5, Enum.EasingDirection.Out, Vector3.new(part.Size.X + randomIncrement, 0.1, part.Size.Z + randomIncrement))

    spawn(function()
        tween.Completed:Wait()
        tween:Destroy()
    end)
end


Prompt: -- Função para mover o NPC para uma posição aleatória

Response:
function moveToRandomPosition()
	local x = math.random(-100, 100)
	local y = 0
	local z = math.random(-100, 100)
	local position = Vector3.new(x, y, z)
	humanoid:MoveTo(position)
end


Prompt:
-- [[ Dummiez's Data Store Score Board ]]
-- This script updates the Data store with the values from the remote function.

Response:
wait(1)

local score = game:GetService("DataStoreService"):GetOrderedDataStore(script.DataStore.Value)

function script.UploadScore.OnServerInvoke(player)
	print("working")
	local inv = player:FindFirstChild(script.Original.Value)
	local storedValue = inv:FindFirstChild(script.Score.Value).Value ~= 0 and math.floor(math.log(inv:FindFirstChild(script.Score.Value).Value) / math.log(1.0000001)) or 0
	score:SetAsync(player.Name,storedValue)
	--score:SetAsync(player.Name, inv:FindFirstChild(script.Score.Value).Value)
	print("worked")
end


Prompt: --	local hit, position = workspace:FindPartOnRayWithIgnoreList(ray, ignoreList)

Response:
	local hit, position = workspace:FindPartOnRay(ray, parts.Parent);

	if hit then -- Leaderboard Supported
		if hit.Parent:IsA("Model") then
			local player = game.Players:GetPlayerFromCharacter(hit.Parent);
			local DriverKOs = script.Parent.Parent.Parent.leaderstats:findFirstChild("KOs")
			local humanoid = hit.Parent:findFirstChild("Humanoid");
			print("XD")
			if player and humanoid then
				if player.TeamColor ~= parts.Parent.Tank.Value then --Not a teammate
					if humanoid.Health >0 then
						humanoid:takeDamage(MGDamage);
						if humanoid.Health <=0 then
							DriverKOs.Value = DriverKOs.Value + 1
						end
					end
				end
			end

		end
	end

	local distance = (position - machineGun.Position).magnitude;

	local rayPart	= rayPart:clone();
	rayPart.Size	= Vector3.new(.2, distance, .2);
	rayPart.CFrame	= CFrame.new(position, machineGun.Position)
						* CFrame.new(0, 0, -distance/2)
						* CFrame.Angles(math.rad(90),0,0);
	rayPart.Parent	= workspace;
	game.Debris:AddItem(rayPart, .03)
	game.Debris:AddItem(PL, .03)

	local MGFlash =	parts.Parent.Gun.Coax.GUI:clone()
	MGFlash.Flash.Rotation = math.random(0,360)
	MGFlash.Parent = parts.Parent.Gun.Coax
   	MGFlash.Enabled = true
	game.Debris:AddItem(MGFlash,.01)

	wait();

	wait();

	return true;
end


Response:
game.Workspace.audiencebackleft1.Part1.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackleft1.Part2.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackleft1.Part3.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackleft1.Part4.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackleft1.Part5.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackleft1.Part6.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackleft1.Part7.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackleft1.Part8.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackleft1.Part9.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)

game.Workspace.audiencebackright1.Part1.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackright1.Part2.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackright1.Part3.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackright1.Part4.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackright1.Part5.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackright1.Part6.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackright1.Part7.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackright1.Part8.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.audiencebackright1.Part9.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)

game.Workspace.post1.Light.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.post2.Light.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)

game.Workspace.sidesquares.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.sidesquares.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.sidesquares.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.sidesquares.l31.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)

game.Workspace.sidesquares.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.sidesquares.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.sidesquares.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.sidesquares.l34.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)

game.Workspace.sidesquares.l14.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.sidesquares.l15.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.sidesquares.l24.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.sidesquares.l25.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.sidesquares.l35.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)

end
wait(0.25)

until game.Workspace.DoorFlashing.Value == false

end

end
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)


Prompt: -- Map storing Player -> Blocked user Ids.

Response:
local BlockedUserIdsMap = {}

PlayersService.PlayerAdded:connect(function(newPlayer)
	for player, blockedUsers in pairs(BlockedUserIdsMap) do
		local speaker = ChatService:GetSpeaker(player.Name)
		if speaker then
			for i = 1, #blockedUsers do
				local blockedUserId = blockedUsers[i]
				if blockedUserId == newPlayer.UserId then
					speaker:AddMutedSpeaker(newPlayer.Name)
				end
			end
		end
	end
end)

PlayersService.PlayerRemoving:connect(function(removingPlayer)
	BlockedUserIdsMap[removingPlayer] = nil
end)

EventFolder.SetBlockedUserIdsRequest.OnServerEvent:connect(function(player, blockedUserIdsList)
	BlockedUserIdsMap[player] = blockedUserIdsList
	local speaker = ChatService:GetSpeaker(player.Name)
	if speaker then
		for i = 1, #blockedUserIdsList do
			local blockedPlayer = PlayersService:GetPlayerByUserId(blockedUserIdsList[i])
			if blockedPlayer then
				speaker:AddMutedSpeaker(blockedPlayer.Name)
			end
		end
	end
end)

EventFolder.GetInitDataRequest.OnServerInvoke = (function(playerObj)
	local speaker = ChatService:GetSpeaker(playerObj.Name)
	if not (speaker and speaker:GetPlayer()) then
		CreatePlayerSpeakerObject(playerObj)
		speaker = ChatService:GetSpeaker(playerObj.Name)
	end

	local data = {}
	data.Channels = {}
	data.SpeakerExtraData = {}

	for i, channelName in pairs(speaker:GetChannelList()) do
		local channelObj = ChatService:GetChannel(channelName)
		if (channelObj) then
			local channelData =
			{
				channelName,
				channelObj:GetWelcomeMessageForSpeaker(speaker),
				channelObj:GetHistoryLogForSpeaker(speaker),
				channelObj.ChannelNameColor,
			}

			table.insert(data.Channels, channelData)
		end
	end

	for i, oSpeakerName in pairs(ChatService:GetSpeakerList()) do
		local oSpeaker = ChatService:GetSpeaker(oSpeakerName)
		data.SpeakerExtraData[oSpeakerName] = oSpeaker.ExtraData
	end

	return data
end)

local function DoJoinCommand(speakerName, channelName, fromChannelName)
	local speaker = ChatService:GetSpeaker(speakerName)
	local channel = ChatService:GetChannel(channelName)

	if (speaker) then
		if (channel) then
			if (channel.Joinable) then
				if (not speaker:IsInChannel(channel.Name)) then
					speaker:JoinChannel(channel.Name)
				else
					speaker:SetMainChannel(channel.Name)
					speaker:SendSystemMessage(
						string.gsub(
							ChatLocalization:Get(
								"GameChat_SwitchChannel_NowInChannel",
								string.format("You are now chatting in channel: '%s'", channel.Name)
							),
						"{RBX_NAME}",channel.Name),
						channel.Name
					)
				end
			else
				speaker:SendSystemMessage(
					string.gsub(
						ChatLocalization:Get(
							"GameChat_ChatServiceRunner_YouCannotJoinChannel",
							("You cannot join channel '" .. channelName .. "'.")
						),
					"{RBX_NAME}",channelName),
					fromChannelName
				)
			end
		else
			speaker:SendSystemMessage(
				string.gsub(
					ChatLocalization:Get(
						"GameChat_ChatServiceRunner_ChannelDoesNotExist",
						("Channel '" .. channelName .. "' does not exist.")
					),
				"{RBX_NAME}",channelName),
				fromChannelName
			)
		end
	end
end

local function DoLeaveCommand(speakerName, channelName, fromChannelName)
	local speaker = ChatService:GetSpeaker(speakerName)
	local channel = ChatService:GetChannel(channelName)

	if (speaker) then
		if (speaker:IsInChannel(channelName)) then
			if (channel.Leavable) then
				speaker:LeaveChannel(channel.Name)
				speaker:SendSystemMessage(
					string.gsub(
						ChatLocalization:Get(
							"GameChat_ChatService_YouHaveLeftChannel",
							string.format("You have left channel '%s'", channelName)
						),
					"{RBX_NAME}",channel.Name),
					"System"
				)
			else
				speaker:SendSystemMessage(
					string.gsub(
						ChatLocalization:Get(
							"GameChat_ChatServiceRunner_YouCannotLeaveChannel",
							("You cannot leave channel '" .. channelName .. "'.")
						),
					"{RBX_NAME}",channelName),
					fromChannelName
				)
			end
		else
			speaker:SendSystemMessage(
				string.gsub(
					ChatLocalization:Get(
						"GameChat_ChatServiceRunner_YouAreNotInChannel",
						("You are not in channel '" .. channelName .. "'.")
					),
				"{RBX_NAME}",channelName),
				fromChannelName
			)
		end
	end
end

ChatService:RegisterProcessCommandsFunction("default_commands", function(fromSpeaker, message, channel)
	if (string.sub(message, 1, 6):lower() == "/join ") then
		DoJoinCommand(fromSpeaker, string.sub(message, 7), channel)
		return true
	elseif (string.sub(message, 1, 3):lower() == "/j ") then
		DoJoinCommand(fromSpeaker, string.sub(message, 4), channel)
		return true

	elseif (string.sub(message, 1, 7):lower() == "/leave ") then
		DoLeaveCommand(fromSpeaker, string.sub(message, 8), channel)
		return true
	elseif (string.sub(message, 1, 3):lower() == "/l ") then
		DoLeaveCommand(fromSpeaker, string.sub(message, 4), channel)
		return true

	elseif (string.sub(message, 1, 3) == "/e " or string.sub(message, 1, 7) == "/emote ") then
		-- Just don't show these in the chatlog. The animation script listens on these.
		return true

	end

	return false
end)

if ChatSettings.GeneralChannelName and ChatSettings.GeneralChannelName ~= "" then
	local allChannel = ChatService:AddChannel(ChatSettings.GeneralChannelName)

	allChannel.Leavable = false
	allChannel.AutoJoin = true

	allChannel:RegisterGetWelcomeMessageFunction(function(speaker)
		if RunService:IsStudio() then
			return nil
		end
		local player = speaker:GetPlayer()
		if player then
			local success, canChat = pcall(function()
				return Chat:CanUserChatAsync(player.UserId)
			end)
			if success and not canChat then
				return ""
			end
		end
	end)
end

local systemChannel = ChatService:AddChannel("System")
systemChannel.Leavable = false
systemChannel.AutoJoin = true
systemChannel.WelcomeMessage = ChatLocalization:Get("GameChat_ChatServiceRunner_SystemChannelWelcomeMessage","This channel is for system and game notifications.")

systemChannel.SpeakerJoined:connect(function(speakerName)
	systemChannel:MuteSpeaker(speakerName)
end)

local function TryRunModule(module)
	if module:IsA("ModuleScript") then
		local ret = require(module)
		if (type(ret) == "function") then
			ret(ChatService)
		end
	end
end

local modules = game:GetService("Chat"):WaitForChild("ChatModules")
modules.ChildAdded:connect(function(child)
	local success, returnval = pcall(TryRunModule, child)
	if not success and returnval then
		print("Error running module " ..child.Name.. ": " ..returnval)
	end
end)

for i, module in pairs(modules:GetChildren()) do
	local success, returnval = pcall(TryRunModule, module)
	if not success and returnval then
		print("Error running module " ..module.Name.. ": " ..returnval)
	end
end

local Players = game:GetService("Players")
Players.PlayerRemoving:connect(function(playerObj)
	if (ChatService:GetSpeaker(playerObj.Name)) then
		ChatService:RemoveSpeaker(playerObj.Name)
	end
end)


Prompt: ---- Initialization ----

Response:
Wave.Enable(true)
Wave.SetSetting("Debug", true)


Prompt:
-- local PIPE = "|"
-- local REPEATABLE_HEADING = ("(%s%s)*"):format(PIPE, HEADING)
-- local HEADINGS_FORMAT = START_OF_LINE .. NEWLINE .. HEADING .. REPEATABLE_HEADING .. NEWLIN

Response:
local END_OF_LINE = "$"
local HEADINGS_FORMAT = START_OF_LINE .. HEADING .. END_OF_LINE


Prompt: -- Create and configure the fire

Response:
local function createFire()
	local fire = Instance.new("Fire")
	fire.Enabled = false
	fire.Size = 10
	return fire
end


Prompt: --[[Weight and CG]]

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

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

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


Prompt: --[[Sword Part Class]]

Response:
--

local SwordPart =
{
	Damage = 15,
	AttackTime = 1,
	CoolDown = 1,

	LastSwing = 0,
	LastHit = 0,

	Part= nil,
	Owner = nil,--player object that owns this sword

	OnHit = nil,
	OnHitHumanoid = nil,
	OnAttackReady = nil,
	OnAttack = nil,

	SwingSound = nil,
	HitSound = nil,
	SwingAnimation = nil, --animation track!

	ActiveConnections = {},

}
do
	UTIL.MakeClass(SwordPart)
	function SwordPart.New(npart,nowner)
		local init= UTIL.DeepCopy(SwordPart)
		init.Part= npart
		init.Owner = nowner
		table.insert(init.ActiveConnections,init.Part.Touched:connect(function(hit) init:SwordTouch(hit) end))

		init.OnHit = InternalEvent.New()
		init.OnHitHumanoid = InternalEvent.New()
		init.OnAttackReady = InternalEvent.New()
		init.OnAttack = InternalEvent.New()

		return init
	end

	function SwordPart:SwordTouch(hit)
		if tick()-self.LastSwing >self.AttackTime or tick()-self.LastHit<self.AttackTime then return end
		self.OnHit:Fire(hit)
		local character,humanoid = UTIL.FindCharacterAncestor(hit)
		if character and character ~= self.Owner.Character then
			humanoid:TakeDamage(self.Damage)
			self.OnHitHumanoid:Fire(humanoid,hit)
			self.LastHit = tick()
			if self.HitSound then
				self.HitSound:Play()
			end
		end

	end

	function SwordPart:DoSwing()
		if tick()-self.LastSwing<self.AttackTime+self.CoolDown then
			return
		end

		if self.SwingAnimation then
			self.SwingAnimation:Play()
		end
		if self.SwingSound then
			self.SwingSound:Play()
		end
		self.LastSwing = tick()
		self.OnAttack:Fire()
	end

	function SwordPart:Destroy()
		for _,i in pairs(self.ActiveConnections) do
			i:disconnect()
		end
	end
end
do
	local Handle = script.Parent
	local Tool = Handle.Parent

	local Player = game.Players.LocalPlayer
	local Character = UTIL.WaitForValidCharacter(Player)
	local SwingAni = UTIL.Instantiate"Animation"
	{AnimationId = "http://www.roblox.com/Asset?ID=89289879"}

	local HitSound = Handle:WaitForChild('Hit')
	local SwingSound = Handle:WaitForChild('Swing')

	local SwingAniTrack

	local Sword

	Tool.Equipped:connect(function(mouse)
		Sword = SwordPart.New(Handle,Player)
		Sword.Damage = 15
		Sword.HitSound = HitSound
		Sword.SwingSound = SwingSound
		Character = UTIL.WaitForValidCharacter(Player)
		local Humanoid = Character:FindFirstChild('Humanoid')

		SwingAniTrack = Humanoid:LoadAnimation(SwingAni)
		Sword.SwingAnimation = SwingAniTrack

		Sword.OnHitHumanoid:Connect(function(humanoid,hit)
			local myTorso = Character:FindFirstChild('Torso')
			local torso = humanoid.Parent:FindFirstChild('Torso')
			if not torso or not myTorso then return end

			if hit.Name=='Right Arm' or hit.Name=='Left Arm' or hit.Name=='Right Leg' or hit.Name=='Left Leg' then
				hit:WeldJoints()
				WeldUtil.WeldBetween(hit, Handle)
				delay(1,function() hit:WeldJoints() end )
			end
		end)

		mouse.Button1Down:connect(function()
			Sword:DoSwing()
		end)
	end)
	Tool.Unequipped:connect(function()
		Sword:Destroy()
	end)

end


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

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

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


Prompt:
-- ROBLOX upstream: https://github.com/facebook/jest/blob/v27.4.7/packages/pretty-format/src/plugins/lib/escapeHTML.ts
--[[*
 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 ]]

Response:
local exports = {}
local function escapeHTML(str: string): string
	return str:gsub("<", "<"):gsub(">", ">")
end
exports.default = escapeHTML
return exports


Response:
script.Sound:Play()
print("BOOM!!")
game.Lighting.Brightness = 2
wait(2.2)
game.Lighting.Brightness = 1
wait(0.3)
game.Lighting.Brightness = 2
wait(2)
game.Lighting.Brightness = 1
wait(10)
end