Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- Ctor


function ActiveCastStatic.new(caster: Caster, origin: Vector3, direction: Vector3, velocity: Vector3 | number, castDataPacket: FastCastBehavior): ActiveCast
	if typeof(velocity) == "number" then
		velocity = direction.Unit * velocity
	end	
	
	-- Basic setup
	local cast = {
		Caster = caster,
		
		-- Data that keeps track of what's going on as well as edits we might make during runtime.
		StateInfo = {
			UpdateConnection = nil,
			Paused = false,
			TotalRuntime = 0,
			DistanceCovered = 0,
			IsActivelySimulatingPierce = false,
			Trajectories = {
				{
					StartTime = 0,
					EndTime = -1,
					Origin = origin,
					InitialVelocity = velocity,
					Acceleration = castDataPacket.Acceleration
				}
			}
		},
		
		-- Information pertaining to actual raycasting.
		RayInfo = {
			Parameters = castDataPacket.RaycastParams,
			WorldRoot = workspace,
			MaxDistance = castDataPacket.MaxDistance or 1000,
			CosmeticBulletObject = castDataPacket.CosmeticBulletTemplate,
			CanPierceCallback = castDataPacket.CanPierceFunction
		},
		
		UserData = {}
	}
	
	
	if cast.RayInfo.Parameters ~= nil then
		cast.RayInfo.Parameters = CloneCastParams(cast.RayInfo.Parameters)
	end
	
	if cast.RayInfo.CosmeticBulletObject ~= nil then
		cast.RayInfo.CosmeticBulletObject = cast.RayInfo.CosmeticBulletObject:Clone()
		cast.RayInfo.CosmeticBulletObject.CFrame = CFrame.new(origin, origin + direction)
		cast.RayInfo.CosmeticBulletObject.Parent = castDataPacket.CosmeticBulletContainer
	end
	
	if castDataPacket.AutoIgnoreContainer == true and castDataPacket.CosmeticBulletContainer ~= nil then
		local ignoreList = cast.RayInfo.Parameters.FilterDescendantsInstances
		if table.find(ignoreList, castDataPacket.CosmeticBulletContainer) == nil then
			table.insert(ignoreList, castDataPacket.CosmeticBulletContainer)
			cast.RayInfo.Parameters.FilterDescendantsInstances = ignoreList
		end
	end
	
	local event
	if RunService:IsClient() then
		event = RunService.RenderStepped
	else
		event = RunService.Heartbeat
	end
	event:wait()
	cast.StateInfo.UpdateConnection = event:Connect(function (delta)
		if cast.StateInfo.Paused then return end
		SimulateCast(cast, delta)
	end)
	
	return setmetatable(cast, ActiveCastStatic)
end

function ActiveCastStatic.SetStaticFastCastReference(ref)
	FastCast = ref
end
--//Created by PlaasBoer 
--Version 3.3.0
--If you find a bug comment on my video for Zed's tycoon save
--Link to my channel 
--[[
	https://www.youtube.com/channel/UCHIypUw5-7noRfLJjczdsqw
]]

--

local tycoonsFolder = script.Parent:WaitForChild("Tycoons")
local tycoons = tycoonsFolder:GetChildren()
-- Initialize the tool


local MeshTool = {
	Name = 'Mesh Tool';
	Color = BrickColor.new 'Bright violet';

	-- State
	CurrentType = nil;

	-- Signals
	OnTypeChanged = Signal.new();
}

MeshTool.ManualText = [[<font face="GothamBlack" size="16">Mesh Tool  🛠</font>
Lets you add meshes to parts.<font size="6"><br /></font>

<b>TIP:</b> You can paste the link to anything with a mesh (e.g. a hat, gear, etc) and it will automatically find the right mesh and texture IDs.<font size="6"><br /></font>

<b>NOTE:</b> If HttpService is not enabled, you must type the mesh or image asset ID directly.]]
-- время до уничтожения построек вышедшего игрока в секундах
-- 8 дней по 24 часа по 60 минут по 60 секунд 


local DD = 7
local HH = 23
local MM = 59
local SS = 59
period = DD*24*60*60 + HH*60*60 + MM*60 + SS 

