Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[[
local core = game.ReplicatedStorage.CustomMovement;
local studioAnim = require(core.Utility:WaitForChild("StudioAnim"));
local animations = core:WaitForChild("Animations");
studioAnim(animations);
--]]



local RUNSERVICE = game:GetService("RunService");
local KFSP = game:GetService("KeyframeSequenceProvider");

local function convert(anim)
	local kfs = anim:FindFirstChildWhichIsA("KeyframeSequence");
	if (kfs) then
		anim.AnimationId = KFSP:RegisterKeyframeSequence(kfs);
	end
end

return function(animFolder)
	for k, anim in next, animFolder:GetChildren() do
		convert(anim);
	end
end
--[=[
	Construct a new Promise that will be resolved or rejected with the given callbacks.

	If you `resolve` with a Promise, it will be chained onto.

	You can safely yield within the executor function and it will not block the creating thread.

	```lua
	local myFunction()
		return Promise.new(function(resolve, reject, onCancel)
			wait(1)
			resolve("Hello world!")
		end)
	end

	myFunction():andThen(print)
	```

	You do not need to use `pcall` within a Promise. Errors that occur during execution will be caught and turned into a rejection automatically. If `error()` is called with a table, that table will be the rejection value. Otherwise, string errors will be converted into `Promise.Error(Promise.Error.Kind.ExecutionError)` objects for tracking debug information.

	You may register an optional cancellation hook by using the `onCancel` argument:

	* This should be used to abort any ongoing operations leading up to the promise being settled.
	* Call the `onCancel` function with a function callback as its only argument to set a hook which will in turn be called when/if the promise is cancelled.
	* `onCancel` returns `true` if the Promise was already cancelled when you called `onCancel`.
	* Calling `onCancel` with no argument will not override a previously set cancellation hook, but it will still return `true` if the Promise is currently cancelled.
	* You can set the cancellation hook at any time before resolving.
	* When a promise is cancelled, calls to `resolve` or `reject` will be ignored, regardless of if you set a cancellation hook or not.

	@param executor (resolve: (...: any) -> (), reject: (...: any) -> (), onCancel: (abortHandler?: () -> ()) -> boolean) -> ()
	@return Promise
]=]


function Promise.new(executor)
	return Promise._new(debug.traceback(nil, 2), executor)
end

function Promise:__tostring()
	return string.format("Promise(%s)", self._status)
end
--/////////// CONFIGURATIONS \\\\\\\\\\\\\\\\\




local sensitivity = 1 -- how quick/snappy the sway movements are. Don't go above 2
local swaysize = 1 -- how large/powerful the sway is. Don't go above 2
local includestrafe = false -- if true the fps arms will sway when the character is strafing
local includewalksway = true -- if true, fps arms will sway when you are walking
local includecamerasway = true -- if true, fps arms will sway when you move the camera
local includejumpsway = true -- if true, jumping will have an effect on the viewmodel
local headoffset = Vector3.new(0,0,0) -- the offset from the default camera position of the head. (0,1,0) will put the camera one stud above the head.
local firstperson_arm_transparency = 0 -- the transparency of the arms in first person; set to 1 for invisible and set to 0 for fully visible.
local firstperson_waist_movements_enabled = false -- if true, animations will affect the Uppertorso. If false, the uppertorso stays still while in first person (applies to R15 only)
--Offset For Each New Ray For The Bullet's Trajectory


local offset			= (parts.Parent.Gun.Muzzle.CFrame*CFrame.new(math.random(-4.3,4.3)/3,100,math.random(-4.3,4.3)/3).p
							- parts.Parent.Gun.Muzzle.Position).unit
							*script.Parent.Stats.GunVelocity.Value
local point1			= parts.Parent.Gun.Muzzle.Position
--// F key, HornOff


mouse.KeyUp:connect(function(key)
	if key=="f" then 
		veh.Lightbar.middle.Airhorn:Stop()
		veh.Lightbar.middle.Wail.Volume = 2
		veh.Lightbar.middle.Yelp.Volume = 2
		veh.Lightbar.middle.Priority.Volume = 2
		veh.Lightbar.AH.Transparency = 1
	end
end)
--[[
	Joins any number of lists together into a new list
]]


