Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[=[
	Sets the current and target position, and sets the velocity to 0.
	@prop pt number
	@within AccelTween
]=]



function AccelTween:__index(index)
	if AccelTween[index] then
		return AccelTween[index]
	elseif index == "p" then
		local pos, _ = self:_getstate(tick())
		return pos
	elseif index == "v" then
		local _, vel = self:_getstate(tick())
		return vel
	elseif index == "a" then
		return self._accel
	elseif index == "t" then
		return self._y1
	elseif index == "rtime" then
		local time = tick()
		return time < self._t1 and self._t1 - time or 0
	else
		error(("Bad index %q"):format(tostring(index)))
	end
end

function AccelTween:__newindex(index, value)
	if index == "p" then
		self:_setstate(value, nil, nil, nil)
	elseif index == "v" then
		self:_setstate(nil, value, nil, nil)
	elseif index == "a" then
		self:_setstate(nil, nil, value, nil)
	elseif index == "t" then
		self:_setstate(nil, nil, nil, value)
	elseif index == "pt" then
		self:_setstate(value, 0, nil, value)
	else
		error(("Bad index %q"):format(tostring(index)))
	end
end

function AccelTween:_getstate(time)
	if time < (self._t0 + self._t1)/2 then
		local t = time - self._t0
		return self._y0 + t*t/2*self._a0, t*self._a0
	elseif time < self._t1 then
		local t = time - self._t1
		return self._y1 + t*t/2*self._a1, t*self._a1
	else
		return self._y1, 0
	end
end

function AccelTween:_setstate(newpos, newvel, newaccel, newtarg)
	local time = tick()
	local pos, vel = self:_getstate(time)
	pos = newpos or pos
	vel = newvel or vel
	self._accel = newaccel or self._accel
	local targ = newtarg or self._y1

	if self._accel*self._accel < 1e-8 then
		self._t0, self._y0, self._a0 = 0, pos, 0
		self._t1, self._y1, self._a1 = math.huge, targ, 0
	else
		local conda = targ < pos
		local condb = vel < 0
		local condc = pos - vel*vel/(2*self._accel) < targ
		local condd = pos + vel*vel/(2*self._accel) < targ
		if conda and condb and condc or not conda and (condb or not condb and condd) then
			self._a0 = self._accel
			self._t1 = time + ((2*vel*vel + 4*self._accel*(targ - pos))^0.5 - vel)/self._accel
		else
			self._a0 = -self._accel
			self._t1 = time + ((2*vel*vel - 4*self._accel*(targ - pos))^0.5 + vel)/self._accel
		end
		self._t0 = time - vel/self._a0
		self._y0 = pos - vel*vel/(2*self._a0)
		self._y1 = targ
		self._a1 = -self._a0
	end
end

return AccelTween
--Tune


OverheatSpeed = 0.2 --How fast the car will overheat
CoolingEfficiency = 0.05 --How fast the car will cool down
RunningTemp = 82 --In degrees

Fan = true --Cooling fan
FanTemp = 93 --At what temperature the cooling fan will activate
FanSpeed = .05
FanVolume = .25

BlowupTemp = 140 --At what temperature the engine will blow up

GUI = true --GUI temperature gauge
--[[Controls]]



local _CTRL = _Tune.Controls
local Controls = Instance.new("Folder",script.Parent)
Controls.Name = "Controls"
for i,v in pairs(_CTRL) do
	local a=Instance.new("StringValue",Controls)
	a.Name=i
	a.Value=v.Name
	a.Changed:connect(function()
		if i=="MouseThrottle" or i=="MouseBrake" then
			if a.Value == "MouseButton1" or a.Value == "MouseButton2" then
				_CTRL[i]=Enum.UserInputType[a.Value]
			else
				_CTRL[i]=Enum.KeyCode[a.Value]
			end
		else
			_CTRL[i]=Enum.KeyCode[a.Value]
		end
	end)
end
--[[
	
	The golden hit detection script! For experimental mode, mainly.
	Rather than detect superball and slingshot hits by having the 
	ball look for a player in any object it touches, this script
	makes the player check if any object it touches is a ball or
	slingshot projectile. It works better because it has all your 
	body parts (about 6 or 7 parts for R6, many more for R15) 
	checking for hits, rather than just one part!
	
--]]



local ds2=true
local dp2=true

