Roblox/luau_corpus huggingface dataset:
--[[
--▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬--
				   May, 3rd 2021
			    Created by NovemberReject

  Put this script in Workspace or ServerScriptService
   Set technology "ShadowMap" in Lighting properties

--▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬--
]]


local Vignette = true -- change to false if you don't want a shadow frame



local Lighting = game:GetService("Lighting")
local StarterGui = game:GetService("StarterGui")
local Bloom = Instance.new("BloomEffect")
local Blur = Instance.new("BlurEffect")
local ColorCor = Instance.new("ColorCorrectionEffect")
local SunRays = Instance.new("SunRaysEffect")
local Sky = Instance.new("Sky")
local Atm = Instance.new("Atmosphere")


for i, v in pairs(Lighting:GetChildren()) do
	if v then
		v:Destroy()
	end
end

Bloom.Parent = Lighting
Blur.Parent = Lighting
ColorCor.Parent = Lighting
SunRays.Parent = Lighting
Sky.Parent = Lighting
Atm.Parent = Lighting

if Vignette == true then
	local Gui = Instance.new("ScreenGui")
	Gui.Parent = StarterGui
	Gui.IgnoreGuiInset = true
	
	local ShadowFrame = Instance.new("ImageLabel")
	ShadowFrame.Parent = Gui
	ShadowFrame.AnchorPoint = Vector2.new(0.5,1)
	ShadowFrame.Position = UDim2.new(0.5,0,1,0)
	ShadowFrame.Size = UDim2.new(1,0,1.05,0)
	ShadowFrame.BackgroundTransparency = 1
	ShadowFrame.Image = "rbxassetid://4576475446"
	ShadowFrame.ImageTransparency = 0.3
	ShadowFrame.ZIndex = 10
end

Bloom.Intensity = 0.85
Bloom.Size = 17
Bloom.Threshold = 0.8

Blur.Size = 5

ColorCor.Brightness = 0.1
ColorCor.Contrast = 0.5
ColorCor.Saturation = -0.3
ColorCor.TintColor = Color3.fromRGB(255, 235, 203)

SunRays.Intensity = 0.075
SunRays.Spread = 0.727

Sky.SkyboxBk = "http://www.roblox.com/asset/?id=151165214"
Sky.SkyboxDn = "http://www.roblox.com/asset/?id=151165197"
Sky.SkyboxFt = "http://www.roblox.com/asset/?id=151165224"
Sky.SkyboxLf = "http://www.roblox.com/asset/?id=151165191"
Sky.SkyboxRt = "http://www.roblox.com/asset/?id=151165206"
Sky.SkyboxUp = "http://www.roblox.com/asset/?id=151165227"
Sky.SunAngularSize = 10

Lighting.Ambient = Color3.fromRGB(2,2,2)
Lighting.Brightness = 2.25
Lighting.ColorShift_Bottom = Color3.fromRGB(0,0,0)
Lighting.ColorShift_Top = Color3.fromRGB(0,0,0)
Lighting.EnvironmentDiffuseScale = 0.2
Lighting.EnvironmentSpecularScale = 0.2
Lighting.GlobalShadows = true
Lighting.OutdoorAmbient = Color3.fromRGB(0,0,0)
Lighting.ShadowSoftness = 0.2
Lighting.ClockTime = 17
Lighting.GeographicLatitude = 45
Lighting.ExposureCompensation = 0.5

Atm.Density = 0.364
Atm.Offset = 0.556
Atm.Color = Color3.fromRGB(199, 175, 166)
Atm.Decay = Color3.fromRGB(44, 39, 33)
Atm.Glare = 0.36
Atm.Haze = 1.72

script:Destroy()
-- Bind the input event
game:GetService("UserInputService").InputBegan:Connect(onInput)
game:GetService("UserInputService").InputEnded:Connect(onInput)
--- Cleans up tracking resources.
function ScopeHierarchyItemButton:willUnmount()
    self.Maid:Destroy()
