Pinkstack/roblox-luau-corpus-text huggingface dataset:
--Made by Repressed_Memories
-- Edited by Truenus


local component = script.Parent.Parent
local car = script.Parent.Parent.Parent.Parent.Car.Value
local mouse = game.Players.LocalPlayer:GetMouse()
local leftsignal = "z"
local rightsignal = "c"
local hazards = "x"
local hazardson = false
local lefton = false
local righton = false
local leftlight = car.Body.Lights.Left.TurnSignal.TSL
local rightlight = car.Body.Lights.Right.TurnSignal.TSL
local leftfront = car.Body.Lights.Left.TurnSignal2
local rightfront = car.Body.Lights.Right.TurnSignal2
local signalblinktime = 0.32
local neonleft = car.Body.Lights.Left.TurnSignal
local neonright = car.Body.Lights.Right.TurnSignal
local on =  BrickColor.New("New Yeller")
local off = BrickColor.New("Medium stone grey")
mouse.KeyDown:connect(function(lkey)
	local key = string.lower(lkey)
	if key == leftsignal then
		if lefton == false then
			lefton = true
			repeat
				neonleft.BrickColor = on
				leftlight.Enabled = true
				neonleft.Material = "Neon"
				leftfront.Material = "Neon"
				component.TurnSignal:play()
				wait(signalblinktime)
				neonleft.BrickColor = off
				component.TurnSignal:play()
				neonleft.Material = "SmoothPlastic"
				leftfront.Material = "SmoothPlastic"
				leftlight.Enabled = false
				wait(signalblinktime)
			until
			lefton == false or righton == true
		elseif lefton == true or righton == true then
			lefton = false
			component.TurnSignal:stop()
			leftlight.Enabled = false
		end
	elseif key == rightsignal then
		if righton == false then
			righton = true
			repeat
				neonright.BrickColor = on
				rightlight.Enabled = true
				neonright.Material = "Neon"
				rightfront.Material = "Neon"
				component.TurnSignal:play()
				wait(signalblinktime)
				neonright.BrickColor = off
				component.TurnSignal:play()
				neonright.Material = "SmoothPlastic"
				rightfront.Material = "SmoothPlastic"
				rightlight.Enabled = false
				wait(signalblinktime)
			until
			righton == false or lefton == true
		elseif righton == true or lefton == true then
			righton = false
			component.TurnSignal:stop()
			rightlight.Enabled = false
		end
	elseif key == hazards then
		if hazardson == false then
			hazardson = true
			repeat
				neonright.BrickColor = on
				neonleft.BrickColor = on
				neonright.Material = "Neon"
				rightfront.Material = "Neon"
				neonleft.Material = "Neon"
				leftfront.Material = "Neon"
				component.TurnSignal:play()
				rightlight.Enabled = true
				leftlight.Enabled = true
				wait(signalblinktime)
				neonright.BrickColor = off
				neonleft.BrickColor = off
				component.TurnSignal:play()
				neonright.Material = "SmoothPlastic"
				rightfront.Material = "SmoothPlastic"
				neonleft.Material = "SmoothPlastic"
				leftfront.Material = "SmoothPlastic"
				rightlight.Enabled = false
				leftlight.Enabled = false
				wait(signalblinktime)
			until
			hazardson == false
		elseif hazardson == true then
			hazardson = false
			component.TurnSignal:stop()
			rightlight.Enabled = false
			leftlight.Enabled = false
		end
	end
end)
-- Touched events


F_Detector.Touched:Connect(function(x)
speedVar = ((math.floor(((10/12) * (60/88)) * script.Parent.Parent:WaitForChild('A-Chassis Interface').Values.Velocity.Value.Magnitude)))
	handle('front', x)
end)

FL_Detector.Touched:Connect(function(x)
speedVar = ((math.floor(((10/12) * (60/88)) * script.Parent.Parent:WaitForChild('A-Chassis Interface').Values.Velocity.Value.Magnitude)))
	handle('frontleft', x)
end)

FR_Detector.Touched:Connect(function(x)
speedVar = ((math.floor(((10/12) * (60/88)) * script.Parent.Parent:WaitForChild('A-Chassis Interface').Values.Velocity.Value.Magnitude)))
	handle('frontright', x)
end)

