Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[[
	Creates a new promise that receives the result of this promise.

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


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

	-- Create a new promise to follow this part of the chain
	return Promise.new(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(successHandler, resolve, reject)
		end

		local failureCallback = reject
		if failureHandler then
			failureCallback = createAdvancer(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("Promise is cancelled")
		end
	end, self)
end
--See: https://www.roblox.com/library/265487607/Cutter


local function GetCenterOfMass(parts)
	local TotalMass = 0
	local SumOfMasses = Vector3.new(0, 0, 0)

	for i = 1, #parts do
		local part = parts[i]
		
		TotalMass = TotalMass + part:GetMass()
		SumOfMasses = SumOfMasses + part:GetMass() * part.Position
	end
	
	return SumOfMasses/TotalMass, TotalMass
end

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

local function GetCFrameFromTopBack(CFrameAt, Top, Back)
	local Right = Top:Cross(Back)
	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(cframe)
	local Back = GetBackVector(cframe)
	return GetCFrameFromTopBack(cframe.p, Vector3.new(0, 1, 0), Vector3.new(Back.x, 0, Back.z).unit)
end
--// Bullet Physics


	BulletPhysics = Vector3.new(0,55,0); -- Drop fixation: Lower number = more drop
	BulletSpeed = 3000; -- Bullet Speed
	BulletSpread = 0; -- How much spread the bullet has
	
	ExploPhysics = Vector3.new(0,20,0); -- Drop for explosive rounds
	ExploSpeed = 600; -- Speed for explosive rounds
	
	BulletDecay = 10000; -- How far the bullet travels before slowing down and being deleted (BUGGY)
-----------------------------------------------------------------------------------------------



script.Parent:WaitForChild("Gear")
script.Parent:WaitForChild("Speed")

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

local car = script.Parent.Parent.Car.Value
script.Parent.CarName.Text = car.Name
car.Body.CarName.Value.VehicleSeat.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)
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 984		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 1100		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 8250		--		Use sliders to manipulate values
	Tune.Redline		= 8750		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5250
	Tune.PeakSharpness	= 5.8
	Tune.CurveMult		= 0.294 
	
	--Incline Compensation
	Tune.InclineComp	= 1.5		-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 400		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 300		-- RPM decay when clutch is off
	Tune.RevBounce		= 450		-- RPM kickback from redline
	Tune.IdleThrottle	= 0			-- Percent throttle at idle
	Tune.ClutchTol		= 450		-- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
--Scripted by DermonDarble



local car = script.Parent
local stats = car.Configurations
local Raycast = require(script.RaycastModule)

local mass = 0

for i, v in pairs(car:GetChildren()) do
	if v:IsA("BasePart") then
		mass = mass + (v:GetMass() * 196.2)
	end
end

local bodyPosition = Instance.new("BodyPosition", car.Chassis)
bodyPosition.MaxForce = Vector3.new()
local bodyGyro = Instance.new("BodyGyro", car.Chassis)
bodyGyro.MaxTorque = Vector3.new()

local function UpdateThruster(thruster)
	-- Raycasting
	local hit, position = Raycast.new(thruster.Position, thruster.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value) --game.Workspace:FindPartOnRay(ray, car)
	local thrusterHeight = (position - thruster.Position).magnitude

	-- Wheel
	local wheelWeld = thruster:FindFirstChild("WheelWeld")
	wheelWeld.C0 = CFrame.new(0, -math.min(thrusterHeight, stats.Height.Value * 0.8) + (wheelWeld.Part1.Size.Y / 2), 0)
	-- Wheel turning
	local offset = car.Chassis.CFrame:inverse() * thruster.CFrame
	local speed = car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity)
	if offset.Z < 0 then
		local direction = 1
		if speed.Z > 0 then
			direction = -1
		end
		wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(0, (car.Chassis.RotVelocity.Y / 2) * direction, 0)
	end

	-- Particles
	if hit and thruster.Velocity.magnitude >= 5 then
		wheelWeld.Part1.ParticleEmitter.Enabled = true
	else
		wheelWeld.Part1.ParticleEmitter.Enabled = false
	end
end

car.DriveSeat.Changed:connect(function(property)
	if property == "Occupant" then
		if car.DriveSeat.Occupant then
			local player = game.Players:GetPlayerFromCharacter(car.DriveSeat.Occupant.Parent)
			if player then
				car.DriveSeat:SetNetworkOwner(player)
				local localCarScript = script.LocalCarScript:Clone()
				localCarScript.Parent = player.PlayerGui
				localCarScript.Car.Value = car
				localCarScript.Disabled = false
			end
		else
			car.DriveSeat:SetNetworkOwnershipAuto()
		end
	end
end)

spawn(function()
	while true do
		game:GetService("RunService").Stepped:wait()
		for i, part in pairs(car:GetChildren()) do
			if part.Name == "Thruster" then
				UpdateThruster(part)
			end
		end
		if car.DriveSeat.Occupant then
			bodyPosition.MaxForce = Vector3.new()
			bodyGyro.MaxTorque = Vector3.new()
		else
			local hit, position, normal = Raycast.new(car.Chassis.Position, car.Chassis.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value)
			if hit and hit.CanCollide then
				bodyPosition.MaxForce = Vector3.new(mass / 5, math.huge, mass / 5)
				bodyPosition.Position = (CFrame.new(position, position + normal) * CFrame.new(0, 0, -stats.Height.Value + 0.5)).p
				bodyGyro.MaxTorque = Vector3.new(math.huge, 0, math.huge)
				bodyGyro.CFrame = CFrame.new(position, position + normal) * CFrame.Angles(-math.pi/2, 0, 0)
			else
				bodyPosition.MaxForce = Vector3.new()
				bodyGyro.MaxTorque = Vector3.new()
			end
		end
	end
end)
--[=[
	@tag Component Class
	`Construct` is called before the component is started, and should be used
	to construct the component instance.

	```lua
	local MyComponent = Component.new({Tag = "MyComponent"})

	function MyComponent:Construct()
		self.SomeData = 32
		self.OtherStuff = "HelloWorld"
	end
	```
]=]


function Component:Construct() end
--/Recoil Modification


module.camRecoil = {
	RecoilUp 		= 1.1
	,RecoilTilt 	= 1
	,RecoilLeft 	= .9
	,RecoilRight 	= .9
}

module.gunRecoil = {
	RecoilUp 		= 1.1
	,RecoilTilt 	= 1
	,RecoilLeft 	= .9
	,RecoilRight 	= .9
}

module.AimRecoilReduction = 1
module.AimSpreadReduction = 1

module.MinRecoilPower 			= 1
module.MaxRecoilPower 			= 1
module.RecoilPowerStepAmount 	= 1

module.MinSpread 				= 1
module.MaxSpread 				= 1					
module.AimInaccuracyStepAmount 	= 1
module.AimInaccuracyDecrease 	= 1
module.WalkMult 				= 1

module.MuzzleVelocityMod	 	= 1

return module
-- Better don't change anything. This script is WIP v.0.2
-- This screen gui doesn't work if your game has day and night loop



game:GetService("RunService").RenderStepped:Connect(function()
if (Rake.Position - Character.HumanoidRootPart.Position).magnitude<70 and Debounce1 == false then
Debounce1 = true
NightTheme:Pause()
Found:Play()
FlashEffect.BackgroundTransparency = 0.6
wait(0.4)
ScreenShake.Disabled = false
FlashEffect.BackgroundTransparency = 1
RakeTheme:Play()
end
if (Rake.Position - Character.HumanoidRootPart.Position).magnitude>70 and Debounce1 == true then
Debounce1 = false
NightTheme:Play()
ScreenShake.Disabled = true
FlashEffect.BackgroundTransparency = 1
RakeTheme:Stop()
end
end)
-- Misc --


local CharacterTable = {}

local function OnCharacterAdded(Character : Model)
	if table.find(CharacterTable, Character.Name) then return end

	CharacterTable[Character.Name] = {}
	CharacterTable[Character.Name].LegController = LegController.new(Character)

	Character.Destroying:Connect(function()
		CharacterTable[Character.Name].LegController:Destroy()
		CharacterTable[Character.Name] = nil
	end)
end
--[[
	    ___      _______                _       _______
	   / _ |____/ ___/ /  ___ ____ ___ (_)__   /__  __/
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<     / /
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/	/_/   
						SecondLogic @ Inspare
						Avxnturador @ Novena
]]


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

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

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

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

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

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

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

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


	--Torque Curve
	Tune.Horsepower		= 10000	--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6000		--		Use sliders to manipulate values
	Tune.Redline		= 6700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 350		-- 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.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)