end
--local Energia = PastaVar.Energia
local Ferido = PastasStan.Ferido
local Caido = PastasStan.Caido
local ouch = Caido
local rodeath = PastasStan.rodeath


local o2 = PastasStan.o2
local dead = PastasStan.dead
local life = PastasStan.life
-----------------
--| Functions |--
-----------------
-- Removes any old creator tags and applies a new one to the target
local function ApplyTags(target)
	while target:FindFirstChild('creator') do
		target.creator:Destroy()
	end

	local creatorTagClone = CreatorTag:Clone()
	DebrisService:AddItem(creatorTagClone, 1.5)
	creatorTagClone.Parent = target
end
--[[
	~= EXAMPLE CODE =~
	return function(gui,gTable,guiData)
		local name = gTable.Name
		if name == "YesNoPrompt" then
			local new = Instance.new("ScreenGui")
			local frame = Instance.new("Frame",new)
			frame.Size = UDim2.new(0,400,0,400)
			local yes = Instance.new("TextButton",frame)
			yes.Size = UDim2.new(0.5,0,1,0)
			yes.Text = "Yes"
			local no = yes:Clone()
			no.Text = "No"
			no.Position = UDim2.new(0.5,0,0,0)
			
			local gTable,gIndex = client.UI.Register(new)
			
			local ans
			local waiting = true
			
			gTable.CustomDestroy = function()
				waiting = false
			end
			
			yes.MouseButton1Click:connect(function()
				ans = "Yes"
				gTable:Destroy()
			end)
			
			no.MouseButton1Click:connect(function()
				ans = "No"
				gTable:Destroy()
			end)
			
			repeat wait() until ans or not waiting  --// Wait until answer
			return ans or false
		end
	end
	
--]]

service = nil
Routine = nil
client = nil

return function(gui, guiData, gTable)
	local contents = {}
	local lerper = 0.5
	local switch = false
	local targetColor = Color3.new(math.random(),math.random(),math.random())
	local classes = {
		Frame = true;
		TextBox = true;
		TextLabel = true;
		TextButton = true;
		ImageLabel = true;
		ImageButton = true; 
		ScrollingFrame = true;
	}
	
	local function getCont(obj)
		for i,v in pairs(obj:GetChildren()) do 
			if classes[v.ClassName] then
				table.insert(contents,v)
				getCont(v)
			end
		end
	end
	
	if classes[gui.ClassName] then
		table.insert(contents,gui)
	end
	
	getCont(gui)
	
	if gTable.Name == "List" then
		gui.Drag.Main.BackgroundTransparency = 0
	end
	
	local increment = 0.001
	local max = 0.7
	local min = 0.1
	local r,g,b = 0.1,0.5,0.8
	local rt,gt,bt = true,true,true 
	local sequence = {
		Color3.fromRGB(255, 85, 88), 
		Color3.fromRGB(78, 140, 255), 
		Color3.fromRGB(202, 255, 10)
	}
	
	local function lerpToColor(color1, color2, inc, time)
		local inc = inc or 0.1
		for i = 0, 1, inc do
			for i2,v in next,contents do
				if v.Name ~= "CapeColor" and v.Name ~= "Color" then
					v.BackgroundColor3 = color1:lerp(color2, i)
					if v:IsA("ImageLabel") or v:IsA("ImageButton") then
						v.ImageColor3 = color1:lerp(color2, i)
					end
				end
			end
			wait(time/(1/inc))
		end
	end
	
	service.TrackTask("Thread: Colorize_"..tostring(gTable.Name),function()
		while ((gTable.Active and wait()) or wait(1)) and not gTable.Destroyed do
			for i,v in next,sequence do
				local one, two = sequence[i], sequence[1]
				
				if i == #sequence then
					two = sequence[1]
				else
					two = sequence[i+1]
				end
				
				lerpToColor(one, two, 0.01, 2)
			end
		end
	end)
end
---------------------------------------------------

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

CustomText = CustomLabel["CUSTOMFLOORLABEL"]

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

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