function dmg(Part)
	script.Parent.Humanoid:TakeDamage(Part.damage.Value)
	script.Parent.Humanoid.Died:connect(function()
		if not script.Parent.Humanoid:FindFirstChild("creator") then
			if Part:FindFirstChild("creator") then
				if Part:WaitForChild("creator",1).Value:FindFirstChild("leaderstats") then
					Part:WaitForChild("creator",1):Clone().Parent=script.Parent.Humanoid
				end
			end
		end
	end)
end

script.Parent:WaitForChild("Humanoid",1).Touched:connect(function(Part,Limb)
	local player=game.Players:GetPlayerFromCharacter(script.Parent)
	if Part.Name=="Cannon Shot" then
		if ds2==true then
			ds2=false
			if Part:WaitForChild("creator",1).Value~=player then
				if script.Parent.Humanoid.Health~=0 then
					if player:WaitForChild("AntiTeamKill",1).Value==true then
						if player.TeamColor~=Part:WaitForChild("creator",1).Value.TeamColor then
							dmg(Part)
						end
					else
						dmg(Part)
					end
				end
			end
			wait(1/30)
			ds2=true
		end
	elseif Part.Name=="Pellet" then
		if dp2==true then
			ds2=false
			if Part:WaitForChild("creator",1).Value~=player then
				if script.Parent.Humanoid.Health~=0 then
					if player:WaitForChild("AntiTeamKill",1).Value==true then
						if player.TeamColor~=Part:WaitForChild("creator",1).Value.TeamColor then
							dmg(Part)
						end
					else
						dmg(Part)
					end
				end
			end
			wait(.2)
			ds2=true
		end
	end
end)
--[[
	Sets up event listeners and modifies emote configurations for the user
	given

	Parameters:
	player - The player to set up for
	humanoidDescription - The HumanoidDecription of the user to set up for
]]


function EmoteManager:setup(player, humanoidDescription)
	-- Send default emotes to the player
	self:updateEmotes(player, humanoidDescription)

	if not self.playerOwnedEmotes[player.UserId] then
		self:getOwnedEmotesAsync(player, function(ownedEmotes)
			-- Send paid emotes that the player owns to the player
			self.playerOwnedEmotes[player.UserId] = ownedEmotes
			self:updateEmotes(player, humanoidDescription)
			self.updatedPlayerEmotes:Fire(player.UserId)
		end)
	end
end
--edit the below function to execute code when this response is chosen OR this prompt is shown
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data


return function(player, dialogueFolder)
	local ClassInformationTable = require(game.ReplicatedStorage.Source.Modules.CharacterScripts.Classes.ClassInformation)
	ClassInformationTable:GetClassFolder(player,"Brawler").GuardBreak.Value = true
	local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
	plrData.Money.Gold.Value = plrData.Money.Gold.Value - 45 -- TODO track for dissertation
end
-- medical station containing NOTHING because we DON'T LIKE GRUNTS that ARE INJURED.



local pivot = script.Parent.Pivot
local TS = game:GetService("TweenService")

local deb = false
local CD = Instance.new("ClickDetector",script.Parent.Door)
CD.MaxActivationDistance = 4

local toggle = false
CD.MouseClick:Connect(function()
	if not deb then
		deb = true
		local anim
		if not toggle then
			anim = TS:Create(pivot,TweenInfo.new(.6,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame = pivot.CFrame * CFrame.Angles(math.rad(140),0,0)})
		else
			anim = TS:Create(pivot,TweenInfo.new(.6,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame = pivot.CFrame * CFrame.Angles(-math.rad(140),0,0)})
		end
		anim.Completed:Connect(function()
			toggle = not toggle
			deb = false
		end)
		anim:Play()
	end
end)
-- DISGUSTING. NEVER DO THIS.


function nearPlayer()
	local p = game.Players:GetPlayers()

	for i=1,#p do

		if (p[i].Character) then
			local t = p[i].Character:FindFirstChild("Torso")
			if t then
				if (Board.Position - t.Position).magnitude < 20 then
					return true
				end
			end
		end
	
	end
	return false

end

function sepuku()	-- +1
	if not nearPlayer() then
		if Board.Parent and Board.Parent.Name=="Snowboard" then
			Board.Parent:remove()
		else
			Board:remove()
		end
	end
end

while true do
	wait(30)
	sepuku()
end
-- Moment of Inertia of any rectangular prism.
-- 1/12 * m * sum(deminsionlengths^2)