R_Detector.Touched:Connect(function(x)
speedVar = ((math.floor(((10/12) * (60/88)) * script.Parent.Parent:WaitForChild('A-Chassis Interface').Values.Velocity.Value.Magnitude)))
	handle('right', x)
end)

L_Detector.Touched:Connect(function(x)
speedVar = ((math.floor(((10/12) * (60/88)) * script.Parent.Parent:WaitForChild('A-Chassis Interface').Values.Velocity.Value.Magnitude)))
	handle('left', x)
end)
--[[
	README
	This clock uses the time in Lighting to display the time by default
	Change the option USE_CUSTOM_TIME to true in order to control the clock time yourself
	Use the MinutesAfterMidnight NumberValue in the DigitalClock model to set the time
	
	You can change the refresh rate of the clock using the NumberValue child of this script
	
	Click on this model to turn it on/off
	
	This model can be safely resized
]]
-- Hat giver script.



debounce = true

function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Hat")
		p = Instance.new("Part")
		h.Name = "Russian cop"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = script.Parent.formFactor
		p.Size = Vector3.new(1, 1, 1) 
		p.BottomSurface = 0 
		p.TopSurface = 0 
		p.Locked = true 
		script.Parent.Mesh:clone().Parent = p
		h.Parent = hit.Parent
                h.AttachmentForward = Vector3.new(0, -0.1, -0.995)
		h.AttachmentPos = Vector3.new(0, -0.17, 0.1)
                h.AttachmentRight = Vector3.new(1,0,0)
                h.AttachmentUp = Vector3.new(0, 0.995, -0.1)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
-- cuts part into two based on an axis aligned plane


local function slicePart(part, origin, normal)
	local verts = blockVerts(part.CFrame, part.Size/2);

	if (normal:Dot(POSITIVEDIR) < 0) then
		normal = -normal;
	end

	local distances = {};
	for i = 1, #verts do
		distances[#distances+1] = (verts[i] - origin):Dot(normal);
	end

	local min = math.min(unpack(distances));
	local max = math.max(unpack(distances));

	local v = part.Position - origin;
	local center = (v - v:Dot(normal)*normal) + origin;
	local size = part.Size - part.Size*normal;

	local pos1, size1;
	if (max >= 0.05) then
		pos1 = center + normal*max/2;
		size1 = size + max*normal;
	end

	local pos2, size2;
	if (min <= -0.05) then
		pos2 = center + normal*min/2;
		size2 = size - min*normal;
	end

	return pos1, size1, pos2, size2;
end
--------------------[ KEYBOARD FUNCTIONS ]--------------------------------------------



function KeyDown(K)
	local Key = string.lower(K)
	
	if Key == S.LowerStanceKey and S.CanChangeStance then
		if (not Running) then
			if Stance == 0 then
				Crouch()
			elseif Stance == 1 then
				Prone()
			end
		elseif S.DolphinDive then
			delay(1 / 30,function()
				CanRun = false
				Dive(S.BaseWalkSpeed)
				Run_Key_Pressed = false
				wait(S.DiveRechargeTime)
				CanRun = true
			end)
		end
	end
	
	if Key == S.RaiseStanceKey and S.CanChangeStance then
		if (not Running) then
			if Stance == 2 then
				Crouch()
			elseif Stance == 1 then
				Stand()
			end
		end
	end
	
	if Key == S.ReloadKey then
		if (not Reloading) and (not Running) then
			Reload()
		end
	end
	
	
	if Key == S.KnifeKey and S.CanKnife then
		if KnifeReady and (not Knifing) and (not ThrowingGrenade) then
			if Aimed then UnAimGun(true) end
			BreakReload = true
			Knifing = true
			KnifeReady = false
			KnifeAnim()
			BreakReload = false
			Knifing = false
			delay(S.KnifeCooldown, function()
				KnifeReady = true
			end)
		end
	end
	
	if Key == S.SprintKey then
		Run_Key_Pressed = true
		if Aimed and (not Aiming) then
			TakingBreath = false
			SteadyCamera()
		end
		if CanRun then
			if (not Idleing) and Walking and (not Running) and (not Knifing) and (not ThrowingGrenade) then
				if Reloading then BreakReload = true end
				MonitorStamina()
			end
		end
	end
end

function KeyUp(K)
	local Key = string.lower(K)
	
	if Key == S.SprintKey then
		Run_Key_Pressed = false
		Running = false
		if (not ChargingStamina) then
			RechargeStamina()
		end
	end
end
--[[ Script Variables ]]

--
while not Players.LocalPlayer do
	task.wait()
end
local LocalPlayer = Players.LocalPlayer
local Humanoid = MasterControl:GetHumanoid()
local JumpButton = nil
local OnInputEnded = nil		-- defined in Create()
local CharacterAddedConnection = nil
local HumStateConnection = nil
local HumChangeConnection = nil
local ExternallyEnabled = false
local JumpPower = 0
local JumpStateEnabled = true
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]


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 on = 0
local mult=0
local det=.13
local trm=.4
local trmmult=0
local trmon=0
local throt=0
local redline=0
local shift=0

