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


game.Workspace.doorleft.l11.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l12.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l31.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(194)
--[=[
	Catches an error, and allows another observable to be subscribed
	in terms of handling the error.

	:::warning
	This method is not yet tested
	:::

	@param callback (error: TError) -> Observable<TErrorResult>
	@return (source: Observable<T>) -> Observable<T | TErrorResult>
]=]


function Rx.catchError(callback)
	assert(type(callback) == "function", "Bad callback")

	return function(source)
		assert(Observable.isObservable(source), "Bad observable")

		return Observable.new(function(sub)
			local maid = Maid.new()

			-- Yikes, let's hope event ordering is good
			local alive = true
			maid:GiveTask(function()
				alive = false
			end)

			maid:GiveTask(source:Subscribe(
				function(...)
					sub:Fire(...)
				end,
				function(...)
					if not alive then
						-- if we failed because maid was cancelled, then we'll get called here?
						-- I think.
						return
					end

					-- at this point, we can only have one error, so we need to subscribe to the result
					-- and continue the observiable
					local observable = callback(...)
					assert(Observable.isObservable(observable), "Bad observable")

					maid:GiveTask(observable:Subscribe(sub:GetFireFailComplete()))
				end,
				function()
					sub:Complete()
				end));

			return maid
		end)
	end
end
-- Other


local indicator = Instance.new("ImageLabel")
indicator.Name = "Indicator"
indicator.BackgroundTransparency = 1
indicator.Image = "rbxassetid://5278151556"
indicator.Size = UDim2.new(0,32,0,32)
indicator.AnchorPoint = Vector2.new(0.5,0)
indicator.Position = UDim2.new(0.5,0,0,5)
indicator.ScaleType = Enum.ScaleType.Fit
indicator.Visible = false
indicator.Active = true
indicator.Parent = topbarPlusGui
indicator.Active = false
--!strict


local function endsWith(value: string, substring: string, optionalLength: number?): boolean
	local substringLength = substring:len()
	if substringLength == 0 then
		return true
	end
	local valueLength = value:len()
	local length = optionalLength or valueLength
	if length > valueLength then
		length = valueLength
	end
	if length < 1 then
		return false
	end
	local position = length - substringLength + 1
	return value:find(substring, position, true) == position
end

return endsWith
--[[
	Model for an UserAsset
	{
		userAssetId = string,
		userId = name,
		userName = string,
		serialNumber = optional string,
		priceInRobux = optional int
	}
]]


local Modules = game:GetService("Players").LocalPlayer.PlayerGui.AvatarEditorInGame.Modules
local MockId = require(Modules.NotLApp.MockId)

local UserAssetModel = {}

function UserAssetModel.mock()
	local self = {}

	self.userAssetId = tostring(MockId())
	self.userId = tostring(MockId())
	self.userName = ""
	self.serialNumber = tostring(MockId())
	self.priceInRobux = 0

	return self
end

function UserAssetModel.fromSellPageAndResellers(newData)
	local userAssetInfo = {}

	userAssetInfo.userAssetId = tostring(newData.userAssetId)
	if newData.seller then
		userAssetInfo.userId = tostring(newData.seller.id)
		userAssetInfo.userName = newData.seller.name
	end

	userAssetInfo.serialNumber = newData.serialNumber and tostring(newData.serialNumber) or nil
	userAssetInfo.priceInRobux = newData.price
	return userAssetInfo
end

function UserAssetModel.fromPriceInRobux(userAssetId, priceInRobux)
	local userAssetInfo = {}

	userAssetInfo.userAssetId = tostring(userAssetId)
	userAssetInfo.priceInRobux = priceInRobux

	return userAssetInfo
end

return UserAssetModel
--UserInput.MouseBehavior = Enum.MouseBehavior.LockCenter