--[[
	Creates a new cooldown, with specified cooldownTime. cooldown:hasExpired returns true or false depending on if the cooldown has expired or not. There
	is also an optional callbackFunction that will be called as soon as the cooldown expires.
]]


function Cooldown.new(cooldownTime, callbackFunction)
	local startTick = tick()

	local cooldownObject = {
		_endTick = startTick + cooldownTime
	}
	setmetatable(cooldownObject, {__index = Cooldown})

	if callbackFunction then
		delay(cooldownTime, callbackFunction)
	end

	return cooldownObject
end

function Cooldown:hasExpired()
	return self._endTick < tick() and true or false
end

return Cooldown
-- declarations



local Figure = script.Parent
local Torso = waitForChild(Figure, "Torso")
local RightShoulder = waitForChild(Torso, "Right Shoulder")
local LeftShoulder = waitForChild(Torso, "Left Shoulder")
local RightHip = waitForChild(Torso, "Right Hip")
local LeftHip = waitForChild(Torso, "Left Hip")
local Humanoid = waitForChild(Figure, "Merch")
local pose = "Standing"

local toolAnim = "None"
local toolAnimTime = 0

local isSeated = false
--[[**
	matches given tuple against tuple type definition

	@param ... The type definition for the tuples

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


function t.tuple(...)
	local checks = { ... }
	return function(...)
		local args = { ... }
		for i, check in ipairs(checks) do
			local success = check(args[i])
			if success == false then
				return false
			end
		end

		return true
	end
end
--Modified by Ricalou, 20/10/2013 17:10
-- NO TOUCHY TOUCHY!



local config = script.Parent.Configuration

script.Parent.Touched:connect(function(part)
	if part.Parent and Game:GetService('Players'):GetPlayerFromCharacter(part.Parent) then
		local player = Game:GetService('Players'):GetPlayerFromCharacter(part.Parent)
		if player:GetRankInGroup(config.GroupId.Value) >= config.RankId.Value then
			script.Parent.CanCollide = false
			wait(0.3)
			script.Parent.CanCollide = true
		end
	end
end)
-- Hydration (when unsupported)


export type SuspenseInstance = any
return {
	supportsHydration = false,
	canHydrateInstance = shim,
	canHydrateTextInstance = shim,
	canHydrateSuspenseInstance = shim,
	isSuspenseInstancePending = shim,
	isSuspenseInstanceFallback = shim,
	registerSuspenseInstanceRetry = shim,
	getNextHydratableSibling = shim,
	getFirstHydratableChild = shim,
	hydrateInstance = shim,
	hydrateTextInstance = shim,
	hydrateSuspenseInstance = shim,
	getNextHydratableInstanceAfterSuspenseInstance = shim,
	commitHydratedContainer = shim,
	commitHydratedSuspenseInstance = shim,
	clearSuspenseBoundary = shim,
	clearSuspenseBoundaryFromContainer = shim,
	didNotMatchHydratedContainerTextInstance = shim,
	didNotMatchHydratedTextInstance = shim,
	didNotHydrateContainerInstance = shim,
	didNotHydrateInstance = shim,
	didNotFindHydratableContainerInstance = shim,
	didNotFindHydratableContainerTextInstance = shim,
	didNotFindHydratableContainerSuspenseInstance = shim,
	didNotFindHydratableInstance = shim,
	didNotFindHydratableTextInstance = shim,
	didNotFindHydratableSuspenseInstance = shim,
}
--------------------------------------------------



script.Parent.Values.Gear.Changed:connect(function()
	local gearText = script.Parent.Values.Gear.Value
	if gearText == 0 then 
		gearText = "N"
		car.Body.Dash.DashSc.G.Gear.Text = "N"
		car.DriveSeat.Filter:FireServer('reverse',false)
	elseif gearText == -1 then
		gearText = "R"
		car.Body.Dash.DashSc.G.Gear.Text = "R"
		car.DriveSeat.Filter:FireServer('reverse',true)
	end
	car.Body.Dash.DashSc.G.Gear.Text = gearText
end)
--Accelerate module(part of physics module)


local e=2.718281828459045
local d=1
local s=1
local p0=0
local v0=0*p0
local p1=p0
local v1=v0
local t0=tick()

local function posvel(d,s,p0,v0,p1,v1,x)
	if s==0 then
		return p0
	elseif d<1-1e-8 then
		local h=(1-d*d)^0.5
		local c1=(p0-p1+2*d/s*v1)
		local c2=d/h*(p0-p1)+v0/(h*s)+(2*d*d-1)/(h*s)*v1
		local co=math.cos(h*s*x)
		local si=math.sin(h*s*x)
		local ex=e^(d*s*x)
		return co/ex*c1+si/ex*c2+p1+(x-2*d/s)*v1,
			s*(co*h-d*si)/ex*c2-s*(co*d+h*si)/ex*c1+v1
	elseif d<1+1e-8 then
		local c1=p0-p1+2/s*v1
		local c2=p0-p1+(v0+v1)/s
		local ex=e^(s*x)
		return (c1+c2*s*x)/ex+p1+(x-2/s)*v1,
			v1-s/ex*(c1+(s*x-1)*c2)
	else
		local h=(d*d-1)^0.5
		local a=(v1-v0)/(2*s*h)
		local b=d/s*v1-(p1-p0)/2
		local c1=(1-d/h)*b+a
		local c2=(1+d/h)*b-a
		local co=e^(-(h+d)*s*x)
		local si=e^((h-d)*s*x)
		return c1*co+c2*si+p1+(x-2*d/s)*v1,
			si*(h-d)*s*c2-co*(d+h)*s*c1+v1
	end
end
	
local function targposvel(p1,v1,x)
	return p1+x*v1,v1
end

local self={}

function self:accelerate(a)
	local time=tick()
	local p,v=posvel(d,s,p0,v0,p1,v1,time-t0)
	local tp,tv=targposvel(p1,v1,time-t0)
	p0,v0=p,v+a
	p1,v1=tp,tv
	t0=time
	return setmetatable(self)
end
--// This method is to be used with the new filter API. This method takes the 
--// TextFilterResult objects and converts them into the appropriate string
--// messages for each player.


function methods:InternalSendFilteredMessageWithFilterResult(inMessageObj, channelName)
	local messageObj = ShallowCopy(inMessageObj)

	local oldFilterResult = messageObj.FilterResult
	local player = self:GetPlayer()

	local msg = ""
	pcall(function()
		if (messageObj.IsFilterResult) then
			if (player) then
				msg = oldFilterResult:GetChatForUserAsync(player.UserId)
			else
				msg = oldFilterResult:GetNonChatStringForBroadcastAsync()
			end
		else
			msg = oldFilterResult
		end
	end)

	--// Messages of 0 length are the result of two users not being allowed
	--// to chat, or GetChatForUserAsync() failing. In both of these situations,
	--// messages with length of 0 should not be sent.
	if (#msg > 0) then
		messageObj.Message = msg
		messageObj.FilterResult = nil
		self:InternalSendFilteredMessage(messageObj, channelName)
	end
end

function methods:InternalSendSystemMessage(messageObj, channelName)
	local success, err = pcall(function()
		self:LazyFire("eReceivedSystemMessage", messageObj, channelName)
		self.EventFolder.OnNewSystemMessage:FireClient(self.PlayerObj, messageObj, channelName)
	end)
	if not success and err then
		print("Error sending internal system message: " ..err)
	end
end

function methods:UpdateChannelNameColor(channelName, channelNameColor)
	self:LazyFire("eChannelNameColorUpdated", channelName, channelNameColor)
	self.EventFolder.ChannelNameColorUpdated:FireClient(self.PlayerObj, channelName, channelNameColor)
end
--[[
	
	When the game is run, this script automatically places all of the model's contents into the correct locations and deletes any leftover clutter.
	
	All you have to do is configure the music IDs and/or zones as described in the README - the rest will be automatically handled! 
	
--]]



local settings = require(script.Parent.Settings)

if settings.UseGlobalBackgroundMusic == false and settings.UseMusicZones == false then
	error("Cindering's BGM error: You have disabled both Global Background Music and Music Zones. You must change at least one of these settings to 'true'.")
	return
end

local name1 = "[1] Global Background Music"
local name2 = "[2] Background Music Zones"

local container = Instance.new("Folder")
container.Name = "CinderingBGM"

script.Parent.Settings.Parent = container

script.LocalBackgroundMusic.Parent = game.StarterPlayer.StarterPlayerScripts

local music = Instance.new("Folder")
local zones = Instance.new("Folder",music)
zones.Name = "MusicZones"
local global = Instance.new("Folder",music)
global.Name = "GlobalMusic"

if settings.UseMusicZones == true then
	local folder = script.Parent:FindFirstChild(name2) or game.ReplicatedStorage:FindFirstChild(name2) or workspace:FindFirstChild(name2) or game:FindFirstChild(name2,true) -- never know where someone might accidentally drag that folder...
	
	if folder then
		for _,model in pairs(folder:GetChildren()) do
			if (model:IsA("Model") and model:FindFirstChild("Music")) then
				model.Parent = zones
			end
		end
	else
		error("Cindering's BGM error: Your background music zones folder could not be found! You may have deleted/renamed the original folder. It should be named: "..name2)
		return
	end
end

if settings.UseGlobalBackgroundMusic == true then
	local folder = script.Parent:FindFirstChild(name1) or game.ReplicatedStorage:FindFirstChild(name1) or workspace:FindFirstChild(name1) or game:FindFirstChild(name1,true)
	
	if folder then
		for _,v in pairs(folder:GetChildren()) do
			if v:IsA("Sound") then
				v.Parent = global
			end
		end
	else
		error("Cindering's BGM error: Your global background music folder could not be found! You may have deleted/renamed the original folder. It should be named: "..name1)
		return
	end
end

if settings.UseGlobalBackgroundMusic == true and #global:GetChildren() == 0 then
	warn("Cindering's BGM warning: Your global background music folder is completely empty; no music will be played from there.")
end
if settings.UseMusicZones == true and #zones:GetChildren() == 0 then
	warn("Cindering's BGM warning: Your background music zones folder is completely empty; no music will be played from there.")
end

music.Name = "MusicFolder"
music.Parent = container

local count = 0
function recurse(instance)
	for _,v in pairs(instance:GetChildren()) do
		count = count + 1
		recurse(v)
	end
end
recurse(music)
local val = Instance.new("IntValue",container)
val.Name = "ObjectCount"
val.Value = count

container.Parent = game.ReplicatedStorage

script.Parent:Destroy()
--[=[
	Detects if a table is an array, meaning purely number indexes and indexes starting at 1.
	
	```lua
	local Array = {"A", "B", "C", "D"}
	local Dictionary = { NotAnArray = true }
	
	print(TableKit.IsArray(Array), TableKit.IsArray(Dictionary)) -- prints true, false
	```

	@within TableKit
	@param mysteryTable table
	@return boolean
]=]


function TableKit.IsArray(mysteryTable: { [unknown]: unknown }): boolean
	local count = 0
	for _ in mysteryTable do
		count += 1
	end
	return count == #mysteryTable
end
--script.Parent.NN.Velocity = script.Parent.NN.CFrame.lookVector *script.Parent.Speed.Value
--script.Parent.NNN.Velocity = script.Parent.NNN.CFrame.lookVector *script.Parent.Speed.Value


script.Parent.NNNN.Velocity = script.Parent.NNNN.CFrame.lookVector *script.Parent.Speed.Value
script.Parent.O.Velocity = script.Parent.O.CFrame.lookVector *script.Parent.Speed.Value
--[[for n = 1,80 do
wait(0.005)
script.Parent.Parent.Parent.Grabber.Claw.Body.Rope.Length = script.Parent.Parent.Claw.Body.Rope.Length - 0.175
end]]


script.Parent.Retreat.Disabled = false
script.Parent.Parent.Parent.CardSwipe.Screen.ClickDetector.PrizeWin.Disabled = false
script.Disabled = true
end