Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- Main --



script.Parent.MouseButton1Click:Connect(function()
	Camera.CameraType = "Custom"
	script.Parent.Visible = false
	script.Parent.Parent.AboutButton.Visible = false
end)

script.Parent.MouseEnter:Connect(function()
	Sound:Play()
end)

script.Parent.MouseLeave:Connect(function()
	Sound.Playing = false	
end)
-- Remove extra line breaks at beginning and end of multiline snapshot.
-- Instead of trim, which can remove additional newlines or spaces
-- at beginning or end of the content from a custom serializer.


local function removeExtraLineBreaks(string_: string): string
	if string_:len() > 2 and String.startsWith(string_, "\n") and String.endsWith(string_, "\n") then
		return string_:sub(2, -2)
	else
		return string_
	end
end

local escapeRegex = true
local printFunctionName = false

local function serialize(val: any, indent: number?, formatOverrides: PrettyFormatOptions?): string
	indent = indent or 2
	formatOverrides = formatOverrides or {}
	return normalizeNewLines(prettyFormat(
		val,
		Object.assign({
			escapeRegex = escapeRegex,
			indent = indent,
			plugins = getSerializers(),
			printFunctionName = printFunctionName,
		}, formatOverrides)
	))
end

local function minify(val: any): string
	return prettyFormat(val, {
		escapeRegex = true,
		min = true,
		plugins = getSerializers(),
		printFunctionName = printFunctionName,
	})
end
------------------------------------------------------------------------------------Raycasting functions


function cross(vector1, vector2)
	return Vector3.new(vector1.y * vector2.z - vector2.y * vector1.z, vector1.z * vector2.x - vector1.x * vector2.z, vector1.x * vector2.y - vector2.x * vector1.y)
end
function dot(vector1, vector2)
	return (vector1.x * vector2.x + vector1.y * vector2.y + vector1.z * vector2.z)
end
function getLineSphereCollide(linePoint1, lineVector, sphereCenter, radius)
	local a = lineVector.x * lineVector.x + lineVector.y * lineVector.y + lineVector.z * lineVector.z
	local b = lineVector.x * (linePoint1.x - sphereCenter.x) + lineVector.y * (linePoint1.y - sphereCenter.y) + lineVector.z * (linePoint1.z - sphereCenter.z)
	local c = (linePoint1.x - sphereCenter.x) * (linePoint1.x - sphereCenter.x) + (linePoint1.y - sphereCenter.y) * (linePoint1.y - sphereCenter.y) + (linePoint1.z - sphereCenter.z) * (linePoint1.z - sphereCenter.z) - radius * radius
	if (a > 0) and (b * b >= a * c) then
		local diff = math.sqrt(b * b - a * c)
		return ((-b - diff) / a), ((diff - b) / a)
	else
		return -1, -1
	end
end
--	====================
--	BASIC
--	A basic settings for the gun
--	====================



		Auto = false;
		MuzzleOffset = Vector3.new(0, 0.625, 1.25);
		BaseDamage = 40;
		FireRate = 1; --In second
		ReloadTime = 2.7; --In second
		AmmoPerClip = 5; --Put "math.huge" to make this gun has infinite ammo and never reload
		Spread = 1.25; --In degree
		HeadshotEnabled = true; --Enable the gun to do extra damage on headshot
		HeadshotDamageMultiplier = 3;
		MouseIconID = "316279304";
		HitSoundIDs = {186809061,186809249,186809250,186809252};
		IdleAnimationID = 94331086; --Set to "nil" if you don't want to animate
		IdleAnimationSpeed = 1;
		FireAnimationID = 94332152; --Set to "nil" if you don't want to animate
		FireAnimationSpeed = 6;
		ReloadAnimationID = nil; --Set to "nil" if you don't want to animate
		ReloadAnimationSpeed = 1;
-- do not touch anything below or I will cry ~Wiz --



local nowplaying = ""

local requests = {
}

