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

Response:
client = nil;
service = nil;
cPcall = nil;
Pcall = nil;
Routine = nil;
GetEnv = nil;
origEnv = nil;
logError = nil;
return function()
	local u1 = nil;
	local l__client__2 = client;
	local u3 = nil;
	local u4 = nil;
	local u5 = nil;
	local u6 = nil;
	local u7 = nil;
	local u8 = nil;
	getfenv().client = nil;
	getfenv().service = nil;
	getfenv().script = nil;
	local v1 = {
		Init = function()
			u1 = l__client__2.UI;
			u3 = l__client__2.Anti;
			u4 = l__client__2.Core;
			u5 = l__client__2.Variables;
			u6 = l__client__2.Functions;
			u7 = l__client__2.Process;
			u8 = l__client__2.Remote;
		end,
		Returns = {},
		PendingReturns = {},
		EncodeCache = {},
		DecodeCache = {},
		Received = 0,
		Sent = 0
	};
	local v2 = {};
	local l__unpack__9 = unpack;
	function v2.Test(p1)
		return "HELLO FROM THE CLIENT SIDE :)! ", l__unpack__9(p1);
	end;
	function v2.Ping(p2)
		return u8.Ping();
	end;
	function v2.ClientHooked(p3)
		return u4.Special;
	end;
	local l__next__10 = next;
	local l__service__11 = service;
	local l__os__12 = os;
	local l__tostring__13 = tostring;
	local l__table__14 = table;
	function v2.TaskManager(p4)
		if p4[1] ~= "GetTasks" then
			return;
		end;
		local v3 = {};
		local v4, v5 = l__service__11.GetTasks();
		while true do
			local v6, v7 = l__next__10(v4, v5);
			if not v6 then
				break;
			end;
			v5 = v6;
			l__table__14.insert(v3, {
				Status = v7.Status,
				Name = v7.Name,
				Index = v7.Index,
				Created = v7.Created,
				CurrentTime = l__os__12.time(),
				Function = l__tostring__13(v7.Function)
			});
		end;
		return v3;
	end;
	function v2.LoadCode(p5)
		local v8 = u4.LoadCode(p5[1], GetEnv());
		if not v8 then
			return;
		end;
		return v8();
	end;
	local l__type__15 = type;
	function v2.Function(p6)
		local v9 = l__client__2.Functions[p6[1]];
		if not v9 or l__type__15(v9) ~= "function" then
			return;
		end;
		return v9(l__unpack__9(p6, 2));
	end;
	function v2.Handler(p7)
		local v10 = l__client__2.Handlers[p7[1]];
		if not v10 or l__type__15(v10) ~= "function" then
			return;
		end;
		return v10(l__unpack__9(p7, 2));
	end;
	function v2.UIKeepAlive(p8)
		if u5.UIKeepAlive then
			for v11, v12 in l__next__10, l__client__2.GUIs do
				if v12.KeepAlive then
					if v12.Class == "ScreenGui" or v12.Class == "GuiMain" then
						v12.Object.Parent = l__service__11.Player.PlayerGui;
					elseif v12.Class == "TextLabel" then
						v12.Object.Parent = u1.GetHolder();
					end;
					v12.KeepAlive = false;
				end;
			end;
		end;
		return true;
	end;
	function v2.UI(p9)
		return u1.Make(p9[1], p9[3], p9[2]);
	end;
	function v2.InstanceList(p10)
		local v13 = {};
		for v14, v15 in l__next__10, l__service__11.GetAdonisObjects() do
			l__table__14.insert(v13, {
				Text = v15:GetFullName(),
				Desc = v15.ClassName
			});
		end;
		return v13;
	end;
	local l__Enum__16 = Enum;
	local l__Color3__17 = Color3;
	function v2.ClientLog(p11)
		local u18 = {};
		local function v16(p12, p13, p14)
			local v17, v18 = l__service__11.ExtractLines(p12);
			while true do
				local v19, v20 = l__next__10(v17, v18);
				if not v19 then
					break;
				end;
				v18 = v19;
				l__table__14.insert(u18, {
					Text = v20,
					Desc = p13 .. v20,
					Color = p14
				});
			end;
		end;
		local v21, v22 = l__service__11.LogService:GetLogHistory();
		while true do
			local v23, v24 = l__next__10(v21, v22);
			if not v23 then
				break;
			end;
			v22 = v23;
			if v24.messageType == l__Enum__16.MessageType.MessageOutput then
				v16(v24.message, "Output: ");
			elseif v24.messageType == l__Enum__16.MessageType.MessageWarning then
				v16(v24.message, "Warning: ", l__Color3__17.new(1, 1, 0));
			elseif v24.messageType == l__Enum__16.MessageType.MessageInfo then
				v16(v24.message, "Info: ", l__Color3__17.new(0, 0, 1));
			elseif v24.messageType == l__Enum__16.MessageType.MessageError then
				v16(v24.message, "Error: ", l__Color3__17.new(1, 0, 0));
			end;
		end;
		return u18;
	end;
	v1.Returnables = v2;
	local v25 = {};
	local l__print__19 = print;
	local l__wait__20 = wait;
	function v25.LightingChange(p15, p16)
		l__print__19(p15, "TICKLE ME!?");
		u5.LightingChanged = true;
		l__service__11.Lighting[p15] = p16;
		u3.LastChanges.Lighting = p15;
		l__wait__20(0.1);
		u5.LightingChanged = false;
		l__print__19("TICKLED :)", u5.LightingChanged);
		if u3.LastChanges.Lighting == p15 then
			u3.LastChanges.Lighting = nil;
		end;
	end;
	v1.UnEncrypted = v25;
	local v26 = {};
	local l__pcall__21 = pcall;
	function v26.GetReturn(p17)
		l__print__19("THE SERVER IS ASKING US FOR A RETURN");
		local v27 = p17[2];
		local v28 = { l__unpack__9(p17, 3) };
		local v29 = u8.Returnables[p17[1]];
		if v29 then
			local v30 = { l__pcall__21(v29, v28) } or {};
		else
			v30 = {};
		end;
		if v30[1] == true then
			l__print__19("SENT RETURN");
			u8.Send("GiveReturn", v27, l__unpack__9(v30, 2));
			return;
		end;
		logError(v30[2]);
		u8.Send("GiveReturn", v27, "__ADONIS_RETURN_ERROR", v30[2]);
	end;
	function v26.GiveReturn(p18)
		l__print__19("SERVER GAVE US A RETURN");
		if u8.PendingReturns[p18[1]] then
			l__print__19("VALID PENDING RETURN");
			u8.PendingReturns[p18[1]] = nil;
			l__service__11.Events[p18[1]]:fire(l__unpack__9(p18, 2));
		end;
	end;
	function v26.SetVariables(p19)
		for v31, v32 in l__next__10, p19[1] do
			u5[v31] = v32;
		end;
	end;
	function v26.Print(p20)
		l__print__19(l__unpack__9(p20));
	end;
	function v26.FireEvent(p21)
		l__service__11.FireEvent(l__unpack__9(p21));
	end;
	function v26.Test(p22)
		l__print__19("OK WE GOT COMMUNICATION!  ORGL: " .. l__tostring__13(p22[1]));
	end;
	local l__error__22 = error;
	function v26.TestError(p23)
		l__error__22("THIS IS A TEST ERROR");
	end;
	function v26.TestEvent(p24)
		u8.PlayerEvent(p24[1], l__unpack__9(p24, 2));
	end;
	function v26.LoadCode(p25)
		local v33 = u4.LoadCode(p25[1], GetEnv());
		if not v33 then
			return;
		end;
		return v33();
	end;
	function v26.LaunchAnti(p26)
		u3.Launch(p26[1], p26[2]);
	end;
	function v26.UI(p27)
		u1.Make(p27[1], p27[3], p27[2]);
	end;
	function v26.RemoveUI(p28)
		u1.Remove(p28[1], p28[2]);
	end;
	function v26.StartLoop(p29)
		local v34 = p29[1];
		local v35 = p29[2];
		local v36 = p29[3];
		local v37 = u4.LoadCode(v36, GetEnv());
		if v34 and v35 and v36 and v37 then
			l__service__11.StartLoop(v34, v35, v37);
		end;
	end;
	function v26.StopLoop(p30)
		l__service__11.StopLoop(p30[1]);
	end;
	function v26.Function(p31)
		local v38 = l__client__2.Functions[p31[1]];
		if v38 and l__type__15(v38) == "function" then
			Pcall(v38, l__unpack__9(p31, 2));
		end;
	end;
	function v26.Handler(p32)
		local v39 = l__client__2.Handlers[p32[1]];
		if v39 and l__type__15(v39) == "function" then
			Pcall(v39, l__unpack__9(p32, 2));
		end;
	end;
	v1.Commands = v26;
	function v1.Fire(...)
		local l__RateLimits__40 = u7.RateLimits;
		local l__RemoteEvent__41 = u4.RemoteEvent;
		if l__RemoteEvent__41 and l__RemoteEvent__41.Object then
			local u23 = { ... };
			local u24 = l__RateLimits__40 and l__RateLimits__40.Remote or 0.01;
			l__service__11.Queue("REMOTE_SEND", function()
				u8.Sent = u8.Sent + 1;
				l__RemoteEvent__41.Object:FireServer({
					Mode = "Fire",
					Module = l__client__2.Module,
					Loader = l__client__2.Loader,
					Sent = u8.Sent,
					Received = u8.Received
				}, l__unpack__9(u23));
				l__wait__20(u24);
			end);
		end;
	end;
	local l__tick__25 = tick;
	function v1.Send(p33, ...)
		u4.LastUpdate = l__tick__25();
		u8.Fire(u8.Encrypt(p33, u4.Key), ...);
	end;
	function v1.GetFire(...)
		local l__RemoteEvent__42 = u4.RemoteEvent;
		local l__RateLimits__43 = u7.RateLimits;
		if l__RemoteEvent__42 and l__RemoteEvent__42.Function then
			local u26 = nil;
			local u27 = { ... };
			local u28 = l__service__11.New("BindableEvent");
			local u29 = l__RateLimits__43 and l__RateLimits__43.Remote or 0.02;
			l__service__11.Queue("REMOTE_SEND", function()
				u8.Sent = u8.Sent + 1;
				spawn(function()
					u26 = { l__RemoteEvent__42.Function:InvokeServer({
							Mode = "Get",
							Module = l__client__2.Module,
							Loader = l__client__2.Loader,
							Sent = u8.Sent,
							Received = u8.Received
						}, l__unpack__9(u27)) };
					u28:Fire();
				end);
				l__wait__20(u29);
			end);
			if not u26 then
				u28.Event:Wait();
				u28:Destroy();
			end;
			if u26 then
				return l__unpack__9(u26);
			end;
		end;
	end;
	function v1.Get(p34, ...)
		u4.LastUpdate = l__tick__25();
		local v44 = u8.GetFire(u8.Encrypt(p34, u4.Key), ...);
		if l__type__15(v44) ~= "table" then
			return v44;
		end;
		return l__unpack__9(v44);
	end;
	local l__string__30 = string;
	function v1.OldGet(p35, ...)
		local v45 = u6:GetRandom();
		local u31 = nil;
		local u32 = l__service__11.New("BindableEvent");
		local v46 = l__service__11.Events[v45]:Connect(function(...)
			l__print__19("WE ARE GETTING A RETURN!");
			u31 = { ... };
			u32:Fire();
			l__wait__20();
			u32:Fire();
			u32:Destroy();
		end);
		u8.PendingReturns[v45] = true;
		u8.Send("GetReturn", p35, v45, ...);
		l__print__19(l__string__30.format("GETTING RETURNS? %s", l__tostring__13(u31)));
		u32.Event:Wait();
		l__print__19(l__string__30.format("WE GOT IT! %s", l__tostring__13(u31)));
		v46:Disconnect();
		if not u31 then
			return nil;
		end;
		if u31[1] ~= "__ADONIS_RETURN_ERROR" then
			return l__unpack__9(u31);
		end;
		l__error__22(u31[2]);
	end;
	local l__math__33 = math;
	function v1.Ping()
		if not u8.Get("Ping") then
			return false;
		end;
		return l__math__33.floor((l__tick__25() - l__tick__25()) * 1000 + 0.5) / 1000 * 100;
	end;
	function v1.PlayerEvent(p36, ...)
		u8.Send("PlayerEvent", p36, ...);
	end;
	function v1.Encrypt(p37, p38, p39)
		local v47 = p39 or (u8.EncodeCache or {});
		if not p38 or not p37 then
			return p37;
		end;
		if v47[p38] and v47[p38][p37] then
			return v47[p38][p37];
		end;
		local v48 = v47[p38] or {};
		local l__byte__49 = l__string__30.byte;
		local l__abs__50 = l__math__33.abs;
		local l__sub__51 = l__string__30.sub;
		local l__len__52 = l__string__30.len;
		local l__char__53 = l__string__30.char;
		local v54 = {};
		for v55 = 1, l__len__52(p37) do
			local v56 = v55 % l__len__52(p38) + 1;
			v54[v55] = l__string__30.char((l__byte__49(l__sub__51(p37, v55, v55)) + l__byte__49(l__sub__51(p38, v56, v56))) % 126 + 1);
		end;
		local v57 = l__table__14.concat(v54);
		v47[p38] = v48;
		v48[p37] = v57;
		return v57;
	end;
	function v1.Decrypt(p40, p41, p42)
		local v58 = p42 or (u8.DecodeCache or {});
		if not p41 or not p40 then
			return p40;
		end;
		if v58[p41] and v58[p41][p40] then
			return v58[p41][p40];
		end;
		local v59 = v58[p41] or {};
		local l__byte__60 = l__string__30.byte;
		local l__abs__61 = l__math__33.abs;
		local l__sub__62 = l__string__30.sub;
		local l__len__63 = l__string__30.len;
		local l__char__64 = l__string__30.char;
		local v65 = {};
		for v66 = 1, l__len__63(p40) do
			local v67 = v66 % l__len__63(p41) + 1;
			v65[v66] = l__string__30.char((l__byte__60(l__sub__62(p40, v66, v66)) - l__byte__60(l__sub__62(p41, v67, v67))) % 126 - 1);
		end;
		local v68 = l__table__14.concat(v65);
		v58[p41] = v59;
		v59[p40] = v68;
		return v68;
	end;
	l__client__2.Remote = v1;