wait(period)

gamer = me.Parent.Name
if game.Players:FindFirstChild(gamer) then
	script.Parent = nil 		-- если игрок есть, уничтожаем скрипт
else
	me.Parent = nil		-- игрока нет, уничтожаем всю его папку
end
--Creates a remote function.


function RemoteEventCreator:CreateRemoteFunction(Name)
	--Warn if an item with that name exists.
	if Tool:FindFirstChild(Name) then
		warn("Conflicting item "..Name.." exists in "..Tool:GetFullName())
	end
	
	--Create and return the remote function.
	local RemoteFunction = Instance.new("RemoteFunction")
	RemoteFunction.Name = Name
	RemoteFunction.Parent = Tool
	
	return RemoteFunction
end
--!strict
-- upstream: https://github.com/facebook/react/blob/a774502e0ff2a82e3c0a3102534dbc3f1406e5ea/packages/shared/getComponentName.js
--[[*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
]]


type Function = (...any) -> ...any
local console = require(script.Parent.console)
--[=[
	@return Promise
	Starts Knit. Should only be called once per client.
	```lua
	Knit.Start():andThen(function()
		print("Knit started!")
	end):catch(warn)
	```

	By default, service methods exposed to the client will return promises.
	To change this behavior, set the `ServicePromises` option to `false`:
	```lua
	Knit.Start({ServicePromises = false}):andThen(function()
		print("Knit started!")
	end):catch(warn)
	```
]=]


function KnitClient.Start(options: KnitOptions?)

	if started then
		return Promise.reject("Knit already started")
	end

	started = true

	if options == nil then
		selectedOptions = defaultOptions
	else
		assert(typeof(options) == "table", "KnitOptions should be a table or nil; got " .. typeof(options))
		selectedOptions = options
		for k,v in pairs(defaultOptions) do
			if selectedOptions[k] == nil then
				selectedOptions[k] = v
			end
		end
	end
	if type(selectedOptions.PerServiceMiddleware) ~= "table" then
		selectedOptions.PerServiceMiddleware = {}
	end

	return Promise.new(function(resolve)

		-- Init:
		local promisesStartControllers = {}
		for _,controller in pairs(controllers) do
			if type(controller.KnitInit) == "function" then
				table.insert(promisesStartControllers, Promise.new(function(r)
					controller:KnitInit()
					r()
				end))
			end
		end

		resolve(Promise.all(promisesStartControllers))

	end):andThen(function()

		-- Start:
		for _,controller in pairs(controllers) do
			if type(controller.KnitStart) == "function" then
				task.spawn(controller.KnitStart, controller)
			end
		end

		startedComplete = true
		onStartedComplete:Fire()

		task.defer(function()
			onStartedComplete:Destroy()
		end)

	end)

end
--// Dump log on disconnect


local isStudio = game:GetService("RunService"):IsStudio()
game:GetService("NetworkClient").ChildRemoved:Connect(function(p)
	if not isStudio then
		warn("~! PLAYER DISCONNECTED/KICKED! DUMPING ADONIS CLIENT LOG!");
		dumplog();
	end
end)

local unique = {}
local origEnv = getfenv();
setfenv(1,setmetatable({}, {__metatable = unique}))
-- Setup animation objects


function scriptChildModified(child)
	local fileList = animNames[child.Name]
	if (fileList ~= nil) then
		configureAnimationSet(child.Name, fileList)
	else
		if child:isA("StringValue") then
			animNames[child.Name] = {}
			configureAnimationSet(child.Name, animNames[child.Name])
		end
	end	
end

script.ChildAdded:connect(scriptChildModified)
script.ChildRemoved:connect(scriptChildModified)
-- ROBLOX deviation: rewrote to replace ternary operators and reduce code repetition