function CameraModule.new(Position, Rotation, Sensitivity, move)
	local Camera = {}
	
	Camera.Position = Position
	Camera.Rotation = Rotation
	Camera.CFrame = CFrame.new(Position) * CFrame.Angles(math.rad(Rotation.X), math.rad(Rotation.Y), math.rad(Rotation.Z))
	Camera.Target = Vector3.new(1,0,0)
	Camera.PressedKey = nil

	Camera.fpsController = {
		direction = 0,
		pitch = 0,
	}

	Camera.Sensitivity = Sensitivity
	
	Mouse.KeyDown:Connect(function(key)
		Camera.PressedKey = key
	end)

	Mouse.KeyUp:Connect(function()
		Camera.PressedKey = nil
	end)

	function Camera:Movement()
		local key = Camera.PressedKey

		if key == "e" then
			Camera.CFrame += Vector3.new(0,0.4,0)
		elseif key == "q" then
			Camera.CFrame -= Vector3.new(0,0.4,0)
		elseif key == "w" then
			Camera.CFrame += Vector3.new(0.4*math.cos(-Camera.Rotation.Y), 0, 0.4*math.sin(-Camera.Rotation.Y))
		elseif key == "s" then
			Camera.CFrame -= Vector3.new(0.4*math.cos(-Camera.Rotation.Y), 0, 0.4*math.sin(-Camera.Rotation.Y))
		elseif key == "a" then
			Camera.CFrame += Vector3.new(0.4*math.sin(-Camera.Rotation.Y), 0, -0.4*math.cos(-Camera.Rotation.Y))
		elseif key == "d" then
			Camera.CFrame += Vector3.new(-0.4*math.sin(-Camera.Rotation.Y), 0, 0.4*math.cos(-Camera.Rotation.Y))
		end
		
		task.synchronize()
		Camera:Pan(UserInput:GetMouseDelta().X, UserInput:GetMouseDelta().Y)
		task.desynchronize()
	end

	function Camera:Pan(dx, dy)
		Camera.fpsController.direction = math.max(math.min(Camera.fpsController.direction - dy * Camera.Sensitivity, math.pi * 0.5), math.pi * -0.5)
		Camera.fpsController.pitch = Camera.fpsController.pitch - dx * Camera.Sensitivity
		
		local rotationCFrame = CFrame.Angles(0, Camera.fpsController.pitch, 0) * CFrame.Angles(Camera.fpsController.direction, 0, 0)
		local positionCFrame = CFrame.new(Camera.CFrame.Position)

		Camera.CFrame = positionCFrame * rotationCFrame
	end
	
	function Camera:Update()
		Camera.Position = Camera.CFrame.Position
		local xRotation, yRotation, _ = Camera.CFrame:ToOrientation()
		Camera.Rotation = Vector3.new(xRotation, yRotation + math.rad(90), 0)
		
		if move == true then
			Camera:Movement()
		end
	end

	return Camera
end

return CameraModule
-- Create a new explosion at the location of our grenade


local Explosion = Instance.new("Explosion")
Explosion.BlastRadius = 19
Explosion.BlastPressure = 2000
Explosion.DestroyJointRadiusPercent = 0

Explosion.Position = RootModel:GetPrimaryPartCFrame().Position

local parts = workspace:GetPartBoundsInRadius(Explosion.Position,Explosion.BlastRadius)
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 800		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 600		--		Use sliders to manipulate values
	Tune.Redline		= 670		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 550
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 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)
--Made by Luckymaxer



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

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

Animations = {}

ServerControl = Tool:WaitForChild("ServerControl")
ClientControl = Tool:WaitForChild("ClientControl")

ToolEquipped = false

function SetAnimation(mode, value)
	if not ToolEquipped or not CheckIfAlive() then
		return
	end
	if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
		for i, v in pairs(Animations) do
			if v.Animation == value.Animation then
				v.AnimationTrack:Stop()
				table.remove(Animations, i)
			end
		end
		local AnimationTrack = Humanoid:LoadAnimation(value.Animation)
		table.insert(Animations, {Animation = value.Animation, AnimationTrack = AnimationTrack})
		AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed)
	elseif mode == "StopAnimation" and value then
		for i, v in pairs(Animations) do
			if v.Animation == value.Animation then
				v.AnimationTrack:Stop()
				table.remove(Animations, i)
			end
		end
	end