function Immutable.JoinLists(...)
	local new = {}

	for listKey = 1, select("#", ...) do
		local list = select(listKey, ...)
		local len = #new

		for itemKey = 1, #list do
			new[len + itemKey] = list[itemKey]
		end
	end

	return new
end
--[[
	A special key for property tables, which stores a reference to the instance
	in a user-provided Value object.
]]



local Package = script.Parent.Parent
local PubTypes = require(Package.PubTypes)
local logError = require(Package.Logging.logError)
local xtypeof = require(Package.Utility.xtypeof)

local Ref = {}
Ref.type = "SpecialKey"
Ref.kind = "Ref"
Ref.stage = "observer"

function Ref:apply(refState: any, applyTo: Instance, cleanupTasks: {PubTypes.Task})
	if xtypeof(refState) ~= "State" or refState.kind ~= "Value" then
		logError("invalidRefType")
	else
		refState:set(applyTo)
		table.insert(cleanupTasks, function()
			refState:set(nil)
		end)
	end
end

return Ref
--[[Engine]]

--
	
	-- Everything below can be illustrated and tuned with the graph below.
	-- https://www.desmos.com/calculator/x1h2vdccu1
	-- This includes everything, from the engines, to boost, to electric.
	
	-- Naturally Aspirated Engine
	Tune.Engine 		= true		
		
		Tune.IdleRPM		= 1000
		Tune.Redline		= 13000
		Tune.PeakRPM		= 11000
		-- Horsepower
		Tune.Horsepower		= 180
		Tune.MH_PeakRPM		= Tune.PeakRPM
		Tune.MH_PeakSharp	= 2
		Tune.MH_CurveMult	= 0.02
		-- Torque
		Tune.M_EqPoint		= 9500
		Tune.MT_PeakRPM		= 11000
		Tune.MT_PeakSharp	= 2
		Tune.MT_CurveMult	= 0.02
	
	-- Electric Engine
	Tune.Electric		= false
		
		Tune.E_Redline	= 16000
		Tune.E_Trans1	= 4000
		Tune.E_Trans2	= 9000
		-- Horsepower
		Tune.E_Horsepower	= 223
		Tune.EH_FrontMult	= 0.15
		Tune.EH_EndMult		= 2.9
		Tune.EH_EndPercent	= 7
		-- Torque
		Tune.E_Torque		= 223
		Tune.ET_EndMult		= 1.505
		Tune.ET_EndPercent	= 27.5
		
	-- Turbocharger
	Tune.Turbochargers	= 0				-- Number of turbochargers in the engine
										-- Set to 0 for no turbochargers
		Tune.T_Boost		= 7
		Tune.T_Efficiency	= 6
		--Horsepower
		Tune.TH_PeakSharp	= 2
		Tune.TH_CurveMult	= 0.02
		--Torque
		Tune.TT_PeakSharp	= 2
		Tune.TT_CurveMult	= 0.02
		
		Tune.T_Size			= 80		-- Turbo Size; Bigger size = more turbo lag
		
	-- Supercharger
	Tune.Superchargers	= 0				-- Number of superchargers in the engine
										-- Set to 0 for no superchargers
		Tune.S_Boost		= 5
		Tune.S_Efficiency	= 6
		--Horsepower
		Tune.SH_PeakSharp	= 2
		Tune.SH_CurveMult	= 0.02
		--Torque
		Tune.ST_PeakSharp	= 2
		Tune.ST_CurveMult	= 0.02
		
		Tune.S_Sensitivity	= 0.05		-- Supercharger responsiveness/sensitivity, applied per tick (recommended values between 0.05 to 0.1)
	
	--Misc
	Tune.RevAccel		= 250		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.Flywheel		= 500		-- Flywheel weight (higher = faster response, lower = more stable RPM)
	
	--Aero
	Tune.Drag			= 0.5		-- 0 to 1, edit to change drag effect (0 = no effect, 1 = full effect)
---------------------------------------------------



