Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[[
	
	StreamableUtil.Compound(observers: {Observer}, handler: ({[child: string]: Instance}, maid: Maid) -> void): Maid
	
	Example:
	
		local streamable1 = Streamable.new(someModel, "SomeChild")
		local streamable2 = Streamable.new(anotherModel, "AnotherChild")
		
		StreamableUtil.Compound({S1 = streamable1, S2 = streamable2}, function(streamables, maid)
			local someChild = streamables.S1.Instance
			local anotherChild = streamables.S2.Instance
			maid:GiveTask(function()
				-- Cleanup
			end)
		end)
	
--]]




local Maid = require(script.Parent.Maid)


local StreamableUtil = {}


function StreamableUtil.Compound(streamables, handler)
	local compoundMaid = Maid.new()
	local observeAllMaid = Maid.new()
	local allAvailable = false
	local function Check()
		if (allAvailable) then return end
		for _,streamable in pairs(streamables) do
			if (not streamable.Instance) then
				return
			end
		end
		allAvailable = true
		handler(streamables, observeAllMaid)
	end
	local function Cleanup()
		if (not allAvailable) then return end
		allAvailable = false
		observeAllMaid:DoCleaning()
	end
	for _,streamable in pairs(streamables) do
		compoundMaid:GiveTask(streamable:Observe(function(_child, maid)
			Check()
			maid:GiveTask(function()
				Cleanup()
			end)
		end))
	end
	compoundMaid:GiveTask(Cleanup)
	return compoundMaid
end


return StreamableUtil
-- If there is only one item, any HP above that will be set to that color.


local SPECIAL_BALL_COLORS = {
    Tank = {
        [6] = Color3.fromRGB(135, 133, 146);
    },
    Summoner = {
        [1] = Color3.fromRGB(216, 144, 144);
    }
}

local BallColors = {}

function BallColors.Get(BallObject: Part)
    local HitPoints = math.ceil(BallObject:GetAttribute("HitPoints"))
    local Type = BallObject:GetAttribute("Type")

    if (Type and SPECIAL_BALL_COLORS[Type]) then
        local SpecialColors = SPECIAL_BALL_COLORS[Type]

        if (HitPoints >= next(SpecialColors)) then
            if (next(SpecialColors, next(SpecialColors)) == nil) then
                local _, Color = next(SpecialColors)
                return Color
            else
                for Threshold, Color in pairs(SpecialColors) do
                    if (HitPoints <= Threshold) then
                        return Color
                    end
                end
            end
        end
    end

    for Threshold, Color in pairs(DEFAULT_BALL_COLORS) do
        if (HitPoints == Threshold) then
            return Color
        end
    end
end

function BallColors.Fade(Color: Color3, Hits: number)
    return Color:Lerp(Color3.new(0, 0, 0), Hits / 7.5)
end

return BallColors
--[[
	Creates a Symbol with the given name.

	When printed or coerced to a string, the symbol will turn into the string
	given as its name.
]]


function Symbol.named(name)
	assert(type(name) == "string", "Symbols must be created using a string name!")

	local self = newproxy(true)

	local wrappedName = ("Symbol(%s)"):format(name)

	getmetatable(self).__tostring = function()
		return wrappedName
	end

	return self
end

return Symbol
-- and (IsServer or weaponInstance:IsDescendantOf(Players.LocalPlayer))



function WeaponsSystem.onWeaponAdded(weaponInstance)
	local weapon = WeaponsSystem.getWeaponForInstance(weaponInstance)
	if not weapon then
		WeaponsSystem.createWeaponForInstance(weaponInstance)
	end
end

function WeaponsSystem.onWeaponRemoved(weaponInstance)
	local weapon = WeaponsSystem.getWeaponForInstance(weaponInstance)
	if weapon then
		weapon:onDestroyed()
	end
	WeaponsSystem.knownWeapons[weaponInstance] = nil
end

function WeaponsSystem.getRemoteEvent(name)
	if not WeaponsSystem.networkFolder then
		return
	end

	local remoteEvent = WeaponsSystem.remoteEvents[name]
	if IsServer then
		if not remoteEvent then
			warn("No RemoteEvent named ", name)
			return nil
		end

		return remoteEvent
	else
		if not remoteEvent then
			remoteEvent = WeaponsSystem.networkFolder:WaitForChild(name, math.huge)
		end

		return remoteEvent
	end
