Roblox/luau_corpus huggingface dataset:
-- R6 only!

repeat game:GetService("RunService").Stepped:Wait() until game.Players.LocalPlayer
local player = script.Parent.Parent
local mouse = player:GetMouse()
local selecting = false
local valve

mouse.Button1Up:Connect(function()
	if selecting == true then
		 valve = mouse.Target
		if valve.Using.Value == false and valve.Parent == workspace.Valves and script.Parent.IsUsingValve.Value == false then
			if box then
				box:Destroy()
			end
			valve.Using.Value = true
			script.Parent.IsUsingValve.Value = true
			local camera = workspace.CurrentCamera
			local tweenservice = game:GetService('TweenService')
			local cf = camera.CFrame
			repeat
				wait(.01)
				camera.CameraType = Enum.CameraType.Scriptable
			until camera.CameraType == Enum.CameraType.Scriptable
			character.HumanoidRootPart.Anchored = true
			script.Parent.ValveUI.Enabled = true
			tweenservice:Create(camera,TweenInfo.new(1,Enum.EasingStyle.Cubic,Enum.EasingDirection.Out), {CFrame = valve.offset.WorldCFrame}):Play()
			repeat
				wait(.01)
			until valve.Orientation.X > 59
			wait(1.5)
			script.Parent.ValveUI.Enabled = false
			valve.Turn:Play()
			valve.Parent = workspace.Valves.Completed
			valve.Using.Value = false
			wait(0.3)
			tweenservice:Create(camera,TweenInfo.new(1,Enum.EasingStyle.Cubic,Enum.EasingDirection.Out), {CFrame = cf}):Play()
			valve = nil
			wait(1)
			script.Parent.IsUsingValve.Value = false
			character.HumanoidRootPart.Anchored = false
			repeat
				wait(.01)
				camera.CameraType = Enum.CameraType.Custom
			until camera.CameraType == Enum.CameraType.Custom

		end
	end
end)

mouse.KeyDown:Connect(function(key)
	if key == "d" then
		holding = true
		print('play')
		e = 'Front'
		end
end)

mouse.KeyUp:Connect(function(key)
	if key == "d" then
		holding = false
		e = 'nil'
		print('stop')
		
	elseif key == "a" then
		holding = false
		e = 'nil'
		print('stop')

	end
end)

while wait() do	
	
	for i,v in pairs(workspace.Valves.Completed:GetChildren()) do
		if i == 5 then
			workspace.Door.Open:FireServer()
		end
	end
	if valve and holding == true then
		if e == 'Front' then
			print('Q')
			valve.CFrame = valve.CFrame * CFrame.fromEulerAnglesXYZ(0.090,0,0)

		elseif e == 'Back' then
			print('E')
			valve.CFrame = valve.CFrame * CFrame.fromEulerAnglesXYZ(-0.050,0,0)


		end
	end
	
	if mouse.Target then
		if script.Parent.IsUsingValve.Value == false and mouse.Target.Name == '1' or mouse.Target.Name == '2' or mouse.Target.Name == '3' or mouse.Target.Name == '4' or mouse.Target.Name == '5' or mouse.Target.Name == '6' then
				if not mouse.Target:FindFirstChild('selection') and mouse.Target.Parent == workspace.Valves and mouse.Target.Using.Value == false and script.Parent.IsUsingValve.Value == false then
					box = script.Parent.ValveUI.selection:clone()
				box.Parent = mouse.Target
				
					selecting = true
					box.Adornee = mouse.Target
				end
		else
				selecting = false
				if box then
					box:Destroy()
				end
			end
		
	end	
