Pinkstack/roblox-luau-corpus-text huggingface dataset:
---Simply process a completed message.


local COMPLETED_MESSAGE_PROCESSOR = 1

local module = {}
local methods = {}
methods.__index = methods

function methods:SendSystemMessageToSelf(message, channelObj, extraData)
	local messageData =
	{
		ID = -1,
		FromSpeaker = nil,
		SpeakerUserId = 0,
		OriginalChannel = channelObj.Name,
		IsFiltered = true,
		MessageLength = string.len(message),
		MessageLengthUtf8 = utf8.len(utf8.nfcnormalize(message)),
		Message = message,
		MessageType = ChatConstants.MessageTypeSystem,
		Time = os.time(),
		ExtraData = extraData,
	}

	channelObj:AddMessageToChannel(messageData)
end

function module.new()
	local obj = setmetatable({}, methods)

	obj.COMMAND_MODULES_VERSION = COMMAND_MODULES_VERSION

	obj.KEY_COMMAND_PROCESSOR_TYPE = KEY_COMMAND_PROCESSOR_TYPE
	obj.KEY_PROCESSOR_FUNCTION = KEY_PROCESSOR_FUNCTION

	obj.IN_PROGRESS_MESSAGE_PROCESSOR = IN_PROGRESS_MESSAGE_PROCESSOR
	obj.COMPLETED_MESSAGE_PROCESSOR = COMPLETED_MESSAGE_PROCESSOR

	return obj
end

return module.new()
--create tables:


for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "a" then
		table.insert(a, 1, part)
	end
end
for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "b" then
		table.insert(b, 1, part)
	end
end
for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "c" then
		table.insert(c, 1, part)
	end
end
for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "d" then
		table.insert(d, 1, part)
	end
end
for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "e" then
		table.insert(e, 1, part)
	end
end
for i,part in pairs(model:GetChildren()) do
	if string.sub(part.Name, 1,1) == "f" then
		table.insert(f, 1, part)
	end
end

function on(T)
	for i, part in pairs (T) do
		if part:FindFirstChild("SurfaceLight") then
			part.SurfaceLight.Enabled = true
		end
	    if part:FindFirstChild("SpotLight") then
			part.SpotLight.Enabled = true
			part.Material = "Neon"
		end
	end
end

function off(T)
	for i, part in pairs (T) do
		if part:FindFirstChild("SurfaceLight") then
			part.SurfaceLight.Enabled = false
		end
	    if part:FindFirstChild("SpotLight") then
			part.SpotLight.Enabled = false
			part.Material = "SmoothPlastic"
		end
	end
end

function run() --mian

	off(a)--turns all lights off
	off(b)
	off(c)
	off(d)
	off(e)
	off(f)

	if pattern == "Flash" then
		repeat
			local w = 0.05
			off(c)
			off(d)
			on(a)
			off(b)
			off(e)
			on(f)
			wait(w)
			
			off(a)
			off(b)
			off(e)
			off(f)
			on(c)
			on(d)
			wait(w)
			
			off(a)
			on(b)
			on(e)
			off(f)
			off(c)
			off(d)
			wait(w)
		
		until pattern ~= "Flash"
		return
	end

	if pattern == "Left" then
		repeat
		local w = 0.15
		on(f)
		wait(w)
		on(e)
		wait(w)
		on(d)
		wait(w)
		on(c)
		wait(w)
		on(b)
		wait(w)
		on(a)
		wait(w)
		
		off(f)
		wait(w)
		off(e)
		wait(w)
		off(d)
		wait(w)
		off(c)
		wait(w)
		off(b)
		wait(w)
		off(a)
		wait(w)
		until pattern ~= "Left"
		return
	end
	
	if pattern == "Right" then
		repeat
		local w = 0.15
		on(a)
		wait(w)
		on(b)
		wait(w)
		on(c)
		wait(w)
		on(d)
		wait(w)
		on(e)
		wait(w)
		on(f)
		wait(w)
		
		off(a)
		wait(w)
		off(b)
		wait(w)
		off(c)
		wait(w)
		off(d)
		wait(w)
		off(e)
		wait(w)
		off(f)
		wait(w)
		until pattern ~= "Right"
		return
	end
	
	if pattern == "Split" then
		repeat
		local w = 0.2
		on(c)
		on(d)
		wait(w)
		on(b)
		on(e)
		wait(w)
		on(a)
		on(f)
		wait(w)
		
		off(c)
		off(d)
		wait(w)
		off(b)
		off(e)
		wait(w)
		off(a)
		off(f)
		wait(w)
		until pattern ~= "Split"
		return
	end
