Pinkstack/roblox-luau-corpus-text huggingface dataset:
--------LEFT DOOR --------


game.Workspace.doorleft.l31.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(1)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(1)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(1)
-----------------
--| Functions |--
-----------------



local function MakeSkeleton()
	Skeleton = InsertService:LoadAsset(SKELETON_ASSET_ID):GetChildren()[1]
	if Skeleton then
		local head = Skeleton:FindFirstChild('Head')
		if head then
			head.Transparency = 1
		end

		local skeletonScriptClone = SkeletonScript:Clone()
		skeletonScriptClone.Parent = Skeleton
		skeletonScriptClone.Disabled = false

		local creatorTag = Instance.new('ObjectValue')
		creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
		creatorTag.Value = MyPlayer
		local iconTag = Instance.new('StringValue', creatorTag)
		iconTag.Name = 'icon'
		iconTag.Value = Tool.TextureId
		creatorTag.Parent = Skeleton
	end
end

local function SpawnSkeleton(spawnPosition)
	if Skeleton then
		-- Hellfire
		local firePart = Instance.new('Part')
		firePart.Name = 'Effect'
		firePart.Transparency = 1
		firePart.FormFactor = Enum.FormFactor.Custom
		firePart.Size = Vector3.new()
		firePart.Anchored = true
		firePart.CanCollide = false
		firePart.CFrame = CFrame.new(spawnPosition - Vector3.new(0, 4, 0))
		local fireClone = Fire:Clone()
		fireClone.Parent = firePart
		Delay(0.5, function()
			if fireClone then
				fireClone.Enabled = false
			end
		end)
		DebrisService:AddItem(firePart, 3)
		firePart.Parent = Workspace

		-- Spawn
		local skeletonClone = Skeleton:Clone()
		DebrisService:AddItem(skeletonClone, SKELETON_DURATION)
		skeletonClone.Parent = Workspace
		skeletonClone:MoveTo(spawnPosition) --NOTE: Model must be in Workspace

		-- Rise!
		local torso = skeletonClone:FindFirstChild('Torso')
		if torso then
			torso.CFrame = torso.CFrame - Vector3.new(0, 4.5, 0)
			for i = 0, 4.5, 0.45 do
				torso.CFrame = torso.CFrame + Vector3.new(0, i, 0)
				wait(1/30)
			end
		end
	end
end

local function RaiseSkeletons()
	if not Skeleton then -- Try again
		MakeSkeleton()
	end
	for theta = -135, -45, 45 do
		SpawnSkeleton(MyModel.Torso.CFrame:pointToWorldSpace(Vector3.new(math.cos(theta), 0, math.sin(theta)) * SPAWN_RADIUS))
	end
end
--ScanForPoint()



hum.MoveToFinished:connect(function()

anims.AntWalk:Stop()
if enRoute then
enRoute = false
end
end)