This = script.Parent
Elevator = This.Parent.Parent.Parent
CustomLabel = require(This.Parent.Parent.Parent.CustomLabel)
Characters = require(script.Characters)

CustomText = CustomLabel["CUSTOMFLOORLABEL"]

Elevator:WaitForChild("Floor").Changed:connect(function(floor)
  --custom indicator code--
  ChangeFloor(tostring(floor))
end)

function ChangeFloor(SF)
	if CustomText[tonumber(SF)] then
		SF = CustomText[tonumber(SF)]
	end
	SetDisplay(1,(string.len(SF) == 2 and SF:sub(1,1) or "NIL"))		
	SetDisplay(2,(string.len(SF) == 2 and SF:sub(2,2) or SF))
end



function SetDisplay(ID,CHAR)
	if This.Display:FindFirstChild("DIG"..ID) and Characters[CHAR] ~= nil then
 		for i,l in pairs(Characters[CHAR]) do 
			for r=1,7 do	
				This.Display["DIG"..ID]["D"..r].Transparency = (l:sub(r,r) == "1" and 0 or 0.99)
			end
		end
	end
end
--[[**
	Calls each Object's `MethodName` (or calls the Object if `MethodName == true`) and removes them from the Janitor. Also clears the namespace. This function is also called when you call a Janitor Object (so it can be used as a destructor callback).
	@returns [t:void]
**--]]


function Janitor.__index:Cleanup()
	if not self.CurrentlyCleaning then
		self.CurrentlyCleaning = nil
		for Object, MethodName in next, self do
			if Object == IndicesReference then
				continue
			end

			-- Weird decision to rawset directly to the janitor in Agent. This should protect against it though.
			local TypeOf = type(Object)
			if TypeOf == "string" or TypeOf == "number" then
				self[Object] = nil
				continue
			end

			if MethodName == true then
				Object()
			else
				local ObjectMethod = Object[MethodName]
				if ObjectMethod then
					ObjectMethod(Object)
				end
			end

			self[Object] = nil
		end

		local This = self[IndicesReference]
		if This then
			for Index in next, This do
				This[Index] = nil
			end

			self[IndicesReference] = {}
		end

		self.CurrentlyCleaning = false
	end
end

Janitor.__index.Clean = Janitor.__index.Cleanup
--Precalculated paths