local function MomentOfInertia(Part, Axis, Origin)
	--- Calculates the moment of inertia of a cuboid.

	-- Part is part
	-- Axis is the axis
	-- Origin is the origin of the axis

	local PartSize = Part.Size

	local Mass  = Part:GetMass()
	local Radius  = (Part.Position - Origin):Cross(Axis)
	local r2 = Radius:Dot(Radius)
	local ip = Mass * r2--Inertia based on Position
	local s2 = PartSize*PartSize
	local sa = (Part.CFrame-Part.Position):inverse()*Axis
	local id = (Vector3.new(s2.y+s2.z, s2.z+s2.x, s2.x+s2.y)):Dot(sa*sa)*Mass/12 -- Inertia based on Direction
	return ip+id
end

local function BodyMomentOfInertia(Parts, Axis, Origin)
	--- Given a connected body of parts, returns the moment of inertia of these parts
	-- @param Parts The parts to use
	-- @param Axis the axis to use (Should be torque, or offset cross force)
	-- @param Origin The origin of the axis (should be center of mass of the parts)
	
	local TotalBodyInertia = 0

	for _, Part in pairs(Parts) do
		TotalBodyInertia = TotalBodyInertia + MomentOfInertia(Part, Axis, Origin)
	end

	return TotalBodyInertia
end

local function GetBackVector(CFrameValue)
	--- Get's the back vector of a CFrame Value
	-- @param CFrameValue A CFrame, of which the vector will be retrieved
	-- @return The back vector of the CFrame

	local _,_,_,_,_,r6,_,_,r9,_,_,r12 = CFrameValue:components()
	return Vector3.new(r6,r9,r12)
end

local function GetCFrameFromTopBack(CFrameAt, Top, Back)
	--- Get's the CFrame fromt he "top back" vector. or something

	local Right = Top:Cross(Back) -- Get's the "right" cframe lookvector.
	return CFrame.new(CFrameAt.x, CFrameAt.y, CFrameAt.z,
		Right.x, Top.x, Back.x,
		Right.y, Top.y, Back.y,
		Right.z, Top.z, Back.z
	)
end

local function GetRotationInXZPlane(CFrameValue)
	--- Get's the rotation in the XZ plane (global).

	local Back = GetBackVector(CFrameValue)
	return GetCFrameFromTopBack(CFrameValue.p, 
		Vector3.new(0,1,0), -- Top lookVector (straight up)
		Vector3.new(Back.x, 0, Back.z).unit -- Right facing direction (removed Y axis.)
	)
end

local function Sign(Number)
	-- Return's the mathetmatical sign of an object
	if Number == 0 then
		return 0
	elseif Number > 0 then
		return 1
	else
		return -1
	end
end

local EasyConfiguration = require(WaitForChild(script, "EasyConfiguration"))
--use this to determine if you want this human to be harmed or not, returns boolean



function boom()
	wait(2)
	Used = true
	Object.Anchored = true
	Object.CanCollide = false
	Object.Sparks.Enabled = false
	Object.Orientation = Vector3.new(0,0,0)
	Object.Transparency = 1
	Object.Fuse:Stop()
	Object.Explode:Play()
	Object.Dist1:Play()
	Object.Dist2:Play()
	Object.Explosion:Emit(100)
	Object.Smoke1:Emit(150)
	Object.Smoke2:Emit(150)
	Object.Smoke3:Emit(150)
	Object.Smoke4:Emit(50)
	Object.Debris:Emit(1000)
	Object.Debris2:Emit(1000)
	Object.Shockwave:Emit(5)
	Explode()
end

boom()
--Gas.InputChanged:Connect(TouchThrottle)



local function TouchBrake(input, GPE)
	if input.UserInputState == Enum.UserInputState.Begin then
		_GBrake = 1
	else
		_GBrake = 0
	end
end
Brake.InputBegan:Connect(TouchBrake)
Brake.InputEnded:Connect(TouchBrake)
--------------------[ GUI UPDATE FUNCTIONS ]------------------------------------------