function SetDisplay(ID,CHAR)
	if This.Display:FindFirstChild("Matrix"..ID) and Characters[CHAR] ~= nil then
 		for i,l in pairs(Characters[CHAR]) do 
			for r=1,5 do	
				This.Display["Matrix"..ID]["Row"..i]["D"..r].Visible = (l:sub(r,r) == "1" and true or false)
			end
		end
	end
end

for M = 1, Displays do
	for R = 1, 7 do
		for D = 1, 5 do
			This.Display["Matrix"..M]["Row"..R]["D"..D].BackgroundColor3 = DisplayColor
		end
	end
end
--- Runs hooks matching name and returns nil for ok or a string for cancellation
function Dispatcher:RunHooks(hookName, commandContext, ...)
	if not self.Registry.Hooks[hookName] then
		error(("Invalid hook name: %q"):format(hookName), 2)
	end

	if
		hookName == "BeforeRun"
		and #self.Registry.Hooks[hookName] == 0
		and commandContext.Group ~= "Admin"
		and commandContext.Group ~= "UserAlias"
		and commandContext:HasImplementation()
	then

		if RunService:IsStudio() then
			if displayedBeforeRunHookWarning == false then
				commandContext:Reply((RunService:IsServer() and "<Server>" or "<Client>") .. " Commands will not run in-game if no BeforeRun hook is configured. Learn more: https://eryn.io/Cmdr/guide/Hooks.html", Color3.fromRGB(255,228,26))
				displayedBeforeRunHookWarning = true
			end
		else
			return "Command blocked for security as no BeforeRun hook is configured."
		end
	end

	for _, hook in ipairs(self.Registry.Hooks[hookName]) do
		local value = hook.callback(commandContext, ...)

		if value ~= nil then
			return tostring(value)
		end
	end
end

