Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[=[
	Repeatedly calls a Promise-returning function up to `times` number of times, waiting `seconds` seconds between each
	retry, until the returned Promise resolves.

	If the amount of retries is exceeded, the function will return the latest rejected Promise.

	@since v3.2.0
	@param callback (...: P) -> Promise<T>
	@param times number
	@param seconds number
	@param ...? P
]=]


function Promise.retryWithDelay(callback, times, seconds, ...)
	assert(isCallable(callback), "Parameter #1 to Promise.retry must be a function")
	assert(type(times) == "number", "Parameter #2 (times) to Promise.retry must be a number")
	assert(type(seconds) == "number", "Parameter #3 (seconds) to Promise.retry must be a number")

	local args, length = { ... }, select("#", ...)

	return Promise.resolve(callback(...)):catch(function(...)
		if times > 0 then
			Promise.delay(seconds):await()

			return Promise.retryWithDelay(callback, times - 1, seconds, unpack(args, 1, length))
		else
			return Promise.reject(...)
		end
	end)
end
--[[

	enumList = EnumList.new(name: string, enums: string[])

	enumList:BelongsTo(item): boolean


	Example:

		direction = EnumList.new("Direction", {"Up", "Down", "Left", "Right"})
		leftDir = direction.Left
		print("IsDirection", direction:BelongsTo(leftDir))

--]]




type EnumNames = {string}

local Symbol = require(script.Parent.Symbol)
--		print(animName .. " * " .. idx .. " [" .. origRoll .. "]")


		local anim = animTable[animName][idx].anim

		if (toolAnimInstance ~= anim) then
			
			if (toolAnimTrack ~= nil) then
				toolAnimTrack:Stop()
				toolAnimTrack:Destroy()
				transitionTime = 0
			end
					
			-- load it to the humanoid; get AnimationTrack
			toolAnimTrack = humanoid:LoadAnimation(anim)
			 
			-- play the animation
			toolAnimTrack:Play(transitionTime)
			toolAnimName = animName
			toolAnimInstance = anim

			currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:Connect(toolKeyFrameReachedFunc)
		end
end

function stopToolAnimations()
	local oldAnim = toolAnimName

	if (currentToolAnimKeyframeHandler ~= nil) then
		currentToolAnimKeyframeHandler:Disconnect()
	end

	toolAnimName = ""
	toolAnimInstance = nil
	if (toolAnimTrack ~= nil) then
		toolAnimTrack:Stop()
		toolAnimTrack:Destroy()
		toolAnimTrack = nil
	end


	return oldAnim
end
--



local Supports = {}

function Supports.PointCloud(set, direction)
	local max, maxDot = set[1], set[1]:Dot(direction)
	for i = 2, #set do
		local dot = set[i]:Dot(direction)
		if (dot > maxDot) then
			max = set[i]
			maxDot = dot
		end
	end
	return max
end

function Supports.Cylinder(set, direction)
	local cf, size2 = unpack(set)
	direction = cf:VectorToObjectSpace(direction)
	local radius = math.min(size2.y, size2.z)
	local dotT, cPoint = direction:Dot(RIGHT), Vector3.new(size2.x, 0, 0)
	local h, t, final
	
	if (dotT == 0) then
		final = direction.Unit * radius
	else
		cPoint = dotT > 0 and cPoint or -cPoint
		h, t = rayPlane(ZERO, direction, cPoint, RIGHT)
		final = cPoint + (h - cPoint).Unit * radius
	end
	
	return cf:PointToWorldSpace(final)
end

function Supports.Ellipsoid(set, direction)
	local cf, size2 = unpack(set)
	return cf:PointToWorldSpace(size2 * (size2 * cf:VectorToObjectSpace(direction)).Unit)
end

return Supports
-- GameplayUi