end

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

function Equipped(Mouse)
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChild("Humanoid")
	ToolEquipped = true
	if not CheckIfAlive() then
		return
	end
	PlayerMouse = Player:GetMouse()
	Mouse.KeyDown:connect(function(Key)
		InvokeServer("KeyPress", {Key = Key, Down = true})
	end)
	Mouse.KeyUp:connect(function(Key)
		InvokeServer("KeyPress", {Key = Key, Down = false})
	end)
end

function Unequipped()
	ToolEquipped = false
	for i, v in pairs(Animations) do
		if v and v.AnimationTrack then
			v.AnimationTrack:Stop()
		end
	end
	Animations = {}
end

function InvokeServer(mode, value)
	local ServerReturn
	pcall(function()
		ServerReturn = ServerControl:InvokeServer(mode, value)
	end)
	return ServerReturn
end

function OnClientInvoke(mode, value)
	if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
		SetAnimation("PlayAnimation", value)
	elseif mode == "StopAnimation" and value then
		SetAnimation("StopAnimation", value)
	elseif mode == "PlaySound" and value then
		value:Play()
	elseif mode == "StopSound" and value then
		value:Stop()
	elseif mode == "MouseData" then
		return {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}
	end
end

ClientControl.OnClientInvoke = OnClientInvoke
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
--[[
	*
	* Creates a server listening event
]]


local function createServerListener(id, ...)
	local args = { ... }
	local event
	if isMiddlewareArgument(args) then
		local _binding = args
		local middleware = _binding[1]
		local connect = _binding[2]
		event = ServerEventV2.new(id, middleware)
		return event:Connect(connect)
	else
		local _binding = args
		local connect = _binding[1]
		event = ServerEventV2.new(id)
		return event:Connect(connect)
	end
end
return {
	default = createServerListener,
}
-- Events


ClientOrchestration.ClientSceneMetadataEvent = Orchestra.Events.ClientEvents.ClientSceneMetadata
ClientOrchestration.SendMediaControllerConfig = Orchestra.Events.MediaControllerConfigEvents.SendMediaControllerConfig
ClientOrchestration.Seek = Orchestra.Events.ClientEvents.Seek
ClientOrchestration.Pause = Orchestra.Events.ClientEvents.Pause
ClientOrchestration.SceneEnded = Orchestra.Events.ClientEvents.SceneEnded
ClientOrchestration.SeekPermissionsEvent = Orchestra.Events.ClientEvents.SeekPermissions

ClientOrchestration.SeekerGuiComponent = nil

ClientOrchestration.playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")

ClientOrchestration.taskLib = task
ClientOrchestration._warn = function(msg)
	warn(msg)
end

ClientOrchestration._require = function(file)
	return require(file)
end

ClientOrchestration.handleSeekPermissionsEvent = function(hasPermission)
	if hasPermission and not ClientOrchestration.SeekerGuiComponent then
		local SeekerGuiElement = ClientOrchestration.Roact.createElement(ClientOrchestration.SeekerGui)

		ClientOrchestration.SeekerGuiComponent = ClientOrchestration.Roact.mount(
			SeekerGuiElement,
			ClientOrchestration.playerGui,
			"SceneSeeker"
		)
	end

	if not hasPermission and ClientOrchestration.SeekerGuiComponent then
		if ClientOrchestration.SeekerGuiComponent then
			ClientOrchestration.Roact.unmount(ClientOrchestration.SeekerGuiComponent)
			ClientOrchestration.SeekerGuiComponent = nil
		end
	end
end

ClientOrchestration.ClientSceneMetadataRequestConnection = nil

ClientOrchestration.setupSchema = function()
	ClientOrchestration.isSeekable = false
	local lastCalledOrchestrationTime = ClientOrchestration.lastCalledOrchestrationTime

	local setupSuccess, setupError = ClientOrchestration.SchemaProcessorInstance:Setup()

	local isSameScene = lastCalledOrchestrationTime == ClientOrchestration.lastCalledOrchestrationTime

	if not setupSuccess then
		ClientOrchestration._warn("Client Schema Setup wasn't successful")
		ClientOrchestration._warn(setupError)
	elseif isSameScene then
		ClientOrchestration.isSeekable = true
	end
	return setupSuccess