end;


Prompt: --[[ Local Functions ]]

Response:
--
function MouseLockController:OnMouseLockToggled()
	self.isMouseLocked = not self.isMouseLocked

	if self.isMouseLocked then
		local cursorImageValueObj = script:FindFirstChild("CursorImage")
		if cursorImageValueObj and cursorImageValueObj:IsA("StringValue") and cursorImageValueObj.Value then
			self.savedMouseCursor = Mouse.Icon
			Mouse.Icon = cursorImageValueObj.Value
		else
			if cursorImageValueObj then
				cursorImageValueObj:Destroy()
			end
			cursorImageValueObj = Instance.new("StringValue")
			cursorImageValueObj.Name = "CursorImage"
			cursorImageValueObj.Value = DEFAULT_MOUSE_LOCK_CURSOR
			cursorImageValueObj.Parent = script
			self.savedMouseCursor = Mouse.Icon
			Mouse.Icon = DEFAULT_MOUSE_LOCK_CURSOR
		end
	else
		if self.savedMouseCursor then
			Mouse.Icon = self.savedMouseCursor
			self.savedMouseCursor = nil
		end
	end

	self.mouseLockToggledEvent:Fire()
end

function MouseLockController:DoMouseLockSwitch(name, state, input)
	if state == Enum.UserInputState.Begin then
		self:OnMouseLockToggled()
		return Enum.ContextActionResult.Sink
	end
	return Enum.ContextActionResult.Pass
end

function MouseLockController:BindContextActions()
	ContextActionService:BindActionAtPriority(CONTEXT_ACTION_NAME, function(name, state, input) return self:DoMouseLockSwitch(name, state, input) end,
		false, MOUSELOCK_ACTION_PRIORITY, unpack(self.boundKeys))
end

function MouseLockController:UnbindContextActions()
		ContextActionService:UnbindAction(CONTEXT_ACTION_NAME)
end

function MouseLockController:IsMouseLocked()
	return self.enabled and self.isMouseLocked
end

function MouseLockController:EnableMouseLock(enable)
	if enable~=self.enabled then

		self.enabled = enable

		if self.enabled then
			-- Enabling the mode
			self:BindContextActions()
		else
			-- Disabling
			-- Restore mouse cursor
			if Mouse.Icon~="" then
				Mouse.Icon = ""
			end

			self:UnbindContextActions()

			-- If the mode is disabled while being used, fire the event to toggle it off
			if self.isMouseLocked then
				self.mouseLockToggledEvent:Fire()
			end

			self.isMouseLocked = false
		end

	end
end

return MouseLockController


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

Response:
local u1 = nil;
coroutine.wrap(function()
	u1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
end)();
return function(p1, p2, p3, p4)
	p1 = p1 or 1;
	p2 = p2 or 1;
	p3 = p3 or Color3.new(1, 1, 1);
	p4 = p4 or 0;
	task.defer(function()
		local v1 = Instance.new("Frame");
		v1.BackgroundTransparency = 1;
		v1.BackgroundColor3 = p3;
		v1.Size = UDim2.new(2, 0, 2, 0);
		v1.AnchorPoint = Vector2.new(0.5, 0.5);
		v1.Position = UDim2.new(0.5, 0, 0.5, 0);
		v1.BorderSizePixel = 0;
		v1.Parent = u1.GFX.GetHolder();
		if p1 > 0 then
			u1.Functions.Tween(v1, { p1, 8, 1 }, {
				BackgroundTransparency = p4
			});
			task.wait(p1);
		else
			v1.BackgroundTransparency = p4;
		end;
		if p2 > 0 then
			u1.Functions.Tween(v1, { p2, 1, 1 }, {
				BackgroundTransparency = 1
			});
			task.wait(p2);
		else
			v1.BackgroundTransparency = 1;
		end;
		v1:Destroy();
	end);
end;


Prompt: --// Script

Response:
BUYB.MouseButton1Click:connect(function()
if Player.Cash.Value >= Price.Value then
	Player.Cash.Value = Player.Cash.Value - Price.Value
local weapon =game.ReplicatedStorage.Weapons[Frame.Name]:clone()
weapon.Parent = Player.Backpack
end
end)


Prompt:
-- This decides what to do if detection is 'Automatic'
-- This is placed in ZoneController instead of the Zone object due to the ZoneControllers all-knowing group-minded logic

Response:
function ZoneController.updateDetection(zone)
	local detectionTypes = {
		["enterDetection"] = "_currentEnterDetection",
		["exitDetection"] = "_currentExitDetection",
	}
	for detectionType, currentDetectionName in pairs(detectionTypes) do
		local detection = zone[detectionType]
		local combinedTotalVolume = Tracker.getCombinedTotalVolumes()
		if detection == enum.Detection.Automatic then
			if combinedTotalVolume > WHOLE_BODY_DETECTION_LIMIT then
				detection = enum.Detection.Centre
			else
				detection = enum.Detection.WholeBody
			end
		end
		zone[currentDetectionName] = detection
	end
end

function ZoneController._formHeartbeat(registeredTriggerType)
	local heartbeatConnection = heartbeatConnections[registeredTriggerType]
	if heartbeatConnection then return end
	-- This will only ever connect once per triggerType per server
	-- This means instead of initiating a loop per-zone we can handle everything within
	-- a singular connection. This is particularly beneficial for player/item-orinetated
	-- checking, where a check only needs to be cast once per interval, as apposed
	-- to every zone per interval
	-- I utilise heartbeat with os.clock() to provide precision (where needed) and flexibility
	local nextCheck = 0
	heartbeatConnection = heartbeat:Connect(function()
		local clockTime = os.clock()
		if clockTime >= nextCheck then
			local lowestAccuracy
			local lowestDetection
			for zone, _ in pairs(activeZones) do
				if zone.activeTriggers[registeredTriggerType] then
					local zAccuracy = zone.accuracy
					if lowestAccuracy == nil or zAccuracy < lowestAccuracy then
						lowestAccuracy = zAccuracy
					end
					ZoneController.updateDetection(zone)
					local zDetection = zone._currentEnterDetection
					if lowestDetection == nil or zDetection < lowestDetection then
						lowestDetection = zDetection
					end
				end
			end
			local highestAccuracy = lowestAccuracy
			local zonesAndOccupants = heartbeatActions[registeredTriggerType](lowestDetection)

			-- If a zone belongs to a settingsGroup with 'onlyEnterOnceExitedAll = true' , and the occupant already exists in a member group, then
			-- ignore all incoming occupants for the other zones (preventing the enteredSignal from being fired until the occupant has left
			-- all other zones within the same settingGroup)
			local occupantsToBlock = {}
			local zonesToPotentiallyIgnore = {}
			for zone, newOccupants in pairs(zonesAndOccupants) do
				local settingsGroup = (zone.settingsGroupName and ZoneController.getGroup(zone.settingsGroupName))
				if settingsGroup and settingsGroup.onlyEnterOnceExitedAll == true then
					--local currentOccupants = zone.occupants[registeredTriggerType]
					--if currentOccupants then
						for newOccupant, _ in pairs(newOccupants) do
							--if currentOccupants[newOccupant] then
								local groupDetail = occupantsToBlock[zone.settingsGroupName]
								if not groupDetail then
									groupDetail = {}
									occupantsToBlock[zone.settingsGroupName] = groupDetail
								end
								groupDetail[newOccupant] = zone
							--end
						end
						zonesToPotentiallyIgnore[zone] = newOccupants
					--end
				end
			end
			for zone, newOccupants in pairs(zonesToPotentiallyIgnore) do
				local groupDetail = occupantsToBlock[zone.settingsGroupName]
				if groupDetail then
					for newOccupant, _ in pairs(newOccupants) do
						local occupantToKeepZone = groupDetail[newOccupant]
						if occupantToKeepZone and occupantToKeepZone ~= zone then
							newOccupants[newOccupant] = nil
						end
					end
				end
			end

			-- This deduces what signals should be fired
			local collectiveSignalsToFire = {{}, {}}
			for zone, _ in pairs(activeZones) do
				if zone.activeTriggers[registeredTriggerType] then
					local zAccuracy = zone.accuracy
					local occupantsDict = zonesAndOccupants[zone] or {}
					local occupantsPresent = false
					for k,v in pairs(occupantsDict) do
						occupantsPresent = true
						break
					end
					if occupantsPresent and zAccuracy > highestAccuracy then
						highestAccuracy = zAccuracy
					end
					local signalsToFire = zone:_updateOccupants(registeredTriggerType, occupantsDict)
					collectiveSignalsToFire[1][zone] = signalsToFire.exited
					collectiveSignalsToFire[2][zone] = signalsToFire.entered
				end
			end

			-- This ensures all exited signals and called before entered signals
			local indexToSignalType = {"Exited", "Entered"}
			for index, zoneAndOccupants in pairs(collectiveSignalsToFire) do
				local signalType = indexToSignalType[index]
				local signalName = registeredTriggerType..signalType
				for zone, occupants in pairs(zoneAndOccupants) do
					local signal = zone[signalName]
					if signal then
						for _, occupant in pairs(occupants) do
							signal:Fire(occupant)
						end
					end
				end
			end

			local cooldown = enum.Accuracy.getProperty(highestAccuracy)
			nextCheck = clockTime + cooldown
		end
	end)
	heartbeatConnections[registeredTriggerType] = heartbeatConnection
end

function ZoneController._deregisterConnection(registeredZone, registeredTriggerType)
	activeConnections -= 1
	if activeTriggers[registeredTriggerType] == 1 then
		activeTriggers[registeredTriggerType] = nil
		local heartbeatConnection = heartbeatConnections[registeredTriggerType]
		if heartbeatConnection then
			heartbeatConnections[registeredTriggerType] = nil
			heartbeatConnection:Disconnect()
		end
	else
		activeTriggers[registeredTriggerType] -= 1
	end
	registeredZone.activeTriggers[registeredTriggerType] = nil
	if dictLength(registeredZone.activeTriggers) == 0 then
		activeZones[registeredZone] = nil
		ZoneController._updateZoneDetails()
	end
	if registeredZone.touchedConnectionActions[registeredTriggerType] then
		registeredZone:_disconnectTouchedConnection(registeredTriggerType)
	end
end

function ZoneController._updateZoneDetails()
	activeParts = {}
	activePartToZone = {}
	allParts = {}
	allPartToZone = {}
	activeZonesTotalVolume = 0
	for zone, _ in pairs(registeredZones) do
		local isActive = activeZones[zone]
		if isActive then
			activeZonesTotalVolume += zone.volume
		end
		for _, zonePart in pairs(zone.zoneParts) do
			if isActive then
				table.insert(activeParts, zonePart)
				activePartToZone[zonePart] = zone
			end
			table.insert(allParts, zonePart)
			allPartToZone[zonePart] = zone
		end
	end
end

