Pinkstack/roblox-luau-corpus-text huggingface dataset:
--- Cleans up tracking resources.


function ScopeHUD:willUnmount()
    self.Maid:Destroy()
end

function ScopeHUD:render()
    return new('Frame', {
        Active = true;
        Draggable = true;
        Position = self.state.IsToolModeEnabled and
            UDim2.new(0, 10/2, 1, -8/2) or
            UDim2.new(0, 10/2, 0, 8/2);
        AnchorPoint = self.state.IsToolModeEnabled and
            Vector2.new(0, 1) or
            Vector2.new(0, 0);
        Size = self.ContainerSize;
        BackgroundTransparency = 1;
        [Roact.Event.InputBegan] = self.OnInputBegin;
        [Roact.Event.InputEnded] = self.OnInputEnd;
    },
    Support.Merge(self:BuildScopeHierarchyButtons(), {
        Layout = new('UIListLayout', {
            [Roact.Ref] = self.LayoutRef;
            FillDirection = Enum.FillDirection.Horizontal;
            HorizontalAlignment = Enum.HorizontalAlignment.Left;
            VerticalAlignment = Enum.VerticalAlignment.Center;
            SortOrder = Enum.SortOrder.LayoutOrder;
            Padding = UDim.new(0, 5/2);
        });
        ModeToggle = new(ModeToggle, {
            Core = self.props.Core;
            IsToolModeEnabled = self.state.IsToolModeEnabled;
        });
    }))
end
--
--inputS.TouchStarted:Connect(function(object)
--	if object == Enum.KeyCode.DPadUp or seat.Throttle == 1 then
--		w=true
--	elseif object == Enum.KeyCode.DPadLeft or seat.Steer == -1 then
--		a=true	
--	elseif object == Enum.KeyCode.DPadDown or seat.Throttle == -1 then
--		s=true	
--	elseif object == Enum.KeyCode.DPadRight or seat.Steer == 1 then
--		d=true			
--	end
--end)



inputS.InputEnded:connect(function(input)
	local code=input.KeyCode
	if code==Enum.KeyCode.LeftShift then
		up=false
	elseif input.KeyCode==Enum.KeyCode.LeftControl then
		dn=false
	end
end)
-- << VARIABLES >>


local topBar = main.gui.CustomTopBar
local coreToHide = {"Chat", "PlayerList"}
local originalCoreStates = {};
local cmdBar = main.gui.CmdBar
local isOpen = false
local currentProps = {}
local originalTopBarTransparency = 1
local originalTopBarVisibility = true
local mainProps
mainProps = {
	maxSuggestions = 5;
	mainParent = cmdBar;
	textBox = cmdBar.SearchFrame.TextBox;
	rframe = cmdBar.ResultsFrame;
	suggestionPos = 1;
	suggestionDisplayed = 0;
	forceExecute = false;
	highlightColor = Color3.fromRGB(50,50,50);
	otherColor = Color3.fromRGB(80,80,80);
	suggestionLabels = {};
	currentBarCommand = nil;
}
--- Add a task to clean up
-- @usage
-- Maid[key] = (function)         Adds a task to perform
-- Maid[key] = (event connection) Manages an event connection
-- Maid[key] = (thread)           Manages a thread
-- Maid[key] = (Maid)             Maids can act as an event connection, allowing a Maid to have other maids to clean up.
-- Maid[key] = (Object)           Maids can cleanup objects with a `Destroy` method
-- Maid[key] = nil                Removes a named task. If the task is an event, it is disconnected. If it is an object,
--                                it is destroyed.


function Maid:__newindex(index, newTask)
	if Maid[index] ~= nil then
		error(("Cannot use '%s' as a Maid key"):format(tostring(index)), 2)
	end

	local tasks = self._tasks
	local oldTask = tasks[index]

	if oldTask == newTask then
        	return
	end

	tasks[index] = newTask

	if oldTask then
		if type(oldTask) == "function" then
			oldTask()
		elseif type(oldTask) == "thread" then
			local cancelled
			if coroutine.running() ~= oldTask then
				cancelled = pcall(function()
					task.cancel(oldTask)
				end)
			end

			if not cancelled then
				task.defer(function()
					task.cancel(oldTask)
				end)
			end
		elseif typeof(oldTask) == "RBXScriptConnection" then
			oldTask:Disconnect()
		elseif oldTask.Destroy then
			oldTask:Destroy()
		end
	end
