Pinkstack/roblox-luau-corpus-text huggingface dataset:
--		print("Loading anims " .. Name)


		table.insert(AnimTable[Name].Connections, Config.ChildAdded:connect(function(Child)
			ConfigureAnimationSet(Name, FileList)
		end))
		table.insert(AnimTable[Name].Connections, Config.ChildRemoved:connect(function(Child)
			ConfigureAnimationSet(Name, FileList)
		end))
		local Index = 1
		for i, ChildPart in pairs(Config:GetChildren()) do
			if (ChildPart:IsA("Animation")) then
				table.insert(AnimTable[Name].Connections, ChildPart.Changed:connect(function(Property)
					ConfigureAnimationSet(Name, FileList)
				end))
				AnimTable[Name][Index] = {}
				AnimTable[Name][Index].Anim = ChildPart
				local WeightObject = ChildPart:FindFirstChild("Weight")
				if WeightObject then
					AnimTable[Name][Index].Weight = 1
				else
					AnimTable[Name][Index].Weight = WeightObject.Value
				end
				AnimTable[Name].Count = AnimTable[Name].Count + 1
				AnimTable[Name].TotalWeight = AnimTable[Name].TotalWeight + AnimTable[Name][Index].Weight
	--			print(Name .. " [" .. Index .. "] " .. AnimTable[Name][Index].Anim.AnimationId .. " (" .. AnimTable[Name][Index].Weight .. ")")
				Index = Index + 1
			end
		end
	end

	-- fallback to defaults
	if AnimTable[Name].Count <= 0 then
		for Index, Anim in pairs(FileList) do
			AnimTable[Name][Index] = {}
			AnimTable[Name][Index].Anim = Instance.new("Animation")
			AnimTable[Name][Index].Anim.Name = Name
			AnimTable[Name][Index].Anim.AnimationId = Anim.Id
			AnimTable[Name][Index].Weight = Anim.Weight
			AnimTable[Name].Count = AnimTable[Name].Count + 1
			AnimTable[Name].TotalWeight = AnimTable[Name].TotalWeight + Anim.Weight
--[=[
	Gets a signal that will fire when the Brio dies. If the brio is already dead
	calling this method will error.

	:::info
	Calling this while the brio is already dead will throw a error.
	:::

	```lua
	local brio = Brio.new("a", "b")
	brio:GetDiedSignal():Connect(function()
		print("Brio died")
	end)

	brio:Kill() --> Brio died
	brio:Kill() -- no output
	```

	@return Signal
]=]


function Brio:GetDiedSignal()
	if self:IsDead() then
		error("Brio is dead")
	end

	if self._diedEvent then
		return self._diedEvent
	end

	self._diedEvent = GoodSignal.new()
	return self._diedEvent
end
-- Formerly getCurrentCameraMode, this function resolves developer and user camera control settings to
-- decide which camera control module should be instantiated. The old method of converting redundant enum types


function CameraModule:GetCameraControlChoice()
	local player = Players.LocalPlayer

	if player then
		if self.lastInputType == Enum.UserInputType.Touch or UserInputService.TouchEnabled then
			-- Touch
			if player.DevTouchCameraMode == Enum.DevTouchCameraMovementMode.UserChoice then
				return CameraUtils.ConvertCameraModeEnumToStandard( UserGameSettings.TouchCameraMovementMode )
			else
				return CameraUtils.ConvertCameraModeEnumToStandard( player.DevTouchCameraMode )
			end
		else
			-- Computer
			if player.DevComputerCameraMode == Enum.DevComputerCameraMovementMode.UserChoice then
				local computerMovementMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)
				return CameraUtils.ConvertCameraModeEnumToStandard(computerMovementMode)
			else
				return CameraUtils.ConvertCameraModeEnumToStandard(player.DevComputerCameraMode)
			end
		end
	end
end

