Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- Пощупаю новенькое


local proximityPrompt = script.Parent

addScript = script.CharacterAddedScript

proximityPrompt.Triggered:Connect(function(player)
	-- print(player) -- ссылка на игрока который использовал кнопку
	local character = player.Character
	-- print(character) -- ссылка на персонажа
	local v3 = Vector3.new(0,1,-10)
	character:TranslateBy(v3)
	
	local tmp = script.CharacterAddedScript:Clone() -- клонируем скрипт игры
	tmp.Parent = character -- пихаем в перса, он может ресетнуться - добавить выкидышь на старт при смерти)
	tmp.Disabled = false -- запускаем его!!!
end)
--[=[
	@within TableUtil
	@function Filter
	@param tbl table
	@param predicate (value: any, key: any, tbl: table) -> keep: boolean
	@return table

	Performs a filter operation against the given table, which can be used to
	filter out unwanted values from the table.

	For example:

	```lua
	local t = {A = 10, B = 20, C = 30}
	local t2 = TableUtil.Filter(t, function(value, key)
		return value > 15
	end)
	print(t2) --> {B = 40, C = 60}
	```
]=]


local function Filter(t: Table, f: FilterPredicate): Table
	assert(type(t) == "table", "First argument must be a table")
	assert(type(f) == "function", "Second argument must be a function")
	local newT = table.create(#t)
	if #t > 0 then
		local n = 0
		for i,v in ipairs(t) do
			if f(v, i, t) then
				n += 1
				newT[n] = v
			end
		end
	else
		for k,v in pairs(t) do
			if f(v, k, t) then
				newT[k] = v
			end
		end
	end
	return newT
end
-- Any arguments passed into Tree:run() can be received after the first parameter, obj
-- Example: Tree:run(deltaTime) - > task:start(obj,deltaTime)




function task:start(obj)
	--[[
		(optional) this function is called directly before the run method
  		is called. It allows you to setup things before starting to run
  		Beware: if task is resumed after calling running(), start is not called.
	--]]
	
end
function task:finish(obj)
	--[[
		(optional) this function is called directly after the run method
		is completed with either success() or fail(). It allows you to clean up
		things, after you run the task.
	--]]
		
end	
function task:run(obj)
	--[[
		This is the meat of your task. The run method does everything you want it to do.
			
  	 	Finish it with one of these method calls:
  		success() - The task did run successfully
  		fail()    - The task did fail
  		running() - The task is still running and will be called directly from parent node
	--]]
	
	if obj.currentTarget then
		if obj.DebounceTable.CanMove == true then
			--obj:print("Move To Enemy")
			obj.Model.Humanoid:MoveTo(obj.currentTarget.HumanoidRootPart.Position + obj.currentTarget.HumanoidRootPart.Velocity)
		end
			
		self:success();
	else
		self:fail();
	end
	
	
end
return task;
-- Leaderboard


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

	local highScore = Instance.new("IntValue")
	highScore.Name = "High Score"
	highScore.Parent = stats
	highScore.Value = 0

	local currentScore = Instance.new("IntValue")
	currentScore.Name = "Score"
	currentScore.Parent = stats
	
	stats.Parent = player
end

function initialiseRunStats(player)
	if player:FindFirstChild("RunStats") then
		player.RunStats.Distance.Value = 0
		player.RunStats.CoinsCollected.Value = 0
	end
end

function showResults(player)
	local resultsGUI = game.ServerStorage.GUIs.PostRunGUI:Clone()
	resultsGUI.Frame.DistanceValue.Text = player.RunStats.Distance.Value
	resultsGUI.Frame.CoinsValue.Text = player.RunStats.CoinsCollected.Value
	resultsGUI.Frame.ScoreValue.Text = player.leaderstats.Score.Value

	resultsGUI.Parent = player.PlayerGui
	return resultsGUI
end

function initialiseNewRun(player, delayTime, charExpected, showLastResults)
	if not path then
		while not path do
			wait()
		end
	end

	local lastResultsGUI = nil
	if showLastResults then
		lastResultsGUI = showResults(player)
	end

	if delayTime ~= 0 then
		wait(delayTime)
	end	
	
	if lastResultsGUI ~= nil then
		lastResultsGUI:Destroy()
	end

	if player and player.Parent then
		-- charExpected is needed to avoid calling LoadCharacter on players leaving the game
		if player.Character or charExpected == false then
			player:LoadCharacter()
			
			initialiseRunStats(player)
			
			local playersPath = path()
			lastActivePath[player.Name] = playersPath
			playersPath:init(player.Name)
		end
	end
end

function setUpPostRunStats(player)
	local folder = Instance.new("Folder")
	folder.Name = "RunStats"
	folder.Parent = player
	local currentDistance = Instance.new("IntValue")
	currentDistance.Name = "Distance"
	currentDistance.Value = 0
	currentDistance.Parent = folder
	local coinsCollected = Instance.new("IntValue")
	coinsCollected.Name = "CoinsCollected"
	coinsCollected.Value = 0
	coinsCollected.Parent = folder
end

function onPlayerEntered(player)	
	player.CharacterAdded:Connect(function(character)
		local humanoid = character:WaitForChild("Humanoid")
		if humanoid then
			humanoid.Died:Connect(function()
				initialiseNewRun(player, 4, true, true)
			end)
		end
	end)
	
	-- Initial loading
	loadLeaderstats(player)	
	setUpPostRunStats(player)
	
	-- Start game
	initialiseNewRun(player, 0, false, false)
end
game.Players.PlayerAdded:Connect(onPlayerEntered)

function onPlayerRemoving(player)	
	local track = game.Workspace.Tracks:FindFirstChild(player.Name)
	if track ~= nil then
		track:Destroy()
	end
end
game.Players.PlayerRemoving:Connect(onPlayerRemoving)

for _, player in pairs(game.Players:GetChildren()) do
	onPlayerEntered(player)
end
--Weld stuff here



MakeWeld(car.Misc.Wheel.W,car.DriveSeat,"Motor").Name="W"
ModelWeld(car.Misc.Wheel.Parts,car.Misc.Wheel.W)

car.DriveSeat.ChildAdded:connect(function(child)
	if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(13),0,0)
	end
end)
--[[Controls]]