local InteractionBillboard = PlayerGui.InteractionBillboard
local GameplayUi = PlayerGui.GameplayUi
local StatsBar = GameplayUi.StatsBar
local Level = StatsBar.Level
local ProgressBar = StatsBar.ProgressBar
local ProgressBarContainer = ProgressBar.Container
local ProgressBarFill = ProgressBarContainer.Fill
local Star1 = StatsBar.Star1
local Star2 = StatsBar.Star2
local Star3 = StatsBar.Star3
local ClickButton = GameplayUi.ClickButton
local showLevelUpBanner = require(GameplayUi.LevelUpBanner.AnimateLevelUpBanner)
--------------------[ JUMPING ANIMATION ]---------------------------------------------



function onFall(initialVelocity)
	spawn(function()
		local velocityAlpha = math.max(math.min(initialVelocity / Humanoid.JumpPower, 1), 0)
		local startJumpPos = jumpAnim.Pos
		local startJumpRot = jumpAnim.Rot
		local endJumpPos = 0.04 * S.fallSettings.fallMultiplier * velocityAlpha
		local endJumpRot = RAD(4) * S.fallSettings.fallMultiplier * velocityAlpha
		local t0 = tick()
		while true do
			RS.Heartbeat:wait()
			local Alpha = math.min((tick() - t0) / 0.15, 1) * 90
			if onGround then break end
			jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Sine(Alpha))
			jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Sine(Alpha))
			if Alpha == 90 then break end
		end
		startJumpPos = endJumpPos
		startJumpRot = endJumpRot
		endJumpPos = -0.08 * S.fallSettings.fallMultiplier
		endJumpRot = -RAD(8) * S.fallSettings.fallMultiplier
		local X = 1
		while true do
			local dt = RS.Heartbeat:wait()
			X = X + (dt * 60) / X
			local Alpha = (X - 1) / 15
			if onGround then break end
			jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Alpha)
			jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Alpha)
		end
	end)
end

function onLand(fallDist)
	spawn(function()
		local animAlpha = math.min(fallDist, S.fallSettings.maxDist) * (2 / 3)
		local startJumpPos = jumpAnim.Pos
		local startJumpRot = jumpAnim.Rot
		local endJumpPos = animAlpha / 100 * S.fallSettings.landMultiplier * (runReady and 1 or 2)
		local endJumpRot = RAD(animAlpha) * S.fallSettings.landMultiplier * (runReady and 1 or 2)
		local t0 = tick()
		while true do
			RS.Heartbeat:wait()
			local Alpha = math.min((tick() - t0) / 0.2, 1)
			if (not onGround) then break end
			jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Alpha)
			jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Alpha)
			if Alpha == 1 then break end
		end
		t0 = tick()
		while true do
			RS.Heartbeat:wait()
			local Alpha = math.min((tick() - t0) / 0.3, 1) * 90
			if (not onGround) then break end
			jumpAnim.Pos = numLerp(endJumpPos, 0, Sine(Alpha))
			jumpAnim.Rot = numLerp(endJumpRot, 0, Sine(Alpha))
			if Alpha == 90 then break end
		end
	end)
end

function onHumanoidStateChanged(oldState, newState)
	if newState == Enum.HumanoidStateType.Freefall then
		onGround = false
		if S.fallAnimation then
			onFall(HRP.Velocity.Y)
			while HRP.Velocity.Y > 0 do RS.RenderStepped:wait() end
			startFallHeight = HRP.Position.Y
		end
	elseif oldState == Enum.HumanoidStateType.Freefall then
		onGround = true
		if S.fallAnimation then
			local fallDist = startFallHeight - HRP.Position.Y
			onLand(fallDist)
		end
	end