end

function WeaponsSystem.getRemoteFunction(name)
	if not WeaponsSystem.networkFolder then
		return
	end

	local remoteFunc = WeaponsSystem.remoteFunctions[name]
	if IsServer then
		if not remoteFunc then
			warn("No RemoteFunction named ", name)
			return nil
		end

		return remoteFunc
	else
		if not remoteFunc then
			remoteFunc = WeaponsSystem.networkFolder:WaitForChild(name, math.huge)
		end

		return remoteFunc
	end
end

function WeaponsSystem.setWeaponEquipped(weapon, equipped)
	assert(not IsServer, "WeaponsSystem.setWeaponEquipped should only be called on the client.")
	if not weapon then
		return
	end

	local lastWeapon = WeaponsSystem.currentWeapon
	local hasWeapon = false
	local weaponChanged = false

	if lastWeapon == weapon then
		if not equipped then
			WeaponsSystem.currentWeapon = nil
			hasWeapon = false
			weaponChanged = true
		else
			weaponChanged = false
		end
	else
		if equipped then
			WeaponsSystem.currentWeapon = weapon
			hasWeapon = true
			weaponChanged = true
		end
	end

	if WeaponsSystem.camera then
		WeaponsSystem.camera:resetZoomFactor()
		WeaponsSystem.camera:setHasScope(false)

		if WeaponsSystem.currentWeapon then
			WeaponsSystem.camera:setZoomFactor(WeaponsSystem.currentWeapon:getConfigValue("ZoomFactor", 1.1))
			WeaponsSystem.camera:setHasScope(WeaponsSystem.currentWeapon:getConfigValue("HasScope", false))
		end
	end

	if WeaponsSystem.gui then
		WeaponsSystem.gui:setEnabled(hasWeapon)
--[=[
	@param ... any
	@return args: table
	Deserializes the arguments and returns the deserialized values in a table.
]=]


function Ser.DeserializeArgs(...: any): Args
	local args = table.pack(...)
	for i,arg in ipairs(args) do
		if type(arg) == "table" then
			local ser = Ser.Classes[arg.ClassName]
			if ser then
				args[i] = ser.Deserialize(arg)
			end
		end
	end
	return args
end
--[[
	    ___      _______                _       _______
	   / _ |____/ ___/ /  ___ ____ ___ (_)__   /__  __/
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<     / /
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/	/_/   
						SecondLogic @ Inspare
						Avxnturador @ Novena
]]


local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_Sounds")
local _Tune = require(car["A-Chassis Tune"])
local BOVact = 0
local BOVact2 = 0

local BOV_Loudness = 3	--volume of the BOV (not exact volume so you kinda have to experiment with it)
local BOV_Pitch = 1 	--max pitch of the BOV (not exact so might have to mess with it)
local TurboLoudness = 2 --volume of the Turbo (not exact volume so you kinda have to experiment with it also)

script:WaitForChild("Whistle")
script:WaitForChild("BOV")

for i,v in pairs(car.DriveSeat:GetChildren()) do
	for _,a in pairs(script:GetChildren()) do
		if v.Name==a.Name then v:Stop() wait() v:Destroy() end
	end
end

car.DriveSeat.ChildRemoved:connect(function(child)
	if child.Name=="SeatWeld" then
		for i,v in pairs(car.DriveSeat:GetChildren()) do
			for _,a in pairs(script:GetChildren()) do
				if v.Name==a.Name then v:Stop() wait() v:Destroy() end
			end
		end
	end
end)

handler:FireServer("newSound","Whistle",car.DriveSeat,script.Whistle.SoundId,0,script.Whistle.Volume,true)
handler:FireServer("newSound","BOV",car.DriveSeat,script.BOV.SoundId,0,script.BOV.Volume,true)
handler:FireServer("playSound","Whistle")
car.DriveSeat:WaitForChild("Whistle")
car.DriveSeat:WaitForChild("BOV")
local ticc = tick()
local _TCount = 0
if _Tune.Aspiration == "Single" then _TCount = 1 elseif _Tune.Aspiration == "Double" then _TCount = 2 end