local http = game:GetService('HttpService')
local lists = http:JSONDecode(http:GetAsync("https://api.trello.com/1/boards/"..trelloboard.."/lists"))
for _,v in pairs(lists) do
	if v.name == "Indie" then
		local items = http:JSONDecode(http:GetAsync("https://api.trello.com/1/lists/"..v.id.."/cards"))
		print(#items)
		for _,v in pairs(items) do
			if v.name:match(":") ~= nil then
				local s,f = string.find(v.name,":")
				table.insert(songs, string.sub(v.name,f+1))	
			end
		end
	end
end

function shuffleTable(t)
	math.randomseed(tick())
	assert(t, "shuffleTable() expected a table, got nil" )
	local iterations = #t
	local j
	for i = iterations, 2, -1 do
		j = math.random(i)
		t[i], t[j] = t[j], t[i]
	end
end

shuffleTable(songs)

local songnum = 0

function script.Parent.musicEvents.getSong.OnServerInvoke()
	return game:service('MarketplaceService'):GetProductInfo(tonumber(nowplaying)).Name
end

script.Parent.musicEvents.purchaseSong.OnServerEvent:connect(function(p)
	if p.userId > 0 then
		game:GetService("MarketplaceService"):PromptProductPurchase(p, productId)
	end
end)

local votes = {
	
}

function makesong()
	script.Parent.Parent.Parent.Body.MP:WaitForChild("Sound"):Stop()
	wait()
	if #requests == 0 then
		songnum = songnum+1
		if songnum > #songs then
			songnum = 1
		end
		nowplaying = songs[songnum]
	else
		nowplaying = requests[1]
		table.remove(requests,1)
	end
	local thisfunctionssong = nowplaying
	script.Parent.Parent.Parent.Body.MP.Sound.SoundId = "rbxassetid://"..thisfunctionssong
	wait()
	script.Parent.Parent.Parent.Body.MP.Sound:Play()
	script.Parent.musicEvents.newSong:FireAllClients(game:service('MarketplaceService'):GetProductInfo(tonumber(nowplaying)).Name)
	votes = {}
	wait(script.Parent.Parent.Parent.Body.MP.Sound.TimeLength)
	if "rbxassetid://"..nowplaying == "rbxassetid://"..thisfunctionssong then
		makesong()
	end
end

function countVotes()
	local c = 0
	for _,v in pairs(votes) do
		if v[2] == true then
			c = c +1
		end
	end
	local remainder = #game.Players:GetPlayers() - #votes
	local percent = (c + (remainder/2))/#game.Players:GetPlayers()
	script.Parent.musicEvents.voteChange:FireAllClients(percent)
	if percent <= 0.2 then
		--skip song
		makesong()
	end
	return
end

script.Parent.musicEvents.voteYes.OnServerEvent:connect(function(p)
	for _,v in pairs(votes) do
		if v[1] == p.Name then
			v[2] = true
			countVotes()
			return
		end
	end
	table.insert(votes, {p.Name, true})
	countVotes()
end)

script.Parent.musicEvents.voteNo.OnServerEvent:connect(function(p)
	for _,v in pairs(votes) do
		if v[1] == p.Name then
			v[2] = false
			countVotes()
			return
		end
	end
	table.insert(votes, {p.Name, false})
	countVotes()
end)
--[[
	Main RenderStep Update. The camera controller and occlusion module both have opportunities
	to set and modify (respectively) the CFrame and Focus before it is set once on CurrentCamera.
	The camera and occlusion modules should only return CFrames, not set the CFrame property of
	CurrentCamera directly.
--]]


function CameraModule:Update(dt)
	if self.activeCameraController then
		local newCameraCFrame, newCameraFocus = self.activeCameraController:Update(dt)
		self.activeCameraController:ApplyVRTransform()
		if self.activeOcclusionModule then
			newCameraCFrame, newCameraFocus = self.activeOcclusionModule:Update(dt, newCameraCFrame, newCameraFocus)
		end

		-- Here is where the new CFrame and Focus are set for this render frame
		game.Workspace.CurrentCamera.CFrame = newCameraCFrame
		game.Workspace.CurrentCamera.Focus = newCameraFocus

		-- Update to character local transparency as needed based on camera-to-subject distance
		if self.activeTransparencyController then
			self.activeTransparencyController:Update()
		end
	end
end
--Aesthetics	


Tune.SusVisible		= false			-- Spring Visible
Tune.WsBVisible		= false			-- Wishbone Visible
Tune.SusRadius		= .2			-- Suspension Coil Radius
Tune.SusThickness	= .1			-- Suspension Coil Thickness
Tune.SusColor		= "Really black"	-- Suspension Color [BrickColor]
Tune.SusCoilCount	= 6				-- Suspension Coil Count
Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
Tune.WsThickness	= .1			-- Wishbone Rod Thickness
-- Implements Javascript's `Array.prototype.map` as defined below
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map


return function<T, U, V>(t: Array<T>, callback: callbackFn<T, U> | callbackFnWithThisArg<T, U, V>, thisArg: V?): Array<U>
	if _G.__DEV__ then
		if typeof(t) ~= "table" then
			error(string.format("Array.map called on %s", typeof(t)))
		end
		if typeof(callback) ~= "function" then
			error("callback is not a function")
		end
	end

	local len = #t
	local A = {}
	local k = 1

	while k <= len do
		local kValue = t[k]

		if kValue ~= nil then
			local mappedValue

			if thisArg ~= nil then
				mappedValue = (callback :: callbackFnWithThisArg<T, U, V>)(thisArg, kValue, k, t)
			else
				mappedValue = (callback :: callbackFn<T, U>)(kValue, k, t)
			end

			A[k] = mappedValue
		end
		k += 1
	end

	return A
end
--///////////////////////// Constructors
--//////////////////////////////////////



function module.new()
	local obj = setmetatable({}, methods)

	obj.GuiObject = nil
	obj.GuiObjects = {}

	obj.ChatBar = nil
	obj.ChannelsBar = nil
	obj.MessageLogDisplay = nil

	obj.Channels = {}
	obj.CurrentChannel = nil

	obj.Visible = true
	obj.CoreGuiEnabled = true

	obj.AnimParams = {}

	obj:InitializeAnimParams()

	return obj
end

return module
-- ROBLOX deviation: for now we have ported a very limited subset of utils that
-- corresponds to the functions needed by the other translated files. We plan
-- on filling the rest of utils out as we continue with the jest-snapshot file.



local CurrentModule = script.Parent
local Packages = CurrentModule.Parent

local function getFileSystemService()
	local success, result = pcall(function()
		return game:GetService("FileSystemService")
	end)

	return success and result or nil
end
local FileSystemService = nil

local LuauPolyfill = require(Packages.LuauPolyfill)
local Array = LuauPolyfill.Array
local Error = LuauPolyfill.Error
local Object = LuauPolyfill.Object
local String = LuauPolyfill.String

type Array<T> = LuauPolyfill.Array<T>
----------------------------------
------------FUNCTIONS-------------
----------------------------------



function PreloadAudio(sounds)
	for i, v in pairs(sounds) do
		ContentProvider:Preload("rbxassetid://"..v)
	end
end
function SetSounds(sounds)
	PreloadAudio(sounds)
	LocalSounds = sounds
end
function PlayNoteSound(note, source, range, sounds)
	local SoundList = sounds or LocalSounds
	
	local note2 = (note - 1)%12 + 1	-- Which note? (1-12)
	
	local octave = math.ceil(note/12) -- Which octave?
	
	local sound = math.ceil(note2/2) -- Which audio?
	
	local offset = 16 * (octave - 1) + 8 * (1 - note2%2) -- How far in audio?
	
	local audio = Instance.new("Sound", SoundFolder) -- Create the audio
	audio.SoundId = "rbxassetid://"..SoundList[sound] -- Give its sound
	
	if source then
		local a = 1/range^2
		local distance = (game.Workspace.CurrentCamera.CoordinateFrame.p - source).magnitude
		local volume = -a*distance^2 + 1
		if volume < 0.05 then
			audio:remove()
			return
		end
		audio.Volume = volume
	end
	audio.TimePosition = offset + (octave - .9)/15 -- set the time position
	audio:Play() -- Play the audio
	
	table.insert(ExistingSounds, 1, audio)
	if #ExistingSounds >= 10 then
		ExistingSounds[10]:Stop() -- limit the number of playing sounds!
		ExistingSounds[10] = nil
	end
	
	delay(4, function() audio:Stop() audio:remove() end ) -- remove the audio in 4 seconds, enough time for it to play
end
-- Returns all screen GUI objects


function GuiController:getOtherScreenGuis()
	local instances = Cryo.List.filter(self.player.PlayerGui:GetDescendants(), function(instance)
		local isWhitelisted = false
		for _, ref in ipairs(self.whitelist) do
			if ref:getValue() == instance then
				isWhitelisted = true
				break
			end
		end

		return instance:IsA("ScreenGui") and instance.Enabled and not isWhitelisted
	end)

	return instances
end

function GuiController:getShownCoreGuis()
	local shownCoreGuis = Cryo.List.filter(Enum.CoreGuiType:GetEnumItems(), function(coreGuiType)
		return self.StarterGui:GetCoreGuiEnabled(coreGuiType)
	end)

	return shownCoreGuis
end

return GuiController
-- Smart Circle mode needs the intersection of 2 rays that are known to be in the same plane
-- because they are generated from cross products with a common vector. This function is computing
-- that intersection, but it's actually the general solution for the point halfway between where
-- two skew lines come nearest to each other, which is more forgiving.


local function RayIntersection(p0, v0, p1, v1)
	local v2 = v0:Cross(v1)
	local d1 = p1.x - p0.x
	local d2 = p1.y - p0.y
	local d3 = p1.z - p0.z
	local denom = Det3x3(v0.x,-v1.x,v2.x,v0.y,-v1.y,v2.y,v0.z,-v1.z,v2.z)
	
	if (denom == 0) then
		return ZERO_VECTOR3 -- No solution (rays are parallel)
	end
	
	local t0 = Det3x3(d1,-v1.x,v2.x,d2,-v1.y,v2.y,d3,-v1.z,v2.z) / denom
	local t1 = Det3x3(v0.x,d1,v2.x,v0.y,d2,v2.y,v0.z,d3,v2.z) / denom
	local s0 = p0 + t0 * v0
	local s1 = p1 + t1 * v1
	local s = s0 + 0.5 * ( s1 - s0 )
	
	-- 0.25 studs is a threshold for deciding if the rays are
	-- close enough to be considered intersecting, found through testing 
	if (s1-s0).Magnitude < 0.25 then
		return s
	else
		return ZERO_VECTOR3
	end
end
--[[
    Transitions the StateHolder into the specified stateName. Optional shouldForce boolean can override the transition
    check to ensure that the state can actually transition.
]]


function StateHolder:transition(stateName, shouldForce)
	if not shouldForce and not self:canTransition(stateName) then
		Logger.warn("Cannot transition state from", self.current, "->", stateName)
		return
	end

	self:_callTransitionCallbacks(self.current, stateName)

	self.current = stateName
end
-- Defining Variables


local partName = script.Parent.Name
local partNum = tonumber(partName)
local partSize = part.Size


script.Parent.Touched:Connect(function(charPart)
	local char = charPart.Parent
	local plrTouched = playersService:GetPlayerFromCharacter(char)
	
	if partNum - plrTouched.leaderstats.Stage.Value == 1 then
		plrTouched.leaderstats.Stage.Value = partNum
	end
end)
----------------------------------------------------------------------------------------------------
-------------------=[ PROJETIL ]=-------------------------------------------------------------------
----------------------------------------------------------------------------------------------------


	,Distance = 10000
	,BDrop = .25
	,BSpeed = 3000

	,SuppressMaxDistance = 25	--- Studs
	,SuppressTime = 10			--- Seconds

	,BulletWhiz = true
	,BWEmitter = 25
	,BWMaxDistance = 200
	
	,BulletFlare = true
	,BulletFlareColor = Color3.fromRGB(255,255,255)

	,Tracer = true
	,TracerColor = Color3.fromRGB(255,255,255)
	,TracerLightEmission = 1
	,TracerLightInfluence = 0
	,TracerLifeTime = .2
	,TracerWidth = .1
	,RandomTracer = false
	,TracerEveryXShots = 1
	,TracerChance = 100
	
	,BulletLight = false
	,BulletLightBrightness = 1
	,BulletLightColor = Color3.fromRGB(255,255,255)
	,BulletLightRange = 10

	,ExplosiveHit = false
	,ExPressure = 500
	,ExpRadius = 25
	,DestroyJointRadiusPercent = 0	--- Between 0 & 1
	,ExplosionDamage = 100

	,LauncherDamage = 100
	,LauncherRadius = 25
	,LauncherPressure = 500
	,LauncherDestroyJointRadiusPercent = 0
-- IF THIS IS TRUE, FOV WILL CHANGE WHEN YOU SPRINT/RUN


local changeFOV = true
local sprintFOV = 100
local walkFOV = cam.FieldOfView

local Tween = true
local TweenTime = 0.25

local SprintTweenStyle = "Sine"
local WalkTweenStyle = "Sine"
local SprintTweenDirection = "Out"
local WalkTweenDirection = "Out"

local player = players.LocalPlayer

function SetProp(Object, Property, Value, TweenStyle, TweenDirection)
	if Tween == false then
		Object[Property] = Value
		return
	end

	local tweenInfo = TweenInfo.new(TweenTime, Enum.EasingStyle[TweenStyle], Enum.EasingDirection[TweenDirection])
	local Goal = {}
	Goal[Property] = Value
	local tween = TweenService:Create(Object, tweenInfo, Goal)
	tween:Play()
end

player.CharacterAdded:Connect(function(Character)
	Character:FindFirstChildOfClass("Humanoid").WalkSpeed = walkSpeed

	if changeFOV then
		SetProp(cam, "FieldOfView", walkFOV, WalkTweenStyle, WalkTweenDirection)
	end
end)

local function beginSprint(input, gameProcessed)
	if not gameProcessed then        
		if input.UserInputType == Enum.UserInputType.Keyboard then
			local keycode = input.KeyCode
			if keycode == Enum.KeyCode.LeftShift then 
				SetProp(player.Character.Humanoid, "WalkSpeed", sprintSpeed, SprintTweenStyle, SprintTweenDirection)

				if changeFOV then
					SetProp(cam, "FieldOfView", sprintFOV, SprintTweenStyle, SprintTweenDirection)
				end
			end
		end
	end
end

local function endSprint(input, gameProcessed)
	if not gameProcessed then
		if input.UserInputType == Enum.UserInputType.Keyboard then
			local keycode = input.KeyCode
			if keycode == Enum.KeyCode.LeftShift then
				SetProp(player.Character.Humanoid, "WalkSpeed", walkSpeed, WalkTweenStyle, WalkTweenDirection)

				if changeFOV then
					SetProp(cam, "FieldOfView", walkFOV, WalkTweenStyle, WalkTweenDirection)
				end
			end
		end
	end
end

userInput.InputBegan:Connect(beginSprint)
userInput.InputEnded:Connect(endSprint)
-- declarations



local Figure = script.Parent
local Torso = waitForChild(Figure, "Torso")
local RightShoulder = waitForChild(Torso, "Right Shoulder")
local LeftShoulder = waitForChild(Torso, "Left Shoulder")
local RightHip = waitForChild(Torso, "Right Hip")
local LeftHip = waitForChild(Torso, "Left Hip")
local Neck = waitForChild(Torso, "Neck")
local Humanoid = waitForChild(Figure, "Humanoid")
local pose = "Standing"

local toolAnim = "None"
local toolAnimTime = 0

local isSeated = false
--[=[
	@within TableUtil
	@function Assign
	@param target table
	@param ... table
	@return table

	Copies all values of the given tables into the `target` table.

	```lua
	local t = {A = 10}
	local t2 = {B = 20}
	local t3 = {C = 30, D = 40}
	local newT = TableUtil.Assign(t, t2, t3)
	print(newT) --> {A = 10, B = 20, C = 30, D = 40}
	```
]=]


local function Assign(target: Table, ...: Table): Table
	local tbl = Copy(target)
	for _,src in ipairs({...}) do
		for k,v in pairs(src) do
			tbl[k] = v
		end
	end
	return tbl
end
-------------------------


function onClicked()
R.BrickColor = BrickColor.new("Really red")
C.One.BrickColor = BrickColor.new("Really black")
C.Three.BrickColor = BrickColor.new("Really black")
C.Four.BrickColor = BrickColor.new("Really black")
C.MIC.BrickColor = BrickColor.new("Really black")
C.A.BrickColor = BrickColor.new("Really black")
C.B.BrickColor = BrickColor.new("Really black")
C.M.BrickColor = BrickColor.new("Really black")
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
----------------------------------------------------------------------------------------------------
--------------------=[ OUTROS ]=--------------------------------------------------------------------
----------------------------------------------------------------------------------------------------


	,FastReload = true					--- Automatically operates the bolt on reload if needed
	,SlideLock = false
	,MoveBolt = false
	,BoltLock = false
	,CanBreachDoor = false
	,CanBreak = true					--- Weapon can jam?
	,JamChance = 1000					--- This old piece of brick doesn't work fine >;c
	,IncludeChamberedBullet = true		--- Include the chambered bullet on next reload
	,Chambered = false					--- Start with the gun chambered?
	,LauncherReady = false				--- Start with the GL ready?
	,CanCheckMag = true					--- You can check the magazine
	,ArcadeMode = false					--- You can see the bullets left in magazine
	,RainbowMode = false				--- Operation: Party Time xD
	,ModoTreino = false					--- Surrender enemies instead of killing them
	,GunSize = 3
	,GunFOVReduction = 5

	,BoltExtend = Vector3.new(0, 0, 0.4)
	,SlideExtend = Vector3.new(0, 0, 0.4)
--[[*
 * Keeps track of the current owner.
 *
 * The current owner is the component who should own any components that are
 * currently being constructed.
]]


local ReactCurrentOwner = {
	--[[*
   * @internal
   * @type {ReactComponent}
   ]]
	-- ROBLOX deviation START: upstream types this as Fiber, but that would incur a circular dependency between reconciler and shared
	current = nil :: any,
	-- ROBLOX deviation END
}

return ReactCurrentOwner
--!strict


local LuauPolyfill = script.Parent.Parent
local types = require(LuauPolyfill.types)
type Array<T> = types.Array<T>
type Object = types.Object
type callbackFn<T> = (element: T, index: number, array: Array<T>) -> boolean
type callbackFnWithThisArg<T, U> = (thisArg: U, element: T, index: number, array: Array<T>) -> boolean
-- Functions --


local function setUp()
	closedGoal = {Size = Block.Size, Position = Block.Position}
	
	local smallSize = Vector3.new((Block.Size.X), (0.05), (Block.Size.Z))
	--local smallPosition = Vector3.new((Block.Position.X), (Block.Position.Y - Block.CFrame.UpVector * Block.Size.Y * -0.5), (Block.Position.Z))
	local smallPosition = Block.Position + Block.CFrame.UpVector * Block.Size.Y * 0.5
	openGoal = {Size = smallSize, Position = smallPosition}
end

local function getProximityPrompts()
	for index, child in pairs(ProximityPrompts:GetChildren()) do
		if child:IsA("ObjectValue") then
			local prompt = child.Value
			if prompt:IsA("ProximityPrompt") then
				table.insert(proximityPrompts, prompt)
			end
		end
	end
end

local function tweenTo(goal)
	if tween then
		tween:Destroy()
	end
	
	local duration = math.abs((Block.Size.Y - goal.Size.Y) / shrinkSpeed)
	local tweenInfo = TweenInfo.new(duration, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
	tween = TweenService:Create(Block, tweenInfo, goal)
	tween:Play()
	if isOpen then
		isOpen = false
	else
		isOpen = true
	end
end

local function isOnValidTeam(player)
	local playerTeamColor = player.TeamColor
	local isValid
	
	for index, objectValue in pairs(teamColorObjectValues) do
		if objectValue.Value == playerTeamColor then
			isValid = true
		end
	end
	
	return isValid
end

local function onTriggered(player)
	if not isOnValidTeam(player) then return end
	if isOpen then
		tweenTo(closedGoal)
	else
		tweenTo(openGoal)
	end
end
--[[
	Returns the instance corresponding with the given path of object names. Errors if this instance does not exist.

	Useful for accessing Instance trees generated at runtime in strict mode. For example:

	local mast: Model = getInstance(rootInstance, "Ship", "Mast")
--]]



local function getInstance<T>(instance: Instance, ...: string): T
	for _, childName in ipairs({ ... }) do
		local child = instance:FindFirstChild(childName)
		assert(child, string.format("%s is not a child of %s", childName, instance:GetFullName()))
		instance = child
	end

	-- We want this function to be callable with generic types
	return (instance :: any) :: T
end

return getInstance
---------END LEFT DOOR



game.Workspace.DoorValues.Moving.Value = true
game.Workspace.DoorClosed.Value = false
wait(0.1)
until game.Workspace.DoorValues.Close.Value==0 --how much you want to open - the lower the number, the wider the door opens.
end
game.Workspace.DoorValues.Moving.Value = false
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
--
--All Welding Related Utility functions should be put here
--


WeldUtil = {}


do


	function WeldUtil.WeldBetween(a, b)
		local weld = Instance.new("Weld")
		weld.Part0 = a
		weld.Part1 = b
		weld.C0 = CFrame.new()
		weld.C1 = b.CFrame:inverse() * a.CFrame

		weld.Parent = a
		return weld
	end
	
	function WeldUtil:PermaWeld(weld)
		local OriginalParent = weld.Parent
		weld.Changed:connect(function()
			delay(0,function() weld.Parent = OriginalParent end)
		end)
	end

end

local InternalEvent =
{
	Listeners = nil,
}
do
	UTIL.MakeClass(InternalEvent)
	function InternalEvent:Connect(func)
		if not self.Listeners then self.Listeners = {} end
		table.insert(self.Listeners,func)
	end
	function InternalEvent:Fire(...)
		if not self.Listeners then return end
		local args = {...}
		for _,i in ipairs(self.Listeners) do
			spawn(function() i(unpack(args)) end)
		end
	end
end