local function getConfig(options: OptionsReceived?): Config
	return {
		callToJSON = getOption(options, "callToJSON"),
		-- ROBLOX deviation: color formatting omitted
		colors = nil,
		compareKeys = if options ~= nil and typeof(options.compareKeys) == "function"
			then options.compareKeys
			else DEFAULT_OPTIONS.compareKeys,
		escapeRegex = getOption(options, "escapeRegex"),
		escapeString = getOption(options, "escapeString"),
		indent = getIndent(options),
		maxDepth = getOption(options, "maxDepth"),
		min = getOption(options, "min"),
		plugins = getOption(options, "plugins"),
		printBasicPrototype = if options ~= nil and options.printBasicPrototype ~= nil
			then options.printBasicPrototype
			else true,
		printFunctionName = getOption(options, "printFunctionName"),
		spacingInner = getSpacingInner(options),
		spacingOuter = getSpacingOuter(options),
	}
end

function createIndent(indent: number): string
	-- ROBLOX deviation: used string repeat instead of a table join, also don't need the +1
	return string.rep(" ", indent)
end
--script.Parent.Transparency = 0
--wait(0.6)
--script.Parent.Transparency = 0.1
--wait(0.01)
--script.Parent.Transparency = 0.2
--wait(0.01)
--script.Parent.Transparency = 0.3
--wait(0.01)
--script.Parent.Transparency = 0.4
--wait(0.01)
--script.Parent.Transparency = 0.5
--wait(0.01)
--script.Parent.Transparency = 0.6
--wait(0.01)
--script.Parent.Transparency = 0.7
--wait(0.01)
--script.Parent.Transparency = 0.8
--wait(0.01)
--script.Parent.Transparency = 0.9
--wait(0.01)