while wait() do
	local psi = (((script.Parent.Values.Boost.Value)/(_Tune.Boost*_TCount))*2)
	
	BOVact = math.floor(psi*20)
	WP = (psi)
	WV = (psi/4)*TurboLoudness
	
	BP = (1-(-psi/20))*BOV_Pitch
	BV = (((-0.5+((psi/2)*BOV_Loudness)))*(1 - script.Parent.Values.Throttle.Value))

	if BOVact < BOVact2 then if car.DriveSeat.BOV.IsPaused then if FE then handler:FireServer("playSound","BOV") else car.DriveSeat.BOV:Play() end end end
	if BOVact >= BOVact2 then if FE then handler:FireServer("stopSound","BOV") else car.DriveSeat.BOV:Stop() end end
	
	if FE then
		handler:FireServer("updateSound","Whistle",script.Whistle.SoundId,WP,WV)
		handler:FireServer("updateSound","BOV",script.BOV.SoundId,BP,BV)
	else
		car.DriveSeat.Whistle.Pitch = WP
		car.DriveSeat.Whistle.Volume = WV
		car.DriveSeat.BOV.Pitch = BP
		car.DriveSeat.BOV.Volume = BV
	end
	if (tick()-ticc) >= 0.1 then
		BOVact2 = math.floor(psi*20)
		ticc = tick()
	end
end
--[AUTO SIZE]--


function AutoSizeModule.Resize()
	local Offset = 0
	for _, Ui in pairs(PluginGui:GetChildren()) do
		if Ui:IsA("Frame") then
			Offset = Offset + Ui.AbsoluteSize.Y
		end
	end
	if PluginGui.AbsoluteSize.Y < Offset then
		PluginGui.CanvasSize = UDim2.new(0,0,0, Offset)
	end
	if PluginGui.AbsoluteSize.Y > Offset then
		PluginGui.CanvasSize = UDim2.new(0,0,1,0)
	end
end
PluginGui.Changed:Connect(AutoSizeModule.Resize)
return AutoSizeModule
--		carSeat.Parent.Body.Dash.Screen.G.Radio.Song.Text = ""
--		carSeat.Parent.Body.Dash.Screen.G.Radio.Title.Text = ""


	end
end

F.volumech = function(v)
	carSeat.Parent.Body.MP.Sound.Volume = v
	carSeat.Parent.Body.Dash.Screen.G.Radio.VOLMENU.VolumeText.Text = "VOLUME: "..v
end

F.updateSong = function(Song)
	carSeat.Stations.mood.Value = 5
	carSeat.Parent.Body.MP.Sound:Stop()
	wait()
	carSeat.Parent.Body.MP.Sound.SoundId = "rbxassetid://"..Song
	wait()
	carSeat.Parent.Body.MP.Sound:Play()
-- ROBLOX devation: Circular dependency, inline type
-- local bindModule = require(script.Parent.Parent.bind)
-- type EachTests = bindModule.EachTests


type EachTests = Array<{
	title: string,
	arguments: Array<any>,
}>
local interpolationModule = require(script.Parent.interpolation)
type Templates = interpolationModule.Templates
local interpolateVariables = interpolationModule.interpolateVariables
-- Setup animation objects


function scriptChildModified(child)
    local fileList = animNames[child.Name]
    if (fileList ~= nil) then
        configureAnimationSet(child.Name, fileList)
    end
end

script.ChildAdded:connect(scriptChildModified)
script.ChildRemoved:connect(scriptChildModified)


for name, fileList in pairs(animNames) do 
    configureAnimationSet(name, fileList)
end
--  fun = what they have to type (make sure it is lowercased)
--        The first value in the table is what shows in the cmds
--                        Make sure to set this "2" to the rank you want players to have to use this
--                            This function is what runs the command when it is called


	fun = {"Fun [Player]";{2};{"Player"};function(plr, cmds)
		for i,v in pairs(cmds[1]) do -- This would basically get all the players it could find. Example: ;fun me would return only you in the table.
			print(v.Name)
		end
	end;};
}
-------------------------


function onClicked()
R.Function1.Disabled = true
R.Function2.Disabled = false
R.BrickColor = BrickColor.new("Institutional white")
N.One1.BrickColor = BrickColor.new("Really black")
N.One2.BrickColor = BrickColor.new("Really black")
N.One4.BrickColor = BrickColor.new("Really black")
N.Four1.BrickColor = BrickColor.new("Really black")
N.Three4.BrickColor = BrickColor.new("Really black")
N.Two1.BrickColor = BrickColor.new("Really black")
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
----------------------------------------------------------------------------
---  Functionality Loop  ---------------------------------------------------
----------------------------------------------------------------------------