local t,f,n=true,false,{}
local r={
[58]={{23,58},t},
[49]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{23,62,63,19},t},
[59]={{23,58,56,30,41,59},t},
[63]={{23,62,63},t},
[34]={{23,58,56,30,41,39,35,34},t},
[21]={{23,62,20,21},t},
[48]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48},t},
[27]={{23,58,56,30,41,39,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{23,58,56,30,41,39,35,34,32,31},t},
[56]={{23,58,56},t},
[29]={{23,58,56,30,41,39,35,34,32,31,29},t},
[13]={n,f},
[47]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45},t},
[57]={{23,58,57},t},
[36]={{23,58,56,30,41,39,35,37,36},t},
[25]={{23,58,56,30,41,39,35,34,32,31,29,28,27,26,25},t},
[71]={{23,58,56,30,41,59,61,71},t},
[20]={{23,62,20},t},
[60]={{23,58,56,30,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{23,58,56,30,41,59,61,71,72,76,73,75},t},
[22]={{23,62,20,21,22},t},
[74]={{23,58,56,30,41,59,61,71,72,76,73,74},t},
[62]={{23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{23,58,56,30,41,39,35,37},t},
[2]={n,f},
[35]={{23,58,56,30,41,39,35},t},
[53]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{23,58,56,30,41,59,61,71,72,76,73},t},
[72]={{23,58,56,30,41,59,61,71,72},t},
[33]={{23,58,56,30,41,39,35,37,36,33},t},
[69]={{23,58,56,30,41,60,69},t},
[65]={{23,62,63,66,64,65},t},
[26]={{23,58,56,30,41,39,35,34,32,31,29,28,27,26},t},
[68]={{23,62,63,66,64,67,68},t},
[76]={{23,58,56,30,41,59,61,71,72,76},t},
[50]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{23,62,63,66},t},
[10]={n,f},
[24]={{23,58,56,30,41,39,35,34,32,31,29,28,27,26,25,24},t},
[23]={{23},t},
[44]={{23,58,56,30,41,39,35,34,32,31,29,28,44},t},
[39]={{23,58,56,30,41,39},t},
[32]={{23,58,56,30,41,39,35,34,32},t},
[3]={n,f},
[30]={{23,58,56,30},t},
[51]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{23,62,63,66,64,67},t},
[61]={{23,58,56,30,41,59,61},t},
[55]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{23,58,56,30,41,39,40,38,42},t},
[40]={{23,58,56,30,41,39,40},t},
[52]={{23,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{23,58,56,30,41,39,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]={{23,58,56,30,41},t},
[17]={n,f},
[38]={{23,58,56,30,41,39,40,38},t},
[28]={{23,58,56,30,41,39,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{23,62,63,66,64},t},
}
return r
---- Change these settings to change stuff (keep the commas, lua doesn't understand n00b syntax)



local settings = {
	splatters_per_health_inc = 1,     ---- The amount of blood splatters made when you lose (damage_inc) of health
	damage_inc = 2,                   ---- The increment of damage that must be done at a time to trigger blood splatters
	remove_time = 65,                 ---- The time (in seconds) until a blood splatter is removed after it is created
	min_splatter_time = 0,            ---- The delay time (minimum) until another blood splatter is made
	max_splatter_time = 0.05,         ---- The delay time (maximum) until another blood splatter is made
	min_transparency = 0.2,           ---- The (minimum) transparency of a blood splatter
	max_transparency = 0,             ---- The (maximum) transparency of a blood splatter
	min_size_x = 3,                 ---- The (minimum) size of a blood splatter on the X axis
	max_size_x = 8,                   ---- The (maximum) size of a blood splatter on the X axis
	min_size_z = 3,                 ---- The (minimum) size of a blood splatter on the Z axis
	max_size_z = 8,                   ---- The (maximum) size of a blood splatter on the Z axis
	tran_tw_time_min = 0.1,           ---- The (minimum) time to tween the size of a blood splatter
	tran_tw_time_max = 0.5,           ---- The (maximum) time to tween the size of a blood splatter
	size_tw_time_min = 0.1,           ---- The (minimum) time to tween the transparency of a blood splatter
	size_tw_time_max = 0.6            ---- The (maximum) time to tween the transparency of a blood splatter
}
-- list of account names allowed to go through the door. 


permission = {"Player1", "Player2", "Player3"}--Put your friends name's here. You can add more.

function checkOkToLetIn(name) 
	for i = 1,#permission do 
		-- convert strings to all upper case, otherwise we will let in, 
		-- "conrad105," and, "builderman," but not, "blast1."
                -- Why? Because, "blast1," is how it is spelled in the permissions.
		if (string.upper(name) == string.upper(permission[i])) then return true end 
	end 
	return false 
end 

local Door = script.Parent

function onTouched(hit) 
	print("Door Hit") 
	local human = hit.Parent:findFirstChild("Humanoid") 
	if (human ~= nil ) then 
		-- a human has touched this door! 
		print("Human touched door") 
		-- test the human's name against the permission list 
		if (checkOkToLetIn(human.Parent.Name)) then 
			print("Human passed test") 
			Door.Transparency = 0.7 
			Door.CanCollide = false 
			wait(4) -- this is how long the door is open 
			Door.CanCollide = true 
			Door.Transparency = 0 
		else human.Health= 0 -- delete this line of you want a non-killing VIP door 
		end 
	end 
end 

script.Parent.Touched:connect(onTouched)
--[[**
	ensures all keys in given table pass check

	@param check The function to use to check the keys

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


function t.keys(check)
	assert(t.callback(check))
	return function(value)
		local tableSuccess, tableErrMsg = t.table(value)
		if tableSuccess == false then
			return false, tableErrMsg or ""
		end

		for key in pairs(value) do
			local success, errMsg = check(key)
			if success == false then
				return false, string.format("bad key %s:\n\t%s", tostring(key), errMsg or "")
			end
		end

		return true
	end
end
-- Reset broken lights


function ResetLights()
	for i, lData in pairs(dParts.Lights) do
		lData[1].Material = lData[2]
		lData[1].Broken:Destroy()

		for _, light in pairs(lData[1]:GetChildren()) do
			if light:IsA("Light") then
				light.Enabled = true
			end
		end
	end
end
-- ROBLOX FIXME: Can we define ClientChatModules statically in the project config


pcall(function() ChatLocalization = require((game:GetService("Chat") :: any).ClientChatModules.ChatLocalization :: any) end)
if ChatLocalization == nil then ChatLocalization = {} end

if not ChatLocalization.FormatMessageToSend or not ChatLocalization.LocalizeFormattedMessage then
	function ChatLocalization:FormatMessageToSend(key,default) return default end
end

local function Run(ChatService)

	local function ShowJoinAndLeaveCommands()
		if ChatSettings.ShowJoinAndLeaveHelpText ~= nil then
			return ChatSettings.ShowJoinAndLeaveHelpText
		end
		return false
	end

	local function ProcessCommandsFunction(fromSpeaker, message, channel)
		if (message:lower() == "/?" or message:lower() == "/help") then
			local speaker = ChatService:GetSpeaker(fromSpeaker)
			speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_Desc","These are the basic chat commands."), channel)
			if ChatSettings.AllowMeCommand then
				speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_MeCommand","/me <text> : roleplaying command for doing actions."), channel)
			end
			speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_SwitchChannelCommand","/c <channel> : switch channel menu tabs."), channel)
			if ShowJoinAndLeaveCommands() then
				speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_JoinChannelCommand","/join <channel> or /j <channel> : join channel."), channel)
				speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_LeaveChannelCommand","/leave <channel> or /l <channel> : leave channel. (leaves current if none specified)"), channel)
			end
			speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_WhisperCommand","/whisper <speaker> or /w <speaker> : open private message channel with speaker."), channel)
			speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_MuteCommand","/mute <speaker> : mute a speaker."), channel)
			speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_UnMuteCommand","/unmute <speaker> : unmute a speaker."), channel)

			local player = speaker:GetPlayer()
			if player and player.Team then
				speaker:SendSystemMessage(ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_TeamCommand","/team <message> or /t <message> : send a team chat to players on your team."), channel)
			end

			return true
		end

		return false
	end

	ChatService:RegisterProcessCommandsFunction("chat_commands_inquiry", ProcessCommandsFunction, ChatConstants.StandardPriority)

	if ChatSettings.GeneralChannelName then
		local allChannel = ChatService:GetChannel(ChatSettings.GeneralChannelName)
		if (allChannel) then
			allChannel.WelcomeMessage = ChatLocalization:FormatMessageToSend("GameChat_ChatCommandsTeller_AllChannelWelcomeMessage","Chat '/?' or '/help' for a list of chat commands.")
		end
	end
end

return Run
--[=[
	Checks whether the given object is a Promise via duck typing. This only checks if the object is a table and has an `andThen` method.

	@param object any
	@return boolean -- `true` if the given `object` is a Promise.
]=]


function Promise.is(object)
	if type(object) ~= "table" then
		return false
	end

	local objectMetatable = getmetatable(object)

	if objectMetatable == Promise then
		-- The Promise came from this library.
		return true
	elseif objectMetatable == nil then
		-- No metatable, but we should still chain onto tables with andThen methods
		return isCallable(object.andThen)
	elseif
		type(objectMetatable) == "table"
		and type(rawget(objectMetatable, "__index")) == "table"
		and isCallable(rawget(rawget(objectMetatable, "__index"), "andThen"))
	then
		-- Maybe this came from a different or older Promise library.
		return true
	end

	return false
end
-- ROBLOX TODO: ADO-1554 clean up the following deviations and move them to the
-- appropriate locations
-- ROBLOX deviation START: for now we extend the snapshot matchers in the Expect file instead
-- of jest-jasmine2/jestExpect


local JestSnapshot = require(Packages.JestSnapshot)
local toMatchSnapshot = JestSnapshot.toMatchSnapshot
local toThrowErrorMatchingSnapshot = JestSnapshot.toThrowErrorMatchingSnapshot
setMatchers({
	toMatchSnapshot = toMatchSnapshot,
	toThrowErrorMatchingSnapshot = toThrowErrorMatchingSnapshot,
}, false, Expect)
--[[Weight and CG]]


	Tune.Weight			= 3300		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		3.5		,
	 --[[Length]]		14		}
	Tune.WeightDist		= 50		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .8		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .1		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- Rear Wheel Density
	Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
	Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]
	
	Tune.AxleSize		= 2			-- Size of structural members (larger = more stable/carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members
-----------------------------------------------------------------------------------------------



script.Parent:WaitForChild("Speedo")
script.Parent:WaitForChild("Tach")
script.Parent:WaitForChild("ln")
script.Parent:WaitForChild("Gear")
script.Parent:WaitForChild("Speed")

local player=game.Players.LocalPlayer
local mouse=player:GetMouse()

local car = script.Parent.Parent.Car.Value
car.DriveSeat.HeadsUpDisplay = false

local _Tune = require(car["A-Chassis Tune"])

local _pRPM = _Tune.PeakRPM
local _lRPM = _Tune.Redline

local currentUnits = 1
local revEnd = math.ceil(_lRPM/1000)

local intach = car.Body.Dash.Tac.G.Needle
local inspd = car.Body.Dash.Spd.G.Needle
--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.NPCSpecifics.GaveFoodToArtie.Value == true)
end
-- Stops a confetti from firing again once it's out of bounds.


function _Confetti:Toggle()
	self.Enabled = not(self.Enabled);
end;

_Confetti.setGravity(Vector2.new(0, 1));

local Conffetis = {}

for _ = 1, 10 do
	
	table.insert(Conffetis, (_Confetti.createParticle(Vector2.new(0.5, 1), Vector2.new(math.random(90) - 45, math.random(70, 100)), script.Parent.Parent)))
	
end

local Debounce = false

RunService.RenderStepped:Connect(function()
	
	for _, Conffeti in pairs(Conffetis) do
		
		Conffeti.Enabled = Debounce
		
		Conffeti:Update()
		
	end
	
end)

function _Confetti.fire()
	
	spawn(function()
		
		Debounce = true
		
		wait(tick)
		
		Debounce = false
		
	end)
	
end

return _Confetti;
--[[
	Returns a new list containing only the elements within the given range.
]]



local function getRange(list, startIndex, endIndex)
	assert(startIndex <= endIndex, "startIndex must be less than or equal to endIndex")

	local new = {}
	local index = 1

	for i = math.max(1, startIndex), math.min(#list, endIndex) do
		new[index] = list[i]
		index = index + 1
	end

	return new
end

return getRange
--LIGHTING FUNCTIONS



script.Parent.OnServerEvent:connect(function(pl,n) if lt~=1 then pr = true else pr=false end lt=n
	if lt~=3 then
		RefMt.DesiredAngle = RefMt.CurrentAngle%math.rad(360)
		RefMt.CurrentAngle = RefMt.CurrentAngle%math.rad(360)
		UpdateLt(1,white)
		UpdatePt(false,white)
		StopMt(pr)
		repeat wait() until (lt==3)
	elseif lt == 3 then
		wait(1/3)
		UpdateLt(.25,red)
		UpdatePt(true,red)
		UpdateMt(0,9e9,1)
		repeat 
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 90 then UpdateLt(.25,amber) end
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 90 then UpdatePt(true,amber) end
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 270 then UpdateLt(.25,white) end
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 270 then UpdatePt(true,white) end
			wait()
		until lt~=3
	end
end)
--[=[
	@param signal RBXScriptSignal
	@param fn (...: any) -> any
	@return RBXScriptConnection
	Connects the function to the signal, adds the connection
	to the Janitor, and then returns the connection.

	```lua
	Janitor:Connect(workspace.ChildAdded, function(instance)
		print(instance.Name .. " added to workspace")
	end)
	```
]=]


function Janitor:Connect(signal, fn)
	return self:Add(signal:Connect(fn))
end