script.Parent.Transparency = 1
--[[**
		ensures value matches given interface definition strictly

		@param checkTable The interface definition

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


	function t.strictInterface(checkTable)
		assert(checkInterface(checkTable))
		return function(value)
			local tableSuccess, tableErrMsg = t.table(value)
			if tableSuccess == false then
				return false, tableErrMsg or ""
			end

			for key, check in checkTable do
				local success, errMsg = check(value[key])
				if success == false then
					return false, string.format("[interface] bad value for %s:\n\t%s", tostring(key), errMsg or "")
				end
			end

			for key in value do
				if not checkTable[key] then
					return false, string.format("[interface] unexpected field %q", tostring(key))
				end
			end

			return true
		end
	end
end
-- Container for temporary connections (disconnected automatically)


local Connections = {};

function WeldTool.Equip()
	-- Enables the tool's equipped functionality

	-- Start up our interface
	ShowUI();
	EnableFocusHighlighting();

end;

function WeldTool.Unequip()
	-- Disables the tool's equipped functionality

	-- Clear unnecessary resources
	HideUI();
	ClearConnections();

end;

function ClearConnections()
	-- Clears out temporary connections

	for ConnectionKey, Connection in pairs(Connections) do
		Connection:Disconnect();
		Connections[ConnectionKey] = nil;
	end;

end;

function ShowUI()
	-- Creates and reveals the UI

	-- Reveal UI if already created
	if UI then

		-- Reveal the UI
		UI.Visible = true;

		-- Skip UI creation
		return;

	end;

	-- Create the UI
	UI = Core.Tool.Interfaces.BTWeldToolGUI:Clone();
	UI.Parent = Core.UI;
	UI.Visible = true;

	-- Hook up the buttons
	UI.Interface.WeldButton.MouseButton1Click:Connect(CreateWelds);
	UI.Interface.BreakWeldsButton.MouseButton1Click:Connect(BreakWelds);

end;

function HideUI()
	-- Hides the tool UI

	-- Make sure there's a UI
	if not UI then
		return;
	end;

	-- Hide the UI
	UI.Visible = false;

end;
-----------------
--| Variables |--
-----------------



local Tool = script.Parent
local R6Folder = script:WaitForChild("R6")
local R15Folder = script:WaitForChild("R15")

local ScytheEquipAnimation = R6Folder:WaitForChild("ScytheEquip2")
local ScytheIdleAnimation = R6Folder:WaitForChild("ScytheIdle2")
local ScytheSlashAnimation = R6Folder:WaitForChild("ScytheSlash")

local ScytheEquipTrack = nil
local ScytheIdleTrack = nil
local ScytheSlashTrack = nil
--// bolekinds



local plr = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent

script.Parent.MouseButton1Click:Connect(function()
	if plr.YouCash.Value >= 85 and game.ServerStorage.ServerData.ScratchingPost.Value == false then
		script.Parent.Parent.Parent.Ching:Play()
		plr.YouCash.Value -= 85
		game.ServerStorage.ServerData.ScratchingPost.Value = true
	end
end)
--End of Settup


print("Setup Done!")
end

function onSelected(mouse)-- if u Selected the tool it comes alife O: [NOT TO CHANGE!]
	mouse.Icon = "rbxasset://textures\\GunCursor.png"-- Icon of mouse
	mouse.Button1Down:connect(function() onFollow(mouse) end)
	mouse.Move:connect(function() onButton1Down(mouse) end)
	mouse.Button1Up:connect(function() onButton1Up(mouse) end)
	mouse.KeyDown:connect(function(key) onKeyDown(key,mouse) end)
	mouse.KeyUp:connect(KU)
	if(script.Parent.Parent.Parent.Character ~= nil) then
		if(script.Parent.Parent.Parent.Character:findFirstChild("Plane") ~= nil) then
		daplain =script.Parent.Parent.Parent.Character:findFirstChild("Plane")
		end
		end
	vParts = daplain.Parts
	wait()
	local Gui = script.PlaneStats:Clone()
	Gui.Parent = script.Parent.Parent.Parent.PlayerGui
	setup(vParts)
	wait(1)
	interface(Gui)
	 dagui = Gui 

end
function onDeselected()-- this removes the GUI after DISSELECTING [NOT TO CHANGE!]
if Gui ~= nil then
Gui:remove()
Gui = nil
end
end


 

function interface(G)-- GUI InterFace U may change things below XD
while true do
wait(0.1)
if G ~= nil then
PS = G.Frame-- the Gui
------------------------------------------------------------
--\Doors Update
------------------------------------------------------------


local DoorsFolder = ACS_Storage:FindFirstChild("Doors")
local CAS = game:GetService("ContextActionService")

local mDistance = 5
local Key = nil

function getNearest()
	local nearest = nil
	local minDistance = mDistance
	local Character = Player.Character or Player.CharacterAdded:Wait()
	
	for I,Door in pairs (DoorsFolder:GetChildren()) do
		if Door.Door:FindFirstChild("Knob") ~= nil then
			local distance = (Door.Door.Knob.Position - Character.Torso.Position).magnitude
		
			if distance < minDistance then
				nearest = Door
				minDistance = distance
			end
		end
	end
	--print(nearest)
	return nearest
end

function Interact(actionName, inputState, inputObj)
	if inputState ~= Enum.UserInputState.Begin then return end
	
	local nearestDoor = getNearest()
	local Character = Player.Character or Player.CharacterAdded:Wait()
	
	if nearestDoor == nil then return end
	
	if (nearestDoor.Door.Knob.Position - Character.Torso.Position).magnitude <= mDistance then
		if nearestDoor ~= nil then
			if nearestDoor:FindFirstChild("RequiresKey") then
				Key = nearestDoor.RequiresKey.Value
			else
				Key = nil
			end
			Evt.DoorEvent:FireServer(nearestDoor,1,Key)
		end
	end
end


function GetNearest(parts, maxDistance,Part)
	local closestPart
	local minDistance = maxDistance
    for _, partToFace in ipairs(parts) do
        local distance = (Part.Position - partToFace.Position).magnitude
        if distance < minDistance then
            closestPart = partToFace
            minDistance = distance
        end
   end
	return closestPart
end

CAS:BindAction("Interact", Interact, false, Enum.KeyCode.G)

Evt.Rappel.PlaceEvent.OnClientEvent:Connect(function(Parte)
	local Alinhar = Instance.new('AlignOrientation')
	Alinhar.Parent = Parte
	Alinhar.PrimaryAxisOnly = true
	Alinhar.RigidityEnabled = true
	Alinhar.Attachment0 = Character.HumanoidRootPart.RootAttachment
	Alinhar.Attachment1 = Camera.BasePart.Attachment
end)

print("ACS 1.7.5")
---------------------
-- End of Examples --
---------------------



local Plugins
if script:FindFirstChild('Plugins') and #(script:FindFirstChild('Plugins'):GetChildren()) >= 1 then
	Plugins = script:FindFirstChild('Plugins')
end

if script.Parent ~= game:GetService('ServerScriptService') then
	script.Parent = game:GetService('ServerScriptService')
end

require(Configuration['Loader ID'])(Plugins,Configuration)
-- PUT THIS INTO YOUR STARTERGUI
-- LEAVE shader PART INTO THE WORKSPACE


wait(1)
local shad
workspace.CurrentCamera:ClearAllChildren()
game:GetService("RunService").RenderStepped:connect(function()
	if shad then shad:Destroy() end
	shad = workspace.shader:Clone()
	shad.Parent = workspace.CurrentCamera
	Instance.new("BlockMesh",shad).Offset = Vector3.new(0,-1000,0)
	shad.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0,1000,-1.75)
	workspace.CurrentCamera.CameraType = "Custom"
	shad.Transparency = game.Players.LocalPlayer.Character.Humanoid.Health / 140
end)
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------


Target.Changed:Connect(function(Valor)
	if Valor == "N/A" then
		Texto.Text =  player.Name
		script.Parent.Reset.Visible = false
	else
		Texto.Text =  Valor
		script.Parent.Reset.Visible = true
	end
end)

script.Parent.Reset.MouseButton1Down:connect(function()
	Reset:FireServer()
end)

script.Parent.Menu.Bandages.MouseButton1Down:connect(function()
	if Saude.Variaveis.Doer.Value == false and script.Parent.BandagesAberto.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.OtherAberto.Visible = false
	script.Parent.MedicineAberto.Visible = false
	script.Parent.BandagesAberto.Visible = true
	--Saude.Variaveis.Doer.Value = false
	end
end)

script.Parent.Menu.Medicines.MouseButton1Down:connect(function()
	if Saude.Variaveis.Doer.Value == false and script.Parent.MedicineAberto.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.OtherAberto.Visible = false
	script.Parent.MedicineAberto.Visible = true
	script.Parent.BandagesAberto.Visible = false
	--Saude.Variaveis.Doer.Value = false
	end
end)

script.Parent.Menu.Others.MouseButton1Down:connect(function()
	if Saude.Variaveis.Doer.Value == false and script.Parent.OtherAberto.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.OtherAberto.Visible = true
	script.Parent.MedicineAberto.Visible = false
	script.Parent.BandagesAberto.Visible = false
	--Saude.Variaveis.Doer.Value = false
	end
end)
--[[This script simply hides the roblox Core GUIs, including the backpack, health, and the leaderboard.
	All you need to do is put this script in the StarterPack.
--]]



game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false);--Remove this if you want the health bar to be shown.

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false);--Remove this if you want the leaderboard to be shown.

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false);--Remove this if you want the backpack to be shown.
-- Remove from all