RunService.Heartbeat:Connect(function(deltaTime)
	accumulatedChance += deltaTime * Settings.Rate

	if CanShow and ScreenBlockCFrame.LookVector.Y > -0.4 and not UnderObject(ScreenBlockCFrame.Position) then
		for i = 1, math.floor(accumulatedChance) do
			CreateDroplet()
		end

		accumulatedChance %= 1
	else
		accumulatedChance %= 1
	end
end)
-- Make Connection strict


setmetatable(Connection, {
	__index = function(_tb, key)
		error(("Attempt to get Connection::%s (not a valid member)"):format(tostring(key)), 2)
	end,
	__newindex = function(_tb, key, _value)
		error(("Attempt to set Connection::%s (not a valid member)"):format(tostring(key)), 2)
	end
})
-- Setup animation objects


for name, fileList in pairs(animNames) do 
	animTable[name] = {}
	animTable[name].count = 0
	animTable[name].totalWeight = 0
		
	-- check for config values
	local config = script:FindFirstChild(name)
	if (config ~= nil) then
		--		print("Loading anims " .. name)
		local idx = 1
		for _, childPart in pairs(config:GetChildren()) do
			animTable[name][idx] = {}
			animTable[name][idx].anim = childPart
			local weightObject = childPart:FindFirstChild("Weight")
			if (weightObject == nil) then
				animTable[name][idx].weight = 1
			else
				animTable[name][idx].weight = weightObject.Value
			end
			animTable[name].count = animTable[name].count + 1
			animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
			--			print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
			idx = idx + 1
		end
	end
		
	-- fallback to defaults
	if (animTable[name].count <= 0) then
		for idx, anim in pairs(fileList) do
			animTable[name][idx] = {}
			animTable[name][idx].anim = Instance.new("Animation")
			animTable[name][idx].anim.Name = name
			animTable[name][idx].anim.AnimationId = anim.id
			animTable[name][idx].weight = anim.weight
			animTable[name].count = animTable[name].count + 1
			animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
			--			print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
		end
	end
end
--[[**
	ensures value is a number where min < value

	@param min The minimum to use

	@returns A function that will return true iff the condition is passed
**--]]


function t.numberMinExclusive(min)
	return function(value)
		local success = t.number(value)
		if not success then
			return false
		end

		if min < value then
			return true
		else
			return false
		end
	end
end
--!strict


type Array<T> = { [number]: T }
type PredicateFunction = (any, number, Array<any>) -> boolean

return function(array: Array<any>, predicate: PredicateFunction): number
	for i = 1, #array do
		local element = array[i]
		if predicate(element, i, array) then
			return i
		end
	end
	return -1
end
--[[*
 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 ]]



local exports = {}

local function pluralize(word: string, count: number): string
	return ("%s %s%s"):format(tostring(count), word, if count == 1 then "" else "s")
end
exports.default = pluralize
return exports
-------- OMG HAX



r = game:service("RunService")


local damage = 10


local slash_damage = 15


sword = script.Parent.Handle
Tool = script.Parent


local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = 1


local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1


function blow(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
	if humanoid~=nil and humanoid ~= hum and hum ~= nil then
		-- final check, make sure sword is in-hand

		local right_arm = vCharacter:FindFirstChild("Right Arm")
		if (right_arm ~= nil) then
			local joint = right_arm:FindFirstChild("RightGrip")
			if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
				tagHumanoid(humanoid, vPlayer)
				humanoid:TakeDamage(damage)
				wait(1)
				untagHumanoid(humanoid)
			end
		end


	end
end


function tagHumanoid(humanoid, player)
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = player
	creator_tag.Name = "creator"
	creator_tag.Parent = humanoid
end

function untagHumanoid(humanoid)
	if humanoid ~= nil then
		local tag = humanoid:findFirstChild("creator")
		if tag ~= nil then
			tag.Parent = nil
		end
	end
end


function attack()
	damage = slash_damage
	SlashSound:play()
	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Slash"
	anim.Parent = Tool
end


function swordUp()
	Tool.GripForward = Vector3.new(-1,0,0)
	Tool.GripRight = Vector3.new(0,1,0)
	Tool.GripUp = Vector3.new(0,0,1)
end

function swordOut()
	Tool.GripForward = Vector3.new(0,0,1)
	Tool.GripRight = Vector3.new(0,-1,0)
	Tool.GripUp = Vector3.new(-1,0,0)
end



Tool.Enabled = true

function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return 
	end

	

	attack()

	wait(1)

	Tool.Enabled = true
end


function onEquipped()
	UnsheathSound:play()
end


script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)


