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



function Raycast.FindPartOnRayWithCallbackWithIgnoreList(ray, list, terrainCellsAreCubes, ignoreWater, loopout, callbackFunc)
	local maxDistance = ray.Direction.Magnitude
	local direction = ray.Direction.Unit
	
	loopout = loopout or 25
	local loopCount = 0
	
	local lastPosition = ray.Origin
	local distance = 0
	
	local hit, position, normal, material
	
	repeat
		local r = Ray.new(lastPosition, direction * (maxDistance - distance))
		hit, position, normal, material = WORKSPACE:FindPartOnRayWithIgnoreList(ray, list, terrainCellsAreCubes, ignoreWater, true)
		local result = callbackFunc(hit, position, normal, material)
		
		if (result == CALLBACKRESULT.Continue) then
			distance = (ray.Origin - position).Magnitude
			lastPosition = position
		elseif (result == CALLBACKRESULT.Finished) then
			return hit, position, normal, material
		elseif (result == CALLBACKRESULT.Fail or result == nil) then
			break
		end
		
		loopCount = loopCount + 1
	until (loopCount > loopout or distance >= maxDistance - 0.1)
	
	return
end

function Raycast.FindPartOnRayWithCallbackWithWhiteList(ray, list, terrainCellsAreCubes, ignoreWater, loopout, callbackFunc)
	local maxDistance = ray.Direction.Magnitude
	local direction = ray.Direction.Unit
	
	loopout = loopout or 25
	local loopCount = 0
	
	local lastPosition = ray.Origin
	local distance = 0
	
	local hit, position, normal, material
	
	repeat
		local r = Ray.new(lastPosition, direction * (maxDistance - distance))
		hit, position, normal, material = WORKSPACE:FindPartOnRayWithWhitelist(ray, list, terrainCellsAreCubes, ignoreWater, true)
		if hit then
			--print(hit:GetFullName())
			end
		local result = callbackFunc(hit, position, normal, material)
		
		if (result == CALLBACKRESULT.Continue) then
			distance = (ray.Origin - position).Magnitude
			lastPosition = position
		elseif (result == CALLBACKRESULT.Finished) then
			return hit, position, normal, material
		elseif (result == CALLBACKRESULT.Fail or result == nil) then
			break
		end
		loopCount = loopCount + 1
	until (loopCount > loopout or distance >= maxDistance - 0.1)
	
	return
end

function Raycast.FindPartOnRayWithCallback(ray, ignore, terrainCellsAreCubes, ignoreWater, callbackFunc)
	return Raycast.FindPartOnRayWithCallbackWithIgnoreList(ray, {ignore}, terrainCellsAreCubes, ignoreWater, callbackFunc)
end
-- Enemy spawn system