local movementCoroutine = coroutine.wrap(function()
while true do
if target then
local sessionLock = lastLock
if targetType == "Player" then

while target and lastLock == sessionLock do
if target.Character and target.Character:IsDescendantOf(workspace) and target.Character.Humanoid and target.Character.Humanoid.Health > 0 then
local dist = (root.Position-target.Character.PrimaryPart.Position).magnitude
if dist < 7 then
--[[Sword Part Class]]

--
	
local SwordPart =
{
	Damage = 20,
	AttackTime = 1,
	CoolDown = 2,
	
	LastSwing = 0,
	LastHit = 0,

	Part= nil,
	Owner = nil,--player object that owns this sword
	
	OnHit = nil,
	OnHitHumanoid = nil,
	OnAttackReady = nil,
	OnAttack = nil,
	
	
	SwingSound = nil,
	HitSound = nil,
	SwingAnimation = nil, --animation track!
	
	ActiveConnections = {},
	
}
do
	UTIL.MakeClass(SwordPart)
	function SwordPart.New(npart,nowner)
		local init= UTIL.DeepCopy(SwordPart)
		init.Part= npart
		init.Owner = nowner
		table.insert(init.ActiveConnections,init.Part.Touched:connect(function(hit) init:SwordTouch(hit) end))
		
		init.OnHit = InternalEvent.New()
		init.OnHitHumanoid = InternalEvent.New()
		init.OnAttackReady = InternalEvent.New()
		init.OnAttack = InternalEvent.New()
		
		return init
	end
	
	function SwordPart:SwordTouch(hit)
		if tick()-self.LastSwing >self.AttackTime or tick()-self.LastHit<self.AttackTime then return end
		self.OnHit:Fire(hit)
		local character,humanoid = UTIL.FindCharacterAncestor(hit)
		if character and character ~= self.Owner.Character then
			humanoid:TakeDamage(self.Damage)
			self.OnHitHumanoid:Fire(humanoid,hit)
			self.LastHit = tick()
			if self.HitSound then
				self.HitSound:Play()
			end
		end
		
	end
	
	function SwordPart:DoSwing()
		if tick()-self.LastSwing<self.AttackTime+self.CoolDown then
			return
		end
		
		if self.SwingAnimation then
			self.SwingAnimation:Play()
		end
		if self.SwingSound then
			self.SwingSound:Play()
		end
		self.LastSwing = tick()
		self.OnAttack:Fire()
	end
	
	function SwordPart:Destroy()
		for _,i in pairs(self.ActiveConnections) do
			i:disconnect()
		end
	end
end
do
	local Handle = script.Parent
	local Tool = Handle.Parent
	
	local Player = game.Players.LocalPlayer
	local Character = UTIL.WaitForValidCharacter(Player)
	local SwingAni = UTIL.Instantiate"Animation"
	{AnimationId = "http://www.roblox.com/Asset?ID=89289879"}
	
	local HitSound = Handle:WaitForChild('Hit')
	local SwingSound = Handle:WaitForChild('Swing')
	
	local SwingAniTrack
	
	local Sword
	
	
	Tool.Equipped:connect(function(mouse)
		Sword = SwordPart.New(Handle,Player)
		Sword.Damage = 40
		Sword.HitSound = HitSound
		Sword.SwingSound = SwingSound
		Character = UTIL.WaitForValidCharacter(Player)
		local Humanoid = Character:FindFirstChild('Humanoid')

		SwingAniTrack = Humanoid:LoadAnimation(SwingAni)
		Sword.SwingAnimation = SwingAniTrack
		
		Sword.OnHitHumanoid:Connect(function(humanoid,hit)
			local myTorso = Character:FindFirstChild('Torso')
			local torso = humanoid.Parent:FindFirstChild('Torso')
			if not torso or not myTorso then return end
			
			if hit.Name=='Right Arm' or hit.Name=='Left Arm' or hit.Name=='Right Leg' or hit.Name=='Left Leg' then
				hit:BreakJoints()
				WeldUtil.WeldBetween(hit, Handle)
				Delay(1,function() hit:BreakJoints() end )
			end
		end)
		
		mouse.Button1Down:connect(function()
			Sword:DoSwing()
		end)
	end)
	Tool.Unequipped:connect(function()
		Sword:Destroy()
	end)

end
--- Activates the raycasts for the hitbox object.
--- The hitbox will automatically stop and restart if the hitbox was already casting.
-- @param optional number parameter to automatically turn off the hitbox after 'n' seconds


function Hitbox:HitStart(seconds: number?)
	if self.HitboxActive then
		self:HitStop()
	end

	if seconds then
		self.HitboxStopTime = os.clock() + math.max(MINIMUM_SECONDS_SCHEDULER, seconds)
	end

	self.HitboxActive = true
end
--------- CONFIGURATION -----------


local detectionDistance = 40 -- slime will wander until a player comes within this distance
local wanderSpeed = 1 -- the walk speed at which the slime will wander as long as no player is within detection distance
local wanderDistance = 5 -- how far the slime can wander in any one direction at a time
local chaseSpeed = 12 -- the walk speed at which the slime will chase players
local damage = 0 -- how much damage will be done to a humanoid each time the slime touches one
local damageDebounceDelay = .5 -- how many seconds after dealing damage before damage can be dealt again
--[[Weld functions]]



	local JS = game:GetService("JointsService")
	local PGS_ON = workspace:PGSIsEnabled()
	
	function MakeWeld(x,y,type,s) 
		if type==nil then type="Weld" end
		local W=Instance.new(type,x) 
		W.Part0=x W.Part1=y 
		W.C0=x.CFrame:inverse()*x.CFrame 
		W.C1=y.CFrame:inverse()*x.CFrame 
		if type=="Motor" and s~=nil then 
			W.MaxVelocity=s 
		end 
		return W	
	end
	
	function ModelWeld(a,b) 
		if a:IsA("BasePart") and 
			a.Parent.Name ~= ("Hood") then 
			MakeWeld(b,a,"Weld")
			for i,v in pairs(a:GetChildren()) do 
				if v ~= nil and v:IsA("BasePart") then
					ModelWeld(v,b) 
				end
			end
		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  end for i,v in pairs(a:GetChildren()) do UnAnchor(v) end 
	end
--[=[
	Uses the constructor to attach a class or resource to the actual object
	for the lifetime of the subscription of that object.
	@param constructor T
	@return (parent: Instance) -> Observable<T>
]=]


function Blend.Attached(constructor)
	return function(parent)
		return Observable.new(function(sub)
			local maid = Maid.new()

			local resource = constructor(parent)

			if MaidTaskUtils.isValidTask(resource) then
				maid:GiveTask(resource)
			end

			sub:Fire(resource)

			return maid
		end)
	end;
end
----------------------------------
------------FUNCTIONS-------------
----------------------------------



function LetterToNote(key, shift)
	local letterNoteMap = "1!2@34$5%6^78*9(0qQwWeErtTyYuiIoOpPasSdDfgGhHjJklLzZxcCvVbBnm"
	local capitalNumberMap = ")!@#$%^&*("
	local letter = string.char(key)
	if shift then
		if tonumber(letter) then
			-- is a number
			letter = string.sub(capitalNumberMap, tonumber(letter) + 1, tonumber(letter) + 1)
		else
			letter = string.upper(letter)
		end
	end
	local note = string.find(letterNoteMap, letter, 1, true)
	if note then
		return note
	end
end

function KeyDown(Object)
	
	if TextBoxFocused then return end
	local key = Object.KeyCode.Value
	local shift = (InputService:IsKeyDown(303) or InputService:IsKeyDown(304)) == not ShiftLock
	if (key >= 97 and key <= 122) or  (key >= 48 and key <= 57) then
		-- a letter was pressed
		local note = LetterToNote(key, shift)
		if note then PlayNoteClient(note) end
	elseif key == 8 then
		-- backspace was pressed
		Deactivate()
	elseif key == 32 then
		-- space was pressed
		ToggleSheets()
	elseif key == 13 then
		-- return was pressed
		ToggleCaps()
	end
end

function Input(Object)
	local type = Object.UserInputType.Name
	local state = Object.UserInputState.Name -- in case I ever add input types
	if type == "Keyboard" then
		if state == "Begin" then
			if FocusLost then -- this is so when enter is pressed in a textbox, it doesn't toggle caps
				FocusLost = false
				return
			end
			KeyDown(Object)
		end
	end
end

function TextFocus()
	TextBoxFocused = true
end
function TextUnfocus()
	FocusLost = true
	TextBoxFocused = false
end
--edit the below function to execute code when this response is chosen OR this prompt is shown
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data


return function(player, dialogueFolder)
	local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
	plrData.Classes.Base.Scholar.Ignis.Value = true
	
end
--- Creates a new spring
-- @param initial A number or Vector3 (anything with * number and addition/subtraction defined)


function Spring.new(initial)
	local target = initial or 0

	return setmetatable({
		_time0 = tick();
		_position0 = target;
		_velocity0 = 0*target;
		_target = target;
		_damper = 1;
		_speed = 1;
	}, Spring)
end
--API
--RainAPI:StartRain()
--RainAPI:StopRain()
--RainAPI:AddOverrideRegion(X1,Z1,X2,Z2,OverrideY)
--RainAPI:RemoveOverrideRegion(Id)
--RainAPI:SetWindSpeed(X,Z)
--RainAPI:GetWindSpeed()
--RainAPI:SetRainGroupsPerSecond(NewRainGroupsPerSecond)
--RainAPI:GetRainGroupsPerSecond()
--Rescripted by Luckymaxer



Star = script.Parent

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

Creator = Star:FindFirstChild("creator")

HitSound = Star:FindFirstChild("Hit")

Stuck = false

Damage = 23

function IsHuntedVictim(character)
	return character:FindFirstChild("NinjaMaskOfShadows")
end

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

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

function Stick(Object, Hit)
	local Weld = Instance.new("Weld")
	Weld.Part0 = Object
	Weld.Part1 = Hit
	local HitCFrame = CFrame.new(Object.Position)
	Weld.C0 = Object.CFrame:inverse() * HitCFrame
	Weld.C1 = Hit.CFrame:inverse() *  HitCFrame
	Weld.Parent = Object
end

function IsTeamMate(Player1, Player2)
	return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
end

function Touched(Hit)
	if not Hit or not Hit.Parent or Stuck then
		return
	end
	local character = Hit.Parent
	if character:IsA("Hat") or character:IsA("Tool") then
		character = character.Parent
	end
	local CreatorPlayer
	if Creator and Creator.Value and Creator.Value:IsA("Player") and Creator.Value.Character then
		CreatorPlayer = Creator.Value
	end
	if CreatorPlayer and CreatorPlayer.Character == character then
		return
	end
	local player = Players:GetPlayerFromCharacter(character)
	if CreatorPlayer and player and IsTeamMate(CreatorPlayer, player) then
		return
	end
	Stuck = true
	Stick(Star, Hit)
	if HitSound then
		HitSound:Play()
	end
	local humanoid = character:FindFirstChild("Humanoid")
	if humanoid and humanoid.Health > 0 then
		UntagHumanoid(humanoid)
		if CreatorPlayer then
			TagHumanoid(humanoid, CreatorPlayer)
		end
		humanoid:TakeDamage(Damage * ((IsHuntedVictim(character) and 2) or 1))
	end
end
	
Star.Touched:connect(Touched)
--Create attachments and contraints for function


local parts = getParts(boat)
local centerOfMass, totalMass = GetCenterOfMass(parts)

local center = Instance.new("Part")
center.Anchored = true
center.Name = "CenterPart"
center.CanCollide = false
center.Archivable = false
center.Size = Vector3.new()
center.Transparency = 1
center.CFrame = GetRotationInXZPlane(seat.CFrame - seat.CFrame.p) + centerOfMass
center.Parent = boat

local attachment = Instance.new("Attachment")
attachment.CFrame = center.CFrame
attachment.Position = Vector3.new()
attachment.Parent = center

local vectorForce = Instance.new("VectorForce")
vectorForce.ApplyAtCenterOfMass = true
vectorForce.Attachment0 = attachment
vectorForce.Force = Vector3.new()
vectorForce.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
vectorForce.Parent = center

local torque = Instance.new("Torque")
torque.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
torque.Attachment0 = attachment
torque.Torque = Vector3.new()
torque.Parent = center

totalMass = totalMass + center:GetMass()
----------------------------------------------------------------------------------------------------
-----------------=[ General ]=----------------------------------------------------------------------
----------------------------------------------------------------------------------------------------


	 TeamKill = true					--- Enable TeamKill?
	,TeamDamageMultiplier = 1			--- Between 0-1 | This will make you cause less damage if you hit your teammate
	
	,ReplicatedBullets = true			--- Keep in mind that some bullets will pass through surfaces...
	
	,AntiBunnyHop = true				--- Enable anti bunny hop system?
	,JumpCoolDown = 0.1					--- Seconds before you can jump again
	,JumpPower = 50						--- Jump power, default is 50
	
	,RealisticLaser = true				--- True = Laser line is invisible
	,ReplicatedLaser = true				
	,ReplicatedFlashlight = true
	
	,EnableRagdoll = false				--- Enable ragdoll death?
	,TeamTags = false					--- Aaaaaaa
	,HitmarkerSound = false				--- GGWP MLG 360 NO SCOPE xD
--------- Slim AI Script (don't edit unless you know what you're doing) -----------


local slime = script.Parent
local walkAnimation = slime.Humanoid:LoadAnimation(slime.Humanoid.Animation)
walkAnimation:Play()

slime.Humanoid.Died:Connect(function()
	slime:Destroy()
	-- TODO: Add fancier death or give rewards
end)

local hasDamagedRecently = false
local function damageIfHumanoidDebounced(part) 
	if not hasDamagedRecently then
		local humanoid = part.Parent:FindFirstChild("Humanoid")
		if humanoid then
			humanoid.Health -= damage
			hasDamagedRecently = true
			wait(damageDebounceDelay)
			hasDamagedRecently = false
		end	
	end
end
for _,part in pairs(slime:GetChildren()) do
	if part:IsA("BasePart") and part.Name ~= "HitBox"  then
		part.Touched:Connect(damageIfHumanoidDebounced)
	end
end

local function getClosestPlayer(position) 
	local closestPlayer = false
	local closestDistance = 999999999
	for _,player in pairs(game.Players:GetChildren()) do
		local playerPosition = game.Workspace:WaitForChild(player.Name).HumanoidRootPart.Position
		local dist = (position - playerPosition).magnitude
		if(dist < closestDistance) then
			closestDistance = dist
			closestPlayer = game.Workspace:WaitForChild(player.Name)
		end
	end
	return closestPlayer
end

local isWandering = false
while true do -- main AI loop
	wait(.1)
	local player = getClosestPlayer(slime.Head.Position)
	if player then
		local distance = (player.PrimaryPart.Position - slime.HumanoidRootPart.Position).magnitude
		if distance < detectionDistance then
			isWandering = false
			slime.Humanoid.WalkSpeed = chaseSpeed
			slime.Humanoid:MoveTo(player.PrimaryPart.Position)			
		else
			if not isWandering then
				isWandering = true
				slime.Humanoid.WalkSpeed = wanderSpeed
				slime.Humanoid:MoveTo(slime.HumanoidRootPart.Position + Vector3.new(math.random(-wanderDistance, wanderDistance), 0, math.random(-wanderDistance, wanderDistance)))
				slime.Humanoid.MoveToFinished:Connect(function()
					isWandering = false
				end)
			end
		end		
	end
end
--Func


local function condensePath(paths)
    local newWaypoints = {
        paths[1].Position
    }
    local lastUnit = (paths[2].Position - paths[1].Position).Unit

    if #paths > 2 then 
        for i = 2, #paths - 1 do 
            local thisUnit = (paths[i].Position - newWaypoints[#newWaypoints]).Unit

            if not thisUnit ~= lastUnit then
                table.insert(newWaypoints, paths[i].Position)
                lastUnit = thisUnit
            end 
        end 
    end

    return newWaypoints
end 

return function(pointA, pointB, refreshPath)
    if refreshPath then
        path = PathfindingService:CreatePath()
    end
    path:ComputeAsync(pointA, pointB)

    if path.Status == Enum.PathStatus.Success then
        local waypoints = condensePath(path:GetWaypoints())

        return waypoints
    else 
        return false
    end 
end
--!strict


local Players = game:GetService("Players")

local function GetPlayerFromInstance(instance: Instance, aliveOnly: boolean?): Player?
	for _, player: Player in ipairs(Players:GetPlayers()) do
		local character = player.Character::Model
		
		if not character or not character.Parent then
			continue
		end
		
		if aliveOnly == true then
			local humanoid = character:FindFirstChildOfClass("Humanoid")::Humanoid
			
			if not humanoid or humanoid.Health <= 0 or humanoid:GetState() == Enum.HumanoidStateType.Dead then
				continue
			end
		end
		
		if instance:IsDescendantOf(character) then
			return player
		end
	end
	
	return nil
end

return GetPlayerFromInstance
--[[
	Create a TestSession related to the given TestPlan.

	The resulting TestResults object will be linked to this TestPlan.
]]


function TestSession.new(plan)
	local self = {
		results = TestResults.new(plan),
		nodeStack = {},
		contextStack = {},
		expectationContextStack = {},
		hasFocusNodes = false
	}

	setmetatable(self, TestSession)

	return self
end
--	car.DriveSeat.CC.Changed:connect(function()
--		if car.DriveSeat.CC.Value then
--			script.Parent.Values.CCS.Value = car.DriveSeat.CCS.Value
--		end
--	end)


	
	--15 c/s
	while wait(.0667) do
		--Automatic Transmission
		if _TMode.Value == "Auto" then Auto() end
		
		--Flip
		if _Tune.AutoFlip then Flip() end
	end
--------LEFT DOOR --------


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

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

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

game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.Lighting.flashcurrent.Value = "12"
--///////////////// Internal-Use Methods
--//////////////////////////////////////


function methods:InternalDestroy()
	for i, channel in pairs(self.Channels) do
		channel:InternalRemoveSpeaker(self)
	end

	self.eDestroyed:Fire()

	self.eDestroyed:Destroy()
	self.eSaidMessage:Destroy()
	self.eReceivedMessage:Destroy()
	self.eMessageDoneFiltering:Destroy()
	self.eReceivedSystemMessage:Destroy()
	self.eChannelJoined:Destroy()
	self.eChannelLeft:Destroy()
	self.eMuted:Destroy()
	self.eUnmuted:Destroy()
	self.eExtraDataUpdated:Destroy()
	self.eMainChannelSet:Destroy()
	self.eChannelNameColorUpdated:Destroy()
end

function methods:InternalAssignPlayerObject(playerObj)
	self.PlayerObj = playerObj
end

function methods:InternalSendMessage(messageObj, channelName)
	local success, err = pcall(function()
		self.eReceivedMessage:Fire(messageObj, channelName)
	end)
	if not success and err then
		print("Error sending internal message: " ..err)
	end
end

function methods:InternalSendFilteredMessage(messageObj, channelName)
	local success, err = pcall(function()
		self.eMessageDoneFiltering:Fire(messageObj, channelName)
	end)
	if not success and err then
		print("Error sending internal filtered message: " ..err)
	end
end

function methods:InternalSendSystemMessage(messageObj, channelName)
	local success, err = pcall(function()
		self.eReceivedSystemMessage:Fire(messageObj, channelName)
	end)
	if not success and err then
		print("Error sending internal system message: " ..err)
	end
end

function methods:UpdateChannelNameColor(channelName, channelNameColor)
	self.eChannelNameColorUpdated:Fire(channelName, channelNameColor)
end
--- Add a line to the command bar


function Window:AddLine(text, options)
	options = options or {}
	text = tostring(text)

	if typeof(options) == "Color3" then
		options = { Color = options }
	end

	if #text == 0 then
		Window:UpdateWindowHeight()
		return
	end

	local str = self.Cmdr.Util.EmulateTabstops(text or "nil", 8)

	local line = Line:Clone()
	line.Text = str
	line.TextColor3 = options.Color or line.TextColor3
	line.RichText = options.RichText or false
	line.Parent = Gui
end