for i = 1, #Indicator.all do
if self == Indicator.all[i] then
table.remove(Indicator.all, i)
break
end
end
end


function Indicator:setAngle(angleRadians)
if not self.alive then return end
	
local angleDegrees = angleRadians * (180 / math.pi)
self.frame.Position = UDim2.new(
		.5,
		math.cos(angleRadians) * radius + self.frame.AbsoluteSize.X / -2,
		.5,
		math.sin(angleRadians) * radius + self.frame.AbsoluteSize.Y / -2
	)
self.frame.Rotation = angleDegrees + 90
end


function Indicator:update()
if tick() >= self.timeExpire then
self:expire()
else
local perc = (tick() - self.timeCreated) / self.time
self:setAngle(getCameraAngle(camera) - angleBetweenPoints(camera.Focus.p, self.position) - math.pi / 2)

self.frame.ImageLabel.ImageTransparency = perc
self.frame.ImageLabel.Size = UDim2.new(0, 50, 0, -50 * (1 - perc))
end
end


function Indicator:updateAll()
local i = 1
while i <= #Indicator.all do
local indicator = Indicator.all[i]
indicator:update()
if indicator.alive then
i = i + 1
end
end
end
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 150		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6980		--		Use sliders to manipulate values
	Tune.Redline		= 8000		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 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)
-- ROBLOX deviation END