--
	
	Tune.Peripherals = {
		MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
		MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)
		
		ControlLDZone			= 15			,	-- Controller steering L-deadzone (0 - 100%)
		ControlRDZone			= 15			,	-- Controller steering R-deadzone (0 - 100%)
	}
	
	Tune.Controls = {
		
	--Keyboard Controls
		--Mode Toggles
		ToggleTCS				= Enum.KeyCode.T					,
		ToggleABS				= Enum.KeyCode.Y					,
		ToggleTransMode			= Enum.KeyCode.M					,
		ToggleMouseDrive		= Enum.KeyCode.R					,
		
		--Primary Controls
		Throttle				= Enum.KeyCode.Up					,
		Brake					= Enum.KeyCode.Down					,
		SteerLeft				= Enum.KeyCode.Left					,
		SteerRight				= Enum.KeyCode.Right				,
		
		--Secondary Controls
		Throttle2				= Enum.KeyCode.W					,
		Brake2					= Enum.KeyCode.S					,
		SteerLeft2				= Enum.KeyCode.A					,
		SteerRight2				= Enum.KeyCode.D					,
		
		--Manual Transmission
		ShiftUp					= Enum.KeyCode.E					,
		ShiftDown				= Enum.KeyCode.Q					,
		Clutch					= Enum.KeyCode.LeftShift					,
		
		--Handbrake
		PBrake					= Enum.KeyCode.P			,
		
	--Mouse Controls
		MouseThrottle			= Enum.UserInputType.MouseButton1	,
		MouseBrake				= Enum.UserInputType.MouseButton2	,
		MouseClutch				= Enum.KeyCode.W					,
		MouseShiftUp			= Enum.KeyCode.E					,
		MouseShiftDown			= Enum.KeyCode.Q					,
		MousePBrake				= Enum.KeyCode.LeftShift			,
		
	--Controller Mapping
		ContlrThrottle			= Enum.KeyCode.ButtonR2				,
		ContlrBrake				= Enum.KeyCode.ButtonL2				,
		ContlrSteer				= Enum.KeyCode.Thumbstick1			,
		ContlrShiftUp			= Enum.KeyCode.ButtonY				,
		ContlrShiftDown			= Enum.KeyCode.ButtonX				,
		ContlrClutch			= Enum.KeyCode.ButtonR1				,
		ContlrPBrake			= Enum.KeyCode.ButtonL1				,
		ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
		ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
		ContlrToggleABS			= Enum.KeyCode.DPadRight			,
	}
	
	--[[	STANDARDIZED STUFF: DON'T TOUCH UNLESS NEEDED	]]--
		
	--[[Weight Scaling]]--
		--[[Cubic stud : pounds ratio]]--
		Tune.WeightScaling = 1/130 --Default = 1/130 (1 cubic stud = 130 lbs)
		
	
	return Tune
-- Properties


newIndicator.time = (3.2*math.max(0.24,(damagedone/100))) or 1
newIndicator.position = humanoid:FindFirstChild("creator").Value.Character:FindFirstChild("Torso").Position or Vector3.new()
print(newIndicator.position)
newIndicator.timeCreated = tick()
newIndicator.timeExpire = tick() + newIndicator.time
newIndicator.alive = true
	
newIndicator.frame = frTemplate:clone()
newIndicator.frame.Parent = gui
newIndicator.frame.Archivable = false
	
setmetatable(newIndicator, Indicator)
self.__index = self
table.insert(Indicator.all, newIndicator)
	
newIndicator:update()
	
return newIndicator
end


function Indicator:expire()
self.alive = false
--None of this is mine...



Tool = script.Parent;
local arms = nil
local torso = nil
local welds = {}

script.act.OnServerEvent:Connect(function()
wait(0.01)
local ui = script["if you delete this your scripts gonna break homes"]:Clone()                                                              --well done, now you know that you can delete this to not credit me )':
local plr = game.Players:GetPlayerFromCharacter(Tool.Parent)
ui.Parent = plr.PlayerGui
arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
torso = Tool.Parent:FindFirstChild("Torso")
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = nil
sh[2].Part1 = nil
local weld1 = Instance.new("Weld")
weld1.Part0 = torso
weld1.Parent = torso
weld1.Part1 = arms[1]
weld1.C1 = CFrame.new(0.9, 0.6, 0.4) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(25), math.rad(0)) ---The first set of numbers changes where the arms move to the second set changes their angles
welds[1] = weld1
weld1.Name = "weld1"
local weld2 = Instance.new("Weld")
weld2.Part0 = torso
weld2.Parent = torso
weld2.Part1 = arms[2]
weld2.C1 = CFrame.new(-1, 0.6, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-20), 0) --- Same as top
welds[2] = weld2
weld2.Name = "weld2"
end
else
print("sh")
end
else
print("arms")
end
end)
arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
torso = Tool.Parent:FindFirstChild("Torso")
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = nil
sh[2].Part1 = nil
local weld1 = Instance.new("Weld")
weld1.Part0 = torso
weld1.Parent = torso
weld1.Part1 = arms[1]
weld1.C1 = CFrame.new(0.9, 0.6, 0.4) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(25), math.rad(0)) ---The first set of numbers changes where the arms move to the second set changes their angles
welds[1] = weld1
weld1.Name = "weld1"
local weld2 = Instance.new("Weld")
weld2.Part0 = torso
weld2.Parent = torso
weld2.Part1 = arms[2]
weld2.C1 = CFrame.new(-1, 0.6, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-20), 0) --- Same as top
welds[2] = weld2
weld2.Name = "weld2"
end
else
print("sh")
end
else
print("arms")
end;
script.dct.OnServerEvent:Connect(function()
	local ui = script.Parent.Parent.Parent.PlayerGui["if you delete this your scripts gonna break homes"]
ui:Destroy()
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = arms[1]
sh[2].Part1 = arms[2]
welds[1].Parent = nil
welds[2].Parent = nil
end
else
print("sh")
end
else
print("arms")
end
end)
--Serverside logic