for _,area in pairs(workspace.Areas:GetChildren()) do
	local function RefillEnemies()
		local function SpawnEnemy(spawnRegion)
			local enemyToSpawn = spawnRegion.EnemiesToSpawnHere:GetChildren()[math.random(1,#spawnRegion.EnemiesToSpawnHere:GetChildren())].Name
			local xVectorRandom = spawnRegion.CFrame.RightVector * spawnRegion.Size.X * (math.random(-50, 50) / 100)
			local yVectorRandom = spawnRegion.CFrame.UpVector * spawnRegion.Size.Y * (math.random(-50, 50) / 100)
			local zVectorRandom = spawnRegion.CFrame.LookVector * spawnRegion.Size.Z * (math.random(-50, 50) / 100)
			local spawnPosition = spawnRegion.Position + xVectorRandom + yVectorRandom + zVectorRandom
			require(enemyFunctions).SpawnEnemy(enemyToSpawn, spawnPosition, area.Enemies)
		end
		local enemyCounts = {}
		for _,enemy in pairs(area.Enemies:GetChildren()) do
			if not enemyCounts[enemy.Name] then
				enemyCounts[enemy.Name] = 1
			else
				enemyCounts[enemy.Name] = enemyCounts[enemy.Name] + 1
			end
		end
		for _,spawnRegion in pairs(area.SpawnRegions:GetChildren()) do
			local enemiesInRegion = 0
			for _,enemyToSpawn in pairs(spawnRegion.EnemiesToSpawnHere:GetChildren()) do
				if enemyCounts[enemyToSpawn.Name] then
					enemiesInRegion = enemiesInRegion + enemyCounts[enemyToSpawn.Name]
				end
			end
			for i = 1, spawnRegion.MaximumEnemies.Value - enemiesInRegion do
				SpawnEnemy(spawnRegion)
			end
		end
	end
	if area:FindFirstChild("Enemies") and area:FindFirstChild("SpawnRegions") then
		RefillEnemies()
		area.Enemies.ChildRemoved:Connect(RefillEnemies)
	end
end
--LockController




Closed = true

function LockItems()
	Timer.EnclosureDoor.Buttons.Locked.Value = script.Locked.Value
	if script.Locked.Value == true then
		Timer.EnclosureDoor.Locked.Value = script.Locked.Value
		Timer.EnclosureDoor.Interactive.ProximityPromptService.MaxActivationDistance = 0
	else
		Timer.EnclosureDoor.Interactive.ProximityPromptService.MaxActivationDistance = 8
	end
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 and Timer.EnclosureDoor.DoorOpen.Value == false then
			Closed = 1
			script.Locked.Value = true
			LockItems()
			script.Parent.Open.Value = false
			wait(1)
			Closed = true
			return
		end

	end
end)
--Light off


	src.Parent.right.Value.Value = 0
	light.Value = false
	else
	src.Parent.right.Value.Value = 1
	light.Value = true
	return
	end
end
end)
src.Parent.ChildRemoved:connect(function(child)
	if child.Name=="SeatWeld" then 
		src:Stop()
		script.Parent:Destroy()
	end
end)
------------------------------------------------------------------------------------------------------------



function configureAnimationSetOld(name, fileList)
	if (animTable[name] ~= nil) then
		for _, connection in pairs(animTable[name].connections) do
			connection:disconnect()
		end
	end
	animTable[name] = {}
	animTable[name].count = 0
	animTable[name].totalWeight = 0	
	animTable[name].connections = {}

	local allowCustomAnimations = true
	local AllowDisableCustomAnimsUserFlag = false

	local success, msg = pcall(function()
		AllowDisableCustomAnimsUserFlag = UserSettings():IsUserFeatureEnabled("UserAllowDisableCustomAnims2")
	end)

	if (AllowDisableCustomAnimsUserFlag) then
		local success, msg = pcall(function() allowCustomAnimations = game:GetService("StarterPlayer").AllowCustomAnimations end)
		if not success then
			allowCustomAnimations = true
		end
	end

	-- check for config values
	local config = script:FindFirstChild(name)
	if (allowCustomAnimations and config ~= nil) then
		table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
		table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
		local idx = 1
		for _, childPart in pairs(config:GetChildren()) do
			if (childPart:IsA("Animation")) then
				table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
				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
				idx = idx + 1
			end
		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
	
	-- preload anims
	if PreloadAnimsUserFlag then
		for i, animType in pairs(animTable) do
			for idx = 1, animType.count, 1 do 
				Humanoid:LoadAnimation(animType[idx].anim)
			end
		end
	end
end
--[[
	
	Alternative to game.Debris:AddItem() which runs on heartbeat (and runs better, for that matter)
	
	60hz accurate
	
	also supports array of objects in 1st arg
		
--]]




function Step()
	--- scan garbage for items that are expired and clean them up
	for i = #garbage, 1, -1 do
		local v = garbage[i]
		local obj = v[1]
		local t = v[2]
		local removetime = v[3]
		local tp = (tick() - t)
		if tp >= removetime then
			if type(obj) == "table" then
				for _, objchild in ipairs(obj) do
					objchild:Destroy()
				end
			else
				obj:Destroy()
			end
			table.remove(garbage, i)
		end
	end
end


coroutine.wrap(function() --- main loop
	while _L.Services.RunService.Heartbeat:Wait() do
		Step()
	end
end)()


return function(obj, t)
	if not t then
		t = 10
	end
	--- add to garbage
	table.insert(garbage, {obj, tick(), t})