local function formatTime(time: number, prefixPower_: number?, padLeftLength_: number?): string
	local prefixPower = prefixPower_ or -3
	local padLeftLength = padLeftLength_ or 0
	local prefixes = { "n", "μ", "m", "" }
	local prefixIndex = math.max(0, math.min(mathTrunc(prefixPower / 3) + #prefixes - 1, #prefixes - 1)) + 1
	return ("%s %ss"):format(stringPadStart(tostring(time), padLeftLength), prefixes[prefixIndex])
end
exports.default = formatTime
return exports
-- GlobalUpdates object:



local GlobalUpdates = {
	--[[
		_updates_latest = {}, -- [table] {update_index, {{update_id, version_id, update_locked, update_data}, ...}}
		_pending_update_lock = {update_id, ...} / nil, -- [table / nil]
		_pending_update_clear = {update_id, ...} / nil, -- [table / nil]
		
		_new_active_update_listeners = {listener, ...} / nil, -- [table / nil]
		_new_locked_update_listeners = {listener, ...} / nil, -- [table / nil]
		
		_profile = Profile / nil, -- [Profile / nil]
		
		_update_handler_mode = true / nil, -- [bool / nil]
	--]]
}
GlobalUpdates.__index = GlobalUpdates
--Made by Stickmasterluke




sp=script.Parent


function waitfor(a,b)
	while a:FindFirstChild(b)==nil do
		a.ChildAdded:wait()
	end
	return a:FindFirstChild(b)
end

speedboostscript=waitfor(sp,"SpeedBoostScript")

function Equipped()
	if sp.Parent:FindFirstChild("SpeedBoostScript")==nil then
		local s=speedboostscript:clone()
		local tooltag=Instance.new("ObjectValue")
		tooltag.Name="ToolTag"
		tooltag.Value=sp
		tooltag.Parent=s
		s.Parent=sp.Parent
		s.Disabled=false
		local sound=sp.Handle:FindFirstChild("CoilSound")
		if sound~=nil then
			sound:Play()
		end
	end
end

sp.Equipped:connect(Equipped)
--	local rocketScriptClone = RocketScript:Clone()
--	rocketScriptClone.Parent = Rocket
--	rocketScriptClone.Disabled = false


end


fireEvent.OnServerEvent:connect(function(player, target)
	if canFire and player.Character == tool.Parent then
		canFire = false
		
		-- Create a clone of Rocket and set its color
		local rocketClone = Rocket:Clone()
		--game.Debris:AddItem(rocketClone, 30)
		rocketClone.BrickColor = player.TeamColor
		rocketClone.Touched:connect(function(hit)
			if hit and hit.Parent and hit.Parent ~= player.Character and hit.Parent ~= tool then
				local explosion = Instance.new("Explosion", game.Workspace)
				explosion.Position = rocketClone.Position
				rocketClone:Destroy()
			end
		end)
		
		spawn(function()
			wait(30)
			if rocketClone then rocketClone:Destroy() end
		end)		
		
		-- Position the rocket clone and launch!
		local spawnPosition = (tool.Handle.CFrame * CFrame.new(2, 0, 0)).p
		rocketClone.CFrame = CFrame.new(spawnPosition, target) --NOTE: This must be done before assigning Parent
		rocketClone.Velocity = rocketClone.CFrame.lookVector * ROCKET_SPEED --NOTE: This should be done before assigning Parent
		rocketClone.Parent = game.Workspace		
		
		-- Attach creator tags to the rocket early on
		local creatorTag = Instance.new('ObjectValue', rocketClone)
		creatorTag.Value = player
		creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
		local iconTag = Instance.new('StringValue', creatorTag)
		iconTag.Value = tool.TextureId
		iconTag.Name = 'icon'
		
		delay(attackCooldown, function()
			canFire = true
		end)
	end
end)
--Get initial waypoint for non-humanoid


local function getNonHumanoidWaypoint(self)
	--Account for multiple waypoints that are sometimes in the same place
	for i = 2, #self._waypoints do
		if (self._waypoints[i].Position - self._waypoints[i - 1].Position).Magnitude > 0.1 then
			return i
		end
	end
	return 2
end