connection = sword.Touched:connect(blow)
-------------------------


function onClicked()
R.Function1.Disabled = true

FX.ROLL.BrickColor = BrickColor.new("CGA brown")
FX.ROLL.loop.Disabled = true

FX.REVERB.BrickColor = BrickColor.new("CGA brown")
FX.REVERB.loop.Disabled = true

FX.ECHO.BrickColor = BrickColor.new("CGA brown")
FX.ECHO.loop.Disabled = true

FX.PHASER.BrickColor = BrickColor.new("CGA brown")
FX.PHASER.loop.Disabled = true

FX.SLIPROLL.BrickColor = BrickColor.new("CGA brown")
FX.SLIPROLL.loop.Disabled = true

FX.FILTER.BrickColor = BrickColor.new("CGA brown")
FX.FILTER.loop.Disabled = true

FX.SENDRETURN.BrickColor = BrickColor.new("Really red")
FX.SENDRETURN.loop.Disabled = true

FX.TRANS.BrickColor = BrickColor.new("CGA brown")
FX.TRANS.loop.Disabled = true

FX.MultiTapDelay.BrickColor = BrickColor.new("CGA brown")
FX.MultiTapDelay.loop.Disabled = true

FX.DELAY.BrickColor = BrickColor.new("CGA brown")
FX.DELAY.loop.Disabled = true

FX.REVROLL.BrickColor = BrickColor.new("CGA brown")
FX.REVROLL.loop.Disabled = true
R.loop.Disabled = false
R.Function2.Disabled = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
--TextStuff


local Text = script.Parent
local RebirthFormule = game:GetService("ReplicatedStorage").GameProperties.RebirthFormule
local MultiplierFormule = game:GetService("ReplicatedStorage").GameProperties.MultiplierFormule
local Formula = Multiplier.Value + MultiplierFormule.Value

Text.Text = Formula
 
Multiplier.Changed:Connect(function()
	local FormulaUpdate = Multiplier.Value + MultiplierFormule.Value
	Text.Text = FormulaUpdate
end)
--[=[
	Recursively prints the table. Does not handle recursive tables.

	@param _table table -- Table to stringify
	@param indent number? -- Indent level
	@param output string? -- Output string, used recursively
	@return string -- The table in string form
]=]


function Table.stringify(_table, indent, output)
	output = output or tostring(_table)
	indent = indent or 0
	for key, value in pairs(_table) do
		local formattedText = "\n" .. string.rep("  ", indent) .. tostring(key) .. ": "
		if type(value) == "table" then
			output = output .. formattedText
			output = Table.stringify(value, indent + 1, output)
		else
			output = output .. formattedText .. tostring(value)
		end
	end
	return output
end
-- [ ADVANCED ] --
--[[
	[Horizontal and Vertical limits for head and body tracking.]
	Setting to 0 negates tracking, setting to 1 is normal tracking, and setting to anything higher than 1 goes past real life head/body rotation capabilities.
--]]


local HeadHorFactor = 0.8
local HeadVertFactor = 0.5
local BodyHorFactor = 0.4
local BodyVertFactor = 0.4
--local freeSpaceX,freeSpaceY,freeSpaceZ = 3,3,2.8


local freeSpace = Vector3.new(3,2.8,3)
local box = script.Parent
local contents = box.Contents

local lidOffset = 3 

function r(num)
	return math.random(-math.abs(num*100),math.abs(num*100))/100
end

local function weldBetween(a, b)
	--Make a new Weld and Parent it to a.
	local weld = Instance.new("ManualWeld", a)
	weld.Part0 = a
	weld.Part1 = b
	--Get the CFrame of b relative to a.
	weld.C0 = a.CFrame:inverse() * b.CFrame
	--Return the reference to the weld so that you can change it later.
	return weld
end