function ZoneController._getZonesAndItems(trackerName, zonesDictToCheck, zoneCustomVolume, onlyActiveZones, recommendedDetection)
	local totalZoneVolume = zoneCustomVolume
	if not totalZoneVolume then
		for zone, _ in pairs(zonesDictToCheck) do
			totalZoneVolume += zone.volume
		end
	end
	local zonesAndOccupants = {}
	local tracker = trackers[trackerName]
	if tracker.totalVolume < totalZoneVolume then
		-- If the volume of all *characters/items* within the server is *less than* the total
		-- volume of all active zones (i.e. zones which listen for .playerEntered)
		-- then it's more efficient cast checks within each character and
		-- then determine the zones they belong to
		for _, item in pairs(tracker.items) do
			local touchingZones = ZoneController.getTouchingZones(item, onlyActiveZones, recommendedDetection, tracker)
			for _, zone in pairs(touchingZones) do
				if not onlyActiveZones or zone.activeTriggers[trackerName] then
					local finalItem = item
					if trackerName == "player" then
						finalItem = players:GetPlayerFromCharacter(item)
					end
					if finalItem then
						fillOccupants(zonesAndOccupants, zone, finalItem)
					end
				end
			end
		end
	else
		-- If the volume of all *active zones* within the server is *less than* the total
		-- volume of all characters/items, then it's more efficient to perform the
		-- checks directly within each zone to determine players inside
		for zone, _ in pairs(zonesDictToCheck) do
			if not onlyActiveZones or zone.activeTriggers[trackerName] then
				local result = CollectiveWorldModel:GetPartBoundsInBox(zone.region.CFrame, zone.region.Size, tracker.whitelistParams)
				local finalItemsDict = {}
				for _, itemOrChild in pairs(result) do
					local correspondingItem = tracker.partToItem[itemOrChild]
					if not finalItemsDict[correspondingItem] then
						finalItemsDict[correspondingItem] = true
					end
				end
				for item, _ in pairs(finalItemsDict) do
					if trackerName == "player" then
						local player = players:GetPlayerFromCharacter(item)
						if zone:findPlayer(player) then
							fillOccupants(zonesAndOccupants, zone, player)
						end
					elseif zone:findItem(item) then
						fillOccupants(zonesAndOccupants, zone, item)
					end
				end
			end
		end
	end
	return zonesAndOccupants
end


Prompt:
-- local CoverageWorkerModule = require(CurrentModule.CoverageWorker)
-- type worker = CoverageWorkerModule.worker

Response: type worker = any


Prompt:
--Made by Superluck, Uploaded by FederalSignal_QCB.
--Made by Superluck, Uploaded by FederalSignal_QCB.
--Made by Superluck, Uploaded by FederalSignal_QCB.

Response:
while true do
script.Parent.Parent.Parent.Sound.Sound.EmitterSize = 0
script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = 0
wait((math.random(600,672))/1000)
script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10
script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10
wait((math.random(600,672))/1000)
end


Prompt: --------------------[ STANCE FUNCTIONS ]----------------------------------------------

Response:
function Stand(OnDeselected)
	local LHip = Torso["Left Hip"]
	local RHip = Torso["Right Hip"]
	local Root = HRP.RootJoint
	Stance = 2
	if (not OnDeselected) then
		spawn(function()
			local PreviousOffset = Humanoid.CameraOffset
			local PreviousRootP = Root.C0.p
			for X = 0, 90, 1.5 / 0.25 do
				local Alpha = Sine(X)
				Humanoid.CameraOffset = PreviousOffset:lerp(StanceOffset[1], Alpha)
				Root.C0 = CF(PreviousRootP:lerp(VEC3(), Alpha)) * CFANG(RAD(-90), 0, RAD(180))
				RS:wait()
			end
		end)
		TweenJoint(ABWeld, CF(), CF(), Sine, 0.25)
		TweenJoint(LHip, CF(-1, -1, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0), Sine, 0.25)
		TweenJoint(RHip, CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0), Sine, 0.25)
	elseif OnDeselected then
		Humanoid.CameraOffset = StanceOffset[1]
		ABWeld.C0 = CF()
		ABWeld.C1 = CF()
		LHip.C0 = CF(-1, -1, 0) * CFANG(0, RAD(-90), 0)
		LHip.C1 = CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0)
		RHip.C0 = CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0)
		RHip.C1 = CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0)
		Root.C0 = CFANG(RAD(-90), 0, RAD(180))
	end
end

function Crouch()
	local LHip = Torso["Left Hip"]
	local RHip = Torso["Right Hip"]
	local Root = HRP.RootJoint
	Stance = 1
		spawn(function()
			local PreviousOffset = Humanoid.CameraOffset
			local PreviousRootP = Root.C0.p
			for X = 0, 90, 1.5 / 0.25 do
				if Stance ~= 1 then break end
				local Alpha = Sine(X)
				Humanoid.CameraOffset = PreviousOffset:lerp(StanceOffset[2], Alpha)
				Root.C0 = CF(PreviousRootP:lerp(VEC3(0, -1, 0), Alpha)) * CFANG(RAD(-90), 0, RAD(180))
				RS:wait()
			end
		end)
		TweenJoint(ABWeld, CF(0, 0, -1 / 16), CF(), Sine, 0.25)
		TweenJoint(LHip, CF(-1, -0.5, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 0.5, 1) * CFANG(0, RAD(-90), RAD(-90)), Sine, 0.25)
		TweenJoint(RHip, CF(1, -0.5, 0.25) * CFANG(RAD(-180), RAD(90), 0), CF(0.5, 0.5, 1) * CFANG(RAD(-180), RAD(90), 0), Sine, 0.25)
end


Prompt:
--12 hours : 360 degs
--1 hour : 30 degs
--60 mins : 30 degs
--1 min : 0.5 degs
--60 s : 0.5 degs
--1 s : 0.00833333333... degs

Response:
local chour, chmin, chsec = 0,0,0
local centerPoint = script.Parent.CenterPoint

local function TryUpdateHour(h, m, s)
	if chour ~= h or chmin ~= m or chsec ~= s then
		chour = h
		chmin = m
		chsec = s
		return true
	end
	return false
end

local function PlayBell()
	centerPoint.Bell:Play()
	centerPoint.BillboardGui.Enabled = true
	delay(11.2*3, function ()
		centerPoint.Bell:Stop()
		centerPoint.BillboardGui.Enabled = false
	end)
end

local function UpdatePointers()
	local hourhinge = centerPoint.HoursHinge
	local secshinge = centerPoint.SecsHinge
	local minshinge = centerPoint.MinsHinge
	secshinge.TargetAngle = chsec * 6
	minshinge.TargetAngle = chmin * 6
	hourhinge.TargetAngle = chour * 30

	if (chour == 12 or chour == 0) and (chmin == 0 and chsec == 0) then
		PlayBell()
	end
end

while wait()
do
	local now = os.time()
	local hours = os.date("*t",now)["hour"]
	local mins = os.date("*t",now)["min"]
	local secs = os.date("*t",now)["sec"]
	if TryUpdateHour(hours, mins, secs) then


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

Response:
debounce = true

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

script.Parent.Touched:connect(onTouched)


Prompt: -- Play sounds

Response:
for _, effect in pairs(EffectsToPlay:GetChildren()) do
	effect.Parent = effectPart
	if effect:IsA("Sound") then
		effect:Play()
	end
end

DebrisService:AddItem(effectPart,4)

RootModel:Destroy()


Prompt: -- local script inside a TextLabel

Response:
local player = game.Players.LocalPlayer
local goldValue = player.leaderstats.Gold
local textLabel = script.Parent

local function updateText()
	local gold = goldValue.Value
	if gold > 999 then
		if gold >= 1000000 then
			textLabel.Text = string.format("%.1fM", gold / 1000000)
		elseif gold >= 1000 then
			textLabel.Text = string.format("%.1fK", gold / 1000)
		end
	else
		textLabel.Text = tostring(gold)
	end
end

goldValue.Changed:Connect(updateText)
updateText()


Prompt:
--[=[
	Shows the pane
	@param doNotAnimate boolean? -- True if this visiblity should not animate
]=]

Response:
function BasicPane:Show(doNotAnimate)
	self:SetVisible(true, doNotAnimate)
end


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

Response:
local function InvokeVector(Vector, Function)
	return Vector3.new(Function(Vector.X), Function(Vector.Y), Function(Vector.Z))
end

local function GetOffset(Region, Position)
	local Center = Region.Center
	local Rotation = Region.Rotation

	local Offset = (CFrame.new(Center) * CFrame.Angles(Rotation.X, Rotation.Y, Rotation.Z)):pointToObjectSpace(Position)
	Offset = InvokeVector(Offset, math.abs)
	return Offset
end


Prompt: --Listen to seat enter/exit

Response:
VehicleSeating.AddSeat(DriverSeat, onEnterSeat, onExitSeat)

for _, seat in ipairs(AdditionalSeats) do
	VehicleSeating.AddSeat(seat, onEnterSeat, onExitSeat)
end

local function playerAdded(player)
	local playerGui = player:WaitForChild("PlayerGui")

	if not playerGui:FindFirstChild("VehiclePromptScreenGui") then
		local screenGui = Instance.new("ScreenGui")
		screenGui.ResetOnSpawn = false
		screenGui.Name = "VehiclePromptScreenGui"
		screenGui.Parent = playerGui

		local newLocalVehiclePromptGui = Scripts.LocalVehiclePromptGui:Clone()
		newLocalVehiclePromptGui.CarValue.Value = TopModel
		newLocalVehiclePromptGui.Parent = screenGui
		newLocalVehiclePromptGui.Enabled = true
	end
end

Players.PlayerAdded:Connect(playerAdded)

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


Prompt: -- A table to prevent users from equipping multiple clothing items that go in the same "slot".

Response:
GroupedAccessoryTypes = {}
GroupedAccessoryTypes[1] = {
	Enum.AccessoryType.Pants,
	Enum.AccessoryType.Shorts,
	Enum.AccessoryType.DressSkirt,
	Enum.AccessoryType.Waist,
}
GroupedAccessoryTypes[2] = {
	Enum.AccessoryType.TShirt,
	Enum.AccessoryType.Shirt,
	Enum.AccessoryType.Sweater,
}

local function usesSameClothingSlot(accessoryTypeName1, accessoryTypeName2)
	local accessoryType1 = ACCESSORY_TYPE_BY_NAME[accessoryTypeName1]
	local accessoryType2 = ACCESSORY_TYPE_BY_NAME[accessoryTypeName2]

	if accessoryType1 == accessoryType2 then
		return true
	end

	local group1 = 0
	local group2 = 0
	for i, accessoryGroup in pairs(GroupedAccessoryTypes) do
		for _, accType in pairs(accessoryGroup) do
			if accessoryType1 == accType then
				group1 = i
			end

			if accessoryType2 == accType then
				group2 = i
			end
		end
	end

	if group1 == group2 and group1 ~= 0 then
		return true
	end

	return false
end

return usesSameClothingSlot


Prompt: -- Inputs

Response:
local KEY_W = Enum.KeyCode.W
local KEY_A = Enum.KeyCode.A
local KEY_S = Enum.KeyCode.S
local KEY_D = Enum.KeyCode.D
local KEY_UP = Enum.KeyCode.Up
local KEY_DOWN = Enum.KeyCode.Down
local KEY_LEFT = Enum.KeyCode.Left
local KEY_RIGHT = Enum.KeyCode.Right
local KEY_RIGHTSHIFT = Enum.KeyCode.RightShift
local KEY_LEFTSHIFT = Enum.KeyCode.LeftShift
local THUMBSTICK_1 = Enum.KeyCode.Thumbstick1
local BUTTON_RT = Enum.KeyCode.ButtonR2

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local humanoid = character:WaitForChild("Humanoid")

local dead = false

local ModuleScripts = ReplicatedStorage:FindFirstChild("ModuleScripts")
local PlayerConverter = require(ModuleScripts:WaitForChild("PlayerConverter"))

local Scripts = script:WaitForChild("Scripts")

local PilotSeat = require(Scripts:WaitForChild("PilotSeat"))

local speeder = PilotSeat.new(script.Parent)
local engine = speeder.engine

local Controls = require(Scripts:WaitForChild("Controls"))
	local Keyboard = Controls.Keyboard
	local Gamepad = Controls.Gamepad
	local Mobile = Controls.Mobile

local physicsUpdateHandle

local lastServerUpdate = 0
local lastInputUpdate = tick()


Prompt:
--[[
	Creates a number of different collision groups, and sets their interaction
]]