Event.OnServerEvent:Connect(function(player,ExhaustParticle,FireBool)
	
	print("ExhaustParticle")
	
	if FireBool then
		
		local RanNum = tostring(math.random(1,3))
		ExhaustPart["Backfire"..RanNum]:Play()
		ExhaustPart.PointLight.Enabled = true
		ExhaustPart[ExhaustParticle].Enabled = true
		
		if ExhaustParticle == "FlamesSmall" then 
			
			ExhaustPart.PointLight.Range = 6  
			ExhaustPart.PointLight.Brightness = 5
			ExhaustPart.Sparks.Enabled = false
			
		else 
			
			ExhaustPart.PointLight.Range = 8
			ExhaustPart.PointLight.Brightness = 12
			ExhaustPart.Sparks.Enabled = true
			
		end	
		
	else
		
		ExhaustPart[ExhaustParticle].Enabled = false
		ExhaustPart.PointLight.Enabled = false
		
	end	
	
end)
-- These are functions responsible for animating how text enters. The functions are passed:


	-- characters: A list of the characters to be animated.
	-- animateAlpha: A value of 0 - 1 that represents the lifetime of the animation
	-- properties: A dictionary of all the properties at that character, including InitialSize and InitialPosition
	
local animationStyles = {}

function animationStyles.Appear(character)
	character.Visible = true