local function updateClipAmmo()
	clipAmmoGUI.Text = Ammo.Value
	clipAmmoGUI.TextColor3 = (Ammo.Value <= (ClipSize.Value / 3) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
end

local function updateStoredAmmo()
	storedAmmoGUI.Text = StoredAmmo.Value
	storedAmmoGUI.TextColor3 = (StoredAmmo.Value <= (ClipSize.Value * 2) and Color3.new(1, 0, 0) or Color3.new(1, 1, 1))
end

local function updateHealth()
	HUD.Health.Num.Text = CEIL(Humanoid.Health).."%"
	HUD.Health.Num.TextColor3 = (
		(Humanoid.Health > 200 / 3) and Color3.new(1, 1, 1) or
		(Humanoid.Health <= 200 / 3 and Humanoid.Health > 100 / 3) and Color3.new(1, 1, 0) or
		(Humanoid.Health <= 100 / 3) and Color3.new(1, 0, 0)
	)
end

local function updateModeLabels(prevState, newState, X)
	for Num, Mode in pairs(fireModes:GetChildren()) do
		local guiAngOffset2 = guiAngOffset + 90
		local Ang = numLerp(
			(guiAngOffset2 * prevState) - (guiAngOffset2 * Num) - guiAngOffset2,
			(guiAngOffset2 * newState) - (guiAngOffset2 * Num) - guiAngOffset2,
			Sine(X)
		) + guiAngOffset
		local XPos = COS(RAD(Ang))
		local YPos = SIN(RAD(Ang))
		Mode.Position = UDim2.new(0.5, XPos * 100, 0.5, YPos * 100)
		
		local R = COS(math.atan2(Mode.Position.Y.Offset, Mode.Position.X.Offset) + RAD(90))
		Mode.Label.TextTransparency = 1 - ((R / 4) + 0.75)
		
		local Scale = (R * 10) + 50
		Mode.Label.Position = UDim2.new(0, -Scale / 2, 0, 0)
		Mode.Label.Size = UDim2.new(0, Scale, 0, Scale / 2)
	end
end
-- Set Pet Canvas Size --


module.SetCanvasSize = function(ScrollingFrame)
	local PADDING,SIZE,MaxCells = getSizes()
	local UIGridLayout = ScrollingFrame.UIGridLayout
	local AbsoluteSize = ScrollingFrame.AbsoluteSize

    local NewPadding = PADDING * AbsoluteSize
    NewPadding = UDim2.new(0, NewPadding .X, 0, NewPadding .Y)
    local NewSize = SIZE * AbsoluteSize
    NewSize = UDim2.new(0, NewSize.X, 0, NewSize.Y)

    UIGridLayout.CellPadding = NewPadding
    UIGridLayout.CellSize = NewSize

	local items = getItems(ScrollingFrame) --ScrollingFrame:GetChildren()
	local frameSizeY = ScrollingFrame.AbsoluteSize.Y
	local ySize = UIGridLayout.CellSize.Y.Offset
	local yPadding = UIGridLayout.CellPadding.Y.Offset
	UIGridLayout.FillDirectionMaxCells = MaxCells
	local rows = math.ceil((items-1)/UIGridLayout.FillDirectionMaxCells)
	local pixels = rows*ySize + (rows-1)*yPadding
	ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, (pixels + 5))
end

local main = script.Parent.Parent.Parent.Parent.Parent:WaitForChild("main")
local weaponShopUI = main.WeaponShop

function module:Int()
	game:GetService("Workspace").CurrentCamera:GetPropertyChangedSignal("ViewportSize"):Connect(function()
		delay(.5, function() 
			module.SetCanvasSize(weaponShopUI.Storage.Swords)
			module.SetCanvasSize(weaponShopUI.Storage.Robot)
			module.SetCanvasSize(weaponShopUI.Storage.Storage)
		end)
	end)
end

return module
--[[Transmission]]


	Tune.TransModes		= {"Auto", "Semi"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
		>First mode is default mode													]]
	
	--Automatic Settings
	Tune.AutoShiftMode	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
	Tune.AutoUpThresh	= -200		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)
	
	--Gear Ratios
	Tune.FinalDrive		= 2.93	-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	3.460		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		5.00		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		3.20	,
		--[[ 3 ]]		2.14		,
		--[[ 4 ]]		1.72		,
		--[[ 5 ]]		1.31		,
		--[[ 6 ]]		1.00		,
		--[[ 7 ]]		0.82		,
		--[[ 8 ]]		0.64		,
	}
	Tune.FDMult			= 2			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--game.Lighting:WaitForChild("Blur").Enabled = true
--game.Lighting.ColorCorrection.Enabled = true



local contenProvider = game:GetService("ContentProvider")
game.Loaded:Wait()
local toLoad = workspace:GetDescendants()
local total = #toLoad
for i,v in pairs(toLoad) do
	loadingScreen.Background.Counter.Text = "Loading: " .. i .. "/" .. total .. " " .. v.Name
	contenProvider:PreloadAsync({v})