function CameraModule:OnCharacterAdded(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterAdded(char, player)
	end
end

function CameraModule:OnCharacterRemoving(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterRemoving(char, player)
	end
end

function CameraModule:OnPlayerAdded(player)
	player.CharacterAdded:Connect(function(char)
		self:OnCharacterAdded(char, player)
	end)
	player.CharacterRemoving:Connect(function(char)
		self:OnCharacterRemoving(char, player)
	end)
end

function CameraModule:OnMouseLockToggled()
	if self.activeMouseLockController then
		local mouseLocked = self.activeMouseLockController:GetIsMouseLocked()
		local mouseLockOffset = self.activeMouseLockController:GetMouseLockOffset()
		if self.activeCameraController then
			self.activeCameraController:SetIsMouseLocked(mouseLocked)
			self.activeCameraController:SetMouseLockOffset(mouseLockOffset)
		end
	end
end

local cameraModuleObject = CameraModule.new()

return cameraModuleObject
-- ROBLOX deviation END: binding support


type MutableSourceVersion = ReactTypes.MutableSourceVersion
type MutableSource<Source> = ReactTypes.MutableSource<Source>
type MutableSourceSubscribeFn<Source, Snapshot> = ReactTypes.MutableSourceSubscribeFn<
	Source,
	Snapshot
>
type MutableSourceGetSnapshotFn<Source, Snapshot> = ReactTypes.MutableSourceGetSnapshotFn<
	Source,
	Snapshot
>

type BasicStateAction<S> = ((S) -> S) | S
type Dispatch<A> = (A) -> ()

export type Dispatcher = {
	readContext: <T>(
		context: ReactContext<T>,
		observedBits: nil | number | boolean
	) -> T,
	useState: <S>(initialState: (() -> S) | S) -> (S, Dispatch<BasicStateAction<S>>),
	useReducer: <S, I, A>(
		reducer: (S, A) -> S,
		initialArg: I,
		init: ((I) -> S)?
	) -> (S, Dispatch<A>),
	useContext: <T>(
		context: ReactContext<T>,
		observedBits: nil | number | boolean
	) -> T,
	-- ROBLOX deviation START: TS models this slightly differently, which is needed to have an initially empty ref and clear the ref, and still typecheck
	useRef: <T>(initialValue: T) -> { current: T | nil },
	-- ROBLOX deviation END
	-- ROBLOX deviation START: Bindings are a feature unique to Roact
	useBinding: <T>(initialValue: T) -> (ReactBinding<T>, ReactBindingUpdater<T>),
	-- ROBLOX deviation END
	useEffect: (
		-- ROBLOX TODO: Luau needs union type packs for this type to translate idiomatically
		create: (() -> ()) | (() -> (() -> ())),
		deps: Array<any> | nil
	) -> (),
	useLayoutEffect: (
		-- ROBLOX TODO: Luau needs union type packs for this type to translate idiomatically
		create: (() -> ()) | (() -> (() -> ())),
		deps: Array<any> | nil
	) -> (),
	useCallback: <T>(callback: T, deps: Array<any> | nil) -> T,
	useMemo: <T...>(nextCreate: () -> T..., deps: Array<any> | nil) -> T...,
	useImperativeHandle: <T>(
		ref: { current: T | nil } | ((inst: T | nil) -> any) | nil,
		create: () -> T,
		deps: Array<any> | nil
	) -> (),
	useDebugValue: <T>(value: T, formatterFn: ((value: T) -> any)?) -> (),
	-- ROBLOX TODO: make these non-optional and implement them in the dispatchers
	useDeferredValue: (<T>(value: T) -> T)?,
	useTransition: (() -> ((() -> ()) -> (), boolean))?, -- ROBLOX deviation: Luau doesn't support jagged array types [(() -> ()) -> (), boolean],
	useMutableSource: <Source, Snapshot>(
		source: MutableSource<Source>,
		getSnapshot: MutableSourceGetSnapshotFn<Source, Snapshot>,
		subscribe: MutableSourceSubscribeFn<Source, Snapshot>
	) -> Snapshot,
	useOpaqueIdentifier: () -> any,

	unstable_isNewReconciler: boolean?,
	-- [string]: any,
}

local ReactCurrentDispatcher: { current: nil | Dispatcher } = {
	--[[
		* @internal
		* @type {ReactComponent}
		*/
	]]
	current = nil,
}

return ReactCurrentDispatcher
--[=[
	Handlers if/when promise is fulfilled/rejected. It takes up to two arguments, callback functions
	for the success and failure cases of the Promise. May return the same promise if certain behavior
	is met.

	:::info
	We do not comply with 2.2.4 (onFulfilled or onRejected must not be called until the execution context stack
	contains only platform code). This means promises may stack overflow, however, it also makes promises a lot cheaper
	:::

	If/when promise is rejected, all respective onRejected callbacks must execute in the order of their
	originating calls to then.

	If/when promise is fulfilled, all respective onFulfilled callbacks must execute in the order of their
	originating calls to then.

	@param onFulfilled function -- Called if/when fulfilled with parameters
	@param onRejected function -- Called if/when rejected with parameters
	@return Promise<T>
]=]


function Promise:Then(onFulfilled, onRejected)
	if type(onRejected) == "function" then
		self._unconsumedException = false
	end

	if self._pendingExecuteList then
		local promise = Promise.new()
		self._pendingExecuteList[#self._pendingExecuteList + 1] = { onFulfilled, onRejected, promise }
		return promise
	else
		return self:_executeThen(onFulfilled, onRejected, nil)
	end
end
--------END STAGE--------
--------CREW--------



game.Workspace.crewp1.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CurrentLeftBackground.Value)..""
game.Workspace.crewp2.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CurrentRightBackground.Value)..""
game.Workspace.crewp3.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CurrentLeftBackground.Value)..""
game.Workspace.crewp4.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CurrentRightBackground.Value)..""
--When you are editing the car, make sure that the Left, Right, and Base parts are in a 
--straight line, or the wheels will be somewhere you do not expect them to be