end--run end
-- Here be dragons
-- luacheck: ignore 212


local GuiService = game:GetService("GuiService")
local UserInputService = game:GetService("UserInputService")
local TextService = game:GetService("TextService")
local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer

local WINDOW_MAX_HEIGHT = 300
local MOUSE_TOUCH_ENUM = { Enum.UserInputType.MouseButton1, Enum.UserInputType.MouseButton2, Enum.UserInputType.Touch }
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]


local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local on = 0

local handler = car.AC6_FE_Idle
handler:FireServer("newSound","Idle",car.DriveSeat,script.Idle.SoundId,0,script.Idle.Volume,true)
handler:FireServer("playSound","Idle")

handler:FireServer("updateSound","Idle",script.Idle.SoundId,0.5,0)	

while wait() do
	if car.DriveSeat.IsOn.Value then	
		if script.Parent.Values.RPM.Value <= 1100 then	
			if car.DriveSeat.DriveMode.Value == "Eco" then
				handler:FireServer('tween',"Idle",0)
			else
				handler:FireServer('tween',"Idle",0.5)										
			end
			--handler:FireServer('tween',"Rev",0)				
		else
			handler:FireServer('tween',"Idle",0)						
		end
	 else
		handler:FireServer('tween',"Idle",0)				
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 = 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

function module:Int()
	game:GetService("Workspace").CurrentCamera:GetPropertyChangedSignal("ViewportSize"):Connect(function()
		delay(.5, function() module.SetCanvasSize(skillShopUI.Skills) end)
	end)
end

return module
-- Toggle pan


do
	local holdPan = false
	local togglePan = false
	local lastRmbDown = 0 -- tick() timestamp of the last right mouse button down event
	
	function CameraInput.getHoldPan(): boolean
		return holdPan
	end
	
	function CameraInput.getTogglePan(): boolean
		return togglePan
	end
	
	function CameraInput.getPanning(): boolean
		return togglePan or holdPan
	end
	
	function CameraInput.setTogglePan(value: boolean)
		togglePan = value
	end
	
	local cameraToggleInputEnabled = false
	local rmbDownConnection
	local rmbUpConnection
	
	function CameraInput.enableCameraToggleInput()
		if cameraToggleInputEnabled then
			return
		end
		cameraToggleInputEnabled = true
	
		holdPan = false
		togglePan = false
	
		if rmbDownConnection then
			rmbDownConnection:Disconnect()
		end
	
		if rmbUpConnection then
			rmbUpConnection:Disconnect()
		end
	
		rmbDownConnection = rmbDown:Connect(function()
			holdPan = true
			lastRmbDown = tick()
		end)
	
		rmbUpConnection = rmbUp:Connect(function()
			holdPan = false
			if tick() - lastRmbDown < MB_TAP_LENGTH and (togglePan or UserInputService:GetMouseDelta().Magnitude < 2) then
				togglePan = not togglePan
			end
		end)
	end
	
	function CameraInput.disableCameraToggleInput()
		if not cameraToggleInputEnabled then
			return
		end
		cameraToggleInputEnabled = false
	
		if rmbDownConnection then
			rmbDownConnection:Disconnect()
			rmbDownConnection = nil
		end
		
		if rmbUpConnection then
			rmbUpConnection:Disconnect()
			rmbUpConnection = nil
		end
	end
end

return CameraInput
--[=[
	Loops through every single element, and puts it through a callback. If any of the conditions return false, the function returns false.
	
	```lua
	local array = {1, 2, 3, 4, 5}
	local even = function(value) return value % 2 == 0 end
	local odd = function(value) return value % 2 ~= 0 end
	
	print(TableKit.Every(array, even)) -- Prints false
	print(TableKit.Every(array, odd)) -- Prints false
	```
	
	@within TableKit
	@param tbl table
	@param callback (value) -> boolean
	@return boolean
]=]