end

ClientOrchestration.processSchema = function(isSeeking)
	local processSuccess, processError = ClientOrchestration.SchemaProcessorInstance:Process(isSeeking)

	if not processSuccess then
		ClientOrchestration._warn("Client Schema Process wasn't successful")
		ClientOrchestration._warn(processError)
	end
end

ClientOrchestration.cleanUp = function()
	if ClientOrchestration.SchemaProcessorInstance then
		ClientOrchestration.SchemaProcessorInstance:CleanUp()
	end
end

ClientOrchestration.handleSceneEnded = function()
	if ClientOrchestration.SchemaProcessorInstance then
		local endSceneSuccess, endSceneError = ClientOrchestration.SchemaProcessorInstance:EndScene()
		if not endSceneSuccess then
			ClientOrchestration._warn("Client End Scene wasn't successful")
			ClientOrchestration._warn(endSceneError)
		end
		ClientOrchestration.cleanUp()
	end
end
--[=[
	Executes the task delayed after some time.

	```lua
	-- delays cleanup by 5 seconds
	maid:GiveTask(MaidTaskUtils.delayed(5, gui))
	```

	@param time number -- Time in seconds
	@param job MaidTask -- Job to delay execution
	@return () -> () -- function that will execute the job delayed
]=]


function MaidTaskUtils.delayed(time, job)
	assert(type(time) == "number", "Bad time")
	assert(MaidTaskUtils.isValidTask(job), "Bad job")

	return function()
		task.delay(time, function()
			MaidTaskUtils.doTask(job)
		end)
	end
end

return MaidTaskUtils
-- The states where the Last Standing Y Position variable will not be changed.


local States = {
	[Enum.HumanoidStateType.Running] = true;
	[Enum.HumanoidStateType.RunningNoPhysics] = true;
	[Enum.HumanoidStateType.Climbing] = true;
	[Enum.HumanoidStateType.Ragdoll] = true;
	[Enum.HumanoidStateType.FallingDown] = true;
	[Enum.HumanoidStateType.Flying] = true;
	[Enum.HumanoidStateType.GettingUp] = true;
	[Enum.HumanoidStateType.Dead] = true;
	[Enum.HumanoidStateType.None] = true;
	[Enum.HumanoidStateType.Physics] = true;
	[Enum.HumanoidStateType.Swimming] = true;
	[Enum.HumanoidStateType.Seated] = true;
	[Enum.HumanoidStateType.PlatformStanding] = true;
}

local Character

repeat wait() until script.Parent.Parent:FindFirstChild("Humanoid")

Character = script.Parent.Parent

local Humanoid = Character:WaitForChild("Humanoid")
local HRP = Character:WaitForChild("HumanoidRootPart")
local Values = require(script.Parent.Values)

while true do
	local state = getHumanoidState(Humanoid)
	--print(state)
	if States[state] and not Values.DontUpdateYet then
		Values.LastStandingPos = HRP.Position
		--print(Values.LastStandingYPos)
	end
	task.wait()
end
-- Driver Input Loop --


while script.Parent ~= nil do
	--Update throttle, steer, handbrake
	getInputValues()

	local currentVel = Chassis.GetAverageVelocity()

	if Car:GetAttribute("Fuel") > 0 and Car:GetAttribute("Health") > 0 then
		local steer = script.Steering.Value
		Chassis.UpdateSteering(steer, currentVel)

		-- Taking care of throttling
		local throttle = script.Throttle.Value
		script.AngularMotorVelocity.Value = currentVel
		script.ForwardVelocity.Value = DriverSeat.CFrame.LookVector:Dot(DriverSeat.Velocity)
		Chassis.UpdateThrottle(currentVel, throttle)

		-- Taking care of handbrake
		if script.HandBrake.Value > 0 then
			Chassis.EnableHandbrake()
		end
	else
		script.AngularMotorVelocity.Value = 0
		script.ForwardVelocity.Value = 0
		Chassis.UpdateThrottle(0, 0)
	end
	
	task.wait()