end
-----------------------------------------------------------------------------------------------



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.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)
--[[Susupension]]


	Tune.SusEnabled		= true		-- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
	
	--Front Suspension
	Tune.FSusDamping	= 300		-- Spring Dampening
	Tune.FSusStiffness	= 4000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 2.5			-- Suspension length (in studs)
	Tune.FPreCompress	= .5		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .5		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= 2		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 8		-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.5		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Rear Suspension
	Tune.RSusDamping	= 300		-- Spring Dampening
	Tune.RSusStiffness	= 4000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 2.5			-- Suspension length (in studs)
	Tune.RPreCompress	= .5		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .5		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= 2		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.RWsBoneLen		= 8			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.5		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics	
	Tune.SusVisible		= true			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Bright red"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--Version 1.43 Made my PistonsofDoom--


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=(carSeat.Velocity.magnitude)/1.7 --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
--Traction Control Settings


Tune.TCSEnabled		= false		-- Implements TCS
Tune.TCSThreshold	= 20		-- Slip speed allowed before TCS starts working (in SPS)
Tune.TCSGradient	= 20		-- Slip speed gradient between 0 to max reduction (in SPS)
Tune.TCSLimit		= 20		-- Minimum amount of torque at max reduction (in percent)
--[[--------------------------------------------------------------------
-- Notes:
-- * one function manipulate a pointer argument with a simple data type
--   (can't be emulated by a table, ambiguous), now returns that value:
--   luaK:concat(fs, l1, l2)
-- * luaM_growvector uses the faux luaY:growvector, for limit checking
-- * some function parameters changed to boolean, additional code
--   translates boolean back to 1/0 for instruction fields
--
-- Not implemented:
-- * NOTE there is a failed assert in luaK:addk, a porting problem
--
-- Added:
-- * constant MAXSTACK from llimits.h
-- * luaK:ttisnumber(o) (from lobject.h)
-- * luaK:nvalue(o) (from lobject.h)
-- * luaK:setnilvalue(o) (from lobject.h)
-- * luaK:setnvalue(o, x) (from lobject.h)
-- * luaK:setbvalue(o, x) (from lobject.h)
-- * luaK:sethvalue(o, x) (from lobject.h), parameter L deleted
-- * luaK:setsvalue(o, x) (from lobject.h), parameter L deleted
-- * luaK:numadd, luaK:numsub, luaK:nummul, luaK:numdiv, luaK:nummod,
--   luaK:numpow, luaK:numunm, luaK:numisnan (from luaconf.h)
-- * copyexp(e1, e2) added in luaK:posfix to copy expdesc struct
--
-- Changed in 5.1.x:
-- * enum BinOpr has a new entry, OPR_MOD
-- * enum UnOpr has a new entry, OPR_LEN
-- * binopistest, unused in 5.0.x, has been deleted
-- * macro setmultret is new
-- * functions isnumeral, luaK_ret, boolK are new
-- * funcion nilK was named nil_constant in 5.0.x
-- * function interface changed: need_value, patchtestreg, concat
-- * TObject now a TValue
-- * functions luaK_setreturns, luaK_setoneret are new
-- * function luaK:setcallreturns deleted, to be replaced by:
--   luaK:setmultret, luaK:ret, luaK:setreturns, luaK:setoneret
-- * functions constfolding, codearith, codecomp are new
-- * luaK:codebinop has been deleted
-- * function luaK_setlist is new
-- * OPR_MULT renamed to OPR_MUL
----------------------------------------------------------------------]]
-- Roact


local new = Roact.createElement
local ToolManualWindow = require(UI:WaitForChild('ToolManualWindow'))

local MANUAL_CONTENT = [[<font face="GothamBlack" size="16">Building Tools by F3X  🛠</font>
To learn more about each tool, click on its ❔ icon at the top right corner.<font size="12"><br /></font>

<font size="12" color="rgb(150, 150, 150)"><b>Selecting</b></font>
 <font color="rgb(150, 150, 150)">•</font> Select individual parts by holding <b>Shift</b> and clicking each one.
 <font color="rgb(150, 150, 150)">•</font> Rectangle select parts by holding <b>Shift</b>, clicking, and dragging.
 <font color="rgb(150, 150, 150)">•</font> Press <b>Shift-K</b> to select parts inside of the selected parts.
 <font color="rgb(150, 150, 150)">•</font> Press <b>Shift-R</b> to clear your selection.<font size="12"><br /></font>

<font size="12" color="rgb(150, 150, 150)"><b>Exporting your creations</b></font>
You can export your builds into a short code by clicking the export button, or pressing <b>Shift-P</b>.<font size="8"><br /></font>
Install the import plugin in <b>Roblox Studio</b> to import your creation:
<font color="rgb(150, 150, 150)">roblox.com/library/142485815</font>]]
--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 NumOfSupers = #require(game.ReplicatedStorage.Source.Modules.CharacterScripts.Classes.ClassInformation):GetObtainedSupers(player)
	
	local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
	return NumOfSupers < 2 and plrData.Classes.Super.Mage.Obtained.Value ~= true
end
--Rear Suspension


Tune.RSusDamping	= 500		-- Spring Dampening
Tune.RSusStiffness	= 9000		-- Spring Force
Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)