end
--[=[
	@param object any -- Object to track
	@param cleanupMethod string? -- Optional cleanup name override
	@return object: any
	Adds an object to the trove. Once the trove is cleaned or
	destroyed, the object will also be cleaned up.
	The object must be any of the following:
	- Roblox instance (e.g. Part)
	- RBXScriptConnection (e.g. `workspace.ChildAdded:Connect(function() end)`)
	- Function
	- Table with either a `Destroy` or `Disconnect` method
	- Table with custom `cleanupMethod` name provided
	Returns the object added.
	```lua
	-- Add a part to the trove, then destroy the trove,
	-- which will also destroy the part:
	local part = Instance.new("Part")
	trove:Add(part)
	trove:Destroy()
	-- Add a function to the trove:
	trove:Add(function()
		print("Cleanup!")
	end)
	trove:Destroy()
	-- Standard cleanup from table:
	local tbl = {}
	function tbl:Destroy()
		print("Cleanup")
	end
	trove:Add(tbl)
	-- Custom cleanup from table:
	local tbl = {}
	function tbl:DoSomething()
		print("Do something on cleanup")
	end
	trove:Add(tbl, "DoSomething")
	```
]=]


function Trove:Add(object: any, cleanupMethod: string?): any
	local cleanup = GetObjectCleanupFunction(object, cleanupMethod)
	table.insert(self._objects, {object, cleanup})
	return object
end
--[[
	Creates a new promise that receives the result of this promise.

	The given callbacks are invoked depending on that result.
]]


function Promise.prototype:_andThen(traceback, successHandler, failureHandler)
	self._unhandledRejection = false

	-- Create a new promise to follow this part of the chain
	return Promise._new(traceback, function(resolve, reject)
		-- Our default callbacks just pass values onto the next promise.
		-- This lets success and failure cascade correctly!

		local successCallback = resolve
		if successHandler then
			successCallback = createAdvancer(traceback, successHandler, resolve, reject)
		end

		local failureCallback = reject
		if failureHandler then
			failureCallback = createAdvancer(traceback, failureHandler, resolve, reject)
		end

		if self._status == Promise.Status.Started then
			-- If we haven't resolved yet, put ourselves into the queue
			table.insert(self._queuedResolve, successCallback)
			table.insert(self._queuedReject, failureCallback)
		elseif self._status == Promise.Status.Resolved then
			-- This promise has already resolved! Trigger success immediately.
			successCallback(unpack(self._values, 1, self._valuesLength))
		elseif self._status == Promise.Status.Rejected then
			-- This promise died a terrible death! Trigger failure immediately.
			failureCallback(unpack(self._values, 1, self._valuesLength))
		elseif self._status == Promise.Status.Cancelled then
			-- We don't want to call the success handler or the failure handler,
			-- we just reject this promise outright.
			reject(Error.new({
				error = "Promise is cancelled",
				kind = Error.Kind.AlreadyCancelled,
				context = "Promise created at\n\n" .. traceback,
			}))
		end
	end, self)
end
--[[
    Controller for the sounds of the vehicle
]]


local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local Debris = game:GetService("Debris")

local SoundsFolder = ReplicatedStorage:FindFirstChild("SFX")
local CarSoundsFolder = SoundsFolder:FindFirstChild("Car")

local VehicleSoundComponent = {}

local tweenInfo = TweenInfo.new(0.6)
-- Libraries


local Libraries = Tool:WaitForChild 'Libraries'
local Signal = require(Libraries:WaitForChild 'Signal')

History = {

	-- Record stack
	Stack = {},

	-- Current position in record stack
	Index = 0,

	-- History change event
	Changed = Signal.new()

};

function History.Undo()
	-- Unapplies the previous record in stack

	-- Stay within boundaries
	if History.Index - 1 < 0 then
		return;
	end;

	-- Get the history record, unapply it
	local Record = History.Stack[History.Index];
	Record:Unapply();

	-- Update the index
	History.Index = History.Index - 1;

	-- Fire the Changed event
	History.Changed:Fire();

end;

function History.Redo()
	-- Applies the next record in stack

	-- Stay within boundaries
	if History.Index + 1 > #History.Stack then
		return;
	end;

	-- Update the index
	History.Index = History.Index + 1;

	-- Get the history record and apply it
	local Record = History.Stack[History.Index];
	Record:Apply();

	-- Fire the Changed event
	History.Changed:Fire();

end;