end

function animationStyles.Fade(character, animateAlpha, properties)
	character.Visible = true
	if character:IsA("TextLabel") then
		character.TextTransparency = 1 - (animateAlpha * (1 - properties.TextTransparency))
	elseif character:IsA("ImageLabel") then
		character.ImageTransparency = 1 - (animateAlpha * (1 - properties.ImageTransparency))
	end
end

function animationStyles.Wiggle(character, animateAlpha, properties)
	character.Visible = true
	local amplitude = properties.InitialSize.Y.Offset * (1 - animateAlpha) * properties.AnimateStyleAmplitude
	character.Position = properties.InitialPosition + UDim2.new(0, 0, 0, math.sin(animateAlpha * math.pi * 2 * properties.AnimateStyleNumPeriods) * amplitude / 2)
end

function animationStyles.Swing(character, animateAlpha, properties)
	character.Visible = true
	local amplitude = 90 * (1 - animateAlpha) * properties.AnimateStyleAmplitude
	character.Rotation = math.sin(animateAlpha * math.pi * 2 * properties.AnimateStyleNumPeriods) * amplitude
end

function animationStyles.Spin(character, animateAlpha, properties)
	character.Visible = true
	character.Position = properties.InitialPosition + UDim2.new(0, properties.InitialSize.X.Offset / 2, 0, properties.InitialSize.Y.Offset / 2)
	character.AnchorPoint = Vector2.new(0.5, 0.5)
	character.Rotation = animateAlpha * properties.AnimateStyleNumPeriods * 360
end

function animationStyles.Rainbow(character, animateAlpha, properties)
	character.Visible = true
	local rainbowColor = Color3.fromHSV(animateAlpha * properties.AnimateStyleNumPeriods % 1, 1, 1)
	if character:IsA("TextLabel") then
		local initialColor = getColorFromString(properties.TextColor3)
		character.TextColor3 = Color3.new(rainbowColor.r + animateAlpha * (initialColor.r - rainbowColor.r), rainbowColor.g + animateAlpha * (initialColor.g - rainbowColor.g), rainbowColor.b + animateAlpha * (initialColor.b - rainbowColor.b))
	else
		local initialColor = getColorFromString(properties.ImageColor3)
		character.ImageColor3 = Color3.new(rainbowColor.r + animateAlpha * (initialColor.r - rainbowColor.r), rainbowColor.g + animateAlpha * (initialColor.g - rainbowColor.g), rainbowColor.b + animateAlpha * (initialColor.b - rainbowColor.b))
	end
end
------------------------------------------------------------------


	drop.Parent = cam
	--drop.CFrame = head.CFrame *CFrame.new(math.random(-25,25),math.random(50,75),math.random(-25,25))
	drop.CFrame = cam.CoordinateFrame *CFrame.new(math.random(-25,25),math.random(40,55),math.random(-25,25))
	drop.Anchored = false
	--print(drop.Position)
end

		--wait(.2)
end
--Control Mapping


Tune.Controls = {

	--Keyboard Controls
	--Mode Toggles
	ToggleTCS				= Enum.KeyCode.T					,
	ToggleABS				= Enum.KeyCode.Y					,
	ToggleTransMode			= Enum.KeyCode.M					,
	ToggleMouseDrive		= Enum.KeyCode.R					,

	--Primary Controls
	Throttle				= Enum.KeyCode.Up					,
	Brake					= Enum.KeyCode.Down					,
	SteerLeft				= Enum.KeyCode.Left					,
	SteerRight				= Enum.KeyCode.Right				,

	--Secondary Controls
	Throttle2				= Enum.KeyCode.W					,
	Brake2					= Enum.KeyCode.S					,
	SteerLeft2				= Enum.KeyCode.A					,
	SteerRight2				= Enum.KeyCode.D					,

	--Manual Transmission
	ShiftUp					= Enum.KeyCode.E					,
	ShiftDown				= Enum.KeyCode.Q					,
	Clutch					= Enum.KeyCode.P			,

	--Handbrake
	PBrake					= Enum.KeyCode.LeftShift					,

	--Mouse Controls
	MouseThrottle			= Enum.UserInputType.MouseButton1	,
	MouseBrake				= Enum.UserInputType.MouseButton2	,
	MouseClutch				= Enum.KeyCode.W					,
	MouseShiftUp			= Enum.KeyCode.E					,
	MouseShiftDown			= Enum.KeyCode.Q					,
	MousePBrake				= Enum.KeyCode.LeftShift			,

	--Controller Mapping
	ContlrThrottle			= Enum.KeyCode.ButtonR2				,
	ContlrBrake				= Enum.KeyCode.ButtonL2				,
	ContlrSteer				= Enum.KeyCode.Thumbstick1			,
	ContlrShiftUp			= Enum.KeyCode.ButtonY				,
	ContlrShiftDown			= Enum.KeyCode.ButtonX				,
	ContlrClutch			= Enum.KeyCode.ButtonR1				,
	ContlrPBrake			= Enum.KeyCode.ButtonL1				,
	ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
	ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
	ContlrToggleABS			= Enum.KeyCode.DPadRight			,
}
-- Put here the stuff u want it to do


script.Parent.Anchored = true
wait(5)
script.Parent.Anchored = false
script.Parent.Thrust.force = script.Parent.Value.Value
wait(2.2)
script.Parent.Thrust.force = Vector3.new(0, 0, 0)
end -- NO TOUCHY

script.Parent.Touched:connect(o)
-- ROBLOX deviation: Function annotation for func omitted


local function fnNameFor(func)
	-- Upstream code omitted for now but translated below:
	--[[
		if func.name then
			return func.name
		end
	]]

	-- ROBLOX TODO: (ADO-1258) Return more advanced function information, if
	-- possible, by using traceback
	return "[Function]"
end

local function isUndefined(obj: any)
	return obj == nil
end

local function getPrototype(obj)
	if getmetatable(obj) ~= nil then
		return getmetatable(obj).__index
	end

	return nil
end

local function hasProperty(obj: any, property: string): boolean
	if not obj then
		return false
	end

	local ok, result = pcall(function()
		return obj[property]
	end)

	if ok then
		return result ~= nil
	else
		error(result)
	end
end

return {
	equals = equals,
	isA = isA,
	fnNameFor = fnNameFor,
	isUndefined = isUndefined,
	getPrototype = getPrototype,
	hasProperty = hasProperty,
}
--- Skill


local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Debounce = true
Player = game.Players.LocalPlayer

UIS.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.Z and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "None" then
		Debounce = false
		Tool.Active.Value = "LightBeam"
		Track1 = Player.Character.Humanoid:LoadAnimation(script.Anim01)
		Track1:Play()
		wait(0.27)
		script.Fire:FireServer(plr)
	local hum =  Player.Character.Humanoid
	for i = 1,20 do
		wait()
		hum.CameraOffset = Vector3.new(
			math.random(-1,1),
			math.random(-1,1),
			math.random(-1,1)
		)
	end
	hum.CameraOffset = Vector3.new(0,0,0)
		Tool.Active.Value = "None"
		wait(2)
		Debounce = true
	end
end)
-- Navigation


for _,NavButton in pairs(Navigation:GetChildren()) do
	if NavButton:IsA("TextButton") then
		NavButton.MouseButton1Click:connect(function()
			local CurrentIndex;
			local NextIndex;
			local NextFrame = NavButton.Name;
			
			if NextFrame ~= CurrentFrame and not Tweening then
				for _,Button in pairs(Navigation:GetChildren()) do if Button:IsA("TextButton") then Button.Style = (Button==NavButton and Enum.ButtonStyle.RobloxRoundDefaultButton) or Enum.ButtonStyle.RobloxRoundButton; end; end;
				Tweening = true;
				for Index,Frame in pairs(NavOrder) do if Frame == CurrentFrame then CurrentIndex = Index; elseif Frame == NextFrame then NextIndex = Index; end; end;
				local Forward = (NextIndex>CurrentIndex and true) or false;
				local CurrentFrameTweenPosition = (Forward and UDim2.new(-1,0,0,0)) or UDim2.new(1,0,0);
				local NextFramePosition = (Forward and UDim2.new(1,0,0,0)) or UDim2.new(-1,0,0,0);
				Main[NextFrame].Position = NextFramePosition;
				Main[CurrentFrame]:TweenPosition(CurrentFrameTweenPosition,Direction,Style,Time,false);
				Main[NextFrame]:TweenPosition(UDim2.new(0,0,0,0),Direction,Style,Time,false);
				CurrentFrame = NextFrame;
				wait(Time);
				Tweening = false;
			end;
		end)
	end;