Response:
function CollisionGroupsController.init()
	PhysicsService:CreateCollisionGroup(Constants.CollisionGroup.Door)
	PhysicsService:CreateCollisionGroup(Constants.CollisionGroup.Monster)
	PhysicsService:CreateCollisionGroup(Constants.CollisionGroup.Player)
	PhysicsService:CreateCollisionGroup(Constants.CollisionGroup.Elevator)

	PhysicsService:CollisionGroupSetCollidable(Constants.CollisionGroup.Monster, Constants.CollisionGroup.Door, false)
	PhysicsService:CollisionGroupSetCollidable(Constants.CollisionGroup.Monster, Constants.CollisionGroup.Player, false)
	PhysicsService:CollisionGroupSetCollidable(Constants.CollisionGroup.Elevator, "Default", false)
end


Response:
function onSwimming(speed)
	if speed > 1.00 then
		local scale = 10.0
		playAnimation("swim", 0.4, Humanoid)
		pose = "Swimming"
	else
		playAnimation("swimidle", 0.4, Humanoid)
		pose = "Standing"
	end
end

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

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

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

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

local lastTick = 0

function stepAnimate(currentTime)
  	local deltaTime = currentTime - lastTick
  	lastTick = currentTime

	local climbFudge = 0
	local setAngles = false

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

	if (pose == "FreeFall" and jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, Humanoid)
	elseif (pose == "Seated") then
		playAnimation("sit", 0.5, Humanoid)
		return
	elseif (pose == "Running") then
		playAnimation("walk", 0.2, Humanoid)
	elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
		stopAllAnimations()
	end

	-- Tool Animation handling
end


Prompt: --[[Weight and CG]]

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

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

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


Prompt:
----------------------------------
------------FUNCTIONS-------------
----------------------------------

Response:
function Receive(player, action, ...)
	local args = {...}
	if player == User and action == "play" then
		Connector:FireAllClients("play", User, args[1], Settings.SoundSource.Position, Settings.PianoSoundRange, player, args[2], Settings.IsCustom,Settings.Length)
		HighlightPianoKey((args[1] > 61 and 61) or (args[1] < 1 and 1) or args[1],args[3])
	elseif player == User and action == "abort" then
		Deactivate()
		if SeatWeld then
			SeatWeld:remove()
		end
	end
end

function Activate(player)
	Connector:FireClient(player, "activate", Settings.CameraCFrame, Settings.PianoSounds, true)
	User = player
end

function Deactivate()
	if User and User.Parent then
		Connector:FireClient(User, "deactivate")
		User.Character:SetPrimaryPartCFrame(Box.CFrame + Vector3.new(0, 5, 0))
	end
	User = nil
end


Prompt:
--[=[
	Holds constants for resource retrieval.
	@class ResourceConstants
	@private
]=]

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

local Table = require("Table")

return Table.readonly({
	REMOTE_EVENT_STORAGE_NAME = "RemoteEvents";
	REMOTE_FUNCTION_STORAGE_NAME = "RemoteFunctions";
})


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

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

    if self.connectionsChanged then
		self.connectionsChanged:Fire(-self.totalConnections)
		self.connectionsChanged:Destroy()
		self.connectionsChanged = nil
		self.totalConnections = 0
	end
end
Signal.Destroy = Signal.DisconnectAll
Signal.destroy = Signal.DisconnectAll


Prompt:
-- * Fires when the local player begins input. Ignores all input except if
--	 the user presses `KEY`. If `KEY` is pressed opens the game GUI unless
--	 player already interacting with the game
--
--	 Arguments:
--		actionName - Name of the ContextActionService action
--		userInputState - State of input
--		inputObject - Contains info about input
--	 Return: None
-- *

Response:
local function toggleKeyboard(actionName, userInputState, inputObject)
	if not (userInputState == Enum.UserInputState.Begin) then return end
	toggleInteraction()
end
local function toggleMouse(playerWhoClicked)
	if playerWhoClicked then
		toggleInteraction()
	end
end


Prompt: -- FUNCTIONS --

Response:
return function(Action, ...)
	local Args = {...}

	if Action == "Splash" then
		local TargetPosition = Args[1]
		local oceanHeight = Args[2]

		local splashPos = Vector3.new(TargetPosition.X, oceanHeight + 1, TargetPosition.Z)

		local splashAttachment = Instance.new("Attachment")
		splashAttachment.Parent = workspace.Terrain
		splashAttachment.WorldPosition = splashPos
		game.Debris:AddItem(splashAttachment, 5)

		debrisModule.Shockwave(splashPos, 3, 13)

		coroutine.wrap(function()
			for i, v in pairs(script.Splash:GetChildren()) do
				if v:IsA("ParticleEmitter") then
					local fx = v:Clone()
					fx.Parent = splashAttachment
					fx:Emit(fx:GetAttribute("EmitCount"))
				end
			end
		end)()
	end
end


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

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

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

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

local function initializeSoundSystem(instances)
	local player = instances.player
	local humanoid = instances.humanoid
	local rootPart = instances.rootPart

	local sounds: {[string]: Sound} = {}

	-- initialize sounds
	for name: string, props: {[string]: any} in pairs(SOUND_DATA) do
		local sound: Sound = Instance.new("Sound")
		sound.Name = name

		-- set default values
		sound.Archivable = false
		sound.RollOffMinDistance = 5
		sound.RollOffMaxDistance = 150
		sound.Volume = 0.65

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

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

	local playingLoopedSounds: {[Sound]: boolean?} = {}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		if state ~= activeState then
			local transitionFunc: () -> () = stateTransitions[state]

			if transitionFunc then
				transitionFunc()
			end

			activeState = state
		end
	end)

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

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

	local function terminate()
		stateChangedConn:Disconnect()
		steppedConn:Disconnect()

		if FFlagUserAtomicCharacterSoundsUnparent then
			-- Unparent all sounds and empty sounds table
			-- This is needed in order to support the case where initializeSoundSystem might be called more than once for the same player,
			-- which might happen in case player character is unparented and parented back on server and reset-children mechanism is active.
			for name: string, sound: Sound in pairs(sounds) do
				sound:Destroy()
			end
			table.clear(sounds)
		end
	end

	return terminate
end

local binding = AtomicBinding.new({
	humanoid = "Humanoid",
	rootPart = "HumanoidRootPart",
}, initializeSoundSystem)

local playerConnections = {}

local function characterAdded(character)
	binding:bindRoot(character)
end

local function characterRemoving(character)
	binding:unbindRoot(character)
end

local function playerAdded(player: Player)
	local connections = playerConnections[player]
	if not connections then
		connections = {}
		playerConnections[player] = connections
	end

	if player.Character then
		characterAdded(player.Character)
	end
	table.insert(connections, player.CharacterAdded:Connect(characterAdded))
	table.insert(connections, player.CharacterRemoving:Connect(characterRemoving))
end

local function playerRemoving(player: Player)
	local connections = playerConnections[player]
	if connections then
		for _, conn in ipairs(connections) do
			conn:Disconnect()
		end
		playerConnections[player] = nil
	end

	if player.Character then
		characterRemoving(player.Character)
	end
end

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


Prompt: -- This is responsible for positioning the topbar icons