end
-------------------------------------------------------------------------------
-- Core:



local MAX_PATHS = 10

local pathfindingService = game:GetService("PathfindingService")


local function SimplifyPointsStraight(points)
	local simplified = {}
	local i = 1
	while (i < #points) do
		local pt = points[i]
		table.insert(simplified, pt)
		if (i < #points) then
			local ptNext = points[i + 1]
			local dx, dy, dz = (ptNext.x - pt.x), (ptNext.y - pt.y), (ptNext.z - pt.z)
			for j = i+1, #points do
				i = j
				local ptLast = points[i - 1]
				local pt2 = points[i]
				local dx2, dy2, dz2 = (pt2.x - ptLast.x), (pt2.y - ptLast.y), (pt2.z - ptLast.z)
				if (dx ~= dx2 or dy ~= dy2 or dz ~= dz2) then
					i = (i - 1)
					break
				end
			end
		end
	end
	table.insert(simplified, points[#points])
	return simplified
end


local function SimplifyPointsDiagonal(points)
	local simplified = {}
	local i = 3
	while (i < #points) do
		local p1 = points[i - 2]
		local p2 = points[i - 1]
		local p3 = points[i]
		local a = (p1 - p2).magnitude
		local b = (p2 - p3).magnitude
		local c = (p1 - p3).magnitude
		table.insert(simplified, p1)
		if (a == b) then
			i = (i + 2)
		else
			i = (i + 1)
		end
	end
	table.insert(simplified, points[#points])
	return simplified
end


function CreatePathObject(paths, points, finalStatus)
	local path = {}
	local api = {}
	api.Status = finalStatus
	function api:GetPointCoordinates()
		return points
	end
	function api:CheckOcclusionAsync(start)
		local n = 0
		local startIndex = 1
		for i,p in pairs(paths) do
			local numPoints = #p:GetPointCoordinates()
			n = (n + numPoints)
			if (n >= start) then
				startIndex = i + 1
				local test = p:CheckOcclusionAsync(n - numPoints + start)
				if (test ~= -1) then
					return (n - numPoints + test)
				end
				break
			end
		end
		for i = startIndex, #paths do
			local p = paths[i]
			local numPoints = #p:GetPointCoordinates()
			n = (n + numPoints)
			if (numPoints > 0) then
				local test = p:CheckOcclusionAsync(1)
				if (test ~= -1) then
					return (n - numPoints + test)
				end
			end
		end
		return -1
	end
	return setmetatable(path, {
		__metatable = true;
		__index = api;
		__newindex = function()
			error("Cannot edit Path")
		end;
	})
end
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!


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

hitPart.Touched:Connect(function(hit)
	if debounce == true then
		if hit.Parent:FindFirstChild("Humanoid") then
			local plr = game.Players:FindFirstChild(hit.Parent.Name)
			if plr then
				debounce = false
				hitPart.BrickColor = BrickColor.new("Bright red")
				tool:Clone().Parent = plr.Backpack
				wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again
				debounce = true
				hitPart.BrickColor = BrickColor.new("Bright green")
			end
		end
	end
end)
--[[spawn(function()
	while wait(5) do
		for i = 1,5 do
			module:Notice(main.hdAdminCoreName, "Your rank is 'Owner'! Click to view the commands.", {"ShowSpecificPage", "Commands", "Commands"})
			wait(1)
			--module:Notice(main.hdAdminCoreName, "You're a Donor! Click to view Donor commands." )
			--wait(1)
		end
	end
end)--]]




return module
-- Main script execution


game.Players.PlayerAdded:Connect(function(player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"

	local points = Instance.new("IntValue")
	points.Name = "Points"
	points.Parent = leaderstats

	local survival = Instance.new("IntValue")
	survival.Name = "Survival"
	survival.Parent = leaderstats

	leaderstats.Parent = player
end)

dayNightCycle()
--[[Drivetrain Initialize]]



	local Drive={}
	
	--Power Front Wheels
		if _Tune.Config == "FWD" or _Tune.Config == "AWD" then for i,v in pairs(car.Wheels:GetChildren()) do if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then table.insert(Drive,v) end end end
	
	--Power Rear Wheels
		if _Tune.Config == "RWD" or _Tune.Config == "AWD" then for i,v in pairs(car.Wheels:GetChildren()) do if v.Name=="RL" or v.Name=="RR" or v.Name=="R" then table.insert(Drive,v) end end end
	
	--Determine Wheel Size
	local wDia = 0 for i,v in pairs(Drive) do if v.Size.x>wDia then wDia = v.Size.x end end
	
	--Pre-Toggled PBrake
	for i,v in pairs(car.Wheels:GetChildren()) do if math.abs(v["#AV"].maxTorque.Magnitude-PBrakeForce)<1 then _PBrake=true end end
--[[**
	Gets the player's primary group if it exists.
	@param [Instance<Player>] Player The player you are checking for. Can also be their UserID.
	@returns [DictionaryOrNil] The player's primary group if it exists, otherwise nil.
**--]]


function GroupService:GetPrimaryGroupAsync(Player)
	for _, Group in ipairs(GroupService:GetGroupsAsync(Player)) do
		if Group.IsPrimary then
			return Group
		end
	end

	return nil
end
--create tables:


for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "e" then
		table.insert(e, 1, part)
	end
end
for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "f" then
		table.insert(f, 1, part)
	end
end

function lightOn(T)
	for i, part in pairs (T) do
		if part:FindFirstChild("On") then
			part.On.Value  = true
		end
	end
end

function lightOff(T)
	for i, part in pairs (T) do
		if part:FindFirstChild("On") then
			part.On.Value = false
		end
	end
end

while true do

	lightOn(e)
	lightOn(f)
	wait(0.15)

	lightOff(e)
	lightOff(f)
	wait(0.15)
	
end
--[=[
	Transforms the observable with the following transformers

	```lua
	Rx.of(1, 2, 3):Pipe({
		Rx.map(function(result)
			return result + 1
		end);
		Rx.map(function(value)
			return ("%0.2f"):format(value)
		end);
	}):Subscribe(print)

	--> 2.00
	--> 3.00
	--> 4.00
	```
	@param transformers { (observable: Observable<T>) -> Observable<T> }
	@return Observable<T>
]=]


function Observable:Pipe(transformers)
	assert(type(transformers) == "table", "Bad transformers")

	local current = self
	for _, transformer in pairs(transformers) do
		assert(type(transformer) == "function", "Bad transformer")
		current = transformer(current)
		assert(Observable.isObservable(current), "Transformer must return an observable")
	end

	return current
end
----------------------------------
-----------CONNECTIONS------------
----------------------------------



PianoKeysConnections = {}
ExitButtonConnection = nil
SheetsButtonConnection = nil
SheetsEditedConnection = nil
CapsButtonConnection = nil

function MakeGuiConnections()
	for i, v in pairs(PianoGui.Keys:GetChildren()) do
		PianoKeysConnections[i] = v.InputBegan:connect(function(Object) PianoKeyPressed(Object, tonumber(v.Name)) end)
	end
	
	ExitButtonConnection = PianoGui.ExitButton.InputBegan:connect(ExitButtonPressed)
	SheetsButtonConnection = PianoGui.SheetsButton.InputBegan:connect(SheetsButtonPressed)
	SheetsEditedConnection = SheetsGui.Sheet.ScrollingFrame.TextBox.Changed:connect(SheetsEdited)
	CapsButtonConnection = PianoGui.CapsButton.InputBegan:connect(CapsButtonPressed)
end
function BreakGuiConnections()
	for i, v in pairs(PianoKeysConnections) do
		v:disconnect()
	end
	
	ExitButtonConnection:disconnect()
	SheetsButtonConnection:disconnect()
	SheetsEditedConnection:disconnect()
	CapsButtonConnection:disconnect()
end