box.Base.Touched:connect(function(oldHit)

	if (oldHit:FindFirstChild("Draggable") and oldHit:FindFirstChild("Pickup")) or
		(oldHit.Parent and (oldHit.Parent:FindFirstChild("Draggable") and oldHit.Parent:FindFirstChild("Pickup")))
	then
		local hit
		if oldHit.Parent:IsA("Model") and oldHit.Parent ~= workspace.Items then
			hit = oldHit.Parent:Clone()
			oldHit.Parent:Destroy()
		elseif oldHit.Parent == workspace.Items then
			hit = oldHit:Clone()
			oldHit:Destroy()
		end

		if hit.Draggable then
			hit.Draggable:Destroy()
		end

		if hit:IsA("BasePart") then
			hit.Anchored = false
			hit.CanCollide = false
			local vary = freeSpace-hit.Size
			-- random x,y,z
			print(vary,"as variance")
			--hit.CFrame = box.PrimaryPart.CFrame*CFrame.new(r(vary.X),1+math.random(0,vary.Y*100)/100,r(vary.Z))
			hit.CFrame = box.PrimaryPart.CFrame*CFrame.new(math.random(-100,100)/100,math.random(100,200)/100,math.random(-100,100)/100)
			weldBetween(hit, box.PrimaryPart)
		elseif hit:IsA("Model") then
			for _,v in next,hit:GetDescendants() do
				if v:IsA("BasePart") then
					v.Anchored = false
					v.CanCollide = false
					if v == hit.PrimaryPart then continue end
					weldBetween(v, hit.PrimaryPart)
				end
			end
			local modelSize=  hit:GetExtentsSize()
			local vary = freeSpace-modelSize
			--hit:SetPrimaryPartCFrame(box.PrimaryPart.CFrame*CFrame.new(r(vary.X),1+math.random(0,vary.Y*100)/100,r(vary.Z)))
			hit:SetPrimaryPartCFrame(box.PrimaryPart.CFrame*CFrame.new(math.random(-100,100)/100,math.random(100,200)/100,math.random(-100,100)/100))
			weldBetween(hit.PrimaryPart, box.PrimaryPart)
		end -- end of if hit is a basepart or model
		hit.Parent = contents
	end
end)
-- this is a dummy object that holds the flash made when the gun is fired


local FlashHolder = nil

local EquipTrack = nil
local PumpTrack = nil


local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
local GetCellFunction = Workspace.Terrain.GetCell

function RayIgnoreCheck(hit, pos)
	if hit then
		if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
				hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
				hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
			return true
		elseif hit:IsA('Terrain') and pos then
			local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
			if cellPos then
				local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
				if cellMat and cellMat == Enum.CellMaterial.Water then
					return true
				end
			end
		end
	end
	return false
end
-- Do a line/plane intersection.  The line starts at the camera.  The plane is at y == 0, normal(0, 1, 0)
--
-- vectorPos - End point of the line.
--
-- Return:
-- cellPos - The terrain cell intersection point if there is one, vectorPos if there isn't.
-- hit - Whether there was a plane intersection.  Value is true if there was, false if not.


function PlaneIntersection(vectorPos)
	local hit = false
	local currCamera = game:GetService("Workspace").CurrentCamera
	local startPos = Vector3.new(currCamera.CoordinateFrame.p.X, currCamera.CoordinateFrame.p.Y, currCamera.CoordinateFrame.p.Z)
	local endPos = Vector3.new(vectorPos.X, vectorPos.Y, vectorPos.Z)
	local normal = Vector3.new(0, 1, 0)
	local p3 = Vector3.new(0, 0, 0)
	local startEndDot = normal:Dot(endPos - startPos)
	local cellPos = vectorPos
	if startEndDot ~= 0  then
		local t = normal:Dot(p3 - startPos) / startEndDot
		if(t >=0 and t <=1) then
			local intersection = ((endPos - startPos) * t) + startPos
			cellPos = game:GetService("Workspace").Terrain:WorldToCell(intersection)
			hit = true
		end
	end

	return cellPos, hit
end
-- // Events \\ --


ProximityPrompt.PromptButtonHoldBegan:Connect(function()
	Functions.Flash("Teal")
end)

ProximityPrompt.Triggered:Connect(function(Player)
	DoorLogo.Beep:Play()
	Functions.Flash("Bright green")
	ProximityPrompt.Enabled = false
	Functions.Move(true)
	wait(2)
	Functions.Move(false)
	Functions.Flash("Bright red")
	ProximityPrompt.Enabled = true
end)