function Dispatcher:PushHistory(text)
	assert(RunService:IsClient(), "PushHistory may only be used from the client.")

	local history = self:GetHistory()

	-- Remove duplicates
	if Util.TrimString(text) == "" or text == history[#history] then
		return
	end

	history[#history + 1] = text

	TeleportService:SetTeleportSetting(HISTORY_SETTING_NAME, history)
end

function Dispatcher:GetHistory()
	assert(RunService:IsClient(), "GetHistory may only be used from the client.")

	return TeleportService:GetTeleportSetting(HISTORY_SETTING_NAME) or {}
end

return function (cmdr)
	Dispatcher.Cmdr = cmdr
	Dispatcher.Registry = cmdr.Registry

	return Dispatcher
end
----
local bindable = Instance.new("BindableEvent", script)
bindable.Name = "DamageEvent"
bindable.Event:Connect(_onDamage)
-- Wait for the client's initial replication to complete.
-- This should allow us to avoid having a mountian of WaitForChilds 😅
if not game:IsLoaded() then
	game.Loaded:Wait()
end
--- Compute offset

function Module._computePosition()
	local viewSize = Camera.ViewportSize
	local aspectRatio = viewSize.X / viewSize.Y

	local offset = UDim2Absolute(Module.Position)
	local position = offset / viewSize

	-- Taken from ScreenSpace
	local hFactor = math.tan(math.rad(Camera.FieldOfView) / 2)
	local wFactor = hFactor * aspectRatio

	return -position.X * wFactor * 2, position.Y * hFactor * 2
end

function Module._computeSize()
	local size = UDim2Absolute(Module.Size) / Camera.ViewportSize
	return size.X, size.Y
end

function Module._getOffset()
	local x, y = Module._computePosition()
	local w, h = Module._computeSize()

	return CFrame.new(
		0, 0, 0,

		w, 0, 0,
		0, h, 0,
		x, y, 1
	)
end
--[[ << PERMISSION TYPES >>																																							
<PermissionNumber>		<PermissionName>																																																	]]local Owner local HeadAdmin local Admin local Mod local VIP--[[
auto					Owner			-- Type ;cmds to view all Owner commands
4						HeadAdmin		-- Type ;cmds to view all HeadAdmin commands
3						Admin			-- Type ;cmds to view all Admin commands
2						Mod				-- Type ;cmds to view all Mod commands
1						VIP				-- Can only use commands on theirself. Type ;cmds to view all VIP commands																		
0						Everyone		-- Setting a command to this permission type will allow anyone to use it																															]]
--// Positioning
	SprintPos = CFrame.new(0, 0, 0, 0.844756603, -0.251352191, 0.472449303, 0.103136979, 0.942750931, 0.317149073, -0.525118113, -0.219186768, 0.822318792);
-- function

return function(character, grinding)
	local rootPart	= character.HumanoidRootPart
	local grindAtt	= rootPart.GrindAttachment
	
	grindAtt.SparkEmitter.Enabled	= grinding
	
	if grinding then
		grindAtt.GrindSound:Play()
	else
		grindAtt.GrindSound:Stop()
	end
end
-- Decompiled with the Synapse X Luau decompiler.

local v1 = {
	Name = "edit", 
	Aliases = {}, 
	Description = "Edit text in a TextBox", 
	Group = "DefaultUtil", 
	Args = { {
			Type = "string", 
			Name = "Input text", 
			Description = "The text you wish to edit", 
			Default = ""
		}, {
			Type = "string", 
			Name = "Delimiter", 
			Description = "The character that separates each line", 
			Default = ","
		} }
};
local u1 = nil;
local u2 = {
	AnchorPoint = Vector2.new(0.5, 0.5), 
	BackgroundColor3 = Color3.fromRGB(17, 17, 17), 
	BackgroundTransparency = 0.05, 
	BorderColor3 = Color3.fromRGB(17, 17, 17), 
	BorderSizePixel = 20, 
	ClearTextOnFocus = false, 
	MultiLine = true, 
	Position = UDim2.new(0.5, 0, 0.5, 0), 
	Size = UDim2.new(0.5, 0, 0.4, 0), 
	Font = Enum.Font.Code, 
	TextColor3 = Color3.fromRGB(241, 241, 241), 
	TextWrapped = true, 
	TextSize = 18, 
	TextXAlignment = "Left", 
	TextYAlignment = "Top", 
	AutoLocalize = false, 
	PlaceholderText = "Right click to exit"
};
local l__Players__3 = game:GetService("Players");
function v1.ClientRun(p1, p2, p3)
	u1 = u1 or p1.Cmdr.Util.Mutex();
	local v2 = u1();
	p1:Reply("Right-click on the text area to exit.", Color3.fromRGB(158, 158, 158));
	local v3 = Instance.new("ScreenGui");
	v3.Name = "CmdrEditBox";
	v3.ResetOnSpawn = false;
	local v4 = Instance.new("TextBox");
	for v5, v6 in pairs(u2) do
		v4[v5] = v6;
	end;
	v4.Text = p2:gsub(p3, "\n");
	v4.Parent = v3;
	v3.Parent = l__Players__3.LocalPlayer:WaitForChild("PlayerGui");
	local u4 = coroutine.running();
	v4.InputBegan:Connect(function(p4)
		if p4.UserInputType == Enum.UserInputType.MouseButton2 then
			coroutine.resume(u4, v4.Text:gsub("\n", p3));
			v3:Destroy();
			v2();
		end;
	end);
	return coroutine.yield();
end;
return v1;
--------------------------------------------------------------------------------------
--------------------[ VARIABLES ]-----------------------------------------------------
--------------------------------------------------------------------------------------

local Selected = false

local playerMass = 0

local Forward = false
local Backward = false

local Idling = false
local Walking = false
local Running = false

local crawlCamRot = 0
local crawlAlpha = 0
local idleAlpha = 1
local walkAlpha = 0
local isCrawling = false
local isIdling = false
local isWalking = false
local isRunning = false

local Aimed = false
local Aiming = false
local aimAlpha = 0
local headOffset = VEC2(COS(RAD(90) - S.aimSettings.headTilt) * 0.5, 1 + SIN(RAD(90) - S.aimSettings.headTilt) * 0.5)

local Reloading = false
local breakReload = false
local magVisible = true
local newMag = false

local Knifing = false

local MB1Down = false
local Firing = false
local canFire = true
local fireFunction = nil
local firstShot = false
local shotCount = 0
local lastSideRecoil = {0, 0}
local recoilAnim = {
	Pos = V3();
	Rot = V3();
	Code = nil;
}

local numModes = 0
local rawFireMode = 1
local canSelectFire = true
local guiAngOffset = 0
local Modes = {}

local onGround = true
local startFallHeight = 0
local jumpAnim = {
	Pos = 0;
	Rot = 0;
	Code = 0;
}

local runReady = true
local runKeyPressed = false
local chargingStamina = false

local AimingIn = false
local AimingOut = false

local Stamina = S.sprintTime * 60
local currentSteadyTime = S.scopeSettings.steadyTime * 60

local camSteady = false
local takingBreath = false
local steadyKeyPressed = false

local Grip = nil
local aimedGripCF = nil

local spreadZoom = "unAimed"
local spreadStance = "Stand"
local spreadMotion = "Idling"
local baseSpread = S.spreadSettings.unAimed.Stand.Idling
local currentSpread = 0
local loweringSpread = false

local mouseSensitivity = S.sensitivitySettings.Default
local aimSensitivity = S.sensitivitySettings.Aim
local lastSensUpdate = 0

local ammoInClip = 0

local Stance = 0
local stanceSway = 1
local camSway = 1

local camAng = VEC2()

local armTilt = 0
local moveAng = 0
local animCode = 0

local desiredXOffset = 0
local desiredYOffset = 0
local currentXOffset = 0
local currentYOffset = 0
local aimHeadOffset = 0
local recoilAnimMultiplier = 1
local jumpAnimMultiplier = 1
local translationDivisor = 7
local rotationMultiplier = S.momentumSettings.Amplitude.unAimed
local armTiltMultiplier = 1

local equipAnimPlaying = false

local crossOffset = 0

local camOffsets = {
	guiScope = {
		Rot = V3();
	};
	Reload = {
		Rot = V3();
		Code = nil;
	};
	Recoil = {
		Rot = V3();
		Code = nil;
	};
}

local Anim = {
	Pos = V3();
	Rot = V3();
	Ang = 0;
	Code = 0;
}

local lastBeat = 0

local gunParts = {}

local Connections = {}

local Keys = {}
-- Connect the button's click event to the function
button.MouseButton1Click:Connect(onButtonClicked)
-- ROBLOX FIXME: Can we define ClientChatModules statically in the project config
pcall(function() ChatLocalization = require((game:GetService("Chat") :: any).ClientChatModules.ChatLocalization :: any) end)

function CreateWelcomeMessageLabel(messageData, channelName)
	local message = messageData.Message
	if ChatLocalization and ChatLocalization.LocalizeFormattedMessage then
		message = ChatLocalization:LocalizeFormattedMessage(message)
	end
	local extraData = messageData.ExtraData or {}
	local useFont = extraData.Font or ChatSettings.DefaultFont
	local useTextSize = extraData.FontSize or ChatSettings.ChatWindowTextSize
	local useChatColor = extraData.ChatColor or ChatSettings.DefaultMessageColor
	local useChannelColor = extraData.ChannelColor or useChatColor

	local BaseFrame, BaseMessage = util:CreateBaseMessage(message, useFont, useTextSize, useChatColor)
	local ChannelButton = nil

	if channelName ~= messageData.OriginalChannel then
			local localizedChannelName = messageData.OriginalChannel
			if ChatLocalization.tryLocalize then
				localizedChannelName = ChatLocalization:tryLocalize(messageData.OriginalChannel)
			end
			local formatChannelName = string.format("{%s}", localizedChannelName)
			ChannelButton = util:AddChannelButtonToBaseMessage(BaseMessage, useChannelColor, formatChannelName, messageData.OriginalChannel)
			local numNeededSpaces = util:GetNumberOfSpaces(formatChannelName, useFont, useTextSize) + 1
			BaseMessage.Text = string.rep(" ", numNeededSpaces) .. message
	end

	local function GetHeightFunction(xSize)
		return util:GetMessageHeight(BaseMessage, BaseFrame, xSize)
	end

	local FadeParmaters = {}
	FadeParmaters[BaseMessage] = {
		TextTransparency = {FadedIn = 0, FadedOut = 1},
		TextStrokeTransparency = {FadedIn = 0.75, FadedOut = 1}
	}

	if ChannelButton then
		FadeParmaters[ChannelButton] = {
			TextTransparency = {FadedIn = 0, FadedOut = 1},
			TextStrokeTransparency = {FadedIn = 0.75, FadedOut = 1}
		}
	end

	local FadeInFunction, FadeOutFunction, UpdateAnimFunction = util:CreateFadeFunctions(FadeParmaters)

	return {
		[util.KEY_BASE_FRAME] = BaseFrame,
		[util.KEY_BASE_MESSAGE] = BaseMessage,
		[util.KEY_UPDATE_TEXT_FUNC] = nil,
		[util.KEY_GET_HEIGHT] = GetHeightFunction,
		[util.KEY_FADE_IN] = FadeInFunction,
		[util.KEY_FADE_OUT] = FadeOutFunction,
		[util.KEY_UPDATE_ANIMATION] = UpdateAnimFunction
	}
end

return {
	[util.KEY_MESSAGE_TYPE] = ChatConstants.MessageTypeWelcome,
	[util.KEY_CREATOR_FUNCTION] = CreateWelcomeMessageLabel
}
--script.Parent.Unequipped:Connect(function()
--	player.PlayerGui:FindFirstChild("AlterGui").Enabled = false
--end)

script.Parent.Activated:Connect(function(plr)
	--if debounce == false then
	--	debounce = true
	--end
	warn("Force Destroy activated")
	if mouse.Target then
		warn("target found")
		local target = mouse.Target
		if target.Parent:FindFirstChild("Humanoid") then
			local PlayerTargeted = target.Parent
			print(PlayerTargeted)
			remote:FireServer(PlayerTargeted)
			warn("destroy fired")
		end
	end
end)
--------------------------UTIL LIBRARY-------------------------------
local Utility = {}
do
	local function FindCharacterAncestor(part)
		if part then
			local humanoid = part:FindFirstChildOfClass("Humanoid")
			if humanoid then
				return part, humanoid
			else
				return FindCharacterAncestor(part.Parent)
			end
		end
	end
	Utility.FindCharacterAncestor = FindCharacterAncestor

	local function Raycast(ray, ignoreNonCollidable: boolean, ignoreList: {Model})
		ignoreList = ignoreList or {}
		local hitPart, hitPos, hitNorm, hitMat = Workspace:FindPartOnRayWithIgnoreList(ray, ignoreList)
		if hitPart then
			if ignoreNonCollidable and hitPart.CanCollide == false then
				-- We always include character parts so a user can click on another character
				-- to walk to them.
				local _, humanoid = FindCharacterAncestor(hitPart)
				if humanoid == nil then
					table.insert(ignoreList, hitPart)
					return Raycast(ray, ignoreNonCollidable, ignoreList)
				end
			end
			return hitPart, hitPos, hitNorm, hitMat
		end
		return nil, nil
	end
	Utility.Raycast = Raycast
end

local humanoidCache = {}
local function findPlayerHumanoid(player: Player)
	local character = player and player.Character
	if character then
		local resultHumanoid = humanoidCache[player]
		if resultHumanoid and resultHumanoid.Parent == character then
			return resultHumanoid
		else
			humanoidCache[player] = nil -- Bust Old Cache
			local humanoid = character:FindFirstChildOfClass("Humanoid")
			if humanoid then
				humanoidCache[player] = humanoid
			end
			return humanoid
		end
	end
end
--[[
	Assert that our expectation value is equal to another value within some
	inclusive limit.
]]
function Expectation:near(otherValue, limit)
	assert(type(self.value) == "number", "Expectation value must be a number to use 'near'")
	assert(type(otherValue) == "number", "otherValue must be a number")
	assert(type(limit) == "number" or limit == nil, "limit must be a number or nil")

	limit = limit or 1e-7

	local result = (math.abs(self.value - otherValue) <= limit) == self.successCondition

	local message = formatMessage(self.successCondition,
		("Expected value to be near %f (within %f) but got %f instead"):format(
			otherValue,
			limit,
			self.value
		),
		("Expected value to not be near %f (within %f) but got %f instead"):format(
			otherValue,
			limit,
			self.value
		)
	)

	assertLevel(result, message, 3)
	self:_resetModifiers()

	return self
end
--!strict
local LuauPolyfill = script.Parent

local Array = require(LuauPolyfill.Array)
local Object = require(LuauPolyfill.Object)
local instanceOf = require(LuauPolyfill.instanceof)
type Object = Object.Object
type Array<T> = Array.Array<T>
type Table<T, V> = { [T]: V }
type Tuple<T, V> = Array<T | V>
type callbackFn<K, V> = (element: V, key: K, map: Map<K, V>) -> ()
type callbackFnWithThisArg<K, V> = (thisArg: Object, value: V, key: K, map: Map<K, V>) -> ()

local Map = {}

export type Map<K, V> = {
	size: number,
	-- method definitions
	set: (self: Map<K, V>, K, V) -> Map<K, V>,
	get: (self: Map<K, V>, K) -> V | nil,
	clear: (self: Map<K, V>) -> (),
	delete: (self: Map<K, V>, K) -> boolean,
	forEach: (self: Map<K, V>, callback: callbackFn<K, V> | callbackFnWithThisArg<K, V>, thisArg: Object?) -> (),
	has: (self: Map<K, V>, K) -> boolean,
	keys: (self: Map<K, V>) -> Array<K>,
	values: (self: Map<K, V>) -> Array<V>,
	entries: (self: Map<K, V>) -> Array<Tuple<K, V>>,
	ipairs: (self: Map<K, V>) -> any,
	[K]: V,
	_map: { [K]: V },
	_array: { [number]: K },
}

function Map.new<K, V>(iterable: Array<Array<any>>?): Map<K, V>
	local array = {}
	local map = {}
	if iterable ~= nil then
		local arrayFromIterable
		local iterableType = typeof(iterable)
		if iterableType == "table" then
			if #iterable > 0 and typeof(iterable[1]) ~= "table" then
				error("cannot create Map from {K, V} form, it must be { {K, V}... }")
			end

			arrayFromIterable = Array.from(iterable)
		else
			error(("cannot create array from value of type `%s`"):format(iterableType))
		end

		for _, entry in ipairs(arrayFromIterable) do
			local key = entry[1]
			if _G.__DEV__ then
				if key == nil then
					error("cannot create Map from a table that isn't an array.")
				end
			end
			local val = entry[2]
			-- only add to array if new
			if map[key] == nil then
				table.insert(array, key)
			end
			-- always assign
			map[key] = val
		end
	end

	return (setmetatable({
		size = #array,
		_map = map,
		_array = array,
	}, Map) :: any) :: Map<K, V>
end

function Map:set<K, V>(key: K, value: V): Map<K, V>
	-- preserve initial insertion order
	if self._map[key] == nil then
		-- Luau FIXME: analyze should know self is Map<K, V> which includes size as a number
		self.size = self.size :: number + 1
		table.insert(self._array, key)
	end
	-- always update value
	self._map[key] = value
	return self
end

function Map:get(key)
	return self._map[key]
end

function Map:clear()
	local table_: any = table
	self.size = 0
	table_.clear(self._map)
	table_.clear(self._array)
end

function Map:delete(key): boolean
	if self._map[key] == nil then
		return false
	end
	-- Luau FIXME: analyze should know self is Map<K, V> which includes size as a number
	self.size = self.size :: number - 1
	self._map[key] = nil
	local index = table.find(self._array, key)
	if index then
		table.remove(self._array, index)
	end
	return true
end