left = Instance.new("Motor", script.Parent.Parent)
right = Instance.new("Motor", script.Parent.Parent)
left.Name = "LeftMotor"
right.Name = "RightMotor"

left.Part0 = l
right.Part0 = r
left.Part1 = b2
right.Part1 = b
right.C0 = CFrame.new(-WheelSize/2-r.Size.x/2,0,0)*CFrame.Angles(math.pi/2,0,math.pi/2)
right.C1 = CFrame.new(-b.Size.x/2-r.Size.x-WheelSize/2,0,0)*CFrame.Angles(math.pi/2,0,math.pi/2)
left.C0 = CFrame.new(-1,0,0)*CFrame.Angles(0,0,math.pi/2)
left.C1 = CFrame.new()*CFrame.Angles(0,0,math.pi/2)
right.MaxVelocity = 0.02
left.MaxVelocity = 0.02
--- Splits a string by space but taking into account quoted sequences which will be treated as a single argument.


function Util.SplitString(text, max)
	text = encodeControlChars(text)
	max = max or math.huge
	local t = {}
	local spat, epat, buf, quoted = [=[^(['"])]=], [=[(['"])$]=]
	for str in text:gmatch("%S+") do
		str = Util.ParseEscapeSequences(str)
		local squoted = str:match(spat)
		local equoted = str:match(epat)
		local escaped = str:match([=[(\*)['"]$]=])
		if squoted and not quoted and not equoted then
			buf, quoted = str, squoted
		elseif buf and equoted == quoted and #escaped % 2 == 0 then
			str, buf, quoted = buf .. " " .. str, nil, nil
		elseif buf then
			buf = buf .. " " .. str
		end
		if not buf then
			t[#t + (#t > max and 0 or 1)] = decodeControlChars(str:gsub(spat, ""):gsub(epat, ""))
		end
	end

	if buf then
		t[#t + (#t > max and 0 or 1)] = decodeControlChars(buf)
	end

	return t
end
-- Requires


local APIEquipment = require(ReplicatedStorage.Common.APIEquipment)

PlayersService.PlayerAdded:Connect(function(player)
	
	-- When the character is added we'll listen for them to die.
	player.CharacterAdded:Connect(function(character)
		
		local humanoid = character:WaitForChild("Humanoid")
		if not humanoid then return end
		
		-- As soon as the player dies the weapons are removed
		humanoid.Died:Connect(function()
			APIEquipment.RemoveWeapons(player)
		end)
		
	end)
	
end)
--Made by Luckymaxer



Camera = game:GetService("Workspace").CurrentCamera

Rate = (1 / 60)

Shake = {Movement = 20, Rate = 0.001}

local CoordinateFrame = Camera.CoordinateFrame
local Focus = Camera.Focus
while true do
	local CameraRotation = Camera.CoordinateFrame - Camera.CoordinateFrame.p
	local CameraScroll = (CoordinateFrame.p - Focus.p).magnitude
	local NewCFrame = CFrame.new(Camera.Focus.p) * CameraRotation * CFrame.fromEulerAnglesXYZ((math.random(-Shake.Movement, Shake.Movement) * Shake.Rate), (math.random(-Shake.Movement, Shake.Movement) * Shake.Rate), 0)
	CoordinateFrame = NewCFrame * CFrame.new(0, 0, CameraScroll)
	Camera.CoordinateFrame = CoordinateFrame
	wait(Rate)
end
-- lunge and hold


if target.Humanoid.SeatPart then
game.ReplicatedStorage.Events.NPCAttack:Fire(target.Humanoid.SeatPart.Parent,math.random(5,15))
else
game.ReplicatedStorage.Events.NPCAttack:Fire(game.Players:GetPlayerFromCharacter(target),25)
end

shark.Head.SharkEat:Play()
local emitter = game.ReplicatedStorage.Particles.Teeth:Clone()
emitter.Parent = shark.Head
emitter.EmissionDirection = Enum.NormalId.Top
wait()
emitter:Emit(1)




holdOrder = tick()
holdDuration = 2
end

end
end -- end of MakeAMove()
MakeAMove()


local scanSurroundings = coroutine.wrap(function()
while true do
stance = "wander"
local surroundingParts = workspace:FindPartsInRegion3WithIgnoreList(Region3.new(
shark.PrimaryPart.Position+Vector3.new(-60,-3,-60),
shark.PrimaryPart.Position+Vector3.new(60,10,60)),
shark:GetChildren())
for _,v in next,surroundingParts do
if v.Parent:FindFirstChild("Humanoid") and v.Parent.Humanoid.Health > 0 then
--[[
	Updates the value stored in this State object.

	If `force` is enabled, this will skip equality checks and always update the
	state object and any dependents - use this with care as this can lead to
	unnecessary updates.
]]


function class:set(newValue, force: boolean?)
	if force or not utility.isSimilar(self._value, newValue) then
		self._value = newValue
		Dependencies.updateAll(self)
	end
end

return Value
-- Functions


function TeamManager:CreateTeams()
	local newTeam = Instance.new("Team", game.Teams)
	newTeam.TeamColor = BrickColor.new("Really red")
	TeamPlayers[newTeam] = {}
	TeamScores[newTeam] = 0
	
	newTeam = Instance.new("Team", game.Teams)
	newTeam.TeamColor = BrickColor.new("Really blue")
	TeamPlayers[newTeam] = {}
	TeamScores[newTeam] = 0
end

function TeamManager:CreateFFATeam()
	local newTeamColor = BrickColor.Random()
	while GetTeamFromColor(newTeamColor) do
		newTeamColor = BrickColor.Random()
	end
	
	local newTeam = Instance.new("Team", game.Teams)
	newTeam.TeamColor = newTeamColor
	TeamPlayers[newTeam] = {}
	TeamScores[newTeam] = 0
	return newTeam
end

function TeamManager:AssignPlayerToTeam(player)
	local smallestTeam
	local lowestCount = math.huge
	for team, playerList in pairs(TeamPlayers) do
		if #playerList < lowestCount then
			smallestTeam = team
			lowestCount = #playerList
		end
	end
	
	if not Configurations.TEAMS and (not smallestTeam or #TeamPlayers[smallestTeam] > 0) then
		smallestTeam = TeamManager:CreateFFATeam()
	end
	
	table.insert(TeamPlayers[smallestTeam], player)
	player.Neutral = false
	player.TeamColor = smallestTeam.TeamColor
end

function TeamManager:RemovePlayer(player)
	local team = GetTeamFromColor(player.TeamColor)
	local teamTable = TeamPlayers[team]
	for i = 1, #teamTable do
		if teamTable[i] == player then
			table.remove(teamTable, i)
			if not Configurations.TEAMS then
				team:Destroy()
			end
			return
		end
	end
end

function TeamManager:ClearTeamScores()
	for _, team in pairs(Teams:GetTeams()) do
		TeamScores[team] = 0
		if Configurations.TEAMS then
			DisplayManager:UpdateScore(team, 0)
		end
	end
end

function TeamManager:AddTeamScore(teamColor, score)
	local team = GetTeamFromColor(teamColor)
	TeamScores[team] = TeamScores[team] + score
	if Configurations.TEAMS then
		DisplayManager:UpdateScore(team, TeamScores[team])
	end
end

function TeamManager:HasTeamWon()
	for _, team in pairs(Teams:GetTeams()) do
		if TeamScores[team] >= Configurations.POINTS_TO_WIN then
			return team
		end
	end
	return false
end

function TeamManager:GetWinningTeam()
	local highestScore = 0
	local winningTeam = nil
	for _, team in pairs(Teams:GetTeams()) do
		if TeamScores[team] > highestScore then
			highestScore = TeamScores[team]
			winningTeam = team
		end
	end
	return winningTeam
end

function TeamManager:AreTeamsTied()
	local teams = Teams:GetTeams()
	local highestScore = 0
	local tied = false
	for _, team in pairs(teams) do
		if TeamScores[team] == highestScore then
			tied = true
		elseif TeamScores[team] > highestScore then
			tied = false
			highestScore = TeamScores[team]
		end
	end
	return tied
end

function TeamManager:ShuffleTeams()
	for _, team in pairs(Teams:GetTeams()) do
		TeamPlayers[team] = {}
	end
	local players = Players:GetPlayers()
	while #players > 0 do
		local rIndex = math.random(1, #players)
		local player = table.remove(players, rIndex)
		TeamManager:AssignPlayerToTeam(player)
	end
end
--[[
	Iterates serially over the given an array of values, calling the predicate callback on each before continuing.
	If the predicate returns a Promise, we wait for that Promise to resolve before continuing to the next item
	in the array. If the Promise the predicate returns rejects, the Promise from Promise.each is also rejected with
	the same value.

	Returns a Promise containing an array of the return values from the predicate for each item in the original list.
]]


function Promise.each(list, predicate)
	assert(type(list) == "table", string.format(ERROR_NON_LIST, "Promise.each"))
	assert(type(predicate) == "function", string.format(ERROR_NON_FUNCTION, "Promise.each"))

	return Promise._new(debug.traceback(nil, 2), function(resolve, reject, onCancel)
		local results = {}
		local promisesToCancel = {}

		local cancelled = false

		local function cancel()
			for _, promiseToCancel in ipairs(promisesToCancel) do
				promiseToCancel:cancel()
			end
		end

		onCancel(function()
			cancelled = true

			cancel()
		end)

		-- We need to preprocess the list of values and look for Promises.
		-- If we find some, we must register our andThen calls now, so that those Promises have a consumer
		-- from us registered. If we don't do this, those Promises might get cancelled by something else
		-- before we get to them in the series because it's not possible to tell that we plan to use it
		-- unless we indicate it here.

		local preprocessedList = {}

		for index, value in ipairs(list) do
			if Promise.is(value) then
				if value:getStatus() == Promise.Status.Cancelled then
					cancel()
					return reject(Error.new({
						error = "Promise is cancelled",
						kind = Error.Kind.AlreadyCancelled,
						context = string.format(
							"The Promise that was part of the array at index %d passed into Promise.each was already cancelled when Promise.each began.\n\nThat Promise was created at:\n\n%s",
							index,
							value._source
						),
					}))
				elseif value:getStatus() == Promise.Status.Rejected then
					cancel()
					return reject(select(2, value:await()))
				end

				-- Chain a new Promise from this one so we only cancel ours
				local ourPromise = value:andThen(function(...)
					return ...
				end)

				table.insert(promisesToCancel, ourPromise)
				preprocessedList[index] = ourPromise
			else
				preprocessedList[index] = value
			end
		end

		for index, value in ipairs(preprocessedList) do
			if Promise.is(value) then
				local success
				success, value = value:await()

				if not success then
					cancel()
					return reject(value)
				end
			end

			if cancelled then
				return
			end

			local predicatePromise = Promise.resolve(predicate(value, index))

			table.insert(promisesToCancel, predicatePromise)

			local success, result = predicatePromise:await()

			if not success then
				cancel()
				return reject(result)
			end

			results[index] = result
		end

		resolve(results)
	end)
end
Promise.Each = Promise.each
-- Trim empty datastores and scopes from an entire datastore type:


local function prepareDataStoresForExport(origin)
	local dataPrepared = {}

	for name, scopes in pairs(origin) do
		local exportScopes = {}
		for scope, data in pairs(scopes) do
			local exportData = {}
			for key, value in pairs(data) do
				exportData[key] = value
			end
			if next(exportData) ~= nil then -- Only export datastore when non-empty
				exportScopes[scope] = exportData
			end
		end
		if next(exportScopes) ~= nil then -- Only export scope list when non-empty
			dataPrepared[name] = exportScopes
		end
	end

	if next(dataPrepared) ~= nil then -- Only return datastore type when non-empty
		return dataPrepared
	end
end

local function preprocessKey(key)
	if type(key) == "number" then
		if key ~= key then
			return "NAN"
		elseif key >= math.huge then
			return "INF"
		elseif key <= -math.huge then
			return "-INF"
		end
		return tostring(key)
	end
	return key
end

local function simulateYield()
	if Constants.YIELD_TIME_MAX > 0 then
		wait(rand:NextNumber(Constants.YIELD_TIME_MIN, Constants.YIELD_TIME_MAX))
	end
end

local function simulateErrorCheck(method)
	if Constants.SIMULATE_ERROR_RATE > 0 and rand:NextNumber() <= Constants.SIMULATE_ERROR_RATE then
		simulateYield()
		error(method .. " rejected with error (simulated error)", 3)
	end
end
--Tune


OverheatSpeed = .2 --How fast the car will overheat
CoolingEfficiency = .04 --How fast the car will cool down
RunningTemp = 85 --In degrees

Fan = true --Cooling fan
FanTemp = 100 --At what temperature the cooling fan will activate
FanSpeed = .1
FanVolume = .2

BlowupTemp = 112 --At what temperature the engine will blow up

GUI = true --GUI temperature gauge
--Loop For Making Rays For The Bullet's Trajectory


for i = 1, 30 do
	local thisOffset = offset + Vector3.new(0, yOffset*(i-1), 0)
	local travelRay = Ray.new(point1,thisOffset)
	local hit, position = workspace:FindPartOnRay(travelRay, parts.Parent)

	local distance 		= (position - point1).magnitude
	round.Size				= Vector3.new(1, distance, 1)
	round.CFrame			= CFrame.new(position, point1)
								* CFrame.new(0, 0, -distance/2)
								* CFrame.Angles(math.rad(90),0,0)
	round.Parent			= workspace
	point1					= point1 + thisOffset
	
	if hit then
		round:remove()
		local e = Instance.new("Explosion")
		e.BlastRadius = 4
		e.BlastPressure = 1
		e.ExplosionType = "NoCraters"
		e.Position = position
		e.Parent = workspace
		
		local players = game.Players:getChildren()
		for i = 1, #players do
			
			if players[i].TeamColor ~= script.Parent.Parent.Tank.Value then --if he's not an ally
				character = players[i].Character
				if character then
					torso = character:findFirstChild'Torso'
					if torso then
						
						torsoPos = torso.Position
						origPos = round.Position
						
						local ray = Ray.new(origPos, torsoPos-origPos)
						local hit, position = game.Workspace:FindPartOnRayWithIgnoreList(ray,ignoreList)
						if hit then
							if hit.Parent == character then
								human = hit.Parent:findFirstChild("Humanoid")
								if human then
									distance = (position-origPos).magnitude
--!strict


type Array<T> = { [number]: T }
type PredicateFunction<T> = (value: T, index: number, array: Array<T>) -> boolean

return function<T>(array: Array<T>, predicate: PredicateFunction<T>): T | nil
	for i = 1, #array do
		local element = array[i]
		if predicate(element, i, array) then
			return element
		end
	end
	return nil
end
-- find player's head pos



	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)

	local head = vCharacter:findFirstChild("Head")
	if head == nil then return end


	local launch = head.Position + 10 * v

	local missile = Pellet:clone()
    
	missile.Position = launch
	missile.Velocity = v * 220--160
	missile.Locked = true


	local force = Instance.new("BodyForce")
	force.force = Vector3.new(0,40,0)
	force.Parent = missile

	if (turbo) then
		missile.Velocity = v * 140
		force.force = Vector3.new(0,45,0)
	end

	missile.SnowballScript.Disabled = false

	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = vCharacter
	creator_tag.Name = "creator"
	creator_tag.Parent = missile
	
	missile.Parent = game.Workspace
	
	missile:SetNetworkOwner(vPlayer)

end



function rndDir()
	return Vector3.new(math.random() - .5, math.random() - .5, math.random() - .5).unit
end

Tool.Enabled = true
function onActivated(player,mouseHitp)
	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false
	Tool.Handle.Transparency=1
	local character = Tool.Parent;
	local humanoid = character:FindFirstChild("Humanoid")
	if humanoid == nil then
		return 
	end


	local targetPos = mouseHitp --humanoid.TargetPoint
	local lookAt = (targetPos - character.Head.Position).unit

	fire(lookAt )

	wait(2)
	Tool.Enabled = true
Tool.Handle.Transparency=0

	
end

script.Parent.Clicked.OnServerEvent:connect(onActivated)