Response:
local requestedTopbarUpdate = false
function IconController.updateTopbar()
	local function getIncrement(otherIcon, alignment)
		--local container = otherIcon.instances.iconContainer
		--local sizeX = container.Size.X.Offset
		local iconSize = otherIcon:get("iconSize", otherIcon:getIconState()) or UDim2.new(0, 32, 0, 32)
		local sizeX = iconSize.X.Offset
		local alignmentGap = IconController[alignment.."Gap"]
		local iconWidthAndGap = (sizeX + alignmentGap)
		local increment = iconWidthAndGap
		local preOffset = 0
		if otherIcon._parentIcon == nil then
			local extendLeft, extendRight, additionalRight = IconController.getMenuOffset(otherIcon)
			preOffset += extendLeft
			increment += extendRight + additionalRight
		end
		return increment, preOffset
	end
	if topbarUpdating then -- This prevents the topbar updating and shifting icons more than it needs to
		requestedTopbarUpdate = true
		return false
	end
	coroutine.wrap(function()
		topbarUpdating = true
		runService.Heartbeat:Wait()
		topbarUpdating = false

		for alignment, alignmentInfo in pairs(alignmentDetails) do
			alignmentInfo.records = {}
		end

		for otherIcon, _ in pairs(topbarIcons) do
			if IconController.canShowIconOnTopbar(otherIcon) then
				local alignment = otherIcon:get("alignment")
				table.insert(alignmentDetails[alignment].records, otherIcon)
			end
		end
		local viewportSize = workspace.CurrentCamera.ViewportSize
		for alignment, alignmentInfo in pairs(alignmentDetails) do
			local records = alignmentInfo.records
			if #records > 1 then
				if alignmentInfo.reverseSort then
					table.sort(records, function(a,b) return a:get("order") > b:get("order") end)
				else
					table.sort(records, function(a,b) return a:get("order") < b:get("order") end)
				end
			end
			local totalIconX = 0
			for i, otherIcon in pairs(records) do
				local increment = getIncrement(otherIcon, alignment)
				totalIconX = totalIconX + increment
			end
			local offsetX = alignmentInfo.getStartOffset(totalIconX, alignment)
			local preOffsetX = offsetX
			local containerX = TopbarPlusGui.TopbarContainer.AbsoluteSize.X
			for i, otherIcon in pairs(records) do
				local increment, preOffset = getIncrement(otherIcon, alignment)
				local newAbsoluteX = alignmentInfo.startScale*containerX + preOffsetX+preOffset
				preOffsetX = preOffsetX + increment
			end
			for i, otherIcon in pairs(records) do
				local container = otherIcon.instances.iconContainer
				local increment, preOffset = getIncrement(otherIcon, alignment)
				local topPadding = otherIcon.topPadding
				local newPositon = UDim2.new(alignmentInfo.startScale, offsetX+preOffset, topPadding.Scale, topPadding.Offset)
				local isAnOverflowIcon = string.match(otherIcon.name, "_overflowIcon-")
				local repositionInfo = otherIcon:get("repositionInfo")
				if repositionInfo then
					tweenService:Create(container, repositionInfo, {Position = newPositon}):Play()
				else
					container.Position = newPositon
				end
				offsetX = offsetX + increment
				otherIcon.targetPosition = UDim2.new(0, (newPositon.X.Scale*viewportSize.X) + newPositon.X.Offset, 0, (newPositon.Y.Scale*viewportSize.Y) + newPositon.Y.Offset)
			end
		end

		-- OVERFLOW HANDLER
		--------
		local START_LEEWAY = 10 -- The additional offset where the end icon will be converted to ... without an apparant change in position
		local function getBoundaryX(iconToCheck, side, gap)
			local additionalGap = gap or 0
			local currentSize = iconToCheck:get("iconSize", iconToCheck:getIconState())
			local sizeX = currentSize.X.Offset
			local extendLeft, extendRight = IconController.getMenuOffset(iconToCheck)
			local boundaryXOffset = (side == "left" and (-additionalGap-extendLeft)) or (side == "right" and sizeX+additionalGap+extendRight)
			local boundaryX = iconToCheck.targetPosition.X.Offset + boundaryXOffset
			return boundaryX
		end
		local function getSizeX(iconToCheck, usePrevious)
			local currentSize, previousSize = iconToCheck:get("iconSize", iconToCheck:getIconState(), "beforeDropdown")
			local hoveringSize = iconToCheck:get("iconSize", "hovering")
			if iconToCheck.wasHoveringBeforeOverflow and previousSize and hoveringSize and hoveringSize.X.Offset > previousSize.X.Offset then
				-- This prevents hovering icons flicking back and forth, demonstrated at thread/1017485/191.
				previousSize = hoveringSize
			end
			local newSize = (usePrevious and previousSize) or currentSize
			local extendLeft, extendRight = IconController.getMenuOffset(iconToCheck)
			local sizeX = newSize.X.Offset + extendLeft + extendRight
			return sizeX
		end

		for alignment, alignmentInfo in pairs(alignmentDetails) do
			local overflowIcon = alignmentInfo.overflowIcon
			if overflowIcon then
				local alignmentGap = IconController[alignment.."Gap"]
				local oppositeAlignment = (alignment == "left" and "right") or "left"
				local oppositeAlignmentInfo = alignmentDetails[oppositeAlignment]
				local oppositeOverflowIcon = IconController.getIcon("_overflowIcon-"..oppositeAlignment)

				-- This determines whether any icons (from opposite or mid alignment) are overlapping with this alignment
				local overflowBoundaryX = getBoundaryX(overflowIcon, alignment)
				if overflowIcon.enabled then
					overflowBoundaryX = getBoundaryX(overflowIcon, oppositeAlignment, alignmentGap)
				end
				local function doesExceed(givenBoundaryX)
					local exceeds = (alignment == "left" and givenBoundaryX < overflowBoundaryX) or (alignment == "right" and givenBoundaryX > overflowBoundaryX)
					return exceeds
				end
				local alignmentOffset = oppositeAlignmentInfo.getOffset()
				if not overflowIcon.enabled then
					alignmentOffset += START_LEEWAY
				end
				local alignmentBorderX = (alignment == "left" and viewportSize.X - alignmentOffset) or (alignment == "right" and alignmentOffset)
				local closestBoundaryX = alignmentBorderX
				local exceededCriticalBoundary = doesExceed(closestBoundaryX)
				local function checkBoundaryExceeded(recordToCheck)
					local totalIcons = #recordToCheck
					for i = 1, totalIcons do
						local endIcon = recordToCheck[totalIcons+1 - i]
						if IconController.canShowIconOnTopbar(endIcon) then
							local isAnOverflowIcon = string.match(endIcon.name, "_overflowIcon-")
							if isAnOverflowIcon and totalIcons ~= 1 then
								break
							elseif isAnOverflowIcon and not endIcon.enabled then
								continue
							end
							local additionalMyX = 0
							if not overflowIcon.enabled then
								additionalMyX = START_LEEWAY
							end
							local myBoundaryX = getBoundaryX(endIcon, alignment, additionalMyX)
							local isNowClosest = (alignment == "left" and myBoundaryX < closestBoundaryX) or (alignment == "right" and myBoundaryX > closestBoundaryX)
							if isNowClosest then
								closestBoundaryX = myBoundaryX
								if doesExceed(myBoundaryX) then
									exceededCriticalBoundary = true
								end
							end
						end
					end
				end
				checkBoundaryExceeded(alignmentDetails[oppositeAlignment].records)
				checkBoundaryExceeded(alignmentDetails.mid.records)

				-- This determines which icons to give to the overflow if an overlap is present
				if exceededCriticalBoundary then
					local recordToCheck = alignmentInfo.records
					local totalIcons = #recordToCheck
					for i = 1, totalIcons do
						local endIcon = (alignment == "left" and recordToCheck[totalIcons+1 - i]) or (alignment == "right" and recordToCheck[i])
						if endIcon ~= overflowIcon and IconController.canShowIconOnTopbar(endIcon) then
							local additionalGap = alignmentGap
							local overflowIconSizeX = overflowIcon:get("iconSize", overflowIcon:getIconState()).X.Offset
							if overflowIcon.enabled then
								additionalGap += alignmentGap + overflowIconSizeX
							end
							local myBoundaryXPlusGap = getBoundaryX(endIcon, oppositeAlignment, additionalGap)
							local exceeds = (alignment == "left" and myBoundaryXPlusGap >= closestBoundaryX) or (alignment == "right" and myBoundaryXPlusGap <= closestBoundaryX)
							if exceeds then
								if not overflowIcon.enabled then
									local overflowContainer = overflowIcon.instances.iconContainer
									local yPos = overflowContainer.Position.Y
									local appearXAdditional = (alignment == "left" and -overflowContainer.Size.X.Offset) or 0
									local appearX = getBoundaryX(endIcon, oppositeAlignment, appearXAdditional)
									overflowContainer.Position = UDim2.new(0, appearX, yPos.Scale, yPos.Offset)
									overflowIcon:setEnabled(true)
								end
								if #endIcon.dropdownIcons > 0 then
									endIcon._overflowConvertedToMenu = true
									local wasSelected = endIcon.isSelected
									endIcon:deselect()
									local iconsToConvert = {}
									for _, dIcon in pairs(endIcon.dropdownIcons) do
										table.insert(iconsToConvert, dIcon)
									end
									for _, dIcon in pairs(endIcon.dropdownIcons) do
										dIcon:leave()
									end
									endIcon:setMenu(iconsToConvert)
									if wasSelected and overflowIcon.isSelected then
										endIcon:select()
									end
								end
								if endIcon.hovering then
									endIcon.wasHoveringBeforeOverflow = true
								end
								endIcon:join(overflowIcon, "dropdown")
								if #endIcon.menuIcons > 0 and endIcon.menuOpen then
									endIcon:deselect()
									endIcon:select()
									overflowIcon:select()
								end
							end
							break
						end
					end

				else

					-- This checks to see if the lowest/highest (depending on left/right) ordered overlapping icon is no longer overlapping, removes from the dropdown, and repeats if valid
					local winningOrder, winningOverlappedIcon
					local totalOverlappingIcons = #overflowIcon.dropdownIcons
					if not (oppositeOverflowIcon and oppositeOverflowIcon.enabled and #alignmentInfo.records == 1 and #oppositeAlignmentInfo.records ~= 1) then
						for _, overlappedIcon in pairs(overflowIcon.dropdownIcons) do
							local iconOrder = overlappedIcon:get("order")
							if winningOverlappedIcon == nil or (alignment == "left" and iconOrder < winningOrder) or (alignment == "right" and iconOrder > winningOrder) then
								winningOrder = iconOrder
								winningOverlappedIcon = overlappedIcon
							end
						end
					end
					if winningOverlappedIcon then
						local sizeX = getSizeX(winningOverlappedIcon, true)
						local myForesightBoundaryX = getBoundaryX(overflowIcon, oppositeAlignment)
						if totalOverlappingIcons == 1 then
							myForesightBoundaryX = getBoundaryX(overflowIcon, alignment, alignmentGap-START_LEEWAY)
						end
						local availableGap = math.abs(closestBoundaryX - myForesightBoundaryX) - (alignmentGap*2)
						local noLongerExeeds = (sizeX < availableGap)
						if noLongerExeeds then
							if #overflowIcon.dropdownIcons == 1 then
								overflowIcon:setEnabled(false)
							end
							local overflowContainer = overflowIcon.instances.iconContainer
							local yPos = overflowContainer.Position.Y
							overflowContainer.Position = UDim2.new(0, myForesightBoundaryX, yPos.Scale, yPos.Offset)
							winningOverlappedIcon:leave()
							winningOverlappedIcon.wasHoveringBeforeOverflow = nil
							--
							if winningOverlappedIcon._overflowConvertedToMenu then
								winningOverlappedIcon._overflowConvertedToMenu = nil
								local iconsToConvert = {}
								for _, dIcon in pairs(winningOverlappedIcon.menuIcons) do
									table.insert(iconsToConvert, dIcon)
								end
								for _, dIcon in pairs(winningOverlappedIcon.menuIcons) do
									dIcon:leave()
								end
								winningOverlappedIcon:setDropdown(iconsToConvert)
							end
							--
						end
					end

				end
			end
		end
		--------
		if requestedTopbarUpdate then
			requestedTopbarUpdate = false
			IconController.updateTopbar()
		end
		return true
	end)()
end

function IconController.setTopbarEnabled(bool, forceBool)
	if forceBool == nil then
		forceBool = true
	end
	local indicator = TopbarPlusGui.Indicator
	if forceBool and not bool then
		forceTopbarDisabled = true
	elseif forceBool and bool then
		forceTopbarDisabled = false
	end
	local topbarEnabledAccountingForMimic = checkTopbarEnabledAccountingForMimic()
	if IconController.controllerModeEnabled then
		if bool then
			if TopbarPlusGui.TopbarContainer.Visible or forceTopbarDisabled or menuOpen or not topbarEnabledAccountingForMimic then return end
			if forceBool then
				indicator.Visible = topbarEnabledAccountingForMimic
			else
				indicator.Active = false
				if controllerMenuOverride and controllerMenuOverride.Connected then
					controllerMenuOverride:Disconnect()
				end

				if hapticService:IsVibrationSupported(Enum.UserInputType.Gamepad1) and hapticService:IsMotorSupported(Enum.UserInputType.Gamepad1,Enum.VibrationMotor.Small) then
					hapticService:SetMotor(Enum.UserInputType.Gamepad1,Enum.VibrationMotor.Small,1)
					delay(0.2,function()
						pcall(function()
							hapticService:SetMotor(Enum.UserInputType.Gamepad1,Enum.VibrationMotor.Small,0)
						end)
					end)
				end
				TopbarPlusGui.TopbarContainer.Visible = true
				TopbarPlusGui.TopbarContainer:TweenPosition(
					UDim2.new(0,0,0,5 + STUPID_CONTROLLER_OFFSET),
					Enum.EasingDirection.Out,
					Enum.EasingStyle.Quad,
					0.1,
					true
				)

				local selectIcon
				local targetOffset = 0
				IconController:_updateSelectionGroup()
				runService.Heartbeat:Wait()
				local indicatorSizeTrip = 50 --indicator.AbsoluteSize.Y * 2
				for otherIcon, _ in pairs(topbarIcons) do
					if IconController.canShowIconOnTopbar(otherIcon) and (selectIcon == nil or otherIcon:get("order") > selectIcon:get("order")) then
						selectIcon = otherIcon
					end
					local container = otherIcon.instances.iconContainer
					local newTargetOffset = -27 + container.AbsoluteSize.Y + indicatorSizeTrip
					if newTargetOffset > targetOffset then
						targetOffset = newTargetOffset
					end
				end
				if guiService:GetEmotesMenuOpen() then
					guiService:SetEmotesMenuOpen(false)
				end
				if guiService:GetInspectMenuEnabled() then
					guiService:CloseInspectMenu()
				end
				local newSelectedObject = IconController._previousSelectedObject or selectIcon.instances.iconButton
				IconController._setControllerSelectedObject(newSelectedObject)
				indicator.Image = "rbxassetid://5278151071"
				indicator:TweenPosition(
					UDim2.new(0.5,0,0,targetOffset + STUPID_CONTROLLER_OFFSET),
					Enum.EasingDirection.Out,
					Enum.EasingStyle.Quad,
					0.1,
					true
				)
			end
		else
			if forceBool then
				indicator.Visible = false
			elseif topbarEnabledAccountingForMimic then
				indicator.Visible = true
				indicator.Active = true
				controllerMenuOverride = indicator.InputBegan:Connect(function(input)
					if input.UserInputType == Enum.UserInputType.MouseButton1 then
						IconController.setTopbarEnabled(true,false)
					end
				end)
			else
				indicator.Visible = false
			end
			if not TopbarPlusGui.TopbarContainer.Visible then return end
			guiService.AutoSelectGuiEnabled = true
			IconController:_updateSelectionGroup(true)
			TopbarPlusGui.TopbarContainer:TweenPosition(
				UDim2.new(0,0,0,-TopbarPlusGui.TopbarContainer.Size.Y.Offset + STUPID_CONTROLLER_OFFSET),
				Enum.EasingDirection.Out,
				Enum.EasingStyle.Quad,
				0.1,
				true,
				function()
					TopbarPlusGui.TopbarContainer.Visible = false
				end
			)
			indicator.Image = "rbxassetid://5278151556"
			indicator:TweenPosition(
				UDim2.new(0.5,0,0,5),
				Enum.EasingDirection.Out,
				Enum.EasingStyle.Quad,
				0.1,
				true
			)
		end
	else
		local topbarContainer = TopbarPlusGui.TopbarContainer
		if topbarEnabledAccountingForMimic then
			topbarContainer.Visible = bool
		else
			topbarContainer.Visible = false
		end
	end
end

function IconController.setGap(value, alignment)
	local newValue = tonumber(value) or 12
	local newAlignment = tostring(alignment):lower()
	if newAlignment == "left" or newAlignment == "mid" or newAlignment == "right" then
		IconController[newAlignment.."Gap"] = newValue
		IconController.updateTopbar()
		return
	end
	IconController.leftGap = newValue
	IconController.midGap = newValue
	IconController.rightGap = newValue
	IconController.updateTopbar()
end

function IconController.setLeftOffset(value)
	IconController.leftOffset = tonumber(value) or 0
	IconController.updateTopbar()
end

function IconController.setRightOffset(value)
	IconController.rightOffset = tonumber(value) or 0
	IconController.updateTopbar()
end

local localPlayer = players.LocalPlayer
local iconsToClearOnSpawn = {}
localPlayer.CharacterAdded:Connect(function()
	for _, icon in pairs(iconsToClearOnSpawn) do
		icon:destroy()
	end
	iconsToClearOnSpawn = {}
end)
function IconController.clearIconOnSpawn(icon)
	coroutine.wrap(function()
		local char = localPlayer.Character or localPlayer.CharacterAdded:Wait()
		table.insert(iconsToClearOnSpawn, icon)
	end)()
end


Prompt: -- Add scripts into game.

Response:
local ButterflyManagerScript = script.ButterflyManager
if not game.StarterGui:FindFirstChild("ButterflyManager") then
	local NewScript = ButterflyManagerScript:Clone()
	NewScript.Parent = game.StarterGui
	NewScript.Disabled = false

	-- Give players scripts
	for _, Player in pairs(game.Players:GetPlayers()) do
		if Player:FindFirstChild("PlayerGui") and not Player.PlayerGui:FindFirstChild("ButterflyManagerScript") then
			local NewScript = ButterflyManagerScript:Clone()
			NewScript.Archivable = false
			NewScript.Disabled = false

			NewScript.Parent = Player.PlayerGui
		end
	end
end


Prompt: -- PUT ME IN SERVERSCRIPTSERVICE

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

local serverScriptService = game:GetService("ServerScriptService")

local chatService = require(serverScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))