Tune.RSusLength		= 2			-- Suspension length (in studs)
Tune.RPreCompress	= .3		-- Pre-compression adds resting length force
Tune.RExtensionLim	= .3		-- Max Extension Travel (in studs)
Tune.RCompressLim	= .30		-- Max Compression Travel (in studs)
Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)

Tune.RWsBoneLen		= 5			-- Wishbone Length
Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	--[[Lateral]]		-.4		,	-- positive = outward
	--[[Vertical]]		-.5		,	-- positive = upward
	--[[Forward]]		0		}	-- positive = forward
--v.SGUI.Identifier.Text = Stats.Plate.Value


v.SGUI.Identifier.Text = Stats:WaitForChild("Plate").Value
end
end


function ToogleLock(status)
for i,v in pairs(Car:GetDescendants()) do
if v.ClassName == "VehicleSeat" or v.ClassName == "Seat" then
v.Disabled = status
end
end
end
--Creates a remote event.


function RemoteEventCreator:CreateRemoteEvent(Name)
	--Warn if an item with that name exists.
	if Tool:FindFirstChild(Name) then
		warn("Conflicting item "..Name.." exists in "..Tool:GetFullName())
	end	
	
	--Create and return the remote event.
	local RemoteEvent = Instance.new("RemoteEvent")
	RemoteEvent.Name = Name
	RemoteEvent.Parent = Tool
	
	return RemoteEvent
end
-- Variables (best not to touch these!)


local button = script.Parent .Parent.Parent
local car = script.Parent.Parent.Parent.Parent.Car.Value
local sound = script.Parent.Parent.Start
local st = script.Parent.Parent.Stall
st.Parent = car.DriveSeat
sound.Parent = car.DriveSeat -- What brick the start sound is playing from.
button.MouseButton1Click:connect(function() -- Event when the button is clicked
	if script.Parent.Parent.Parent.Text == "Engine: Off" then -- If the text says it's off then..
		sound:Play() -- Startup sound plays..
		wait(.6) -- I don't know what to put for this
		script.Parent.Parent.Parent.Parent.IsOn.Value = true -- The car is is on, or in other words, start up the car.
		button.Text = "Engine: On"  -- You don't really need this, but I would keep it.
	else -- If it's on then when you click the button,
		st:play()
		script.Parent.Parent.Parent.Parent.IsOn.Value = false -- The car is turned off.
		button.Text = "Engine: Off"
	end -- Don't touch this.
end) -- And don't touch this either.
-- update loop



game:GetService("RunService").Heartbeat:Connect(function(dt)
	for i,v in pairs(workspace:GetDescendants()) do
	if v.Name == "Head" then
	if (head.Position - v.Position).Magnitude <= 20 then
	BP.Position = lookAt(v.Position);
	local set = springPart.Position;
	neck.C0 = neckC0 * CFrame.fromEulerAnglesYXZ(set.z*0.5, set.x, 0);
	waist.C0 = waistC0 * CFrame.fromEulerAnglesYXZ(set.z*0.5, set.y, 0);
	else
	BP.Position = lookAt(target.Position);
	local set = springPart.Position;
	neck.C0 = neckC0 * CFrame.fromEulerAnglesYXZ(set.z*0.5, set.x, 0);
	waist.C0 = waistC0 * CFrame.fromEulerAnglesYXZ(set.z*0.5, set.y, 0);
end
end
end
end);
--////////////////////////////// Include
--//////////////////////////////////////


