Roblox/luau_corpus huggingface dataset:
--RedEgg--

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

EggEvent.Hitbox.ClickDetector.MouseClick:Connect(function(plr)
	if plr.Backpack:FindFirstChild(ToolRequired1) then
		if game.ReplicatedStorage.ItemSwitching.Value == true then
			plr.Backpack:FindFirstChild(ToolRequired1):Destroy()
		end
		EggEvent.SoundPart.Insert:Play()
		EggEvent.RedEgg.Transparency = 0
		EggEvent.LocksLeft.Value = EggEvent.LocksLeft.Value - 1	
		script.Disabled = true
		EggEvent.Hitbox.RedEggHint:Destroy()
	end
end)
-- / Functions / --
EventModule.ActivateEvent = function()
	
	local RandomPlayer1 = PlayingTeam:GetPlayers()[math.random(1, #PlayingTeam:GetPlayers())]
	local Character1 = RandomPlayer1.Character or RandomPlayer1.CharacterAdded:Wait()
	local Humanoid1 = Character1:WaitForChild("Humanoid")
	
	local HumanoidDescription1 = game.Players:GetHumanoidDescriptionFromUserId(RandomPlayer1.UserId)	
	
	local RandomPlayer2
	
	if #PlayingTeam:GetPlayers() > GameConfiguration.MinPlayerAmount.Value then
		repeat 
			task.wait()

			RandomPlayer2 = PlayingTeam:GetPlayers()[math.random(1, #PlayingTeam:GetPlayers())]
		until 

		RandomPlayer2.Name ~= RandomPlayer1.Name

		local Character2 = RandomPlayer2.Character or RandomPlayer2.CharacterAdded:Wait()
		local Humanoid2 = Character2:WaitForChild("Humanoid")

		local HumanoidDescription2 = game.Players:GetHumanoidDescriptionFromUserId(RandomPlayer2.UserId)

		for _, Accessory in pairs(Character1:GetChildren()) do
			if Accessory:IsA("Accessory") then
				Accessory:Destroy()

			end
		end

		for _, Accessory in pairs(Character2:GetChildren()) do
			if Accessory:IsA("Accessory") then
				Accessory:Destroy()

			end
		end

		Humanoid1:ApplyDescription(HumanoidDescription2)
		Humanoid2:ApplyDescription(HumanoidDescription1)

		RandomPlayer1.Team = PlayingTeam
		RandomPlayer2.Team = PlayingTeam
	end
end
--!nonstrict
local StarterGui = game:GetService("StarterGui")

local initialized = false

local CameraUI: any = {}

do
	-- Instantaneously disable the toast or enable for opening later on. Used when switching camera modes.
	function CameraUI.setCameraModeToastEnabled(enabled: boolean)
		if not enabled and not initialized then
			return
		end

		if not initialized then
			initialized = true
		end
		
		if not enabled then
			CameraUI.setCameraModeToastOpen(false)
		end
	end

	function CameraUI.setCameraModeToastOpen(open: boolean)
		assert(initialized)

		if open then
			StarterGui:SetCore("SendNotification", {
				Title = "Camera Control Enabled",
				Text = "Right click to toggle",
				Duration = 3,
			})
		end
	end
end

return CameraUI
-- Create a function to update the timer label
local function updateTimerLabel()
	timerLabel.Text = tostring(tick())
	-- make the label text visible in large font
	timerLabel.FontSize = "Size48"
	timerLabel.TextColor3 = Color3.new(1,1,1)
end
--------|    Reference    |--------
local isServer = game:GetService("RunService"):IsServer()
--[[ Local Functions ]]--
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
-- Decompiled with the Synapse X Luau decompiler.

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;
--// Script
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)
-- local CoverageWorkerModule = require(CurrentModule.CoverageWorker)
-- type worker = CoverageWorkerModule.worker
type worker = any
--Made by Superluck, Uploaded by FederalSignal_QCB.
--Made by Superluck, Uploaded by FederalSignal_QCB.
--Made by Superluck, Uploaded by FederalSignal_QCB.
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
--------------------[ STANCE FUNCTIONS ]----------------------------------------------

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
--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

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
-- (Hat Giver Script - Loaded.)

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)
-- Play sounds
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()
-- local script inside a TextLabel 
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()
--[=[
	Shows the pane
	@param doNotAnimate boolean? -- True if this visiblity should not animate
]=]
function BasicPane:Show(doNotAnimate)
	self:SetVisible(true, doNotAnimate)
end
--///////////////--
--Helping Methods--
--///////////////--

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
--Listen to seat enter/exit
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
-- A table to prevent users from equipping multiple clothing items that go in the same "slot". 
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
-- Inputs
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()
--[[
	Creates a number of different collision groups, and sets their interaction
]]
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
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------

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
--[[Weight and CG]]
	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
----------------------------------
------------FUNCTIONS-------------
----------------------------------

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
--[=[
	Holds constants for resource retrieval.
	@class ResourceConstants
	@private
]=]

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";
})
-- Disconnect all handlers. Since we use a linked list it suffices to clear the
-- reference to the head handler.
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
-- * 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
-- *
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
-- FUNCTIONS --
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
-- Add scripts into game.
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
-- PUT ME IN SERVERSCRIPTSERVICE

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)
-- Define setting instances
local IsOn = Configuration:WaitForChild("IsOn")
local ShouldEmitSound = Configuration:WaitForChild("ShouldEmitSound")
local MaxVolume = Configuration:WaitForChild("MaxVolume")
-- @Description Automatically Profile the given %Function. Arguments that will be passed to the %Function can be added after ...
-- @Arg1 ProfilerString
-- @Arg2 Function
-- @Arg3 ...
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
--returns all of the instances of a specific instance in a model
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