chatService.SpeakerAdded:Connect(function(player)
	local speaker = chatService:GetSpeaker(player)
	players[player]:IsInGroup(16072157) -- Change this then put your group ID!
	speaker:SetExtraData("Tags",{{TagText = players[player:GetRoleInGroup(16072157)]}}) -- Change this then put your group ID!
end)


Prompt:
-- ROBLOX deviation: deviates from upstream substantially since Lua only has tables
-- we only have two functions
-- `printTableEntries` for formatting key, value pairs and
-- `printListItems` for formatting arrays


Prompt: -- Define setting instances

Response:
local IsOn = Configuration:WaitForChild("IsOn")
local ShouldEmitSound = Configuration:WaitForChild("ShouldEmitSound")
local MaxVolume = Configuration:WaitForChild("MaxVolume")


Prompt:
-- @Description Automatically Profile the given %Function. Arguments that will be passed to the %Function can be added after ...
-- @Arg1 ProfilerString
-- @Arg2 Function
-- @Arg3 ...

Response:
function Debug.Profiler(ProfilerString, Callback, ...)
	debug.profilebegin(ProfilerString)
	local Results = table.pack(Callback(unpack({...} or {})))
	debug.profileend()
	return table.unpack(Results or {})
end

return Debug


Prompt: --returns all of the instances of a specific instance in a model

Response:
function GetSpecificInstances(model,type)
	local tab={};
	for _,v in pairs(model:GetChildren()) do
		if v:IsA(type) then
			table.insert(tab,v);
		end
	end
	return tab;
end


Prompt:
---------------
-- Constants --
---------------

Response:
local FADE_TARGET = 0.75
local FADE_RATE = 0.1

local MODE = {
	CUSTOM = 1, -- Whatever you want!
	LIMBS = 2, -- Track limbs
	MOVEMENT = 3, -- Track movement
	CORNERS = 4, -- Char model corners
	CIRCLE1 = 5, -- Circle of casts around character
	CIRCLE2 = 6, -- Circle of casts around character, camera relative
	LIMBMOVE = 7, -- LIMBS mode + MOVEMENT mode
}

Invisicam.MODE = MODE

local STARTING_MODE = MODE.LIMBS

local LIMB_TRACKING_SET = {
	['Head'] = true,
	['Left Arm'] = true,
	['Right Arm'] = true,
	['Left Leg'] = true,
	['Right Leg'] = true,
	['LeftLowerArm'] = true,
	['RightLowerArm'] = true,
	['LeftLowerLeg'] = true,
	['RightLowerLeg'] = true
}

local CORNER_FACTORS = {
	Vector3.new(1, 1, -1),
	Vector3.new(1, -1, -1),
	Vector3.new(-1, -1, -1),
	Vector3.new(-1, 1, -1)
}

local CIRCLE_CASTS = 10
local MOVE_CASTS = 3


Prompt:
--wr2.MaxVelocity = 0.007
--wr2.Part0 = script.Parent.Parent.Misc.RR.Door.WD
--wr2.Part1 = wr2.Parent

Response:
sw.MaxVelocity = 0.1
sw.Part0 = script.Parent.SW
sw.Part1 = sw.Parent

TK.MaxVelocity = 0.03
TK.Part0 = script.Parent.TK
TK.Part1 = TK.Parent


Prompt: -------- OMG HAX

Response:
r = game:service("RunService")

local damage = 10

local slash_damage = 12
local lunge_damage = 24

sword = script.Parent.Handle
Tool = script.Parent

local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "http://www.roblox.com/asset/?id=11998777"
SlashSound.Parent = sword

local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "http://www.roblox.com/asset/?id=11998796"
LungeSound.Parent = sword

local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "http://www.roblox.com/asset/?id=11998770"
UnsheathSound.Parent = sword

function blow(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
	if humanoid~=nil and humanoid ~= hum and hum ~= nil then
		-- final check, make sure sword is in-hand

		local right_arm = vCharacter:FindFirstChild("Right Arm")
		if (right_arm ~= nil) then
			local joint = right_arm:FindFirstChild("RightGrip")
			if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
				tagHumanoid(humanoid, vPlayer)
				humanoid:TakeDamage(damage)
				wait(1)
				untagHumanoid(humanoid)
			end
		end

	end
end

function tagHumanoid(humanoid, player)
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = player
	creator_tag.Name = "creator"
	creator_tag.Parent = humanoid
end

function untagHumanoid(humanoid)
	if humanoid ~= nil then
		local tag = humanoid:findFirstChild("creator")
		if tag ~= nil then
			tag.Parent = nil
		end
	end
end

function attack()
	damage = slash_damage
	SlashSound:play()
	Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 0.7
	Tool.Parent.Torso["Right Shoulder"].DesiredAngle = 3.6
	wait(.1)
	Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 1

end

function lunge()
	damage = lunge_damage

	LungeSound:play()

	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Lunge"
	anim.Parent = Tool

	local force = Instance.new("BodyVelocity")
	force.velocity =  Vector3.new(0,80,0)
	force.Parent = Tool.Parent.Torso
	wait(.25)
	force.velocity =  (Tool.Parent.Torso.CFrame.lookVector * 160)  + Vector3.new(0, 60,0)
	--swordOut()
	wait(.5)
	force.Parent = nil
	wait(.5)
	--swordUp()

	damage = slash_damage
end

function swordUp()
	Tool.GripForward = Vector3.new(-1,0,0)
	Tool.GripRight = Vector3.new(0,1,0)
	Tool.GripUp = Vector3.new(0,0,1)
end

function swordOut()
	Tool.GripForward = Vector3.new(0,0,1)
	Tool.GripRight = Vector3.new(0,-1,0)
	Tool.GripUp = Vector3.new(-1,0,0)
end

function swordAcross()
	-- parry
end

Tool.Enabled = true
local last_attack = 0
function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return
	end

	t = r.Stepped:wait()

	if (t - last_attack < .2) then
		lunge()
	else
		attack()
	end

	last_attack = t

	--wait(.5)

	Tool.Enabled = true
end

function onEquipped()
	UnsheathSound:play()
end

script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)

connection = sword.Touched:connect(blow)


Prompt: --Made by Luckymaxer

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

Character = script.Parent
Humanoid = Character:FindFirstChild("Humanoid")

Duration = script:FindFirstChild("Duration")

Rate = (1 / 60)

function DestroyScript()
	Debris:AddItem(script, 0.5)
	script:Destroy()
end

if not Humanoid or Humanoid.Health == 0 or not Duration or Duration.Value <= 0 then
	DestroyScript()
	return
end

while Humanoid.Health > 0 and Duration.Value > 0 do
	if Humanoid then
		Humanoid.WalkSpeed = 6
	end
	local Time = wait(Rate)
	Duration.Value = (Duration.Value - Time)
end

if Humanoid then
	Humanoid.WalkSpeed = 16
end

DestroyScript()


Response:
local TwinService = game:GetService("TweenService")
local AnimationHighLight = TweenInfo.new(1.5, Enum.EasingStyle.Sine ,Enum.EasingDirection.InOut)
local Info1 = {Position = Vector3.new(pos1,Positionn,pos3)}
local Info2 = {Position = Vector3.new(pos1,Positionn2,pos3)}
local AnimkaUp = TwinService:Create(Danger, AnimationHighLight, Info1 )
local AnimkaDown = TwinService:Create(Danger, AnimationHighLight, Info2 )
while true do
	AnimkaUp:Play()
	wait(1.5)
	AnimkaDown:Play()
	wait(1.5)
end


Prompt: --Stickmasterluke

Response:
sp=script.Parent
framerate=30

frames=1
running=false
direction=1

function waitForChild(instance,name)
	while not instance:FindFirstChild(name) do
		instance.ChildAdded:wait()
	end
end

waitForChild(sp,"Bottom")
waitForChild(sp.Bottom,"OpenDoor")
waitForChild(sp.Bottom,"Configuration")

function checkframes()
	if sp:FindFirstChild("Bottom") then
		local config=sp.Bottom:FindFirstChild("Configuration")
		if config then
			frames=math.floor(config.TimeToMove.Value*framerate)+1
		end
	end
end
sp.Bottom.Configuration.TimeToMove.Changed:connect(checkframes)
checkframes()

function updatedoor(frame)
	local percentage=frame/frames
	if sp:FindFirstChild("Bottom") then
		local hingedist=1.9
		local hinge1=sp.Bottom:FindFirstChild("Door1")
		if hinge1~=nil then
			hinge1.C1=CFrame.new(-hingedist,-hingedist,0)*CFrame.Angles(0,0,(math.pi/2)*percentage)*CFrame.new(hingedist,hingedist,0)
		end
		local hinge1=sp.Bottom:FindFirstChild("Door2")
		if hinge1~=nil then
			hinge1.C1=CFrame.new(-hingedist,hingedist,0)*CFrame.Angles(0,0,(math.pi/2)*percentage)*CFrame.new(hingedist,-hingedist,0)
		end
		local hinge1=sp.Bottom:FindFirstChild("Door3")
		if hinge1~=nil then
			hinge1.C1=CFrame.new(hingedist,hingedist,0)*CFrame.Angles(0,0,(math.pi/2)*percentage)*CFrame.new(-hingedist,-hingedist,0)
		end
		local hinge1=sp.Bottom:FindFirstChild("Door4")
		if hinge1~=nil then
			hinge1.C1=CFrame.new(hingedist,-hingedist,0)*CFrame.Angles(0,0,(math.pi/2)*percentage)*CFrame.new(-hingedist,hingedist,0)
		end
	end
end

function runloop()
	if not running then
		running=true
		while true do
			if sp:FindFirstChild("Bottom") then
				local frame=sp.Bottom:FindFirstChild("Frame")
				if frame then
					frame.Value=frame.Value+direction
					if frame.Value>frames then
						frame.Value=frames
					end
					if frame.Value<=0 then
						frame.Value=0
					end
					updatedoor(frame.Value)
					wait(1/framerate)
					if frame then
						if (frame.Value<=0 and direction==-1) or (frame.Value>=frames and direction==1) then
							break
						end
					end
				else
					break
				end
			else
				break
			end
		end
		running=false
	end
end

function check(val)
	if val>.5 then
		direction=1
	else
		direction=-1
	end
	runloop()
end

sp.Bottom.OpenDoor.SourceValueChanged:connect(check)
check(sp.Bottom.OpenDoor:GetCurrentValue())


Prompt:
--[[if CurrentX >= SlowdownPoint then
local Multiplier = Start/End;
Speed = 20 * (1 - Multiplier);
if Speed < 1 then
	Speed = 1;
end
end]]


Prompt: -- © Native Lighting & NativeFX, All Rights Reserved, Do not edit or distribute.


Prompt: -- Make the HotbarFrame, which holds only the Hotbar Slots

Response:
HotbarFrame = NewGui('Frame', 'Hotbar')
HotbarFrame.BackgroundTransparency = 0.7

local grad = script.UIGradient:Clone()
grad.Parent = HotbarFrame

HotbarFrame.Parent = MainFrame


Prompt: --------SIDE SQUARES--------

Response:
game.Workspace.sidesquares.l11.BrickColor = BrickColor.new(1023)
game.Workspace.sidesquares.l12.BrickColor = BrickColor.new(1023)
game.Workspace.sidesquares.l21.BrickColor = BrickColor.new(1023)
game.Workspace.sidesquares.l31.BrickColor = BrickColor.new(1023)

game.Workspace.rightpalette.l11.BrickColor = BrickColor.new(1023)
game.Workspace.rightpalette.l12.BrickColor = BrickColor.new(1023)
game.Workspace.rightpalette.l21.BrickColor = BrickColor.new(1023)
game.Workspace.rightpalette.l22.BrickColor = BrickColor.new(1023)

game.Workspace.sidesquares.l13.BrickColor = BrickColor.new(106)
game.Workspace.sidesquares.l23.BrickColor = BrickColor.new(106)
game.Workspace.sidesquares.l33.BrickColor = BrickColor.new(106)
game.Workspace.sidesquares.l34.BrickColor = BrickColor.new(106)