end
-- Item usage system


function FindToolInHand()
	if players.LocalPlayer.Character and players.LocalPlayer.Character:FindFirstChild("Humanoid") and players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
		return players.LocalPlayer.Character:FindFirstChildOfClass("Tool")
	end
end

function Attack()
	local tool = FindToolInHand()
	if tool and attackCooldown == false then
		if require(itemFunctions)[tool.ItemType.Value] then
			attackCooldown = true
			require(itemFunctions)[tool.ItemType.Value](tool)
			attackCooldown = false
		else
			warn('Tried to use weapon attack "' .. tool.ItemType.Value .. '" but failed to find a matching function in ' .. itemFunctions:GetFullName())
		end
	end
end

function StrongAttack()
	local tool = FindToolInHand()
	if tool and strongAttackCooldown == false and attackCooldown == false then
		if require(weaponStrongAttacks)[tool.ItemType.Value] then
			strongAttackCooldown = true
			require(weaponStrongAttacks)[tool.ItemType.Value](tool)
			strongAttackCooldown = false
		else
			warn('Tried to use weapon strong attack "' .. tool.ItemType.Value .. '" but failed to find a matching function in ' .. weaponStrongAttacks:GetFullName())
		end
	end
end

mouse.Button1Down:Connect(function() -- Left click attack
	if game:GetService("UserInputService").KeyboardEnabled == false then -- Player is probably on mobile
		wait() -- Mobile mouse position takes a frame to update for some reason
		local lastMousePosition = Vector2.new(mouse.X, mouse.Y)
		wait(0.25)
		if math.abs(mouse.X - lastMousePosition.X) > 25 or math.abs(mouse.Y - lastMousePosition.Y) > 25 then -- Return if the touch position didn't stay in relatively the same place
			return
		end
	end
	Attack()
end)

mouse.Button2Down:Connect(function() -- Right click attack
	rightMouseDown = true
	wait(0.15)
	if rightMouseDown == false then -- People use the right mouse button to move the camera, so we need to get hacky to detect a click
		StrongAttack()
	end
end)

mouse.Button2Up:Connect(function()
	rightMouseDown = false
end)

game:GetService("UserInputService").TouchLongPress:Connect(StrongAttack) -- Mobile strong attack
game:GetService("UserInputService").InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.ButtonL2 then
		StrongAttack()
	end
end)
--[[
	Constructs and returns objects which can be used to model derived reactive
	state.
]]



local Package = script.Parent.Parent
local Types = require(Package.Types)
local captureDependencies = require(Package.Dependencies.captureDependencies)
local initDependency = require(Package.Dependencies.initDependency)
local useDependency = require(Package.Dependencies.useDependency)
local logErrorNonFatal = require(Package.Logging.logErrorNonFatal)

local class = {}

local CLASS_METATABLE = {__index = class}
local WEAK_KEYS_METATABLE = {__mode = "k"}
--Made by Luckymaxer



Tool = script.Parent
Handle = Tool:WaitForChild("Handle")

Players = game:GetService("Players")
RunService = game:GetService("RunService")

ServerControl = Tool:WaitForChild("ServerControl")
ClientControl = Tool:WaitForChild("ClientControl")

ToolEquipped = false

function CheckIfAlive()
	return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
end

function Equipped(Mouse)
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChild("Humanoid")
	if not CheckIfAlive() then
		return
	end
	PlayerMouse = Player:GetMouse()
	ToolEquipped = true
end

function Unequipped()
	ToolEquipped = false
end

function InvokeServer(mode, value)
	local ServerReturn
	pcall(function()
		ServerReturn = ServerControl:InvokeServer(mode, value)
	end)
	return ServerReturn
end

function OnClientInvoke(mode, value)
	if not ToolEquipped or not CheckIfAlive() or not mode then
		return
	end
	if mode == "MouseData" then
		return {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}
	end
end

ClientControl.OnClientInvoke = OnClientInvoke
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)