Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- Handles behaviours


local function characterTouchedBrick(partTouched)
	local behaviours = partTouched:FindFirstChild("Behaviours")
	if behaviours ~= nil then
		behaviours = behaviours:GetChildren()
		for i = 1, #behaviours do
			if behaviours[i].Value == true then
				game.ReplicatedStorage.RemoteEvents.ExecuteBehaviour:FireServer(player.Character, partTouched, behaviours[i].Name)

				if string.find(behaviours[i].Name, "Kill") then
					SmoothDie()
				end

			end
		end
	end
end

function characterAdded(newCharacter)
	ResetGame()
	bindFuc:Invoke(true)
	character = player.Character
	humanoid = character:WaitForChild("Humanoid")
	animator = humanoid:WaitForChild("Animator")
	humanoid.Touched:connect(characterTouchedBrick)
	humanoid.Died:connect(OnDie)
	SetWalkSpeed(0)

	local splashScreen = player.PlayerGui:WaitForChild("StartScreen")

	if UserInputService.TouchEnabled == false then
		if UserInputService.GamepadEnabled then
			splashScreen.StartInstructions.StartLabel.Text = "Press Space or Gamepad A Button to Start"
		else
			splashScreen.StartInstructions.StartLabel.Text = "Press Space to Start"
		end

	end
end




local function MoveAction(actionName, inputState, inputObject)
	if(not startGame) then
		return
	end

	if inputState == Enum.UserInputState.Begin then
		if inputObject.KeyCode == Enum.KeyCode.Left then
			left = -1
			moveDir = -1
		elseif inputObject.KeyCode == Enum.KeyCode.Right then
			right = 1
			moveDir = 1
		end
		SetWalkSpeed(moveSpeed)
	elseif inputState == Enum.UserInputState.End then
		if inputObject.KeyCode == Enum.KeyCode.Left then
			left = 0
		elseif inputObject.KeyCode == Enum.KeyCode.Right then
			right = 0
		end
		moveDir = left + right
		if moveDir == 0 then
			SetWalkSpeed(0) 
		end

	end
end
--- Calls the transform function on this argument.
-- The return value(s) from this function are passed to all of the other argument methods.
-- Called automatically at instantiation