end
--[[Weight and CG]]


	Tune.Weight			= 3321		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensionws in studs ; larger = more stable)
	 --[[Width]]		6.5		,
	 --[[Height]]		4.8		,
	 --[[Length]]		17		}
	Tune.WeightDist		= 51		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .7		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .1		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- Rear Wheel Density
	Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
	Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]
	
	Tune.AxleSize		= 2			-- Size of structural members (larger = MORE STABLE / carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members
-- << LOCAL FUNCTION >>


local function selectSuggestion(props)
	local newInput = ""
	local suggestion = props.suggestionLabels["Label"..props.suggestionPos]
	if props.specificArg then
		newInput = suggestion.Name.." "
		--
		props.textBox.Text = newInput
		coroutine.wrap(function()
			for i = 1,10 do
				props.textBox:ReleaseFocus()
				wait()
			end
		end)()
		wait()
		props.textBox.Text = newInput
	else
		local newInputTable = {}
		local argPosCount = -1
		local firstChar = string.sub(props.textBox.Text,1,1)
		props.textBox.Text:gsub('([^'..main.pdata.SplitKey..']+)',function(c) argPosCount = argPosCount + 1 if argPosCount > suggestion.ArgPos-1 then return end table.insert(newInputTable, c.." ") end);
		if argPosCount == 0 and (firstChar == main.settings.UniversalPrefix or firstChar == main.pdata.Prefix) then
			newInput = firstChar
		end
		newInput = newInput..table.concat(newInputTable, "")
		newInput = newInput..suggestion.Name
		newInput = newInput..main.pdata.SplitKey
		--
		props.textBox.Text = newInput
		wait()
		props.textBox.Text = newInput
		props.textBox:CaptureFocus()
		props.textBox.CursorPosition = #newInput+1
	end
end
-- Controls the lighting effects depending on the player's setting.
-- 
-- ForbiddenJ



Effect1 = game.Lighting.DefaultBloom
Effect2 = game.Lighting.DefaultColorCorrection
LightingFXEnabled = game.ReplicatedStorage.ClientConfig.LightingFXEnabled

function Update()
	Effect1.Enabled = LightingFXEnabled.Value
	Effect2.Enabled = LightingFXEnabled.Value
end

LightingFXEnabled:GetPropertyChangedSignal("Value"):Connect(Update)

Update()
--// GUI Variables


local PlayerGUI = Player:WaitForChild("PlayerGui")
local MainUI = PlayerGUI:WaitForChild("MainUI") 
local PetUI = MainUI.PetsFrame
local PetsFrame = PetUI.Inventory.Frame
local ScrollingFrame = PetsFrame
local UIGridLayout = ScrollingFrame.UIGridLayout
local shrinkOn = PetUI.Resize.ShrinkOn

local getSizes = function()
	if shrinkOn.Value == true then
		return Vector2.new(0.02, 0.03), Vector2.new(0.23, 0.28), 4
	else
		return Vector2.new(0.03, 0.04), Vector2.new(0.32, 0.37), 3
	end
end
--				local Destructible = ExplosionTouchPart:FindFirstChild("RocketDestructible")
--				if Destructible and Destructible.Value and RadiusFromBlast < BLAST_RADIUS then
--					Destructible.Value = false
--					
--					RunLocalEffect:FireAllClients("FadePart",ExplosionTouchPart)
--					Debris:AddItem(ExplosionTouchPart,3)
--				end


		
				--Set the velocity of the part.
				local DeltaPos = ExplosionTouchPart.Position - Position
				local Normal = DeltaPos.magnitude == 0 and Vector3.new(0,1,0) or DeltaPos.unit
				local PartRadius = ExplosionTouchPart.Size.magnitude / 2
				local SurfaceArea = PartRadius * PartRadius
				
				local Impulse = Normal * BLAST_PRESSURE * SurfaceArea * (1 / 4560)
				local Fraction = 1
				if IsInCharacter then
					Fraction = 1 - math.max(0, math.min(1,(RadiusFromBlast - 2) / BLAST_RADIUS))
				end				
				
				local CurrentVelocity = ExplosionTouchPart.Velocity
				local DeltaVelocity = Impulse / ExplosionTouchPart:GetMass()
				local BodyVelocity = Instance.new("BodyVelocity")
				BodyVelocity.Velocity = CurrentVelocity + DeltaVelocity
				BodyVelocity.Parent = ExplosionTouchPart
				
				local ForceNeeded = 196.2 * ExplosionTouchPart:GetMass()
				BodyVelocity.MaxForce = Vector3.new(ForceNeeded,ForceNeeded,ForceNeeded) * 10 * Fraction
				Debris:AddItem(BodyVelocity,0.2/FORCE_GRANULARITY)
				
				local RotImpulse = Impulse * 0.5 * RadiusFromBlast
				local CurrentRotVelocity = ExplosionTouchPart.RotVelocity
				local MomentOfInertia = (2 * ExplosionTouchPart:GetMass() * RadiusFromBlast * RadiusFromBlast/5) 
				local DeltaRotVelocity = RotImpulse / MomentOfInertia 
				local AngularVelocity = Instance.new("BodyAngularVelocity")
				local TorqueNeeded = 20 * MomentOfInertia
				AngularVelocity.MaxTorque = Vector3.new(TorqueNeeded,TorqueNeeded,TorqueNeeded) * 10 * Fraction
				AngularVelocity.AngularVelocity = CurrentRotVelocity + DeltaRotVelocity
				AngularVelocity.Parent = ExplosionTouchPart
				Debris:AddItem(AngularVelocity,0.2/FORCE_GRANULARITY)
			end
		end
		
		--Create the explosion.
		local Explosion = Instance.new("Explosion")
		Explosion.BlastPressure = 0
		Explosion.BlastRadius = BLAST_RADIUS
		Explosion.Position = Position
		Explosion.Hit:Connect(OnExplosionHit)
		Explosion.Parent = game.Workspace
		
		--Reparent the script to the explosion and destroy the rocket.
		FiredByValue.Parent = script
		script.Parent = Explosion
		Rocket:Destroy()
	end
end
--[[ SCRIPT VARIABLES ]]


local CHAT_BUBBLE_FONT = Enum.Font.SourceSans
local CHAT_BUBBLE_FONT_SIZE = Enum.FontSize.Size24 -- if you change CHAT_BUBBLE_FONT_SIZE_INT please change this to match
local CHAT_BUBBLE_FONT_SIZE_INT = 24 -- if you change CHAT_BUBBLE_FONT_SIZE please change this to match
local CHAT_BUBBLE_LINE_HEIGHT = CHAT_BUBBLE_FONT_SIZE_INT + 10
local CHAT_BUBBLE_TAIL_HEIGHT = 14
local CHAT_BUBBLE_WIDTH_PADDING = 30
local CHAT_BUBBLE_FADE_SPEED = 1.5

local BILLBOARD_MAX_WIDTH = 400
local BILLBOARD_MAX_HEIGHT = 250	--This limits the number of bubble chats that you see above characters

local ELIPSES = "..."
local MaxChatMessageLength = 128 -- max chat message length, including null terminator and elipses.
local MaxChatMessageLengthExclusive = MaxChatMessageLength - string.len(ELIPSES) - 1

local NEAR_BUBBLE_DISTANCE = 65	--previously 45
local MAX_BUBBLE_DISTANCE = 100	--previously 80
--[[Weight Scaling]]


	--[Cubic stud : pounds ratio]
	--[STANDARDIZED: Don't touch unless needed]
	Tune.WeightScaling = 1/50	--Default = 1/50 (1 cubic stud = 50 lbs)
	Tune.LegacyScaling = 1/50	--Default = 1/10 (1 cubic stud = 10 lbs) [PGS OFF]
	
return Tune
-- Overloads functions in Roblox's TransparencyController 
-- module with replacement functions in the FpsCamera.



function FpsCamera:MountTransparency(Transparency)
	local baseUpdate = Transparency.Update
	
	if baseUpdate then
		Transparency.BaseUpdate = baseUpdate
		Transparency.Update = self.UpdateTransparency
	else
		self:Warn("MountTransparency - Could not find Transparency:Update()!")
	end
	
	if Transparency.IsValidPartToModify then
		Transparency.IsValidPartToModify = self.IsValidPartToModify
		Transparency.HeadAttachments = self.HeadAttachments
		Transparency.ForceRefresh = true
	else
		self:Warn("MountTransparency - Could not find Transparency:IsValidPartToModify(part)!")
	end
	
	if Transparency.SetupTransparency then
		Transparency.BaseSetupTransparency = Transparency.SetupTransparency
		Transparency.SetupTransparency = self.SetupTransparency
	else
		self:Warn("MountTransparency - Could not find Transparency:SetupTransparency(character)!")
	end
end
-----------------------------------------------





function findAllFlagStands(root)
	local c = root:children()
	for i=1,#c do
		if (c[i].className == "Model" or c[i].className == "Part") then
			findAllFlagStands(c[i])
		end
		if (c[i].className == "FlagStand") then
			table.insert(stands, c[i])
		end
	end
end

function hookUpListeners()
	for i=1,#stands do
		stands[i].FlagCaptured:connect(onCaptureScored)
	end
end

function onPlayerEntered(newPlayer)

	if CTF_mode == true then

		local stats = Instance.new("IntValue")
		stats.Name = "leaderstats"

		local captures = Instance.new("IntValue")
		captures.Name = "Captures"
		captures.Value = 0


		captures.Parent = stats

		-- VERY UGLY HACK
		-- Will this leak threads?
		-- Is the problem even what I think it is (player arrived before character)?
		while true do
			if newPlayer.Character ~= nil then break end
			wait(5)
		end

		stats.Parent = newPlayer

	else

		local stats = Instance.new("IntValue")
		stats.Name = "leaderstats"

		local kills = Instance.new("IntValue")
		kills.Name = "Laps"
		kills.Value = 0

		local deaths = Instance.new("IntValue")
		deaths.Name = "Wipeouts"
		deaths.Value = 0

		kills.Parent = stats
		deaths.Parent = stats

		-- VERY UGLY HACK
		-- Will this leak threads?
		-- Is the problem even what I think it is (player arrived before character)?
		while true do
			if newPlayer.Character ~= nil then break end
			wait(5)
		end

		local humanoid = newPlayer.Character.Humanoid

		humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )

		-- start to listen for new humanoid
		newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )


		stats.Parent = newPlayer

	end