function History.Add(Record)
	-- Adds new history record to stack

	-- Update the index
	History.Index = History.Index + 1;

	-- Register the new history record
	History.Stack[History.Index] = Record;

	-- Clear history ahead
	for Index = History.Index + 1, #History.Stack do
		History.Stack[Index] = nil;
	end;

	-- Fire the Changed event
	History.Changed:Fire();

end;

return History;
--// # key, ManOff


mouse.KeyUp:connect(function(key)
	if key=="f" then 
		veh.Lightbar.middle.Man:Stop()
		veh.Lightbar.middle.Wail.Volume = 1
		veh.Lightbar.middle.Yelp.Volume = 1
		veh.Lightbar.middle.Priority.Volume = 1
		script.Parent.Parent.Sirens.Man.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		veh.Lightbar.MAN.Transparency = 1
	end
end)
--[=[
	@within TableUtil
	@function Find
	@param tbl table
	@param callback (value: any, index: any, tbl: table) -> boolean
	@return (value: any?, key: any?)

	Performs a linear scan across the table and calls `callback` on
	each item in the array. Returns the value and key of the first
	pair in which the callback returns `true`.

	```lua
	local t = {
		{Name = "Bob", Age = 20};
		{Name = "Jill", Age = 30};
		{Name = "Ann", Age = 25};
	}

	-- Find first person who has a name starting with J:
	local firstPersonWithJ = TableUtil.Find(t, function(person)
		return person.Name:sub(1, 1):lower() == "j"
	end)

	print(firstPersonWithJ) --> {Name = "Jill", Age = 30}
	```

	:::caution Dictionary Ordering
	While `Find` can also be used with dictionaries, dictionary ordering is never
	guaranteed, and thus the result could be different if there are more
	than one possible matches given the data and callback function.
]=]


local function Find(tbl: Table, callback: FindCallback): (any?, any?)
	for k,v in pairs(tbl) do
		if callback(v, k, tbl) then
			return v, k
		end
	end
	return nil, nil
end
--------SIDE SQUARES--------



game.Workspace.sidesquares.l11.BrickColor = BrickColor.new(1002)
game.Workspace.sidesquares.l12.BrickColor = BrickColor.new(1002)
game.Workspace.sidesquares.l13.BrickColor = BrickColor.new(1002)
game.Workspace.sidesquares.l14.BrickColor = BrickColor.new(1002)
game.Workspace.sidesquares.l15.BrickColor = BrickColor.new(1002)
game.Workspace.sidesquares.l21.BrickColor = BrickColor.new(1002)
game.Workspace.sidesquares.l23.BrickColor = BrickColor.new(1002)
game.Workspace.sidesquares.l24.BrickColor = BrickColor.new(1002)
game.Workspace.sidesquares.l25.BrickColor = BrickColor.new(1002)
game.Workspace.sidesquares.l31.BrickColor = BrickColor.new(1002)
game.Workspace.sidesquares.l33.BrickColor = BrickColor.new(1002)
game.Workspace.sidesquares.l34.BrickColor = BrickColor.new(1002)
game.Workspace.sidesquares.l35.BrickColor = BrickColor.new(1002)
--Main function


local function AttachAuraControl(source_part, eff_cont) --(source_part, effect_container)
	
	local AnimObj
	
	local function Start()
		AnimObj = {}
		AnimObj["LastUpdate"] = tick()
		
		AnimObj["Parts"] = {}
		
		for i = 1, 3 do
			local np = EFFECT_LIB.NewInvisiblePart()
			
			local particlez = script.Energy:Clone()
			particlez.Parent = np
			particlez.Enabled = true
			
			AnimObj["Parts"][i] = np
	
			np.Parent = eff_cont
		end
	end
	
	local function Update()
		local loop = EFFECT_LIB.Loop(6)
		
		for i = 1, #AnimObj["Parts"] do
			AnimObj["Parts"][i].CFrame = source_part.CFrame * CFrame.Angles(0, math.rad(-loop * 360 + (360 / #AnimObj["Parts"] * (i - 1))), 0) * CFrame.new(0, -3, -3.2) --* CFrame.Angles(0, math.rad(90), 0) --* CFrame.Angles(math.rad(loop2 * -360 + (i * 180)), 0, 0)
		end
	end
	
	local function Stop()
		eff_cont:ClearAllChildren()
		AnimObj = nil
	end
	
	return {Start = Start, Update = Update, Stop = Stop}
end

return AttachAuraControl