end
-- Function to update the search results based on the search text
local function updateSearchResults(searchText)
	-- Clear existing search results
	for _, child in ipairs(searchScrollingFrame:GetChildren()) do
		if not child:IsA("UIListLayout") then
			child:Destroy()
		end
	end

	local repositories = config.clippify.Repositories
	local tracks = {} -- This will store the combined tracks from all repositories

	-- Loop through each repository and load the tracks
	for _, repository in ipairs(repositories) do
		local repoTracks = require(repository)
		for _, trackInfo in ipairs(repoTracks) do
			table.insert(tracks, trackInfo)
		end
	end

	-- Filter and copy appropriate track frames based on the search text
	for _, trackInfo in ipairs(tracks) do
		local trackName = trackInfo.name
		if searchText == "" or string.find(string.lower(trackName), string.lower(searchText)) then
			-- Create a copy of the TrackFrame
			local trackFrame = game.ReplicatedStorage.ClipPhone.TrackFrame:Clone()
			trackFrame.Name = trackName
			trackFrame.ArtCover.Image = trackInfo.imageId
			trackFrame.Title.Text = trackName
			trackFrame.Parent = searchScrollingFrame
			trackFrame.Visible = true
		end
	end
end
--Precalculated paths
local t,f,n=true,false,{}
local r={
[58]={{42,38,40,39,41,30,56,58},t},
[49]={{42,38,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{42,38,40,39,41,30,56,58,20,19},t},
[59]={{42,38,40,39,41,59},t},
[63]={{42,38,40,39,41,30,56,58,23,62,63},t},
[34]={{42,38,35,34},t},
[21]={{42,38,40,39,41,30,56,58,20,21},t},
[48]={{42,38,35,34,32,31,29,28,44,45,49,48},t},
[27]={{42,38,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{42,38,35,34,32,31},t},
[56]={{42,38,40,39,41,30,56},t},
[29]={{42,38,35,34,32,31,29},t},
[13]={n,f},
[47]={{42,38,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{42,38,35,34,32,31,29,28,44,45},t},
[57]={{42,38,40,39,41,30,56,57},t},
[36]={{42,38,35,37,36},t},
[25]={{42,38,35,34,32,31,29,28,27,26,25},t},
[71]={{42,38,40,39,41,59,61,71},t},
[20]={{42,38,40,39,41,30,56,58,20},t},
[60]={{42,38,40,39,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{42,38,40,39,41,59,61,71,72,76,73,75},t},
[22]={{42,38,40,39,41,30,56,58,20,21,22},t},
[74]={{42,38,40,39,41,59,61,71,72,76,73,74},t},
[62]={{42,38,40,39,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{42,38,35,37},t},
[2]={n,f},
[35]={{42,38,35},t},
[53]={{42,38,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{42,38,40,39,41,59,61,71,72,76,73},t},
[72]={{42,38,40,39,41,59,61,71,72},t},
[33]={{42,38,35,37,36,33},t},
[69]={{42,38,40,39,41,60,69},t},
[65]={{42,38,40,39,41,30,56,58,20,19,66,64,65},t},
[26]={{42,38,35,34,32,31,29,28,27,26},t},
[68]={{42,38,40,39,41,30,56,58,20,19,66,64,67,68},t},
[76]={{42,38,40,39,41,59,61,71,72,76},t},
[50]={{42,38,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{42,38,40,39,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{42,38,35,34,32,31,29,28,27,26,25,24},t},
[23]={{42,38,40,39,41,30,56,58,23},t},
[44]={{42,38,35,34,32,31,29,28,44},t},
[39]={{42,38,40,39},t},
[32]={{42,38,35,34,32},t},
[3]={n,f},
[30]={{42,38,40,39,41,30},t},
[51]={{42,38,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{42,38,40,39,41,30,56,58,20,19,66,64,67},t},
[61]={{42,38,40,39,41,59,61},t},
[55]={{42,38,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{42,38,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{42},t},
[40]={{42,38,40},t},
[52]={{42,38,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{42,38,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{42,38,40,39,41},t},
[17]={n,f},
[38]={{42,38},t},
[28]={{42,38,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{42,38,40,39,41,30,56,58,20,19,66,64},t},
}
return r
-- Get the correct sound from our sound list.
local function getSoundProperties()
	for name, data in pairs(IDList) do
		if name == material then
			id = data.id
			volume = data.volume
			playbackSpeed = (humanoid.WalkSpeed / 16) * data.speed
			break
		end
	end
end
-- Decompiled with the Synapse X Luau decompiler.

local l__Players__1 = game:GetService("Players");
return function(p1, p2, p3)
	local v1 = l__Players__1:GetUserIdFromNameAsync(p1);
	p1 = l__Players__1:GetNameFromUserIdAsync(v1);
	local v2 = l__Players__1:GetCharacterAppearanceAsync(v1);
	if p3 == nil then
		if v2.IsR15.Value then
			local v3 = "R15";
		else
			v3 = "R6";
		end;
		local v4 = script[v3]:Clone();
		if not v4 then
			if p3 then
				local v5 = "R15";
			else
				v5 = "R6";
			end;
			v4 = script[v5]:Clone();
		end;
	else
		if p3 then
			v5 = "R15";
		else
			v5 = "R6";
		end;
		v4 = script[v5]:Clone();
	end;
	local l__Head__6 = v4.Head;
	local l__Humanoid__7 = v4.Humanoid;
	p3 = v4.Name == "R15";
	local l__next__8 = next;
	local v9, v10 = v2:GetChildren();
	while true do
		local v11, v12 = l__next__8(v9, v10);
		if not v11 then
			break;
		end;
		v10 = v11;
		if v12:IsA("Accessory") then
			l__Humanoid__7:AddAccessory(v12);
		end;	
	end;
	local l__next__13 = next;
	local v14, v15 = v2:GetChildren();
	while true do
		local v16, v17 = l__next__13(v14, v15);
		if not v16 then
			break;
		end;
		v15 = v16;
		if v17:IsA("ValueBase") and p3 then
			v17.Parent = l__Humanoid__7;
		end;	
	end;
	local l__next__18 = next;
	local v19, v20 = v2:GetChildren();
	while true do
		local v21 = nil;
		local v22 = nil;
		v22, v21 = l__next__18(v19, v20);
		if not v22 then
			break;
		end;
		v20 = v22;
		if p3 then
			if v21.Name == "R15ArtistIntent" then
				local l__next__23 = next;
				local v24, v25 = v21:GetChildren();
				while true do
					local v26, v27 = l__next__23(v24, v25);
					if not v26 then
						break;
					end;
					v25 = v26;
					l__Humanoid__7:ReplaceBodyPartR15(Enum.BodyPartR15[v27.Name], v27);				
				end;
			end;
		elseif v21.Name == "R6" then
			v21:GetChildren()[1].Parent = v4;
		end;	
	end;
	local l__Body_Colors__28 = v2:FindFirstChild("Body Colors");
	if l__Body_Colors__28 then
		l__Body_Colors__28.Parent = v4;
	end;
	local l__Shirt__29 = v2:FindFirstChild("Shirt");
	if l__Shirt__29 then
		l__Shirt__29.Parent = v4;
	end;
	local l__Shirt_Graphic__30 = v2:FindFirstChild("Shirt Graphic");
	if l__Shirt_Graphic__30 then
		l__Shirt_Graphic__30.Parent = v4;
	end;
	local l__Pants__31 = v2:FindFirstChild("Pants");
	if l__Pants__31 then
		l__Pants__31.Parent = v4;
	end;
	local l__Mesh__32 = v2:FindFirstChild("Mesh");
	if l__Mesh__32 then
		l__Head__6.Mesh:Destroy();
		l__Mesh__32.Parent = l__Head__6;
	end;
	local l__face__33 = v2:FindFirstChild("face");
	if l__face__33 then
		l__Head__6.face:Destroy();
		l__face__33.Parent = l__Head__6;
	end;
	v4.Name = p1;
	v4.Parent = p2;
	v2:Destroy();
	return v4;
end;
--anti-sleep algorithm
local LastPositions = {}
local NumberPositions = 5
local LastAveragePosition = coupler.Position
local LastRateOfChangeOfAveragePosition = 0
local WakeupThreshold = 0.5 --studs per second
--[=[
  @function flatten
  @within Dictionary

  @param dictionary T -- The dictionary to flatten.
  @param depth? number -- The depth to flatten the dictionary to.
  @return T -- The flattened dictionary.

  Flattens a dictionary. If depth is not specified, it will flatten the dictionary as far as it can go.

  ```lua
  local dictionary = {
    hello = "world",
    goodbye = {
      world = "hello",
      roblox = {
        yes = "no",
        no = "yes",
      }
    }
  }

  local new = Flatten(dictionary) -- { hello = "world", world = "hello", yes = "no", no = "yes" }
  local new = Flatten(dictionary, 1) -- { hello = "world", world = "hello", roblox = { yes = "no", no = "yes" } }
  ```
]=]
local function flatten(dictionary: _T.AnyDictionary, depth: number?): _T.AnyDictionary
	depth = if type(depth) == "number" then depth else math.huge

	local result = {}

	for key, value in pairs(dictionary :: _T.AnyDictionary) do
		if type(value) == "table" and depth > 0 then
			local nested = flatten(value, depth - 1)

			for resultKey, resultValue in pairs(result) do
				nested[resultKey] = resultValue
			end

			result = nested
		else
			result[key] = value
		end
	end

	return result
end

return flatten
--[[Engine]]
	--Torque Curve
	Tune.Horsepower		= 899		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 1100		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 8000		--		Use sliders to manipulate values
	Tune.Redline		= 7500		--		Copy and paste slider values into the respective tune values
	Tune.ComfortShift   = 3500
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 160		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 0			-- Percent throttle at idle
	Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)
-------------------------------------------------------------------
function CheckDeletes(Model,Delete)
	for _,s in pairs(Model:GetDescendants())do
		if s:IsA("VehicleSeat") or s:IsA("Seat") then
			if s:FindFirstChild("SeatWeld") ~= nil then
				Delete = false
				break;
			end
		end
	end
	print(Delete)
	return Delete
end
--make the part jump up and down 5 times
	for i = 1,5 do 
    part.Position = part.Position + Vector3.new(0,1,0)
    wait(0.2)
	end
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]


local autoscaling	= false					--Estimates top speed

local UNITS	= {								--Click on speed to change units
											--First unit is default	
	{
		units			= "MPH"				,
		scaling			= (10/12) * (60/88)	, -- 1 stud : 10 inches | ft/s to MPH
		maxSpeed		= 180				,
		spInc			= 20				, -- Increment between labelled notches
	},
	
	{
		units			= "KM/H"			,
		scaling			= (10/12) * 1.09728	, -- 1 stud : 10 inches | ft/s to KP/H
		maxSpeed		= 280				,
		spInc			= 20				, -- Increment between labelled notches
	},
	
	{
		units			= "SPS"				,
		scaling			= 1					, -- Roblox standard
		maxSpeed		= 320				,
		spInc			= 20				, -- Increment between labelled notches
	}
}
-- Keep MostPoints value updated:
PointsService.MostPoints.Changed:Connect(function(newMostPoints)
	mostPoints = newMostPoints
end)
--Variables--
local Tool = script.Tool
local GamepassID = script.GamepassID
--[[ The Module ]]--
local BaseCamera = require(script.Parent:WaitForChild("BaseCamera"))
local ClassicCamera = setmetatable({}, BaseCamera)
ClassicCamera.__index = ClassicCamera

function ClassicCamera.new()
	local self = setmetatable(BaseCamera.new(), ClassicCamera)

	self.isFollowCamera = false
	self.isCameraToggle = false
	self.lastUpdate = tick()
	self.cameraToggleSpring = Util.Spring.new(5, 0)

	return self
end

function ClassicCamera:GetCameraToggleOffset(dt)
	assert(FFlagUserCameraToggle)

	if self.isCameraToggle then
		local zoom = self.currentSubjectDistance

		if CameraInput.getTogglePan() then
			self.cameraToggleSpring.goal = math.clamp(Util.map(zoom, 0.5, self.FIRST_PERSON_DISTANCE_THRESHOLD, 0, 1), 0, 1)
		else
			self.cameraToggleSpring.goal = 0
		end

		local distanceOffset = math.clamp(Util.map(zoom, 0.5, 64, 0, 1), 0, 1) + 1
		return Vector3.new(0, self.cameraToggleSpring:step(dt)*distanceOffset, 0)
	end

	return Vector3.new()
end
-- If you want to know how to retexture a hat, read this:  http://www.roblox.com/Forum/ShowPost.aspx?PostID=10502388








debounce = true

function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Accessory")
		p = Instance.new("Part")
		h.Name = "Accessory"   -- It doesn't make a difference, but if you want to make your place in Explorer neater, change this to the name of your hat.
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = 0
		p.Size = Vector3.new(-0,-0,-1) 
		p.BottomSurface = 0 
		p.TopSurface = 0 
		p.Locked = true 
		script.Parent.Mesh:clone().Parent = p
		h.Parent = hit.Parent
		h.AttachmentPos = Vector3.new(0,-0.05,0.22) -- Change these to change the positiones of your hat, as I said earlier.
		wait(5)		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
-- The maximum distance the can can shoot, this value should never go above 1000
local Range = 250
--Functions
local function onTouched(hit)
	local Humanoid = hit.Parent:FindFirstChild("Humanoid")
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)

	if Humanoid and Debounce == false then
		local leaderstats = player:FindFirstChild("leaderstats")
		Debounce = true

		if Debounce == true and leaderstats then
			

			leaderstats.Guesses.Value = leaderstats.Guesses.Value + AMOUNT_GIVEN
			local sound = script.Parent["Game Sound Correct"]

			if not sound.IsPlaying then
				sound:Play()
			wait(2)
				wait(10)
			end
		end
	end
end
--Va en los Bloques de Checkpoints

function ot(hit)
	if hit.Parent ~= nil then
		local player = game.Players:playerFromCharacter(hit.Parent)
		if player ~= nil then
			if player.leaderstats.Stage.Value == script.Parent.Name - 1 then
				local h = hit.Parent:FindFirstChild("Humanoid")
				if h ~= nil then
					if h.Health ~= 0 then
						player.leaderstats.Stage.Value = script.Parent.Name
					end end end end end end

script.Parent.Touched:connect(ot)
--- Load and create constants
local AntiGravityForce      = Instance.new("BodyForce")
AntiGravityForce.Name       = "GravityCoilEffect"
AntiGravityForce.Archivable = false

local Handle           = WaitForChild(Tool, "Handle")
local CoilSound        = WaitForChild(Handle, "CoilSound")
local GravityMaid      = MakeMaid() -- Will contain and maintain events

local function UpdateGravityEffect(Character)
	-- Updates the AntiGravityForce to match the force of gravity on the character

	local Bricks
	if Character:IsDescendantOf(game) and Character:FindFirstChild("HumanoidRootPart") and Character.HumanoidRootPart:IsA("BasePart") then
		local BasePart = Character.HumanoidRootPart
		Bricks         = BasePart:GetConnectedParts(true) -- Recursive
	else
		warn("[UpdateGravityEffect] - Character failed to have a HumanoidRootPart or something")
		Bricks = GetBricks(Character)
	end

	local TotalMass = 0

	-- Calculate total mass of player
	for _, Part in pairs(Bricks) do
		TotalMass = TotalMass + Part:GetMass()
	end

	-- Force = Mass * Acceleration
	local ForceOnCharacter         = GravityAccelerationConstant * TotalMass
	local CounteringForceMagnitude = (1 - 0.25) * ForceOnCharacter

	-- Set the actual value...
	AntiGravityForce.force = Vector3.new(0, CounteringForceMagnitude, 0)
end
--Gear Ratios
Tune.FinalDrive		= 3.06			-- Gearing determines top speed and wheel torque
Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
	--[[Reverse]]	3.70		,	-- Copy and paste a ratio to add a gear
	--[[Neutral]]	0			,	-- Ratios can also be deleted
	--[[ 1 ]]		3.53		,	-- Reverse, Neutral, and 1st gear are required
	--[[ 2 ]]		2.04		,
	--[[ 3 ]]		1.38		,
	--[[ 4 ]]		1.03		,
	--[[ 5 ]]		0.81		,
	--[[ 6 ]]		0.64		,
}
Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--edit the function below to return true when you want this response/prompt to be valid
--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)
	return plrData.Character.Purity.Value >= 50
end
--------RIGHT DOOR --------
game.Workspace.doorright.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l22.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l31.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l32.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l41.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l42.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l43.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l52.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l53.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l61.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l62.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l63.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l71.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l72.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l73.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
-----------------------------------------------------------------------------------------------

function CheckWhitelist(v)
	for i = 1, #Whitelist do
		if v == Whitelist[i] then
			return true
		end
	end
	return false
end

Door.Touched:Connect(function(hit)
	if game.Players:GetPlayerFromCharacter(hit.Parent) then
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		if Gamepass <= 0 then return nil end
		if MS:UserOwnsGamePassAsync(plr.UserId, Gamepass) or CheckWhitelist(plr.UserId) then
			Door.CanCollide, Door.Transparency = false, OpenTrans
			wait(OpenTime)
			Door.CanCollide, Door.Transparency = true, CloseTrans
		else
			Door.CanCollide, Door.Transparency = true, CloseTrans
			if BuyGUI == true then
				MS:PromptGamePassPurchase(plr, Gamepass)
			end
			if KillOnTouch == true then
				plr.Character.Humanoid.Health = 0
			end
		end
	end
end)
--[[ReadMe*
	Please improve upon this script as needed, I'm a noob scripter and I only script 
	through ways I know that work. This loop works, so I'm happy with it. But please, 
	edit as you may.
	
	This model uses MeshParts to animate the flag. The previous frame turns transparent
	while the next frame becomes visible.
	
	If you would like to use your own custom flag, for your ROBLOX group or country, 
	select all the children in the "Flag" model and paste in a ROBLOX decal asset in 
	the "TextureID" slot. If you receive an error, try subtracting 1 from the decal id.
		
		http://www.roblox.com/asset/?id={decal id}
		rbxassetid://{decal id}
	
	Any ROBLOX decal in the Developers Library will work, or you may upload your own 
	flag decal to insert in. Rectangular decals are recommended for this flag. 
		*If you use a decal with a transparent background in the MeshPart's TextureID, 
		the transparent background will default to black. Instead, insert the actual
		decal into every MeshPart in "Flag." This will allow you to change the BrickColor
		of the flag with the decal on top.
	
	The flags have been UV mapped to flip the flag design on the other side. 
		e.g. You won't see the blue box of the United States flag on the other side
			 of the flag on its end, but close to the pole for both sides.
				
	Thank you and have a wonderful day.
	(MeshParts rendered using Blender)
--]]

sp=script.Parent
flag=sp.Flag

reset=function()
	for _,meshpart in pairs (flag:GetChildren()) do
		if meshpart:IsA("MeshPart") then
			meshpart.Transparency=1
		end
	end
end

waittime=0.0,0 --Time between each "Frame"

while true do
	wait(waittime)
	reset()
	flag["2"].Transparency=0
	wait(waittime)
	reset()
	flag["3"].Transparency=0
	wait(waittime)
	reset()
	flag["4"].Transparency=0	
	wait(waittime)
	reset()
	flag["5"].Transparency=0
	wait(waittime)
	reset()
	flag["6"].Transparency=0
	wait(waittime)
	reset()
	flag["7"].Transparency=0
	wait(waittime)
	reset()
	flag["8"].Transparency=0
	wait(waittime)
	reset()
	flag["9"].Transparency=0
	wait(waittime)
	reset()
	flag["10"].Transparency=0
	wait(waittime)
	reset()
	flag["11"].Transparency=0
	wait(waittime)
	reset()
	flag["12"].Transparency=0
	wait(waittime)
	reset()
	flag["13"].Transparency=0
	wait(waittime)
	reset()
	flag["14"].Transparency=0
	wait(waittime)
	reset()
	flag["15"].Transparency=0
	wait(waittime)
	reset()
	flag["16"].Transparency=0
	wait(waittime)
	reset()
	flag["1"].Transparency=0
end
--//Setup//--
local SongsHolder = script.Parent

local Songs = SongsHolder.Songs:GetChildren()

local CurrentSong = SongsHolder.CurrentSong

local Boombox = SongsHolder.Boombox
local SongNameGui = Boombox.SongNameGui
local NameText = SongNameGui.NameText