end


function onCaptureScored(player)

		local ls = player:findFirstChild("leaderstats")
		if ls == nil then return end
		local caps = ls:findFirstChild("Captures")
		if caps == nil then return end
		caps.Value = caps.Value + 1

end


findAllFlagStands(game.Workspace)
hookUpListeners()
if (#stands > 0) then CTF_mode = true end
game.Players.ChildAdded:connect(onPlayerEntered)
--[[script.Parent.Examinar.MouseButton1Down:connect(function()
	if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.ExaminarAberto.Visible == false then
	Saude.Variaveis.Doer.Value = true
	Timer.Barra.Size = UDim2.new(0,0,1,0)
	TS:Create(Timer.Barra, TweenInfo.new(5), {Size =  UDim2.new(1,0,1,0)}):Play()
	wait(5)
	script.Parent.Parent.ExaminarAberto.Visible = true
	script.Parent.Parent.ExaminarAberto.Base.DiagnoseHandler.Disabled = false
	Saude.Variaveis.Doer.Value = false
	end
end)]]



script.Parent.Circulation.MouseButton1Down:connect(function()
	if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.Circulation.Visible == false then
	--Saude.Variaveis.Doer.Value = true
	--Timer.Barra.Size = UDim2.new(0,0,1,0)
	--TS:Create(Timer.Barra, TweenInfo.new(.25), {Size =  UDim2.new(1,0,1,0)}):Play()
	--wait(.25)
	script.Parent.Parent.Circulation.Visible = true
	script.Parent.Parent.Resuscitation.Visible = false
	
	script.Parent.Parent.Analgesic.Visible = false
	--Saude.Variaveis.Doer.Value = false
	end
end)

script.Parent.Resuscitation.MouseButton1Down:connect(function()
	if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.Resuscitation.Visible == false then
	--Saude.Variaveis.Doer.Value = true
	--Timer.Barra.Size = UDim2.new(0,0,1,0)
	--TS:Create(Timer.Barra, TweenInfo.new(.25), {Size =  UDim2.new(1,0,1,0)}):Play()
	--wait(.25)
	script.Parent.Parent.Circulation.Visible = false
	script.Parent.Parent.Resuscitation.Visible = true
	
	script.Parent.Parent.Analgesic.Visible = false
	--Saude.Variaveis.Doer.Value = false
	end
end)

script.Parent.Analgesic.MouseButton1Down:connect(function()
	if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.Analgesic.Visible == false then
	--Saude.Variaveis.Doer.Value = true
	--Timer.Barra.Size = UDim2.new(0,0,1,0)
	--TS:Create(Timer.Barra, TweenInfo.new(.25), {Size =  UDim2.new(1,0,1,0)}):Play()
	--wait(.25)
	script.Parent.Parent.Circulation.Visible = false
	script.Parent.Parent.Resuscitation.Visible = false
	script.Parent.Parent.Analgesic.Visible = true
	--Saude.Variaveis.Doer.Value = false
	end
end)
--Codes


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

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(300, "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)
------------------------------------------------------------------------------------------
-- чтение потомков и добавление их в UI


local Checked = true -- защита от многократного считывания
local function UpdateList()
	if Checked then
		Checked = false
		
		-- забрать всех из Listing и поместить потомками в UI
		local tmp = ls:GetChildren()
		if #tmp then -- проверка на наличие потомков
--local debris = game:GetService("Debris")



local bot = script.Parent -- bot stuff
local bhum = bot:WaitForChild('Humanoid')
local bhrp = bot:WaitForChild('HumanoidRootPart')

local findPath = PFS:CreatePath({WaypointSpacing = math.huge})
local actPath = PFS:CreatePath({WaypointSpacing = math.huge})

local followedChar -- the one we are already following

local char -- the one which we follow

local function nearestChar()
	while wait() do
		local nearChar, nearDist = nil, nil
		local distance
		local firstPos

		for i,v in pairs(workspace:GetChildren()) do
			if v:FindFirstChild('Humanoid') and v ~= bot and not (v:FindFirstChild('Nextbot') or v:FindFirstChild('NPC')) and v.Humanoid.Health > 0 and v:FindFirstChild('HumanoidRootPart') then
				findPath:ComputeAsync(bhrp.Position, v.HumanoidRootPart.Position)
				if findPath.Status == Enum.PathStatus.Success then
					distance = 0
					for i,waypoint in ipairs(findPath:GetWaypoints()) do
						if i ~= 1 then
							distance = distance + (waypoint.Position - firstPos).Magnitude
						end
						firstPos = waypoint.Position
					end
					if nearDist == nil then
						nearDist = distance
						nearChar = v
					else
						if distance < nearDist then
							nearDist = distance
							nearChar = v
						end
					end
				end
			end
		end
		char = nearChar
	end
end

spawn(nearestChar)

local count = 0

RunS.Heartbeat:Connect(function()
	if count >= 3 then -- You may change this number to your liking, but if you set it too low nextbot will lag
		count = 0
		if char ~= nil and char:FindFirstChild('HumanoidRootPart') then
			actPath:ComputeAsync(bhrp.Position, char.HumanoidRootPart.Position)
			for i,v in ipairs(actPath:GetWaypoints()) do
				if i ~= 1 then
					bhum:MoveTo(v.Position)
					bhum.MoveToFinished:Wait()
				end
			end
		end
	else
		count = count + 1
	end
end)
--[[
	Allows forwarding of refs to underlying host components. Accepts a render
	callback which accepts props and a ref, and returns an element.
]]


local function forwardRef(render)
	if config.typeChecks then
		assert(typeof(render) == "function", "Expected arg #1 to be a function")
	end

	return function(props)
		local ref = props[Ref]
		local propsWithoutRef = assign({}, props, excludeRef)

		return render(propsWithoutRef, ref)
	end
end

return forwardRef