game.Workspace.rightpalette.l13.BrickColor = BrickColor.new(106)
game.Workspace.rightpalette.l23.BrickColor = BrickColor.new(106)
game.Workspace.rightpalette.l14.BrickColor = BrickColor.new(106)
game.Workspace.rightpalette.l24.BrickColor = BrickColor.new(106)

game.Workspace.sidesquares.l14.BrickColor = BrickColor.new(1013)
game.Workspace.sidesquares.l15.BrickColor = BrickColor.new(1013)
game.Workspace.sidesquares.l24.BrickColor = BrickColor.new(1013)
game.Workspace.sidesquares.l25.BrickColor = BrickColor.new(1013)
game.Workspace.sidesquares.l35.BrickColor = BrickColor.new(1013)

game.Workspace.rightpalette.l15.BrickColor = BrickColor.new(1013)
game.Workspace.rightpalette.l25.BrickColor = BrickColor.new(1013)
game.Workspace.rightpalette.l16.BrickColor = BrickColor.new(1013)
game.Workspace.rightpalette.l26.BrickColor = BrickColor.new(1013)


Prompt: -- Function to preload audio assets

Response:
AudioPlayer.preloadAudio = function(assetArray)
	local audioAssets = {}

	-- Add new "Sound" assets to "audioAssets" array
	for name, audioID in pairs(assetArray) do
		local audioInstance = Instance.new("Sound")
		audioInstance.SoundId = "rbxassetid://" .. audioID
		audioInstance.Name = name
		audioInstance.Parent = SoundService

		table.insert(audioAssets, audioInstance)
	end

	local success, assets = pcall(function()
		ContentProvider:PreloadAsync(audioAssets)
	end)
end


Prompt: -- KEYBINDS HERE

Response:
local bind1 = Enum.KeyCode.LeftShift -- This is the keybind this script is set to by default
local bind2 = Enum.KeyCode.RightShift -- This is the second keybind this script is set to by default


Response:
function MakeWeld(x,y,type,s)
	local W=Instance.new(type)
	W.Part0=x W.Part1=y
	W.C0=x.CFrame:inverse()*x.CFrame
	W.C1=y.CFrame:inverse()*x.CFrame
	W.Parent=x
	if type=="Motor" and s~=nil then
		W.MaxVelocity=s
	end
	return W
end
function ModelWeld(a,b)
	if a:IsA("BasePart") then
		MakeWeld(b,a,"Weld")
	elseif a:IsA("Model") then
		for i,v in pairs(a:GetChildren()) do
			ModelWeld(v,b)
		end
	end
end
function UnAnchor(a)
	if a:IsA("BasePart") then a.Anchored=false elseif a:IsA("Model") then for i,v in pairs(a:GetChildren()) do UnAnchor(v) end end
end


Prompt: --[[Engine]]

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

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

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


Prompt: -- Variables

Response:
local b_close = script.Parent

local tpMenu = script.Parent.Parent


Prompt:
--- Connect a new handler to the event. Returns a connection object that can be disconnected.
-- @tparam function handler Function handler called with arguments passed when `:Fire(...)` is called
-- @treturn Connection Connection object that can be disconnected

Response:
function Signal:Connect(handler)
	if not (type(handler) == "function") then
		error(("connect(%s)"):format(typeof(handler)), 2)
	end

	return self._bindableEvent.Event:Connect(function()
		handler(unpack(self._argData, 1, self._argCount))
	end)
end


Prompt: --Rescripted by Luckymaxer

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

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

RbxUtility = LoadLibrary("RbxUtility")
Create = RbxUtility.Create

BaseUrl = "http://www.roblox.com/asset/?id="

Meshes = {
	GrappleWithHook = 33393806,
	Grapple = 30308256,
	Hook = 30307623,
}

Animations = {
	Crouch = {Animation = Tool:WaitForChild("Crouch"), FadeTime = 0.25, Weight = nil, Speed = nil},
}

Sounds = {
	Fire = Handle:WaitForChild("Fire"),
	Connect = Handle:WaitForChild("Connect"),
	Hit = Handle:WaitForChild("Hit"),
}

for i, v in pairs(Meshes) do
	Meshes[i] = (BaseUrl .. v)
end

BasePart = Create("Part"){
	Material = Enum.Material.Plastic,
	Shape = Enum.PartType.Block,
	TopSurface = Enum.SurfaceType.Smooth,
	BottomSurface = Enum.SurfaceType.Smooth,
	FormFactor = Enum.FormFactor.Custom,
	Size = Vector3.new(0.2, 0.2, 0.2),
	CanCollide = true,
	Locked = true,
}

BaseRope = BasePart:Clone()
BaseRope.Name = "Effect"
BaseRope.BrickColor = BrickColor.new("Really black")
BaseRope.Anchored = true
BaseRope.CanCollide = false
Create("CylinderMesh"){
	Scale = Vector3.new(1, 1, 1),
	Parent = BaseRope,
}

BaseGrappleHook = BasePart:Clone()
BaseGrappleHook.Name = "Projectile"
BaseGrappleHook.Transparency = 0
BaseGrappleHook.Size = Vector3.new(1, 0.4, 1)
BaseGrappleHook.Anchored = false
BaseGrappleHook.CanCollide = true
Create("SpecialMesh"){
	MeshType = Enum.MeshType.FileMesh,
	MeshId = (BaseUrl .. "30307623"),
	TextureId = (BaseUrl .. "30307531"),
	Scale = Mesh.Scale,
	VertexColor = Vector3.new(1, 1, 1),
	Offset = Vector3.new(0, 0, 0),
	Parent = BaseGrappleHook,
}
Create("BodyGyro"){
	Parent = BaseGrappleHook,
}
for i, v in pairs({Sounds.Connect, Sounds.Hit}) do
	local Sound = v:Clone()
	Sound.Parent = BaseGrappleHook
end

Gravity = 196.20
Rate = (1 / 60)

MaxDistance = 200
CanFireWhileGrappling = true

Crouching = false
ToolEquipped = false

ServerControl = (Tool:FindFirstChild("ServerControl") or Create("RemoteFunction"){
	Name = "ServerControl",
	Parent = Tool,
})

ClientControl = (Tool:FindFirstChild("ClientControl") or Create("RemoteFunction"){
	Name = "ClientControl",
	Parent = Tool,
})

for i, v in pairs(Tool:GetChildren()) do
	if v:IsA("BasePart") and v ~= Handle then
		v:Destroy()
	end
end

Mesh.MeshId = Meshes.GrappleWithHook
Handle.Transparency = 0
Tool.Enabled = true

function CheckTableForString(Table, String)
	for i, v in pairs(Table) do
		if string.find(string.lower(String), string.lower(v)) then
			return true
		end
	end
	return false
end

function CheckIntangible(Hit)
	local ProjectileNames = {"Water", "Arrow", "Projectile", "Effect", "Rail", "Laser", "Bullet", "GrappleHook"}
	if Hit and Hit.Parent then
		if ((not Hit.CanCollide or CheckTableForString(ProjectileNames, Hit.Name)) and not Hit.Parent:FindFirstChild("Humanoid")) then
			return true
		end
	end
	return false
end

function CastRay(StartPos, Vec, Length, Ignore, DelayIfHit)
	local Ignore = ((type(Ignore) == "table" and Ignore) or {Ignore})
	local RayHit, RayPos, RayNormal = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(StartPos, Vec * Length), Ignore)
	if RayHit and CheckIntangible(RayHit) then
		if DelayIfHit then
			wait()
		end
		RayHit, RayPos, RayNormal = CastRay((RayPos + (Vec * 0.01)), Vec, (Length - ((StartPos - RayPos).magnitude)), Ignore, DelayIfHit)
	end
	return RayHit, RayPos, RayNormal
end

function AdjustRope()
	if not Rope or not Rope.Parent or not CheckIfGrappleHookAlive() then
		return
	end
	local StartPosition = Handle.Position
	local EndPosition = GrappleHook.Position
	local RopeLength = (StartPosition - EndPosition).Magnitude
	Rope.Size = Vector3.new(1, 1, 1)
	Rope.Mesh.Scale = Vector3.new(0.1, RopeLength, 0.1)
	Rope.CFrame = (CFrame.new(((StartPosition + EndPosition) / 2), EndPosition) * CFrame.Angles(-(math.pi / 2), 0, 0))
end

function DisconnectGrappleHook(KeepBodyObjects)
	for i, v in pairs({Rope, GrappleHook, GrappleHookChanged}) do
		if v then
			if tostring(v) == "Connection" then
				v:disconnect()
			elseif type(v) == "userdata" and v.Parent then
				v:Destroy()
			end
		end
	end
	if CheckIfAlive() and not KeepBodyObjects then
		for i, v in pairs(Torso:GetChildren()) do
			if string.find(string.lower(v.ClassName), string.lower("Body")) then
				v:Destroy()
			end
		end
	end
	Connected = false
	Mesh.MeshId = Meshes.GrappleWithHook
end

function TryToConnect()
	if not ToolEquipped or not CheckIfAlive() or not CheckIfGrappleHookAlive() or Connected then
		DisconnectGrappleHook()
		return
	end
	local DistanceApart = (Torso.Position - GrappleHook.Position).Magnitude
	if DistanceApart > MaxDistance then
		DisconnectGrappleHook()
		return
	end
	local Directions = {Vector3.new(0, 1, 0), Vector3.new(0, -1, 0), Vector3.new(1, 0, 0), Vector3.new(-1, 0, 0), Vector3.new(0, 0, 1), Vector3.new(0, 0, -1)}
	local ClosestRay = {DistanceApart = math.huge}
	for i, v in pairs(Directions) do
		local Direction = CFrame.new(GrappleHook.Position, (GrappleHook.CFrame + v * 2).p).lookVector
		local RayHit, RayPos, RayNormal = CastRay((GrappleHook.Position + Vector3.new(0, 0, 0)), Direction, 2, {Character, GrappleHook, Rope}, false)
		if RayHit then
			local DistanceApart = (GrappleHook.Position - RayPos).Magnitude
			if DistanceApart < ClosestRay.DistanceApart then
				ClosestRay = {Hit = RayHit, Pos = RayPos, Normal = RayNormal, DistanceApart = DistanceApart}
			end
		end
	end
	if ClosestRay.Hit then
		Connected = true
		local GrappleCFrame = CFrame.new(ClosestRay.Pos, (CFrame.new(ClosestRay.Pos) + ClosestRay.Normal * 2).p) * CFrame.Angles((math.pi / 2), 0, 0)
		GrappleCFrame = (GrappleCFrame * CFrame.new(0, -(GrappleHook.Size.Y / 1.5), 0))
		GrappleCFrame = (CFrame.new(GrappleCFrame.p, Handle.Position) * CFrame.Angles(0, math.pi, 0))
		local Weld = Create("Motor6D"){
			Part0 = GrappleHook,
			Part1 = ClosestRay.Hit,
			C0 = GrappleCFrame:inverse(),
			C1 = ClosestRay.Hit.CFrame:inverse(),
			Parent = GrappleHook,
		}
		for i, v in pairs(GrappleHook:GetChildren()) do
			if string.find(string.lower(v.ClassName), string.lower("Body")) then
				v:Destroy()
			end
		end
		local HitSound = GrappleHook:FindFirstChild("Hit")
		if HitSound then
			HitSound:Play()
		end
		local BackUpGrappleHook = GrappleHook
		wait(0.4)
		if not CheckIfGrappleHookAlive() or GrappleHook ~= BackUpGrappleHook then
			return
		end
		Sounds.Connect:Play()
		local ConnectSound = GrappleHook:FindFirstChild("Connect")
		if ConnectSound then
			ConnectSound:Play()
		end

		for i, v in pairs(Torso:GetChildren()) do
			if string.find(string.lower(v.ClassName), string.lower("Body")) then
				v:Destroy()
			end
		end

		local TargetPosition = GrappleHook.Position
		local BackUpPosition = TargetPosition

		local BodyPos = Create("BodyPosition"){
			D = 1000,
			P = 3000,
			maxForce = Vector3.new(1000000, 1000000, 1000000),
			position = TargetPosition,
			Parent = Torso,
		}

		local BodyGyro = Create("BodyGyro"){
			maxTorque = Vector3.new(math.huge, math.huge, math.huge),
			cframe = CFrame.new(Torso.Position, Vector3.new(GrappleCFrame.p.X, Torso.Position.Y, GrappleCFrame.p.Z)),
			Parent = Torso,
		}

		Spawn(function()
			while TargetPosition == BackUpPosition and CheckIfGrappleHookAlive() and Connected and ToolEquipped and CheckIfAlive() do
				BodyPos.position = GrappleHook.Position
				wait()
			end
		end)

	end
end

function CheckIfGrappleHookAlive()
	return (((GrappleHook and GrappleHook.Parent --[[and Rope and Rope.Parent]]) and true) or false)