local Chat = game:GetService("Chat")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local commandModules = clientChatModules:WaitForChild("CommandModules")
local commandUtil = require(commandModules:WaitForChild("Util"))
local modulesFolder = script.Parent
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))

function methods:SetupCommandProcessors()
	local commands = commandModules:GetChildren()
	for i = 1, #commands do
		if commands[i]:IsA("ModuleScript") then
			if commands[i].Name ~= "Util" then
				local commandProcessor = require(commands[i])
				local processorType = commandProcessor[commandUtil.KEY_COMMAND_PROCESSOR_TYPE]
				local processorFunction = commandProcessor[commandUtil.KEY_PROCESSOR_FUNCTION]
				if processorType == commandUtil.IN_PROGRESS_MESSAGE_PROCESSOR then
					table.insert(self.InProgressMessageProcessors, processorFunction)
				elseif processorType == commandUtil.COMPLETED_MESSAGE_PROCESSOR then
					table.insert(self.CompletedMessageProcessors, processorFunction)
				end
			end
		end
	end
end

function methods:ProcessCompletedChatMessage(message, ChatWindow)
	for i = 1, #self.CompletedMessageProcessors do
		local processedCommand = self.CompletedMessageProcessors[i](message, ChatWindow, ChatSettings)
		if processedCommand then
			return true
		end
	end
	return false
end

function methods:ProcessInProgressChatMessage(message, ChatWindow, ChatBar)
	for i = 1, #self.InProgressMessageProcessors do
		local customState = self.InProgressMessageProcessors[i](message, ChatWindow, ChatBar, ChatSettings)
		if customState then
			return customState
		end
	end
	return nil
end
--[=[
  @function freeze
  @within Array

  @param array {T} -- The array to freeze.
  @return {T} -- The frozen array.

  Freezes the top level of the array, making it read-only.

  ```lua
  local array = { 1, 2, 3, { 4, 5, 6 } }

  local new = Freeze(array)

  new[1] = 4 -- error!
  new[4][1] = 7 -- still works!
  ```
]=]


local function freeze<T>(array: { T }): { T }
	local new = Copy(array)

	table.freeze(new)

	return new
end

return freeze
--!strict


local Sift = script.Parent.Parent

local Util = require(Sift.Util)
local Copy = require(script.Parent.copy)

type Callback<T> = (index: number) -> T
type Updater<T> = (currentValue: T, index: number) -> T

local function call<T>(callback: Callback<T>, index: number)
	if type(callback) == "function" then
		return callback(index)
	end
end
--[=[
	Interpolates betweeen two numbers, given an percent. The percent is
	a number in the range that will be used to define how interpolated
	it is between num0 and num1.

	```lua
	print(Math.lerp(-1000, 1000, 0.75)) --> 500
	```

	@param num0 number -- Number
	@param num1 number -- Second number
	@param percent number -- The percent
	@return number -- The interpolated
]=]


function Math.lerp(num0: number, num1: number, percent: number): number
	return num0 + ((num1 - num0) * percent)
end
------------------------------------------------------------------------------------------------------------------------------------------------------



	function Core.error(...)
		return error('Nexus Framework | ' .. table.concat({...}, ' '), math.huge)
	end 

	function Core.print(...)
		return print('Nexus Framework | ' .. table.concat({...}, ' ') .. '\n' .. FormatTraceback(debug.traceback()))
	end

	function Core.warn(...)
		return warn('Nexus Framework | ' .. table.concat({...}, ' ') .. '\n' .. FormatTraceback(debug.traceback()))
	end 

	function Core.assert(Statement, Message)
		return assert(Statement, Message .. '\n' .. FormatTraceback(debug.traceback()))
	end