function Argument:Transform()
	if #self.TransformedValues ~= 0 then
		return
	end

	local rawValue = self.RawValue

	if rawValue == "." and self.Type.Default then
		rawValue = self.Type.Default(self.Executor) or ""
		self.RawSegmentsAreAutocomplete = true
	end

	if rawValue == "?" and self.Type.Autocomplete then
		local strings, options = self:GetDefaultAutocomplete()

		if not options.IsPartial and #strings > 0 then
			rawValue = strings[math.random(1, #strings)]
			self.RawSegmentsAreAutocomplete = true
		end

	end

	if self.Type.Listable and #self.RawValue > 0 then
		local randomMatch = rawValue:match("^%?(%d+)$")
		if randomMatch then
			local maxSize = tonumber(randomMatch)

			if maxSize and maxSize > 0 then
				local items = {}
				local remainingItems, options = self:GetDefaultAutocomplete()

				if not options.IsPartial and #remainingItems > 0 then
					for _ = 1, math.min(maxSize, #remainingItems) do
						table.insert(items, table.remove(remainingItems, math.random(1, #remainingItems)))
					end

					rawValue = table.concat(items, ",")
					self.RawSegmentsAreAutocomplete = true
				end
			end
		elseif rawValue == "*" or rawValue == "**" then
			local strings, options = self:GetDefaultAutocomplete()

			if not options.IsPartial and #strings > 0 then
				if rawValue == "**" and self.Type.Default then
					local defaultString = self.Type.Default(self.Executor) or ""

					for i, string in ipairs(strings) do
						if string == defaultString then
							table.remove(strings, i)
						end
					end
				end

				rawValue = table.concat(
					strings,
					","
				)
				self.RawSegmentsAreAutocomplete = true
			end
		end

		rawValue = unescapeOperators(rawValue)

		local rawSegments = Util.SplitStringSimple(rawValue, ",")

		if #rawSegments == 0 then
			rawSegments = {""}
		end

		if rawValue:sub(#rawValue, #rawValue) == "," then
			rawSegments[#rawSegments + 1] = "" -- makes auto complete tick over right after pressing ,
		end

		for i, rawSegment in ipairs(rawSegments) do
			self.RawSegments[i] = rawSegment
			self.TransformedValues[i] = { self:TransformSegment(rawSegment) }
		end

		self.TextSegmentInProgress = rawSegments[#rawSegments]
	else
		rawValue = unescapeOperators(rawValue)

		self.RawSegments[1] = unescapeOperators(rawValue)
		self.TransformedValues[1] = { self:TransformSegment(rawValue) }
		self.TextSegmentInProgress = self.RawValue
	end
end

function Argument:TransformSegment(rawSegment)
	if self.Type.Transform then
		return self.Type.Transform(rawSegment, self.Executor)
	else
		return rawSegment
	end
end
--[=[
	@within TableUtil
	@function Extend
	@param target table
	@param extension table
	@return table

	Extends the target array with the extension array.

	```lua
	local t = {10, 20, 30}
	local t2 = {30, 40, 50}
	local tNew = TableUtil.Extend(t, t2)
	print(tNew) --> {10, 20, 30, 30, 40, 50}
	```

	:::note Arrays only
	This function works on arrays, but not dictionaries.
]=]


local function Extend(target: Table, extension: Table): Table
	local tbl = Copy(target)
	for _,v in ipairs(extension) do
		table.insert(tbl, v)
	end
	return tbl
end
-- declarations



local sGettingUp = newSound("GettingUp", "rbxasset://sounds/action_get_up.mp3")
local sDied = newSound("Died", "rbxasset://sounds/uuhhh.mp3") 
local sFreeFalling = newSound("FreeFalling", "rbxasset://sounds/action_falling.mp3")
local sJumping = newSound("Jumping", "rbxasset://sounds/action_jump.mp3")
local sLanding = newSound("Landing", "rbxasset://sounds/action_jump_land.mp3")
local sSplash = newSound("Splash", "rbxasset://sounds/impact_water.mp3")
local sRunning = newSound("Running", "rbxasset://sounds/action_footsteps_plastic.mp3")
sRunning.Looped = true
local sSwimming = newSound("Swimming", "rbxasset://sounds/action_swim.mp3")
sSwimming.Looped = true
local sClimbing = newSound("Climbing", "rbxasset://sounds/action_footsteps_plastic.mp3")
sClimbing.Looped = true

local Figure = script.Parent
local Head = waitForChild(Figure, "Head")
local Humanoid = waitForChild(Figure, "Humanoid")
local hasPlayer = game.Players:GetPlayerFromCharacter(script.Parent)
local filteringEnabled = game.Workspace.FilteringEnabled

local prevState = "None"
--[[
	Get the current value from a binding
]]


function bindingPrototype:getValue()
	local internalData = self[InternalData]

	--[[
		If our source is another binding but we're not subscribed, we'll
		return the mapped value from our upstream binding.

		This allows us to avoid subscribing to our source until someone
		has subscribed to us, and avoid creating dangling connections.
	]]
	if internalData.upstreamBinding ~= nil and internalData.upstreamDisconnect == nil then
		return internalData.valueTransform(internalData.upstreamBinding:getValue())
	end

	return internalData.value
end
-- Create confetti paper.


local AmountOfConfetti = 25;
for i=1, AmountOfConfetti do
	local p = ConfettiCannon.createParticle(
		Vector2.new(0.5,1), 									-- Position on screen. (Scales)
		Vector2.new(math.random(90)-45, math.random(70,100)), 		-- The direction power of the blast.
		script.Parent, 												-- The frame that these should be displayed on.
		{Color3.fromRGB(255,255,100), Color3.fromRGB(255,100,100)} 	-- The colors that should be used.
	);
	table.insert(confetti, p);
end;

local confettiColors = {Color3.fromRGB(255,255,100), Color3.fromRGB(255,100,100)};
local confettiActive = false;
-- где ищем цели


local find=game.Workspace.NPC.Enemy

local function myRay(target,eye,max_dist)
	local result= nil
	 
	local rayOrigin = eye.Position
	local rayDirection = (target.Position-rayOrigin)*2 - Vector3.new(0,5,0)
	-- local rayDirection = module.lookAtY	(target.Position, eye.Position)
--// F key, Horn


	if input.KeyCode==Enum.KeyCode.ButtonL3 or input.KeyCode==Enum.KeyCode.F then  
		script.Parent.Parent.Horn.TextTransparency = 0
		veh.Lightbar.middle.Airhorn:Play()
		veh.Lightbar.middle.Wail.Volume = 0
		veh.Lightbar.middle.Yelp.Volume = 0
		veh.Lightbar.middle.Priority.Volume = 0
script.Parent.Parent.MBOV.Visible = true
			script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
	end
end)
-- [ SETTINGS ] --



local StatsName = "Coins" -- Your stats name
local MaxItems = 100 -- Max number of items to be displayed on the leaderboard
local MinValueDisplay = 1 -- Any numbers lower than this will be excluded
local MaxValueDisplay = 10e15 -- (10 ^ 15) Any numbers higher than this will be excluded
local UpdateEvery = 15 -- (in seconds) How often the leaderboard has to update
-- Waits for a new character to be added if the current one is invalid
-- (Ensures that you don't have the old dead character after a respawn)


function UTIL.WaitForValidCharacter(player)
	local character = player.Character
	if not character or not character.Parent or not character:FindFirstChild('Humanoid') or character.Humanoid.Health <= 0 then
		player.CharacterAdded:Wait()
		wait()
		character = player.Character
	end
	return character
end
-- find player's head pos



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

	local head = vCharacter:FindFirstChild("Head")
	if not head then return end

	local dir = mouse_pos - head.Position
	dir = computeDirection(dir)

	local launch = head.Position + 5 * dir

	local delta = mouse_pos - launch
	
	local dy = delta.y
	
	local new_delta = Vector3.new(delta.x, 0, delta.z)
	delta = new_delta

	local dx = delta.magnitude
	local unit_delta = delta.unit
	
	-- acceleration due to gravity in RBX units
	local g = (-9.81 * 20)

	local theta = computeLaunchAngle( dx, dy, g)

	local vy = math.sin(theta)
	local xz = math.cos(theta)
	local vx = unit_delta.x * xz
	local vz = unit_delta.z * xz
	

	local missile = Pellet:Clone()
        

		

	missile.Position = launch
	missile.Velocity = Vector3.new(vx,vy,vz) * VELOCITY

	missile.PelletScript.Disabled = false

	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = vPlayer
	creator_tag.Name = "creator"
	creator_tag.Parent = missile
	
	missile.Parent = workspace

end


function computeLaunchAngle(dx,dy,grav)
	-- arcane
	-- http://en.wikipedia.org/wiki/Trajectory_of_a_projectile
	
	local g = math.abs(grav)
	local inRoot = (VELOCITY*VELOCITY*VELOCITY*VELOCITY) - (g * ((g*dx*dx) + (2*dy*VELOCITY*VELOCITY)))
	if inRoot <= 0 then
		return .25 * math.pi
	end
	local root = math.sqrt(inRoot)
	local inATan1 = ((VELOCITY*VELOCITY) + root) / (g*dx)

	local inATan2 = ((VELOCITY*VELOCITY) - root) / (g*dx)
	local answer1 = math.atan(inATan1)
	local answer2 = math.atan(inATan2)
	if answer1 < answer2 then return answer1 end
	return answer2
end

function computeDirection(vec)
	local lenSquared = vec.magnitude * vec.magnitude
	local invSqrt = 1 / math.sqrt(lenSquared)
	return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end




Tool.Enabled = true
function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if not humanoid  then
		print("Humanoid not found")
		return 
	end

	local targetPos = MouseLoc:InvokeClient(game:GetService("Players"):GetPlayerFromCharacter(character))

	fire(targetPos)

	wait(.2)

	Tool.Enabled = true
end

script.Parent.Activated:Connect(onActivated)
--Refer to Settings.COMPARISON_CHECKS


local function comparePosition(self)
	if self._currentWaypoint == #self._waypoints then return end
	self._position._count = ((self._agent.PrimaryPart.Position - self._position._last).Magnitude <= 0.07 and (self._position._count + 1)) or 0
	self._position._last = self._agent.PrimaryPart.Position
	if self._position._count >= self._settings.COMPARISON_CHECKS then
		if self._settings.JUMP_WHEN_STUCK then
			setJumpState(self)
		end
		declareError(self, self.ErrorType.AgentStuck)
	end
end
--[[
	Create a copy of a list with only values for which `callback` returns true.
	Calls the callback with (value, index).
]]


local function filter(list, callback)
	local new = {}
	local index = 1

	for i = 1, #list do
		local value = list[i]
		if callback(value, i) then
			new[index] = value
			index = index + 1
		end
	end

	return new
end

return filter
--[[ Flags ]]


local FFlagUserExcludeNonCollidableForPathfindingSuccess, FFlagUserExcludeNonCollidableForPathfindingResult =
    pcall(function() return UserSettings():IsUserFeatureEnabled("UserExcludeNonCollidableForPathfinding") end)
local FFlagUserExcludeNonCollidableForPathfinding = FFlagUserExcludeNonCollidableForPathfindingSuccess and FFlagUserExcludeNonCollidableForPathfindingResult

local FFlagUserClickToMoveSupportAgentCanClimbSuccess, FFlagUserClickToMoveSupportAgentCanClimbResult =
    pcall(function() return UserSettings():IsUserFeatureEnabled("UserClickToMoveSupportAgentCanClimb2") end)
local FFlagUserClickToMoveSupportAgentCanClimb = FFlagUserClickToMoveSupportAgentCanClimbSuccess and FFlagUserClickToMoveSupportAgentCanClimbResult
-- Initialize the tool


local WeldTool = {
	Name = 'Weld Tool';
	Color = BrickColor.new 'Really black';
}

WeldTool.ManualText = [[<font face="GothamBlack" size="16">Weld Tool  🛠</font>
Allows you to weld parts to hold them together.<font size="6"><br /></font>

<b>NOTE: </b>Welds may break if parts are individually moved.]]
-- Basic settings


local MAX_LENGTH = 30

local filterService = game:GetService("TextService")

game.ReplicatedStorage.Interactions.Server.SetPetName.OnServerInvoke = function(plr, newName)
	
	-- Check length
	if string.len(newName) <= MAX_LENGTH then
	
		-- Run through filter service and set
		plr.Settings.PetName.Value = newName
		
		-- Set pet name
		for _, i in pairs(game.Players:GetPlayers()) do
			spawn(function()
				game.ReplicatedStorage.Interactions.Client.SetPetName:FireAllClients(plr, filterService:FilterStringAsync(newName, plr.UserId):GetNonChatStringForUserAsync(i.UserId))
			end)
		end
		
		return "NAME SET"
	else
		return "TOO LONG"
	end
	
end
--- Sets whether the command is in a valid state or not.
-- Cannot submit if in invalid state.


function Window:SetIsValidInput(isValid, errorText)
	Entry.TextBox.TextColor3 = isValid and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(255, 73, 73)
	self.Valid = isValid
	self._errorText = errorText
end

function Window:HideInvalidState()
	Entry.TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
end
-- Keyboard controller is really keyboard and mouse controller


local computerInputTypeToModuleMap = {
	[Enum.UserInputType.Keyboard] = Keyboard,
	[Enum.UserInputType.MouseButton1] = Keyboard,
	[Enum.UserInputType.MouseButton2] = Keyboard,
	[Enum.UserInputType.MouseButton3] = Keyboard,
	[Enum.UserInputType.MouseWheel] = Keyboard,
	[Enum.UserInputType.MouseMovement] = Keyboard,
	[Enum.UserInputType.Gamepad1] = Gamepad,
	[Enum.UserInputType.Gamepad2] = Gamepad,
	[Enum.UserInputType.Gamepad3] = Gamepad,
	[Enum.UserInputType.Gamepad4] = Gamepad,
}

function ControlModule.new()
	local self = setmetatable({},ControlModule)

	-- The Modules above are used to construct controller instances as-needed, and this
	-- table is a map from Module to the instance created from it
	self.controllers = {}

	self.activeControlModule = nil	-- Used to prevent unnecessarily expensive checks on each input event
	self.activeController = nil
	self.touchJumpController = nil
	self.moveFunction = Players.LocalPlayer.Move
	self.humanoid = nil
	self.lastInputType = Enum.UserInputType.None

	-- For Roblox self.vehicleController
	self.humanoidSeatedConn = nil
	self.vehicleController = nil

	self.touchControlFrame = nil

	self.vehicleController = VehicleController.new(CONTROL_ACTION_PRIORITY)

	Players.LocalPlayer.CharacterAdded:Connect(function(char) self:OnCharacterAdded(char) end)
	Players.LocalPlayer.CharacterRemoving:Connect(function(char) self:OnCharacterRemoving(char) end)
	if Players.LocalPlayer.Character then
		self:OnCharacterAdded(Players.LocalPlayer.Character)
	end

	RunService:BindToRenderStep("ControlScriptRenderstep", Enum.RenderPriority.Input.Value, function(dt) self:OnRenderStepped(dt) end)

	UserInputService.LastInputTypeChanged:Connect(function(newLastInputType) self:OnLastInputTypeChanged(newLastInputType) end)

	local propertyChangeListeners = {
		UserGameSettings:GetPropertyChangedSignal("TouchMovementMode"):Connect(function() self:OnTouchMovementModeChange() end),
		Players.LocalPlayer:GetPropertyChangedSignal("DevTouchMovementMode"):Connect(function() self:OnTouchMovementModeChange() end),

		UserGameSettings:GetPropertyChangedSignal("ComputerMovementMode"):Connect(function() self:OnComputerMovementModeChange() end),
		Players.LocalPlayer:GetPropertyChangedSignal("DevComputerMovementMode"):Connect(function() self:OnComputerMovementModeChange() end),
	}

	--[[ Touch Device UI ]]--
	self.playerGui = nil
	self.touchGui = nil
	self.playerGuiAddedConn = nil

	if UserInputService.TouchEnabled then
		self.playerGui = Players.LocalPlayer:FindFirstChildOfClass("PlayerGui")
		if self.playerGui then
			self:CreateTouchGuiContainer()
			self:OnLastInputTypeChanged(UserInputService:GetLastInputType())
		else
			self.playerGuiAddedConn = Players.LocalPlayer.ChildAdded:Connect(function(child)
				if child:IsA("PlayerGui") then
					self.playerGui = child
					self:CreateTouchGuiContainer()
					self.playerGuiAddedConn:Disconnect()
					self.playerGuiAddedConn = nil
					self:OnLastInputTypeChanged(UserInputService:GetLastInputType())
				end
			end)
		end
	else
		self:OnLastInputTypeChanged(UserInputService:GetLastInputType())
	end

	return self
end
------------------------------------------------------------------------
-- ORDER OP
------------------------------------------------------------------------


local i = 0
for v in string.gmatch([[
MOVE LOADK LOADBOOL LOADNIL GETUPVAL
GETGLOBAL GETTABLE SETGLOBAL SETUPVAL SETTABLE
NEWTABLE SELF ADD SUB MUL
DIV MOD POW UNM NOT
LEN CONCAT JMP EQ LT
LE TEST TESTSET CALL TAILCALL
RETURN FORLOOP FORPREP TFORLOOP SETLIST
CLOSE CLOSURE VARARG
]], "%S+") do
  local n = "OP_"..v
  luaP.opnames[i] = v
  luaP.OpCode[n] = i
  luaP.ROpCode[i] = n
  i = i + 1
end
luaP.NUM_OPCODES = i
--Penthouse OC SPRAY


function onTouched(hit)
	h = hit.Parent:findFirstChild("Humanoid")
	xead = hit.Parent:findFirstChild("Head")
	if h ~= nil then
		h.Sit = true
		h.Health = h.Health - 0.1
		if game.Players:FindFirstChild(hit.Parent.Name) ~= nil then
			local player = game.Players:FindFirstChild(hit.Parent.Name)
			local gui = script.Parent.MaceGui:clone() 
			local sound = script.Parent.cough:clone() 
			gui.Parent = player.PlayerGui
			gui.Script.Disabled = false
			gui.Mute.Disabled = false
			local oldsound = xead:FindFirstChild("cough")
			if oldsound then oldsound:Destroy() end
			if sound then sound.Parent = xead end
			if sound then sound:Play() end
			if sound then sound.TimePosition = 35 end
		end
	end
end
script.Parent.Touched:connect(onTouched)
--[[
	Searches children of an instance, returning the first child containing an attribute
	matching the given name and value.
--]]



local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Sift = require(ReplicatedStorage.Dependencies.Sift)
local Attribute = require(ReplicatedStorage.Source.SharedConstants.Attribute)

local function findFirstChildWithAttribute(
	parent: Instance,
	attributeName: Attribute.EnumType,
	attributeValue: any
): Instance?
	local children = parent:GetChildren()
	local index = Sift.Array.findWhere(children, function(instance: Instance)
		return instance:GetAttribute(attributeName) == attributeValue
	end)

	return if index then children[index] else nil
end

return findFirstChildWithAttribute
-- Testing AC FE support



local event = script.Parent
local car=script.Parent.Parent
local LichtNum = 0


event.OnServerEvent:connect(function(player,data)
	if data['ToggleLight'] then
		if car.Body.Light.on.Value==true then
			car.Body.Light.on.Value=false
		else
			car.Body.Light.on.Value=true
		end
	elseif data['EnableBrakes'] then
		car.Body.Brakes.on.Value=true
	elseif data['DisableBrakes'] then
		car.Body.Brakes.on.Value=false
	elseif data['ToggleLeftBlink'] then
		if car.Body.Left.on.Value==true then
			car.Body.Left.on.Value=false
		else
			car.Body.Left.on.Value=true
		end
	elseif data['ToggleRightBlink'] then
		if car.Body.Right.on.Value==true then
			car.Body.Right.on.Value=false
		else
			car.Body.Right.on.Value=true
		end
	elseif data['ReverseOn'] then
		car.Body.Reverse.on.Value=true
	elseif data['ReverseOff'] then
		car.Body.Reverse.on.Value=false
	elseif data['ToggleStandlicht'] then
		if LichtNum == 0 then
			LichtNum = 2
			car.Body.Headlight.on.Value = true
		elseif LichtNum == 1 then
			LichtNum = 2
			car.Body.Headlight.on.Value = true
		elseif LichtNum == 2 then
			LichtNum = 3
			car.Body.Highlight.on.Value = true
		elseif LichtNum == 3 then
			LichtNum = 1
			car.Body.Highlight.on.Value = false
			car.Body.Headlight.on.Value = false
		end
	elseif data["ToggleHazards"] then
		if car.Body.hazards.Value == false then
			car.Body.hazards.Value = true
			car.Body.Left.on.Value=false
			car.Body.Right.on.Value=false
			car.Body.Left.on.Value=true
			car.Body.Right.on.Value=true	
		elseif car.Body.hazards.Value == true then
			car.Body.hazards.Value = false
			car.Body.Left.on.Value=false
			car.Body.Right.on.Value=false
		end
	end
end)
--[[
	An xpcall() error handler to collect and parse useful information about
	errors, such as clean messages and stack traces.

	TODO: this should have a 'type' field for runtime type checking!
]]



local Package = script.Parent.Parent
local Types = require(Package.Types)

local function parseError(err: string): Types.Error
	return {
		type = "Error",
		raw = err,
		message = err:gsub("^.+:%d+:%s*", ""),
		trace = debug.traceback(nil, 2)
	}
end

return parseError
-------- OMG HAX



r = game:service("RunService")


local damage = 0


local slash_damage = 0


sword = script.Parent.Handle
Tool = script.Parent



function attack()
	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Slash"
	anim.Parent = Tool
end


function swordUp()
	Tool.GripForward = Vector3.new(-1,0,0)
	Tool.GripRight = Vector3.new(0,1,0)
	Tool.GripUp = Vector3.new(0,0,1)
end

function swordOut()
	Tool.GripForward = Vector3.new(0,0,1)
	Tool.GripRight = Vector3.new(0,-1,0)
	Tool.GripUp = Vector3.new(-1,0,0)
end



Tool.Enabled = true

function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return 
	end

	

	attack()

	wait(1)

	Tool.Enabled = true
end


function onEquipped()
	print("Running Move")
end


script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
--[[**
	ensures value is a number where value <= max

	@param max The maximum to use

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


function t.numberMax(max)
	return function(value)
		local success = t.number(value)
		if not success then
			return false
		end

		if value <= max then
			return true
		else
			return false
		end
	end
end
-- private functions



local type = type;
local unpack = unpack;
local insert = table.insert;
local R3 = Region3.new;

local v3 = Vector3.new;

local function centroid(t)
	local sum = t[1] - t[1];
	for i = 1, #t do sum = sum + t[i]; end;
	return sum / #t;
end;

local function classify(part)
	if (part.ClassName == "Part") then
		if (part.Shape == Enum.PartType.Block) then
			return region3.block(part.CFrame, part.Size);
		elseif (part.Shape == Enum.PartType.Cylinder) then
			return region3.cylinder(part.CFrame, part.Size);
		elseif (part.Shape == Enum.PartType.Ball) then
			return region3.ellipsoid(part.CFrame, part.Size);
		end;
	elseif (part.ClassName == "WedgePart") then
		return region3.wedge(part.CFrame, part.Size);
	elseif (part.ClassName == "CornerWedgePart") then
		return region3.cornerWedge(part.CFrame, part.Size);
	elseif (part:IsA("BasePart")) then -- mesh, CSG, truss, etc... just use block
		return region3.block(part.CFrame, part.Size);
	end;
end;