script:WaitForChild("Rev")

script.Parent.Values.Gear.Changed:connect(function()
	mult=1.2
	if script.Parent.Values.RPM.Value>5000 then
		shift=.2
	end
end)

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

handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)
handler:FireServer("playSound","Rev")
car.DriveSeat:WaitForChild("Rev")

game["Run Service"].Stepped:connect(function()
	mult=math.max(0,mult-.1)
	local _RPM = script.Parent.Values.RPM.Value
	
	if script.Parent.Values.Throttle.Value <= _Tune.IdleThrottle/100 then
		throt = math.max(.3,throt-.2)
		trmmult = math.max(0,trmmult-.05)
		trmon = 1		
	else
		throt = math.min(1,throt+.1)
		trmmult = 1
		trmon = 0		
	end	
	shift = math.min(1,shift+.2)	
	if script.Parent.Values.RPM.Value > _Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value > _Tune.IdleThrottle/100 then
		redline=.5
	else
		redline=1
	end
	if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
	local Volume = (1*throt*shift*redline)+(trm*trmon*trmmult*(1-throt)*math.sin(tick()*50))
	local Pitch = math.max((((script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),script.Rev.SetPitch.Value)
	if FE then
		handler:FireServer("updateSound","Rev",script.Rev.SoundId,Pitch,Volume)
	else
		car.DriveSeat.Rev.Volume = Volume
		car.DriveSeat.Rev.Pitch = Pitch
	end
end)
--doEvent()


print(lowered)
return
end

function doEvent()
	if lowered == true then
	return --negative event
	else return --positive event
	end
end

function onClicked()
print("clicked") 
	if debounce == false then 
	debounce = true 
	delay(5, function() debounce = false end) 
		if lowered == false then 
		lower() 
		else if lowered == true then raise() end
		end 
	else return
	end 
end

script.Parent.Bar.ClickDetector.MouseClick:connect(onClicked) 
lower()
--	force.Parent = nil


SlashSound:stop()
end

function onActivated()
	if not Tool.melee.Value then return end

	meleeconnect = Tool.Handle.Touched:connect(blow)

	lunge()

	meleeconnect:disconnect()
	wait(.2)

	Tool.melee.Value=false
end

function TeamColorFix()
	if game.Players:playerFromCharacter(Tool.Parent)~=nil then
		local jill=game.Players:playerFromCharacter(Tool.Parent)
		if jill.Neutral==false then
			cc=jill.TeamColor
		else
			print("neutral")
			colors = {45, 119, 21, 24, 23, 105, 104}
			cc=BrickColor.new(colors[math.random(1, 7)])
		end
	else
		print("no player")
		colors = {45, 119, 21, 24, 23, 105, 104}
		cc=BrickColor.new(colors[math.random(1, 7)])
	end
end
Tool.Equipped:connect(TeamColorFix)

Tool.melee.Changed:connect(onActivated)
-------------------------------------Gun info


ToolName="Shotgun"

ClipSize=6
ReloadTime=3
Firerate=.40
MinSpread=0
MaxSpread=0
SpreadRate=0
BaseDamage=100
automatic=false
burst=false
shot=true		--Shotgun
BarrlePos=Vector3.new(-2.20,.60,0)
Cursors={"rbxasset://textures\\GunCursor.png"}
ReloadCursor="rbxasset://textures\\GunWaitCursor.png"
--[=[
	Observable rx library for Roblox by Quenty. This provides a variety of
	composition classes to be used, and is the primary entry point for an
	observable.

	Most of these functions return either a function that takes in an
	observable (curried for piping) or an [Observable](/api/Observable)
	directly.

	@class Rx
]=]



local require = require(script.Parent.loader).load(script)

local Maid = require("Maid")
local Observable = require("Observable")
local Promise = require("Promise")
local Symbol = require("Symbol")
local Table = require("Table")
local ThrottledFunction = require("ThrottledFunction")
local cancellableDelay = require("cancellableDelay")
local CancelToken = require("CancelToken")

local UNSET_VALUE = Symbol.named("unsetValue")
--Version 1.43 --


local carSeat=script.Parent.Parent.Parent.Parent
local numbers={180354176,180354121,180354128,180354131,180354134,180354138,180354146,180354158,180354160,180354168,180355596,180354115}


while true do
	wait(0.01)
	local value = math.floor((10/12) * (60/88) * carSeat.Velocity.magnitude) -- SPS Magnitude to MPH
	--local value=(carSeat.Velocity.magnitude)/1 --This is the velocity so if it was 1.6 it should work. If not PM me! or comment!--
	if value<10000 then
		local nnnn=math.floor(value/1000)
		local nnn=(math.floor(value/100))-(nnnn*10)
		local nn=(math.floor(value/10)-(nnn*10))-(nnnn*100)
		local n=(math.floor(value)-(nn*10)-(nnn*100))-(nnnn*1000)
		    script.Parent.A.Image="http://www.roblox.com/asset/?id="..numbers[n+1]
		if value>=10 then
			script.Parent.B.Image="http://www.roblox.com/asset/?id="..numbers[nn+1]
		else
			script.Parent.B.Image="http://www.roblox.com/asset/?id="..numbers[12]
		end
		if value>=100 then
			script.Parent.C.Image="http://www.roblox.com/asset/?id="..numbers[nnn+1]
		else
			script.Parent.C.Image="http://www.roblox.com/asset/?id="..numbers[12]
		end
	else
		script.Parent.A.Image="http://www.roblox.com/asset/?id="..numbers[10]
		script.Parent.B.Image="http://www.roblox.com/asset/?id="..numbers[10]	
		script.Parent.C.Image="http://www.roblox.com/asset/?id="..numbers[10]
	end

end
-- Limits the amount you can steer based on velocity. Helpful for keyboard/non-analog steer inputs


local SteerLimit = 0.2 -- Max amount the steering float (-1 to 1) will be limited by if limitSteerAtHighVel is true

local DoGravityAdjust = true -- Adjust chassis values based on the current gravity setting.
local ActualDrivingTorque
local ActualBrakingTorque
local ActualStrutSpringStiffnessFront
local ActualStrutSpringDampingFront
local ActualStrutSpringStiffnessRear
local ActualStrutSpringDampingRear
local ActualTorsionSpringStiffness
local ActualTorsionSpringDamping
--If you see this model posted by someone else, They didnt make that--
--I made it (Dr_Kylak)--
--And theres a reason why im inserting this in, Its because i realeased other R15 models--
--But theres a problem, People are taking the model and uploading it themselves to think that they made it--
--You may know me as the person who created that model Scared guy the r15 one--
--But yeah Please do not Copy this and enjoy  the model. You can use it for whatever you want!--
--[[Status Vars]]



local _IsOn = _Tune.AutoStart
if _Tune.AutoStart then script.Parent.IsOn.Value=true end

local _GSteerT=0
local _GSteerC=0
local _GThrot=0
local _GThrotShift=1
local _GBrake=0

local _ClutchOn = true
local _ClPressing = false
local _RPM = 0
local _HP = 0
local _OutTorque = 0
local _CGear = 0
local _PGear = _CGear
local _spLimit = 0

local _Boost = 0
local _TCount = 0
local _TPsi = 0
local _BH = 0
local _BT = 0
local _NH = 0
local _NT = 0

local _TMode = _Tune.TransModes[1]

local _MSteer = false
local _SteerL = false
local _SteerR = false
local _PBrake = false
local _TCS = _Tune.TCSEnabled
local _TCSActive = false
local _TCSAmt = 0
local _ABS = _Tune.ABSEnabled
local _ABSActive = false

local FlipWait=tick()
local FlipDB=false

local _InControls = false
--						if GetHitPlayers() >= 3 then
--							AwardBadge:Invoke(FiredPlayer,"Explosive Results")
--						end


						
						local FiredPlayer = GetReflectedByPlayer() or FiredPlayer
						local DoDamage = PlayerDamager:CanDamageHumanoid(FiredPlayer,HitHumanoid)
						if DoDamage then
							local Distance
							local HumanoidRootPrart = HitCharacter:FindFirstChild("HumanoidRootPart")
							if HumanoidRootPrart then
								Distance = (HumanoidRootPrart.Position - Position ).magnitude
							else
								Distance = RadiusFromBlast
							end	
							RadiusFromBlast = math.min(math.max(RadiusFromBlast - 0.8,0),1)
								
							PlayerDamager:DamageHumanoid(FiredPlayer,HitHumanoid,MAX_DAMAGE - ((Distance/BLAST_RADIUS) * (MAX_DAMAGE - MIN_DAMAGE)),GetDamageName())
						end
					end
				end		
				
				--Break joints if it isn't a character.
				if BreakJoints then
					ExplosionTouchPart:BreakJoints()
				end
				
				--If the part is able to fade with explosions, signal it to fade.
--LockController




Closed = true

function LockItems()

end

script.Parent.Touched:connect(function(P)
	if P ~= nil and P.Parent ~= nil and P.Parent:FindFirstChild("CardNumber") ~= nil  and P.Parent.CardNumber.Value == 0 then
		if Closed == true then
			Closed = 1
			script.Locked.Value = false
			LockItems()
			script.Parent.Open.Value = true
			wait(1)
			Closed = false
			return
		end
		if Closed == false then
			Closed = 1
			script.Locked.Value = true
			LockItems()
			script.Parent.Open.Value = false
			wait(1)
			Closed = true
			return
		end

	end
end)
-- EchoAUS Custom Health Gui
-- All this script does is put everything where it's supposed to be.



local function EnableScripts(i)
	local t = string.split(i.Name, ".")
	if t[#t] == "lua" and i:IsA("BaseScript") then
		i.Name = table.concat(t, ".", 1, #t - 1)
		i.Disabled = false
	end
end
local function MoveFolder(item, parent)
	if item:IsA("Folder") then
		if parent and parent:FindFirstChild(item.Name) then
			for _, i in ipairs (item:GetChildren()) do
				MoveFolder(i, parent[item.Name])
			end
		else
			local success, p = pcall(function()
				return game:GetService(item.Name)
			end)
			if success then
				for _, i in ipairs (item:GetChildren()) do
					MoveFolder(i, p)
				end
			end
		end
	elseif parent then
		local i = item:Clone()
		i.Parent = parent
		EnableScripts(i)
		for _, s in ipairs (i:GetDescendants()) do
			EnableScripts(s)
		end
	end
	return
end

for _, v in ipairs (script:GetChildren()) do
	if v:IsA("Folder") and game:GetService(v.Name) then
		MoveFolder(v)
	end
end

local parent = script.Parent
if parent:IsA("Model") then
	parent:Destroy()
end
--TweenService Wrapper
--Andrew Bereza


return function (object, properties, value, duration, style, direction)
	style = style or Enum.EasingStyle.Quad
	direction = direction or Enum.EasingDirection.Out

	duration = duration or 0.5

	local propertyGoals = {}

	local isTable = type(value) == "table"

	for i,property in pairs(properties) do
		propertyGoals[property] = isTable and value[i] or value
	end
	local tweenInfo = TweenInfo.new(
		duration,
		style,
		direction
	)
	local tween = game:GetService("TweenService"):Create(object,tweenInfo,propertyGoals)
	tween:Play()

	return tween
end
--Creates a display Gui for the soft shutdown.



return function()
	local ScreenGui = Instance.new("ScreenGui")
	ScreenGui.Name = "SoftShutdownGui"
	ScreenGui.DisplayOrder = 100
	
	--Create background to cover behind top bar.
	local Frame = Instance.new("Frame")
	Frame.BackgroundColor3 = Color3.fromRGB(79,217,255)
	Frame.Position = UDim2.new(-0.5,0,-0.5,0)
	Frame.Size = UDim2.new(2,0,2,0)
	Frame.ZIndex = 10
	Frame.Parent = ScreenGui
	
	local function CreateTextLabel(Size,Position,Text)
		local TextLabel = Instance.new("TextLabel")
		TextLabel.BackgroundTransparency = 1
		TextLabel.Size = Size
		TextLabel.Position = Position
		TextLabel.Text = Text
		TextLabel.ZIndex = 10
		TextLabel.Font = "SourceSansBold"
		TextLabel.TextScaled = true
		TextLabel.TextColor3 = Color3.new(1,1,1)
		TextLabel.TextStrokeColor3 = Color3.new(0,0,0)
		TextLabel.TextStrokeTransparency = 0
		TextLabel.Parent = Frame
	end
	
	--Create text.
	CreateTextLabel(UDim2.new(0.5,0,0.1,0),UDim2.new(0.25,0,0.4,0),"ATTENTION")
	CreateTextLabel(UDim2.new(0.5,0,0.05,0),UDim2.new(0.25,0,0.475,0),"This server is being updated")
	CreateTextLabel(UDim2.new(0.5,0,0.03,0),UDim2.new(0.25,0,0.55,0),"Please wait")
	
	--Return the ScreenGui and the background.
	return ScreenGui,Frame		
end
-- Define the function to open or close the windows with gene-alike effect


local function toggleWindows()
	local anyWindowVisible = false

	for _, window in pairs(windows) do
		if window.Visible then
			anyWindowVisible = true
			backShelf.Visible = true
			dockShelf.Visible = true
			window:TweenSizeAndPosition(
				UDim2.new(0.363, 0, 0.019, 0),
				UDim2.new(0.311, 0, 0.978, 0),
				'Out',
				'Quad',
				-- Determine the tween speed based on the uiSpeedSetting
				ClipSettings.settings.uiSpeedSetting and uiSpeedUser.Value or UISpeed,
				false,
				function()
					window.Visible = false
				end
			)
		end
	end

	if not anyWindowVisible then
	end
end
---------------------------------------------------------------------------------------



local webhookService = {}

local https = game:GetService("HttpService")


function webhookService:createMessage(url, message)
	local data = {
		["content"] = message
	}
	local finalData = https:JSONEncode(data)
	https:PostAsync(url, finalData)
end

function webhookService:createEmbed(url, title, message, image)
	local data = {
		['content'] = "",
		['embeds'] = {{
			['author'] = {
				['name'] = title,
				['icon_url'] = image,
			},
			['description'] = message,
			['type'] = "rich",
			["color"] = tonumber(0xffffff)
		}}
	}
	local finalData = https:JSONEncode(data)
	https:PostAsync(url, finalData)
end


return webhookService
--[[

	StreamableUtil.Compound(observers: {Observer}, handler: ({[child: string]: Instance}, janitor: Janitor) -> void): Janitor

	Example:

		local streamable1 = Streamable.new(someModel, "SomeChild")
		local streamable2 = Streamable.new(anotherModel, "AnotherChild")

		StreamableUtil.Compound({S1 = streamable1, S2 = streamable2}, function(streamables, janitor)
			local someChild = streamables.S1.Instance
			local anotherChild = streamables.S2.Instance
			janitor:Add(function()
				-- Cleanup
			end)
		end)

--]]




local Janitor = require(script.Parent.Janitor)
local _Streamable = require(script.Parent.Streamable)


type Streamables = {_Streamable.Streamable}
type CompoundHandler = (Streamables, any) -> nil


local StreamableUtil = {}


function StreamableUtil.Compound(streamables: Streamables, handler: CompoundHandler)
	local compoundJanitor = Janitor.new()
	local observeAllJanitor = Janitor.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, observeAllJanitor)
	end
	local function Cleanup()
		if not allAvailable then return end
		allAvailable = false
		observeAllJanitor:Clean()
	end
	for _,streamable in pairs(streamables) do
		compoundJanitor:Add(streamable:Observe(function(_child, janitor)
			Check()
			janitor:Add(Cleanup)
		end))
	end
	compoundJanitor:Add(Cleanup)
	return compoundJanitor
end


return StreamableUtil
-----------------
--| Constants |--
-----------------



local POP_RESTORE_RATE = 0.3

local CAST_SCREEN_SCALES = { -- (Relative)
	Vector2.new(1, 1) / 2, -- Center
	Vector2.new(0, 0), -- Top left
	Vector2.new(1, 0), -- Top right
	Vector2.new(1, 1), -- Bottom right
	Vector2.new(0, 1), -- Bottom left
}

local VALID_SUBJECTS = {
	'Humanoid',
	'VehicleSeat',
	'SkateboardPlatform',
}
 
local NEAR_CLIP_PLANE_OFFSET = 0.5 --NOTE: Not configurable here