end
-- 1 == if two players vote yes, and two players vote no, the player gets kicked


conf.MinimumVotesRequired = 2 -- This is recommended to be at 2 to prevent a player from kicking the second player in the server

conf.PlayerVoteKickCooldown = 120 -- How long between a single player being able to start a vote kick
conf.VoteKickCooldown = 30 -- How long between all vote kicks
conf.KickTime = 15 -- How much time is given to vote kick

return conf
--[[
	Updates all Tween objects.
]]


local function updateAllTweens()
	local now = os.clock()
	-- FIXME: Typed Luau doesn't understand this loop yet
	for tween in allTweens :: any do
		local currentTime = now - tween._currentTweenStartTime

		if currentTime > tween._currentTweenDuration then
			if tween._currentTweenInfo.Reverses then
				tween._currentValue = tween._prevValue
			else
				tween._currentValue = tween._nextValue
			end
			tween._currentlyAnimating = false
			updateAll(tween)
			TweenScheduler.remove(tween)
		else
			local ratio = getTweenRatio(tween._currentTweenInfo, currentTime)
			local currentValue = lerpType(tween._prevValue, tween._nextValue, ratio)
			tween._currentValue = currentValue
			tween._currentlyAnimating = true
			updateAll(tween)
		end
	end
end

RunService:BindToRenderStep(
	"__FusionTweenScheduler",
	Enum.RenderPriority.First.Value,
	updateAllTweens
)

return TweenScheduler
-- /**
--  * Return items (for example, of an array)
--  * with spacing, indentation, and comma
--  * without surrounding punctuation (for example, brackets)
--  **/


local function printListItems(
	list: { [number]: any },
	config: Config,
	indentation: string,
	depth: number,
	refs: Refs,
	printer: Printer
): string
	local result = ""

	if #list > 0 then
		result = result .. config.spacingOuter

		local indentationNext = indentation .. config.indent

		for i = 1, #list do
			result ..= indentationNext

			if list[i] ~= nil then
				result ..= printer(list[i], config, indentationNext, depth, refs)
			end

			-- ROBLOX deviation: < #list instead of #list - 1 because of 1-indexing
			if i < #list then
				result = result .. "," .. config.spacingInner
			elseif not config.min then
				result = result .. ","
			end
		end

		result = result .. config.spacingOuter .. indentation
	end

	return result
end

return {
	printTableEntries = printTableEntries,
	printListItems = printListItems,
}
--[[Config = require(script.Parent.Parent.Parent.Parent.Parent.CustomLabel)
CustomLabel = Config["CUSTOMFLOORLABEL"][tonumber(script.Parent.Parent.Name)]
script.Parent.SurfaceGui.Frame.TextLabel.Text = CustomLabel or script.Parent.Parent.Name]]



while true do
	script.Parent.SurfaceGui.Frame.ImageLabel.ImageColor3 = script.Parent.Parent.Light.Color
	if script.Parent.Parent.Light.Material == Enum.Material.Neon then
		script.Parent.SurfaceGui.LightInfluence = 0
	else
		script.Parent.SurfaceGui.LightInfluence = 1
	end
	wait()
end
-----------------
--| Constants |--
-----------------



local GRAVITY_ACCELERATION = workspace.Gravity

local RELOAD_TIME = 3 -- Seconds until tool can be used again
local ROCKET_SPEED = 60 -- Speed of the projectile

local MISSILE_MESH_ID = 'http://www.roblox.com/asset/?id=2251534'
local MISSILE_MESH_SCALE = Vector3.new(0.35, 0.35, 0.25)
local ROCKET_PART_SIZE = Vector3.new(1.2, 1.2, 3.27)
--//SS6 PLUGIN; SPLASH//--


  --//INSPARE 2017//--

local ai = script.Parent.Main_Frame.A.Frame.ImageLabel
local bi = script.Parent.Main_Frame.B.Frame.ImageLabel
local ci = script.Parent.Main_Frame.C.Frame.ImageLabel
local di = script.Parent.Main_Frame.D.Frame.ImageLabel
local ei = script.Parent.Main_Frame.E.Frame.ImageLabel
local a = "rbxassetid://757425958"
local b = "rbxassetid://759830238"
local c = "rbxassetid://759820270"
local d = "rbxassetid://759829474"
local e = "rbxassetid://759821278"