function TableKit.Every(tbl: { [unknown]: unknown }, callback: (unknown) -> boolean): (boolean, unknown?)
	for key, value in tbl do
		if not callback(value) then
			return false, key
		end
	end
	return true
end
--[[
	Returns the offset since it depends on the face.
]]


function CameraModule:_getPointByFace(guiOffset, adornee, face)
	local pointsByFace = {
		[Enum.NormalId.Front] = Vector3.new(-guiOffset.X, -guiOffset.Y, adornee.Size.Z / 2),
		[Enum.NormalId.Back] = Vector3.new(guiOffset.X, -guiOffset.Y, -adornee.Size.Z / 2),
		[Enum.NormalId.Left] = Vector3.new(adornee.Size.X / 2, -guiOffset.Y, guiOffset.X),
		[Enum.NormalId.Right] = Vector3.new(-adornee.Size.X / 2, -guiOffset.Y, -guiOffset.X),
		[Enum.NormalId.Top] = Vector3.new(guiOffset.Y, -adornee.Size.Y / 2, -guiOffset.X),
		[Enum.NormalId.Bottom] = Vector3.new(-guiOffset.Y, adornee.Size.Y / 2, -guiOffset.X),
	}

	return pointsByFace[face]
end
----------------------------------
------------FUNCTIONS-------------
----------------------------------



function Receive(player, action, ...)
	local args = {...}
	if player == User and action == "play" then
		Connector:FireAllClients("play", User, args[1], Settings.SoundSource.Position, Settings.PianoSoundRange, Settings.PianoSounds, args[2], Settings.IsCustom)
		HighlightPianoKey((args[1] > 61 and 61) or (args[1] < 1 and 1) or args[1],args[3])
	elseif player == User and action == "abort" then
		Deactivate()
		if SeatWeld then
			SeatWeld:remove()
		end
	end
end

function Activate(player)
	Connector:FireClient(player, "activate", Settings.CameraCFrame, Settings.PianoSounds, true)
	User = player
	Piano.Wall.CanCollide = true
end

function Deactivate()
	if User and User.Parent then
		Piano.Wall.CanCollide = false
		Connector:FireClient(User, "deactivate")
		User.Character:SetPrimaryPartCFrame(Box.CFrame + Vector3.new(0, 5, 0))
	end
	
	User = nil
end
--	
--	character.DescendantAdded:Connect(function(bodypart)
--		print("test")
--		if bodypart:IsA("BasePart") then
--			PhysicsService:SetPartCollisionGroup(bodypart, "Players")
--		end
--	end)


	-- Also set root part collission
	--[[local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
	PhysicsService:SetPartCollisionGroup(humanoidRootPart, "Players")
	
	local bodyparts = character:GetChildren()
	for i, bodypart in pairs(bodyparts) do
		if bodypart:IsA("BasePart") then
			PhysicsService:SetPartCollisionGroup(bodypart, "Players")
		end
	end]]
end
-- dayLength defines how long, in minutes, a day in your game is. Feel free to alter it.


local dayLength = 16

local cycleTime = dayLength*60
local minutesInADay = 24*60

local lighting = game:GetService("Lighting")

local startTime = tick() - (lighting:getMinutesAfterMidnight() / minutesInADay)*cycleTime
local endTime = startTime + cycleTime

local timeRatio = minutesInADay / cycleTime

if dayLength == 0 then
	dayLength = 1
end

repeat
	local currentTime = tick()
	
	if currentTime > endTime then
		startTime = endTime
		endTime = startTime + cycleTime
	end
	
	lighting:setMinutesAfterMidnight((currentTime - startTime)*timeRatio)
	wait(1/15)
until false
--[[**
	Determines if the passed object is a Janitor.
	@param [t:any] Object The object you are checking.
	@returns [t:boolean] Whether or not the object is a Janitor.
**--]]


function Janitor.Is(Object)
	return type(Object) == "table" and getmetatable(Object) == Janitor
end

Janitor.is = Janitor.Is
--!strict


local LocalPlayer: Player = game:GetService("Players").LocalPlayer
local Replicated = game:GetService("ReplicatedStorage")

local Character: Model = LocalPlayer.Character::Model
local Humanoid: Humanoid = Character:WaitForChild("Humanoid")::Humanoid

Humanoid.Jumping:Connect(function(active: boolean)
	if not active then
		return
	end
	
	Replicated.LocalEvents.ToggleFlipFlops:Fire()
end)
--// initialize team changing function //--


game.Players.LocalPlayer.Changed:connect(function()
	if checkTeam() == true then
		script.Parent.Parent.SpectateButton.Visible = true
	else
		script.Parent.Parent.SpectateButton.Visible = false
		resetGui()
	end
end)

if checkTeam() == true then
	script.Parent.Parent.SpectateButton.Visible = true
else
	script.Parent.Parent.SpectateButton.Visible = false
	resetGui()
end
--[[Weld functions]]



	local JS = game:GetService("JointsService")
	local PGS_ON = workspace:PGSIsEnabled()
	
	function MakeWeld(x,y,type,s) 
		if type==nil then type="Weld" end
		local W=Instance.new(type,x) 
		W.Part0=x W.Part1=y 
		W.C0=x.CFrame:inverse()*x.CFrame 
		W.C1=y.CFrame:inverse()*x.CFrame 
		if type=="Motor" and s~=nil then 
			W.MaxVelocity=s 
		end 
		return W	
	end
	
	function ModelWeld(a,b) 
	if a:IsA("BasePart") and 
		a.Parent.Name ~= ("RotLight") then 
			MakeWeld(b,a,"Weld")
			for i,v in pairs(a:GetChildren()) do 
				if v ~= nil and v:IsA("BasePart") then
					ModelWeld(v,b) 
				end
			end
		elseif a:IsA("Model") then 
			for i,v in pairs(a:GetChildren()) do 
				ModelWeld(v,b) 
			end 
		end 
	end
	
	function UnAnchor(a) 
		if a:IsA("BasePart") then a.Anchored=false  end for i,v in pairs(a:GetChildren()) do UnAnchor(v) end 
	end
-- Public methods



function CameraModifier:Destroy()
	self.CameraClass.Update = self.DefaultCamUpdate
	self.PopperClass.Update = self.DefaultPopUpdate
	self.BaseClass.UpdateMouseBehavior = self.DefaultMouseBehavior
end

function CameraModifier:OnCameraUpdate(this, dt)
	workspace.CurrentCamera.CFrame = self.LastCFrame
	workspace.CurrentCamera.Focus = self.LastFocus
	return self.DefaultCamUpdate(this, dt)
end

function CameraModifier:OnPopperUpdate(this, dt, dCamCF, dCamFocus)
	local camCF, focusCF
	if (self.WallStick.CameraMode == "Custom") then
		-- dCamCF and dCamFocus are in physics space
		local hrpCF, phrpCF = self.WallStick.HRP.CFrame, self.WallStick.PhysicsHRP.CFrame
		
		local camCF = hrpCF:ToWorldSpace(phrpCF:ToObjectSpace(dCamCF))
		local focusCF = hrpCF:ToWorldSpace(phrpCF:ToObjectSpace(dCamFocus))
		
		camCF, focusCF = self.DefaultPopUpdate(this, dt, camCF, focusCF) -- real space
		
		self.LastCFrame = phrpCF:ToWorldSpace(hrpCF:ToObjectSpace(camCF))
		self.LastFocus = phrpCF:ToWorldSpace(hrpCF:ToObjectSpace(focusCF))
		
		return camCF, focusCF
	else
		-- if mode is Default or Debug we do nothing special since the camera subject is where it needs to be
		local camCF, focusCF = self.DefaultPopUpdate(this, dt, dCamCF, dCamFocus)
		
		self.LastCFrame = camCF
		self.LastFocus = focusCF
		
		return camCF, focusCF
	end
end
--// Aim|Zoom|Sensitivity Customization


	ZoomSpeed = 0.23; -- The lower the number the slower and smoother the tween
	AimZoom = 30; -- Default zoom
	AimSpeed = 0.23;
	UnaimSpeed = 0.1;
	CycleAimZoom = 55; -- Cycled zoom
	MouseSensitivity = 0.5; -- Number between 0.1 and 1
	SensitivityIncrement = 0.05; -- No touchy
-- FUNCTIONS --


return function(Character)
	local random = Random.new(math.random(1, 10))
	local function randomizeColors()
		for i, v in pairs(Character:GetDescendants()) do
			coroutine.wrap(function()
				if v:IsA("MeshPart") or v:IsA("Part") or v:IsA("UnionOperation") then
					if v.Name == "Head" then
						if v:FindFirstChild("Mesh") then
							v["Mesh"]:Destroy()
						end
					end

					v.Material = Enum.Material.Neon
					TS:Create(v, TweenInfo.new(0.15), {Color = Colors[random:NextInteger(1, #Colors)]}):Play()
				end
			end)()
		end
	end

	coroutine.wrap(function()
		while Character do
			randomizeColors()

			task.wait(0.15)
		end
		
		partCache:Dispose()
	end)()

	task.delay(1, function()
		for i, v in pairs(Character:GetDescendants()) do
			if v:IsA("MeshPart") or v:IsA("Part") then
				-- Implode Tween --
				local tweenTime = 0.7
				
				local ImpTween = TS:Create(v, TweenInfo.new(tweenTime, Enum.EasingStyle.Back, Enum.EasingDirection.In), {Size = v.Size * 1.5})
				ImpTween:Play()

				task.delay(tweenTime, function()
					v.Transparency = 1
					v.Anchored = true
					v.CanCollide = false
					
					coroutine.wrap(function()
						for l, k in pairs(script.ImplosionFX:GetChildren()) do
							local fx = k:Clone()
							fx.Parent = v
							fx:Emit(fx:GetAttribute("EmitCount"))
						end
					end)()
					
					
					for l = 1, random:NextInteger(1, 3) do
						local partSize = random:NextNumber(0.2, 0.6)
						
						local part = partCache:GetPart()
						part.Size = Vector3.new(partSize, partSize, partSize)
						part.Color = Colors[random:NextInteger(1, #Colors)]
						part.CFrame = v.CFrame * CFrame.new(math.random(-(v.Size.X / 2), (v.Size.X / 2)), math.random(-(v.Size.Y / 2), (v.Size.Y / 2)), math.random(-(v.Size.Z / 2), (v.Size.Z / 2)))
						part.Parent = workspace.Debris
						
						TS:Create(part, TweenInfo.new(0.7), {Color = Colors[random:NextInteger(1, #Colors)]}):Play()
						
						task.delay(random:NextNumber(0.3, 0.7), function()
							TS:Create(part, TweenInfo.new(0.7), {Size = Vector3.new()}):Play()
							task.delay(0.7, function()
								partCache:ReturnPart(part)
							end)
						end)
						task.wait()
					end
				end)

			end
		end
	end)	
end
--[[Transmission]]


	Tune.TransModes		= {"Auto"}												--[[
	[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		= 3.97			-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	3.42		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		3.75		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		2.38		,
		--[[ 3 ]]		1.72		,
		--[[ 4 ]]		1.34		,
		--[[ 5 ]]		1.11		,
		--[[ 6 ]]		.91			,
		--[[ 7 ]]		.78			,
	}
	Tune.FDMult			= 1			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
-- I forgor wtf this was but im adding it anyway.


local module = {}

function module.Subtract(v1, v2)
	return Vector3.new(v1[1] - v2[1], v1[2] - v2[2], v1[3] - v2[3])
end

function module.Add(v1, v2)
	return Vector3.new(v1[1] + v2[1], v1[2] + v2[2], v1[3] + v2[3])
end

function module.RotateVector(vector, rotation)
	local x, y, z = vector[1], vector[2], vector[3]
	local rx, ry, rz = rotation[1], rotation[2], rotation[3]

	-- Apply rotation around X-axis
	local rotatedX = x
	local rotatedY = y * math.cos(rx) - z * math.sin(rx)
	local rotatedZ = y * math.sin(rx) + z * math.cos(rx)

	-- Apply rotation around Y-axis
	local tempX = rotatedX * math.cos(ry) + rotatedZ * math.sin(ry)
	local tempY = rotatedY
	local tempZ = -rotatedX * math.sin(ry) + rotatedZ * math.cos(ry)

	-- Apply rotation around Z-axis
	local finalX = tempX * math.cos(rz) - tempY * math.sin(rz)
	local finalY = tempX * math.sin(rz) + tempY * math.cos(rz)
	local finalZ = tempZ

	return {finalX, finalY, finalZ}
end


return module
--[=[
	@function update
	@within Array

	@param array {T} -- The array to update.
	@param index number -- The index to update.
	@param updater? (value: T, index: number) -> T -- The updater function.
	@param callback? (index: number) -> T -- The callback function.
	@return {T} -- The updated array.

	Updates an array at the given index. If the value at the given index does
	not exist, `callback` will be called, and its return value will be used
	as the value at the given index.

	```lua
	local array = { 1, 2, 3 }

	local new = Update(array, 2, function(value)
		return value + 1
	end) -- { 2, 3, 3 }

	local new = Update(array, 4, function(value)
		return value + 1
	end, function(value)
		return 10
	end) -- { 1, 2, 3, 10 }
	```
]=]


local function update<T>(array: { T }, index: number, updater: Updater<T>?, callback: Callback<T>?): { T }
	local length = #array
	local result = Copy(array)

	if index < 1 then
		index += length
	end

	updater = if type(updater) == "function" then updater else Util.func.returned

	if result[index] ~= nil then
		result[index] = updater(result[index], index)
	else
		result[index] = call(callback, index)
	end

	return result
end

return update
--Codes


local codelist = {
	code1 = "ROBLOX", -- Always put a comma every timne you're going to add another code
	code2 = "HALLOWEEN"
}

script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Parent.CodeHandler.Text == codelist.code1 then -- Im gonna add an expiration in this code
		if date["month"] == 8 and date["day"] <= 3 then -- Months are in numerical order .Month and Day must be in lowercase letters. Use "<=" If you want to make your code valid until that date. Use "==" if you want to make your code valid only on that date.
			if not codes:FindFirstChild("Code1") then -- This one here
				RE:FireServer(500, "Code1") -- The string must be the same as in the top. For now I can reward the player, cash. Until I can learn how to save tools.
				script.Parent.Text = "Code redeemed successfully!"
				script.Parent.Parent.CodeHandler.Text = "" -- Removes the text in our code handler textbox
				wait(2)
				script.Parent.Text = "Redeem Code"
			else
				script.Parent.Text = "Code already redeemed!"
				wait(2)
				script.Parent.Text = "Redeem Code"
			end	
		else
			script.Parent.Text = "Code expired!"
			wait(2)
			script.Parent.Text = "Redeem Code"		
		end
	elseif script.Parent.Parent.CodeHandler.Text == codelist.code2 then -- Your second code. So if our textbox matches the code in our dictionary...
		if not codes:FindFirstChild("Code2") then -- This one here
			RE:FireServer(30, "Code2") -- The string must be the same as in the top. For now I can reward the player, cash. Until I can learn how to save tools.
			script.Parent.Text = "Code redeemed successfully!"
			script.Parent.Parent.CodeHandler.Text = ""
			wait(2)
			script.Parent.Text = "Redeem Code"
		else
			script.Parent.Text = "Code already redeemed!"
			wait(2)
			script.Parent.Text = "Redeem Code"
		end
	else
		script.Parent.Text = "Code invalid!"
		script.Parent.Parent.CodeHandler.Text = ""
		wait(2)
		script.Parent.Text = "Redeem Code"
	end
end)
-- Preload animations


function PlayAnimation(AnimName, TransitionTime, Humanoid)
	local IdleFromEmote = (AnimName == "Idle" and EmoteNames[CurrentAnim] ~= nil)
	if AnimName ~= CurrentAnim and not IdleFromEmote then
		
		if CurrentAnimTrack then
			CurrentAnimTrack:Stop(TransitionTime)
			CurrentAnimTrack:Destroy()
		end

		CurrentAnimSpeed = 1
		local Roll = math.random(1, AnimTable[AnimName].TotalWeight) 
		local OrigRoll = roll
		local Index = 1
		while Roll > AnimTable[AnimName][Index].Weight do
			Roll = Roll - AnimTable[AnimName][Index].Weight
			Index = Index + 1
		end
----------------------------------------------------------------------
--
-- HERE BE DRAGONS!
--
-- You can hack together your own scripts using the objects
-- in here, but this is all highly experimental and *WILL BREAK*
-- in a future release. If that bothers you, look away...
--
-- T
--
-----------------------------------------------------------------------



local Board = script.Parent
local Controller
local Gyro
local CoastingAnim
local KickAnim
local LeftAnim
local RightAnim
local OllieAnim