end

function CheckIfAlive()
	return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
end

function Activated()
	if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then
		return
	end
	local MousePosition = InvokeClient("MousePosition")
	if not MousePosition then
		return
	end
	MousePosition = MousePosition.Position
	if CheckIfGrappleHookAlive() then
		if not CanFireWhileGrappling then
			return
		end
		if GrappleHookChanged then
			GrappleHookChanged:disconnect()
		end
		DisconnectGrappleHook(true)
	end
	if GrappleHookChanged then
		GrappleHookChanged:disconnect()
	end
	Tool.Enabled = false
	Sounds.Fire:Play()
	Mesh.MeshId = Meshes.Grapple
	GrappleHook = BaseGrappleHook:Clone()
	GrappleHook.CFrame = (CFrame.new((Handle.Position + (MousePosition - Handle.Position).Unit * 5), MousePosition) * CFrame.Angles(0, 0, 0))
	local Weight = 70
	GrappleHook.Velocity = (GrappleHook.CFrame.lookVector * Weight)
	local Force = Create("BodyForce"){
		force = Vector3.new(0, Weight-20, 0),
		Parent = GrappleHook,
	}
	GrappleHook.Parent = Tool
	GrappleHookChanged = GrappleHook.Changed:connect(function(Property)
		if Property == "Parent" then
			DisconnectGrappleHook()
		end
	end)
	Rope = BaseRope:Clone()
	Rope.Parent = Tool
	Spawn(function()
		while CheckIfGrappleHookAlive() and ToolEquipped and CheckIfAlive() do
			AdjustRope()
			Spawn(function()
				if not Connected then
					TryToConnect()
				end
			end)
			wait()
		end
	end)
	wait(2)
	Tool.Enabled = true
end

local seatedConnection = nil

function Equipped(Mouse)
	Character = Tool.Parent
	Humanoid = Character:FindFirstChild("Humanoid")
	Torso = Character:FindFirstChild("HumanoidRootPart")
	Player = Players:GetPlayerFromCharacter(Character)
	if not CheckIfAlive() then
		return
	end
	spawn(function()
		DisconnectGrappleHook()
		if HumanoidJumping then
			HumanoidJumping:disconnect()
		end
		HumanoidJumping = Humanoid.Jumping:connect(function()
			DisconnectGrappleHook()
		end)
	end)
	Crouching = false
	ToolEquipped = true

	Tool.Enabled = not Humanoid.Sit
	seatedConnection = Humanoid.Seated:connect(function(active,seat)
		if active then
			Tool.Enabled = false
		else
			Tool.Enabled = true
		end
	end)
end

function Unequipped()
	if HumanoidJumping then
		HumanoidJumping:disconnect()
	end
	DisconnectGrappleHook()
	Crouching = false
	ToolEquipped = false
	seatedConnection:disconnect()
end

function OnServerInvoke(player, mode, value)
	if player ~= Player or not ToolEquipped or not value or not CheckIfAlive() then
		return
	end
	if mode == "KeyPress" then
		local Key = value.Key
		local Down = value.Down
		if Key == "q" and Down then
			DisconnectGrappleHook()
		elseif Key == "c" and Down then
			Crouching = not Crouching
			Spawn(function()
				InvokeClient(((Crouching and "PlayAnimation") or "StopAnimation"), Animations.Crouch)
			end)
		end
	end
end

function InvokeClient(Mode, Value)
	local ClientReturn = nil
	pcall(function()
		ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
	end)
	return ClientReturn
end

ServerControl.OnServerInvoke = OnServerInvoke

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


Prompt: --Feel free to change other properties

Response:
trail.Parent = script.Parent.HumanoidRootPart
att0.Parent = script.Parent.HumanoidRootPart
att1.Parent = script.Parent.HumanoidRootPart
trail.Attachment0 = att0
trail.Attachment1 = att1
trail.Enabled = true
att0.Position = Vector3.new(.5, 0, 0)
att1.Position = Vector3.new(-.5, 0, 0)


Prompt: -----RandomDebris-----

Response:
local Colors = {
	Color3.fromRGB(91, 91, 91),
}
local Materials = {
	Enum.Material.Plastic,
}


Prompt: -- Regular :WaitForChild had issues with order (remoteevents were going through before waitforchild resumed)

Response:
function WaitForChild(parent, name)
	local remote = parent:FindFirstChild(name)

	if not remote then
		local thread = coroutine.running()
		local con

		con = parent.ChildAdded:Connect(function(child)
			if child.Name == name then
				con:Disconnect()
				remote = child
				ResumeThread(thread)
			end
		end)

		YieldThread()
	end

	return remote
end

function GetEventHandler(name)
	local handler = EventHandlers[name]
	if handler then
		return handler
	end

	local handler = {
		Name = name,
		Folder = EventsFolder,

		Callbacks = {},
		IncomingQueueErrored = nil
	}

	EventHandlers[name] = handler

	if IsServer then
		local remote = Instance.new("RemoteEvent")
		remote.Name = handler.Name
		remote.Parent = handler.Folder

		handler.Remote = remote
	else
		FastSpawn(function()
			handler.Queue = {}

			local remote = WaitForChild(handler.Folder, handler.Name)
			handler.Remote = remote

			if #handler.Callbacks == 0 then
				handler.IncomingQueue = {}
			end

			remote.OnClientEvent:Connect(function(...)
				if handler.IncomingQueue then
					if #handler.IncomingQueue >= 2048 then
						if not handler.IncomingQueueErrored then
							handler.IncomingQueueErrored = true
							FastSpawn(error, string.format("Exhausted remote invocation queue for %s", remote:GetFullName()), -1)

							delay(1, function()
								handler.IncomingQueueErrored = nil
							end)
						end

						if #handler.IncomingQueue >= 8172 then
							table.remove(handler.IncomingQueue, 1)
						end
					end

					ReceiveCounter += 1
					table.insert(handler.IncomingQueue, table.pack(ReceiveCounter, handler, ...))
					return
				end

				SafeFireEvent(handler, ...)
			end)

			if not IsStudio then
				remote.Name = ""
			end

			for _,fn in pairs(handler.Queue) do
				fn()
			end

			handler.Queue = nil
		end)
	end

	return handler
end

function GetFunctionHandler(name)
	local handler = FunctionHandlers[name]
	if handler then
		return handler
	end

	local handler = {
		Name = name,
		Folder = FunctionsFolder,

		Callback = nil,
		IncomingQueueErrored = nil
	}

	FunctionHandlers[name] = handler

	if IsServer then
		local remote = Instance.new("RemoteFunction")
		remote.Name = handler.Name
		remote.Parent = handler.Folder

		handler.Remote = remote
	else
		FastSpawn(function()
			handler.Queue = {}

			local remote = WaitForChild(handler.Folder, handler.Name)
			handler.Remote = remote

			handler.IncomingQueue = {}
			handler.OnClientInvoke = function(...)
				if not handler.Callback then
					if #handler.IncomingQueue >= 2048 then
						if not handler.IncomingQueueErrored then
							handler.IncomingQueueErrored = true
							FastSpawn(error, string.format("Exhausted remote invocation queue for %s", remote:GetFullName()), -1)

							delay(1, function()
								handler.IncomingQueueErrored = nil
							end)
						end

						if #handler.IncomingQueue >= 8172 then
							table.remove(handler.IncomingQueue, 1)
						end
					end

					ReceiveCounter += 1
					local params = table.pack(ReceiveCounter, handler, coroutine.running())

					table.insert(handler.IncomingQueue, params)
					YieldThread()
				end

				return SafeInvokeCallback(handler, ...)
			end

			if not IsStudio then
				remote.Name = ""
			end

			for _,fn in pairs(handler.Queue) do
				fn()
			end

			handler.Queue = nil
		end)
	end

	return handler
end

function AddToQueue(handler, fn, doWarn)
	if handler.Remote then
		return fn()
	end

	handler.Queue[#handler.Queue + 1] = fn

	if doWarn then
		delay(5, function()
			if not handler.Remote then
				warn(debug.traceback(("Infinite yield possible on '%s:WaitForChild(\"%s\")'"):format(handler.Folder:GetFullName(), handler.Name)))
			end
		end)
	end
end

function ExecuteDeferredHandlers()
	local handlers = DeferredHandlers
	local queue = {}

	DeferredHandlers = {}

	for handler in pairs(handlers) do
		local incoming = handler.IncomingQueue
		handler.IncomingQueue = nil

		table.move(incoming, 1, #incoming, #queue + 1, queue)
	end

	table.sort(queue, function(a, b) return a[1] < b[1] end)

	for _,v in ipairs(queue) do
		local handler = v[2]

		if handler.Callbacks then
			SafeFireEvent(handler, unpack(v, 3))
		else
			ResumeThread(v[3])
		end
	end
end

local Middleware = {
	MatchParams = function(name, paramTypes)
		paramTypes = { unpack(paramTypes) }
		local paramStart = 1

		for i,v in pairs(paramTypes) do
			local list = type(v) == "string" and string.split(v, "|") or v

			local dict = {}
			local typeListString = ""

			for _,v in pairs(list) do
				local typeString = v:gsub("^%s+", ""):gsub("%s+$", "")

				typeListString ..= (#typeListString > 0 and " or " or "") .. typeString
				dict[typeString:lower()] = true
			end

			dict._string = typeListString
			paramTypes[i] = dict
		end

		if IsServer then
			paramStart = 2
			table.insert(paramTypes, 1, false)
		end

		local function MatchParams(fn, ...)
			local params = table.pack(...)

			if params.n > #paramTypes then
				if IsStudio then
					warn(("[Network] Invalid number of parameters to %s (%s expected, got %s)"):format(name, #paramTypes - paramStart + 1, params.n - paramStart + 1))
				end
				return
			end

			for i = paramStart, #paramTypes do
				local argType = typeof(params[i])
				local argExpected = paramTypes[i]

				if not argExpected[argType:lower()] and not argExpected.any then
					if IsStudio then
						warn(("[Network] Invalid parameter %d to %s (%s expected, got %s)"):format(i - paramStart + 1, name, argExpected._string, argType))
					end
					return
				end
			end

			return fn(...)
		end

		return MatchParams
	end
}

function combineFn(handler, final, ...)
	local middleware = { ... }

	if typeof(final) == "table" then
		local info = final
		final = final[1]

		if info.MatchParams then
			table.insert(middleware, Middleware.MatchParams(handler.Name, info.MatchParams))
		end
	end

	local function NetworkHandler(...)
		if LoggingNetwork then
			local client = ...
			table.insert(LoggingNetwork[client][handler.Remote].dataIn, GetParamString(select(2, ...)))
		end

		local currentIndex = 1

		local function runMiddleware(index, ...)
			if index ~= currentIndex then
				return
			end

			currentIndex += 1

			if index <= #middleware then
				return middleware[index](function(...) return runMiddleware(index + 1, ...) end, ...)
			end

			return final(...)
		end

		return runMiddleware(1, ...)
	end

	return NetworkHandler
end

function Network:BindEvents(pre, callbacks)
	if typeof(pre) == "table" then
		pre, callbacks = nil, pre
	end

	for name,fn in pairs(callbacks) do
		local handler = GetEventHandler(name)
		if not handler then
			error(("Tried to bind callback to non-existing RemoteEvent %q"):format(name))
		end

		handler.Callbacks[#handler.Callbacks + 1] = combineFn(handler, fn, pre)

		if IsServer then
			handler.Remote.OnServerEvent:Connect(function(...)
				SafeFireEvent(handler, ...)
			end)
		else
			if handler.IncomingQueue then
				DeferredHandlers[handler] = true
			end
		end
	end

	ExecuteDeferredHandlers()
end

function Network:BindFunctions(pre, callbacks)
	if typeof(pre) == "table" then
		pre, callbacks = nil, pre
	end

	for name,fn in pairs(callbacks) do
		local handler = GetFunctionHandler(name)
		if not handler then
			error(("Tried to bind callback to non-existing RemoteFunction %q"):format(name))
		end

		if handler.Callback then
			error(("Tried to bind multiple callbacks to the same RemoteFunction (%s)"):format(handler.Remote:GetFullName()))
		end

		handler.Callback = combineFn(handler, fn, pre)

		if IsServer then
			handler.Remote.OnServerInvoke = function(...)
				return SafeInvokeCallback(handler, ...)
			end
		else
			if handler.IncomingQueue then
				DeferredHandlers[handler] = true
			end
		end
	end

	ExecuteDeferredHandlers()
end


Prompt:
--[[
	Function called when leaving the state
]]

Response:
function PlayerPostGame.onLeave(stateMachine, serverPlayer, event, from, to)
end

return PlayerPostGame