local selected
-- regeneration
--while true do
--	local s = wait(4)
--	local health = Humanoid.Health
--	if health > 0 and health < Humanoid.MaxHealth then
--		health = health + 0.08 * s * Humanoid.MaxHealth
--		if health * 1.05 < Humanoid.MaxHealth then
--			Humanoid.Health = health
--		else
--			Humanoid.Health = Humanoid.MaxHealth
--		end
--	end
--end
--[[
	This script handles all behavior for the dinosaur Blue in the Jurassic World Creator Challenge.	
	
	Note:
	With this script detached from the dinosaur-model, we can easily manage more dinosaurs at once! (How cool isn't that..?!)
	This script can also be moved into the Dinosaur if preferred. Just make sure to swap out "workspace:WaitForChild("Blue")" with
	script.Parent or similar. The target path should be the root model currently named "Blue" which contains a model named "Body".
--]]



local ReplicatedStorage = game:GetService("ReplicatedStorage")

local DinosaurModelTemplate = game.Workspace.Blue
DinosaurModelTemplate.Parent = nil
local Dinosaur = require(script.Dinosaur)

local AddToPopperCamIgnore = ReplicatedStorage.AddToPopperCamIgnore

local function spawnDinosaur()
	local DinosaurModel = DinosaurModelTemplate:Clone()
	DinosaurModel.Parent = game.Workspace
	local DinosaurAI = Dinosaur.new(DinosaurModel)
	AddToPopperCamIgnore:FireAllClients(DinosaurModel, true)	
	
	DinosaurModel.Body.Humanoid.Died:Connect(function()
		AddToPopperCamIgnore:FireAllClients(DinosaurModel, false)
		spawnDinosaur()
	end)
end

spawnDinosaur()
---This is a roblox module that has been slightly modified to provide the ImageId and ImageRectOffset/Size for gamepad button prompts.




local ControllerImageLibrary = {}

local spritesheets = {}
for _, platform in pairs(script.Spritesheets:GetChildren()) do
	spritesheets[platform.Name] = {}
	for _, style in pairs(platform:GetChildren()) do
		spritesheets[platform.Name][style.Name] = require(style).new()
	end
end

local function getImageInstance(instanceType, index, style)
	local platform = "XboxOne"
	if type(index)== "userdata" then
		index = string.sub(tostring(index), 14)
	end
	local sheet = spritesheets[platform][style]
	if not sheet then
		warn("Could not find style: " .. style)
		return
	end
	local element = sheet:GetSprite(instanceType, index)
	return element
end

function ControllerImageLibrary:GetImageLabel(index, style, platform)
	return getImageInstance("ImageLabel", index, style, platform)
end

function ControllerImageLibrary:GetImageButton(index, style, platform)
	return getImageInstance("ImageButton", index, style, platform)
end

return ControllerImageLibrary
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 550		--	[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	= 4.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 150		-- 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)
-- Don't edit if you don't know what you're doing --



local DataStoreService = game:GetService("DataStoreService")
local Players = game:GetService("Players")
local DataStore = DataStoreService:GetOrderedDataStore("GlobalLeaderboard_" .. statsName)
local Frame = script.Parent.Frame
local Contents = Frame.Contents
local Template = script.objTemplate

local COLORS = {
	Default = Color3.fromRGB(38, 50, 56),
	Gold = Color3.fromRGB(255, 215, 0),
	Silver = Color3.fromRGB(192, 192, 192),
	Bronze = Color3.fromRGB(205, 127, 50)
}
local ABBREVIATIONS = { "K", "M", "B", "T" }


local function toHumanReadableNumber(num)
	if num < 1000 then
		return tostring(num)
	end
	
	local digits = math.floor(math.log10(num)) + 1
	local index = math.min(#ABBREVIATIONS, math.floor((digits - 1) / 3))
	local front = num / math.pow(10, index * 3)
	
	return string.format("%i%s+", front, ABBREVIATIONS[index])
end

local function getItems()
	local data = DataStore:GetSortedAsync(false, maxItems, minValueDisplay, maxValueDisplay)
	local topPage = data:GetCurrentPage()

	Contents.Items.Nothing.Visible = #topPage == 0 and true or false

	for position, v in ipairs(topPage) do
		local userId = v.key
		local value = v.value
		local username = "[Not Available]"
		local color = COLORS.Default

		local success, err = pcall(function()
			username = Players:GetNameFromUserIdAsync(userId)
		end)

		if position == 1 then
			color = COLORS.Gold
		elseif position == 2 then
			color = COLORS.Silver
		elseif position == 3 then
			color = COLORS.Bronze
		end

		local item = Template:Clone()
		item.Name = username
		item.LayoutOrder = position
		item.Values.Number.TextColor3 = color
		item.Values.Number.Text = position
		item.Values.Username.Text = username
		item.Values.Value.Text = abbreviateValue and toHumanReadableNumber(value) or value
		item.Parent = Contents.Items
	end
end


script.Parent.Parent.Color = headingColor
Frame.Heading.ImageColor3 = headingColor
Frame.Heading.Bar.BackgroundColor3 = headingColor

while true do
	for _, player in pairs(Players:GetPlayers()) do
		local leaderstats = player:FindFirstChild("leaderstats")

		if not leaderstats then
			warn("Couldn't find leaderstats!")
			break
		end

		local statsValue = leaderstats:FindFirstChild(statsName)

		if not statsValue then
			warn("Couldn't find " .. statsName .. " in leaderstats!")
			break
		end

		pcall(function()
			DataStore:UpdateAsync(player.UserId, function()
				return tonumber(statsValue.Value)
			end)
		end)
	end

	for _, item in pairs(Contents.Items:GetChildren()) do
		if item:IsA("Frame") then
			item:Destroy()
		end
	end

	getItems()

	wait()
	Frame.Heading.Heading.Text = statsName .. " Leaderboard"
	Contents.GuideTopBar.Value.Text = statsName
	wait(updateEvery)
end
--[[
    Checks call backs on transition from, to, and calls them if they exist.
]]


function StateHolder:_callTransitionCallbacks(from, to)
	local globalCallback = self._callbacks.global

	if globalCallback then
		local globalLeave = globalCallback.onLeave
		local globalEnter = globalCallback.onEnter

		if globalLeave then
			globalLeave(self, from, to)
		end

		if globalEnter then
			globalEnter(self, from, to)
		end
	end

	local fromCallbacks = self._callbacks[from]

	if fromCallbacks and fromCallbacks.onLeave then
		fromCallbacks.onLeave(self, from, to)
	end

	local toCallbacks = self._callbacks[to]

	if toCallbacks and toCallbacks.onEnter then
		toCallbacks.onEnter(self, from, to)
	end
end
-- connect events


Humanoid.Died:connect(onDied)
Humanoid.Running:connect(onRunning)
Humanoid.Jumping:connect(onJumping)
Humanoid.Climbing:connect(onClimbing)
Humanoid.GettingUp:connect(onGettingUp)
Humanoid.FreeFalling:connect(onFreeFall)
Humanoid.FallingDown:connect(onFallingDown)
Humanoid.Seated:connect(onSeated)
Humanoid.PlatformStanding:connect(onPlatformStanding)
Humanoid.Swimming:connect(onSwimming)
local runService = game:GetService("RunService");
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
while Wait(0)do
local _,time=wait(0)
move(time)
end
----------------------------------------------------------------



local driverInSeat = false
local smokeOpacity_throttleOn = 0.5
local smokeOpacity_throttleOff = 0.1
local fireSize_big = 7
local fireSize_small = 3

function seatChildAddedHandler(child)
	if child.Name=="SeatWeld" then
		print("Turn car ON")
		driverInSeat = true
		if(hasSmoke) then 
			smoke.Enabled = true 
		end
		smoke.Opacity = smokeOpacity_throttleOff
		colorAll(headlights, lightColor_on)
		fire.Size = fireSize_big
		if(hasFire) then 
			fire.Enabled = true
		end
		wait(0.3)
		fire.Size = fireSize_small
		if seat.Throttle==0 then
			fire.Enabled = false
		end
	end
end

function seatChildRemovedHandler(child)
	if child.Name=="SeatWeld" then
		print("Turn car OFF")
		driverInSeat = false
		smoke.Enabled = false
		colorAll(headlights, lightColor_off)
	end
end

function showBigFire()
	fire.Size = fireSize_big
	if(hasFire) then
		fire.Enabled = true
	end
	wait(0.3)
	if seat.Throttle==1 then
		fire.Size = fireSize_small
	end
	wait(1)
	if seat.Throttle==1 then
		fire.Enabled = false
	end
end

function forwardFunction()
	--print("forwardFunction()")
end

function backwardFunction()
	--print("backwardFunction()")
end

function colorAll(parts, color)
	for i=1, #parts do
		parts[i].BrickColor = color
	end
end

function seatChangedHandler(prop)
	if prop=="Throttle" then
		if seat.Throttle==1 then
			-- Throttle Forward
			colorAll(brakelights, brakeColor_off)
			smoke.Opacity = smokeOpacity_throttleOn
			local co = coroutine.create(showBigFire)
			coroutine.resume(co)
			local co2 = coroutine.create(forwardFunction)
			coroutine.resume(co2)
		elseif seat.Throttle==0 then
			-- Throttle Off
			colorAll(brakelights, brakeColor_on)
			smoke.Opacity = smokeOpacity_throttleOff
			fire.Enabled = false
			wait(0.9)
			colorAll(brakelights, brakeColor_off)
		elseif seat.Throttle==-1 then
			-- Throttle Reverse
			colorAll(brakelights, lightColor_on)
			smoke.Opacity = smokeOpacity_throttleOff
			fire.Enabled = false
			local co = coroutine.create(backwardFunction)
			coroutine.resume(co)
		end
	end
end
--////////////////////////////// Include
--//////////////////////////////////////


local ChatConstants = require(replicatedModules:WaitForChild("ChatConstants"))
local Util = require(modulesFolder:WaitForChild("Util"))

local ChatLocalization = nil
pcall(function() ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization) end)
if ChatLocalization == nil then ChatLocalization = { Get = function(key,default) return default end } end
-- Infinitely update the target position for the tank


currentElev = 0;
currentRot = 0;
while wait() do
	if (myMouse) then
		-- Position of mouse in world
		mousePoint = myMouse.Hit.p;
		
		-- Vector from tank to mouse point
		targetVector = (mousePoint - parts.GunBase.CFrame.p).unit;
		
		-- Determine where the gun should point
		targetRotations = determineNewDirections(targetVector);
		
		-- For each time we do all that math to determine the angle, we will smoothly rotate the gun towards it in 4 increments
		-- This means less lag (fewer calculations) but it's still smooth
		for i = 1, 4 do		
			newRotations = getSmoothRotation(targetRotations);
			setTurretDirection(currentElev, currentRot);
			wait();
		end
	end
end
---Flash Script--- 




while true do

	script.Parent.Red.Transparency = 0.9
 
	script.Parent.Gre.Transparency = 0.9
	
	wait (0.4)
	
	script.Parent.Red.Transparency = 0.9
 
	script.Parent.Gre.Transparency = 0 
	
	wait (0.4)	 
	
end
--// # key, Wail


mouse.KeyDown:connect(function(key)
	if key=="r" then 
		if veh.Lightbar.middle.Wail.IsPlaying == true then
		veh.Lightbar.middle.Wail:Stop()
		veh.Lightbar.middle.Yelp:Stop()
		veh.Lightbar.middle.Priority:Stop()
		script.Parent.Parent.Sirens.Wail.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		veh.Lightbar.WAIL.Transparency = 1
		veh.Lightbar.YELP.Transparency = 1
		veh.Lightbar.PIER.Transparency = 1
		veh.Lightbar.STBY.Transparency = 0
		else
		veh.Lightbar.middle.Wail:Play()
		veh.Lightbar.middle.Yelp:Stop()
		veh.Lightbar.middle.Priority:Stop()
		script.Parent.Parent.Sirens.Wail.BackgroundColor3 = Color3.fromRGB(215, 135, 110)
		script.Parent.Parent.Sirens.Yelp.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		script.Parent.Parent.Sirens.Priority.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		veh.Lightbar.WAIL.Transparency = 0
		veh.Lightbar.YELP.Transparency = 1
		veh.Lightbar.PIER.Transparency = 1
		veh.Lightbar.STBY.Transparency = 1
		end
	end
end)
-- (Hat Giver Script - Loaded.)



debounce = true

function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Hat")
		p = Instance.new("Part")
		h.Name = "Army Hat"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = 0
		p.Size = Vector3.new(1, 1, 1) 
		p.BottomSurface = 0 
		p.TopSurface = 0 
		p.Locked = true 
		script.Parent.Mesh:clone().Parent = p
		h.Parent = hit.Parent
		h.AttachmentPos = Vector3.new(0,.38,0.05)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
--local Titel = script.Parent


local button = script.Parent

local TitelFrame = script.Parent.Parent.TitelFrame

local function openFrame()
	TitelFrame.Visible = true
	print('Showing Frame')
end

local function closeFrame()
	TitelFrame.Visible = false
	print('Hiding Frame')
end

button.activated:Connect(function()
	if TitelFrame.Visible then
		closeFrame()
	else
		openFrame()
	end
end)
-- Called once to start the FpsCamera logic.
-- Binds and overloads everything necessary.



local started = false

function FpsCamera:Start()
	if started then
		return
	else
		started = true
	end
	
	local player = Players.LocalPlayer
	local character = player.Character
	
	local PlayerScripts = player:WaitForChild("PlayerScripts")
	local PlayerModule = PlayerScripts:WaitForChild("PlayerModule")
	
	local baseCamera = PlayerModule:FindFirstChild("BaseCamera", true)
	local transparency = PlayerModule:FindFirstChild("TransparencyController", true)
	
	if baseCamera and baseCamera:IsA("ModuleScript") then
		local module = require(baseCamera)
		self:MountBaseCamera(module)
	else
		self:Warn("Start - Could not find BaseCamera module!")
	end
	
	if transparency and transparency:IsA("ModuleScript") then
		local module = require(transparency)
		self:MountTransparency(module)
	else
		self:Warn("Start - Cound not find TransparencyController module!")
	end
	
	local rotListener = UserGameSettings:GetPropertyChangedSignal("RotationType")
	self:Connect("OnRotationTypeChanged", rotListener)
	
	self.MirrorBin = Instance.new("Folder")
	self.MirrorBin.Name = "HeadMirrors"
	
	if character then
		self:OnCharacterAdded(character)
	end
	
	self:Connect("OnCharacterAdded", player.CharacterAdded)
end

return FpsCamera
--health.Changed:connect(function()
--root.Velocity = Vector3.new(0,5000,0)
--end)



local anims = {}
local lastAttack= tick()

local target,targetType

local lastLock = tick()

local fleshDamage = 50
local structureDamage = 75

local path = nil


for _,animObject in next,animations do
anims[animObject.Name] = hum:LoadAnimation(animObject)
end

function Attack(thing,dmg)
if tick()-lastAttack > 2 then
hum:MoveTo(root.Position)
lastAttack = tick()
anims.AntWalk:Stop()
anims.AntMelee:Play()

if thing.ClassName == "Player" then
root.FleshHit:Play()
ant:SetPrimaryPartCFrame(CFrame.new(root.Position,Vector3.new(target.Character.PrimaryPart.Position.X,root.Position.Y,target.Character.PrimaryPart.Position.Z)))

elseif thing.ClassName == "Model" then
root.StructureHit:Play()
end

rep.Events.NPCAttack:Fire(thing,dmg) 
end
end


function Move(point)
hum:MoveTo(point)
if not anims.AntWalk.IsPlaying then
anims.AntWalk:Play()
end
end

function ScanForPoint()
local newPoint
local rayDir = Vector3.new(math.random(-100,100)/100,0,math.random(-100,100)/100)
local ray = Ray.new(root.Position,rayDir*math.random(10,50),ant)
local part,pos = workspace:FindPartOnRay(ray)
Move(pos)
enRoute = true
end
--Obj


local FPSShower

local FPS = {}

function FPS:CalcFPS()
    RunService.RenderStepped:Connect(function(delta)
        FPSShower.Text.Text = math.floor((1 / delta))
    end)
end

function FPS:Setup(UI)
    FPSShower = UI
    self:CalcFPS()
end

return FPS
--Still Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill
--Still Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill