Roblox/luau_corpus huggingface dataset:
----------------------------------
-----------CONNECTIONS------------
----------------------------------

PianoKeysConnections = {};
ExitButtonConnection = nil;
SheetsButtonConnection = nil;
CapsButtonConnection = nil;
TransDnConnection = nil;
TransUpConnection = nil;
VolumeUpConnection = nil;
VolumeDownConnection = nil;

function MakeGuiConnections()
	for i, v in pairs(PianoGui.Keys:GetChildren()) do
		PianoKeysConnections[i] = v.InputBegan:connect(function(Object) PianoKeyPressed(Object, tonumber(v.Name)) end)
	end
	
	ExitButtonConnection = PianoGui.ExitButton.InputBegan:connect(ExitButtonPressed)
	SheetsButtonConnection = PianoGui.SheetsButton.InputBegan:connect(SheetsButtonPressed)
	CapsButtonConnection = PianoGui.CapsButton.InputBegan:connect(CapsButtonPressed)
	
	TransDnConnection = PianoGui.TransDnButton.MouseButton1Click:connect(function()
		Transpose(-1)
	end)
	
	TransUpConnection = PianoGui.TransUpButton.MouseButton1Click:connect(function()
		Transpose(1)
	end)
	
	VolumeUpConnection = PianoGui.VolumeUpButton.MouseButton1Click:connect(function()
		VolumeChange(.1)
	end)
	
	VolumeDownConnection = PianoGui.VolumeDownButton.MouseButton1Click:connect(function()
		VolumeChange(-.1)
	end)
end
function BreakGuiConnections()
	for i, v in pairs(PianoKeysConnections) do
		v:disconnect()
	end
	
	ExitButtonConnection:disconnect()
	SheetsButtonConnection:disconnect()
	CapsButtonConnection:disconnect()
end
-- Place in main folder

aud = script.Parent.AudibleCircuit

wait(1)

while true do
aud.Value = 1
wait(0.5)
aud.Value = 0
wait(2.5)
end
-- Provide an interface into the module
return {

	-- Provide access to internal options
	Options = Options;

	-- Provide client actions API
	PerformAction = function (Client, ActionName, ...)

		-- Make sure the action exists
		local Action = Actions[ActionName];
		if not Action then
			return;
		end;

		-- Ensure client is current player in tool mode
		if ToolMode == 'Tool' then
			--assert(Player and (Client == Player), 'Permission denied for client');
		end;

		-- Execute valid actions
		local rs = game:GetService("RunService")
		return Action(...);

	end;

};
--SKP_10:Create(SKP_23,TweenInfo.new(2.5 * Hurt,Enum.EasingStyle.Sine,Enum.EasingDirection.In,0,false,0),{TintColor = Color3.new(1,1,1)}):Play()

SKP_11:AddItem(SKP_22, 3 * Hurt)
SKP_11:AddItem(SKP_23, 2.5 * Hurt)
end

SKP_20 = SKP_7.Health
end)

local SKP_24 = false

SKP_15.Variaveis.Dor.Changed:Connect(function(Valor)
	
end)

SKP_17.Changed:Connect(function(Valor)
	if Valor >= SKP_17.MaxValue/2 then
		SKP_12.Saturation	= ((Valor*2)/SKP_17.MaxValue) - 2
	elseif Valor < SKP_17.MaxValue/2 then
		SKP_12.Saturation = -1
	elseif Valor <= 0 then
		SKP_12.Saturation = -1
	end
end)

SKP_15.Variaveis.HitCount.Changed:Connect(function(Valor)
	if Valor >= 3 then
		SKP_4.Render:FireServer(true,"N/A")
	end
end)

SKP_16.Changed:Connect(function(Valor)
	if Valor == true then
		SKP_13.Brightness = -10
	else
		SKP_13.Brightness = 0
	end
end)


SKP_7.Died:Connect(function()

Morto = true

SKP_7.AutoRotate = false

SKP_13.TintColor = Color3.new(1,1,1)
--[[Engine]]
	--Torque Curve
	Tune.Horsepower		= 290		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6000		--		Use sliders to manipulate values
	Tune.Redline		= 6700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 4.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 150		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)
--[=[
	Chains onto an existing Promise and returns a new Promise.

	:::warning
	Within the failure handler, you should never assume that the rejection value is a string. Some rejections within the Promise library are represented by [[Error]] objects. If you want to treat it as a string for debugging, you should call `tostring` on it first.
	:::

	Return a Promise from the success or failure handler and it will be chained onto.

	@param successHandler (...: any) -> ...any
	@param failureHandler? (...: any) -> ...any
	@return Promise<...any>
]=]
function Promise.prototype:andThen(successHandler, failureHandler)
	assert(successHandler == nil or isCallable(successHandler), string.format(ERROR_NON_FUNCTION, "Promise:andThen"))
	assert(failureHandler == nil or isCallable(failureHandler), string.format(ERROR_NON_FUNCTION, "Promise:andThen"))

	return self:_andThen(debug.traceback(nil, 2), successHandler, failureHandler)
end
-- Remade by Truenus(1)
wait(0.05)
local car = script.Parent.Parent.Car.Value
local GBrake = script.Parent.Parent.Values.Brake
local lighton=BrickColor.new("Institutional white")
local lightoff=BrickColor.new("Dark stone grey")
function LightOn()
	for i,v in pairs(car.Body.Lights:GetChildren()) do
		if v.Name=="Light" then
			v.BrickColor=lighton
			v.Material=Enum.Material.Neon
			v.Light.Enabled = true
			for i,v in pairs(car.Body.Lights:GetChildren()) do
		if v.Name=="R" then
			v.Material=Enum.Material.Neon
			v.Light.Enabled = true
			v.Transparency =.02
		end
	end
		end
	end
end

function LightOff()
	for i,v in pairs(car.Body.Lights:GetChildren()) do
		if v.Name=="Light" then
			v.BrickColor=lightoff
			v.Material=Enum.Material.SmoothPlastic
			v.Light.Enabled = false
			
			for i,v in pairs(car.Body.Lights:GetChildren()) do
			if v.Name=="R" then
				v.BrickColor=BrickColor.new("Maroon")
			v.Material=Enum.Material.SmoothPlastic
			v.Light.Enabled = false
			v.Transparency =0
			end
			end
			end
			end
	end
function Auto()
	if (game.Lighting:GetMinutesAfterMidnight()<390 or game.Lighting:GetMinutesAfterMidnight()>1050) then
		LightOn()
	else
		LightOff()
		end
end
script.Parent.MouseButton1Click:connect(function()
	if script.Parent.Text=="Lights: Auto" then
		LightOn()
		script.Parent.Text = "Lights: On"
	elseif script.Parent.Text == "Lights: On" then
		LightOff()
		script.Parent.Text = "Lights: Off"
	elseif script.Parent.Text == "Lights: Off" then
		Auto()
		script.Parent.Text = "Lights: Auto"
	end
end)
script.Parent.Parent.Values.Brake.Changed:connect(function()
	for i,v in pairs(car.Body.Lights:GetChildren()) do
		if v.Name=="R" then
			if v.Light.Enabled==true then
				if GBrake.Value>0 then
					v.Transparency=0
					v.Light.Brightness=12
					v.Light.Range=15
					v.BrickColor=BrickColor.new("Really red")
				else
					v.BrickColor=BrickColor.new("Maroon")
					v.Material=Enum.Material.Sand
					v.Transparency=.02
					v.Light.Brightness=8
					v.Light.Range=10
				end
			else
				v.Transparency=0
				if GBrake.Value>0 then
					v.Material=Enum.Material.Neon
					v.BrickColor=BrickColor.new("Really red")
				else
					v.BrickColor=BrickColor.new("Maroon")
					v.Material=Enum.Material.Sand
				end
			end
		elseif v.Name=="RR" then
			if GBrake.Value>0 then
				v.Material=Enum.Material.Neon
				if v.Light.Enabled then
					v.Transparency=1
				else
					v.Transparency=0
				end
			else
				v.Transparency=1
				if v.Light.Enabled then
					v.Material=Enum.Material.Neon
				else
					v.Material=Enum.Material.Sand
				end
			end
		end
	end
end)

game.Lighting.Changed:connect(Auto)
Auto()
--[[Front]]--
Tune.FSusDamping	= 10 		-- Dampening
Tune.FSusStiffness	= 250 		-- Stiffness

Tune.FSusLength		= 1.67	-- Suspension length (in studs)
Tune.FPreComp		= .82 		-- Vehicle height, relative to your suspension settings
Tune.FExtLimit		= 0 		-- Max Extension Travel (in studs)
Tune.FCompLimit		= 0 		-- Max Compression Travel (in studs)

Tune.FBaseOffset	= {			-- Suspension (steering point) base
	--[[Lateral]]		0		,	-- positive = outward
	--[[Vertical]]		0		,	-- positive = upward
	--[[Forward]]		0		}	-- positive = forward
Tune.FAxleOffset	= {			-- Suspension (axle point) base
	--[[Lateral]]		0		,	-- positive = outward
	--[[Vertical]]		0		,	-- positive = upward
	--[[Forward]]		0		}	-- positive = forward

Tune.FBricksVisible	= false 	-- Makes the front suspension bricks visible (Debug)
Tune.FConstsVisible	= false 	-- Makes the front suspension constraints visible (Debug)
-- Get sound id
get_material = function()
    
    local soundTable = footstepsModule:GetTableFromMaterial(humanoid.FloorMaterial)
    local randomSound = footstepsModule:GetRandomSound(soundTable)
    
    if check_repetition(randomSound) == false then
        return randomSound
    else
        randomSound = get_material()
        
        return randomSound
    end
end
--[[
	ROBLOX TODO: add default generic param when possible
	original code:
	export type Expect<State extends MatcherState = MatcherState> = {
]]
export type Expect<State> = {
	-- ROBLOX deviation: no way to express __call metamethod typing
	-- <T = unknown>(actual: T) -> Matchers<void, T>;

	-- TODO: this is added by test runners, not `expect` itself
	addSnapshotSerializer: (any) -> (),
	assertions: (number) -> (),
	-- TODO: remove this `T extends` - should get from some interface merging
	extend: <T>(MatchersObject<T>) -> (),
	extractExpectedAssertionsErrors: () -> ExpectedAssertionsErrors,
	getState: () -> State,
	hasAssertions: () -> (),
	setState: (Partial<MatcherState>) -> (),
} & AsymmetricMatchers & {
	never: AsymmetricMatchersOmitAnyAndAnything,
}
-- If you do not know how to use this or the GUI, check out my YouTube video tutorial on this. 
-- Replace the 0's with your ID's 
-- Delete what you dont use, besides the first part of the function


game.StarterGui.ResetPlayerGuiOnSpawn = false
old_fog = game.Lighting.FogStart
local MarketplaceService = game:GetService("MarketplaceService")

function getPlayerFromId(id)
	for i,v in pairs(game.Players:GetChildren()) do
		if v.userId == id then
			return v
		end
	end
	return nil
end
 
MarketplaceService.ProcessReceipt = function(receiptInfo)
	local productId = receiptInfo.ProductId
	local playerId = receiptInfo.PlayerId
	local player = getPlayerFromId(playerId)
	local productName 
	
	-- Down below is an example of a Cash boost
	
	-------------------------------------------------------------------
	
	if productId == 0 then
		local cashmoney = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
			if cashmoney then
				cashmoney.Value = cashmoney.Value + 5000
			end
		-------------------------------------------------------------------
	
		-- Down below is an example of a Health boost
		
		-------------------------------------------------------------------
	
		elseif productId == 0 then
		local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(player.Name)
		local char = player.Character
		char.Humanoid.MaxHealth = char.Humanoid.MaxHealth + 15
		wait()
		char.Humanoid.Health = char.Humanoid.MaxHealth
		-------------------------------------------------------------------
	
		-- Down below is an example of a WalkSpeed boost
	
		-------------------------------------------------------------------
		elseif productId == 0 then
		local char = player.Character
		if char then
			local human = char:FindFirstChild("Humanoid")
			if human then
				human.WalkSpeed = human.WalkSpeed + 15
			end
		end
		-------------------------------------------------------------------
		
		-- Down below is an example of a gear giver
		
		-------------------------------------------------------------------
		
    	elseif productId == 0 then
		game.ServerStorage.Sword:Clone().Parent=player.Backpack
		
		elseif productId == 0 then
		game.ServerStorage.Sword2:Clone().Parent=player.Backpack  -- Example if you want to make another gear giver, delete the 2 lines if you dont need it
	
		-------------------------------------------------------------------
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted		
end
---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- 

input.InputChanged:connect(function(inputObject)
	
	if inputObject.UserInputType == Enum.UserInputType.MouseMovement then
		local delta = Vector2.new(inputObject.Delta.x/Sensitivity,inputObject.Delta.y/Sensitivity) * Smoothness

		local X = TargetAngleX - delta.y 
		TargetAngleX = (X >= 80 and 80) or (X <= -80 and -80) or X 
		TargetAngleY = (TargetAngleY - delta.x) %360 
	end	
	
end)

input.InputBegan:connect(function(inputObject)
	
	if inputObject.UserInputType == Enum.UserInputType.Keyboard then
		if inputObject.KeyCode == CanToggleMouse.activationkey then
			if CanToggleMouse.allowed and freemouse == false then
				freemouse = true
			else
				freemouse = false
			end
		end
	end
	
end)
--[[Weight and CG]]
	Tune.Weight			= 3000		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		8		,
	 --[[Height]]		7.8		,
	 --[[Length]]		23		}
	Tune.WeightDist		= 50		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .8		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .1		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- Rear Wheel Density
	Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
	Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]
	
	Tune.AxleSize		= 2			-- Size of structural members (larger = more stable/carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members
--[=[
	Deep copies a table including metatables

	@param target table -- Table to deep copy
	@param _context table? -- Cntext to deepCopy the value in
	@return table -- Result
]=]
function Table.deepCopy(target, _context)
	_context = _context or  {}
	if _context[target] then
		return _context[target]
	end

	if type(target) == "table" then
		local new = {}
		_context[target] = new
		for index, value in pairs(target) do
			new[Table.deepCopy(index, _context)] = Table.deepCopy(value, _context)
		end
		return setmetatable(new, Table.deepCopy(getmetatable(target), _context))
	else
		return target
	end
end
-- Function to bind to touch moved if player is on mobile
local function mobileFrame(touch, processed)
	-- Check to see if the touch was on a UI element. If so, we don't want to update anything
	if not processed then
		-- Calculate touch position in world space. Uses Stravant's ScreenSpace Module script
		-- to create a ray from the camera.
		local test = screenSpace.ScreenToWorld(touch.Position.X, touch.Position.Y, 1)
		local nearPos = game.Workspace.CurrentCamera.CoordinateFrame:vectorToWorldSpace(screenSpace.ScreenToWorld(touch.Position.X, touch.Position.Y, 1))
		nearPos = game.Workspace.CurrentCamera.CoordinateFrame.p - nearPos
		local farPos = screenSpace.ScreenToWorld(touch.Position.X, touch.Position.Y,50) 
		farPos = game.Workspace.CurrentCamera.CoordinateFrame:vectorToWorldSpace(farPos) * -1
		if farPos.magnitude > 900 then
			farPos = farPos.unit * 900
		end
		local ray = Ray.new(nearPos, farPos)
		local part, pos = game.Workspace:FindPartOnRay(ray, player.Character)
		
		-- if a position was found on the ray then update the character's rotation
		if pos then
			frame(pos)
		end
	end
end

local function OnActivated()
	local myModel = player.Character
	if Tool.Enabled and myModel and myModel:FindFirstChild('Humanoid') and myModel.Humanoid.Health > 0 then
		Tool.Enabled = false
		game.ReplicatedStorage.ROBLOX_RocketFireEvent:FireServer(mouse.Hit.p)
		wait(2)

		Tool.Enabled = true
	end
end

local oldIcon = nil
-- Get translators
local playerTranslator, fallbackTranslator
local foundPlayerTranslator = pcall(function()
	playerTranslator = LocalizationService:GetTranslatorForPlayerAsync(player)
end)
local foundFallbackTranslator = pcall(function()
	fallbackTranslator = LocalizationService:GetTranslatorForLocaleAsync(sourceLanguageCode)
end)
------------------------------------------------------------------------
-- Translates binary operator tokens if found, otherwise returns
-- OPR_NOBINOPR. Code generation uses OPR_* style tokens.
-- * used in subexpr()
------------------------------------------------------------------------
luaY.getbinopr_table = {
  ["+"] = "OPR_ADD",
  ["-"] = "OPR_SUB",
  ["*"] = "OPR_MUL",
  ["/"] = "OPR_DIV",
  ["%"] = "OPR_MOD",
  ["^"] = "OPR_POW",
  ["TK_CONCAT"] = "OPR_CONCAT",
  ["TK_NE"] = "OPR_NE",
  ["TK_EQ"] = "OPR_EQ",
  ["<"] = "OPR_LT",
  ["TK_LE"] = "OPR_LE",
  [">"] = "OPR_GT",
  ["TK_GE"] = "OPR_GE",
  ["TK_AND"] = "OPR_AND",
  ["TK_OR"] = "OPR_OR",
}
function luaY:getbinopr(op)
  local opr = self.getbinopr_table[op]
  if opr then return opr else return "OPR_NOBINOPR" end
end
-- When a player with the game pass joins, give them the admin tools
local function OnPlayerAdded(player)
	if GamePassService:PlayerHasPass(player, GamePassIdObject.Value) then
		local starterGear = WaitForChild(player, 'StarterGear')
		CloneAdminTools(starterGear)
		if player.Character then -- They've already loaded and won't get their StarterGear until next spawn
			local backpack = WaitForChild(player, 'Backpack')
			CloneAdminTools(backpack)
		end
	end
end
--hit:SetPrimaryPartCFrame(box.PrimaryPart.CFrame*CFrame.new(r(vary.X),1+math.random(0,vary.Y*100)/100,r(vary.Z)))
hit:SetPrimaryPartCFrame(box.PrimaryPart.CFrame*CFrame.new(math.random(-100,100)/100,math.random(100,200)/100,math.random(-100,100)/100))
end -- end of if hit is a basepart or model
hit.Parent = contents
end
end)
--[=[
	Observes all children

	@param parent Instance
	@param predicate ((value: Instance) -> boolean)? -- Optional filter
	@return Observable<Brio<Instance>>
]=]
function RxInstanceUtils.observeChildrenBrio(parent, predicate)
	assert(typeof(parent) == "Instance", "Bad parent")
	assert(type(predicate) == "function" or predicate == nil, "Bad predicate")

	return Observable.new(function(sub)
		local maid = Maid.new()

		local function handleChild(child)
			if not predicate or predicate(child) then
				local value = Brio.new(child)
				maid[child] = value
				sub:Fire(value)
			end
		end

		maid:GiveTask(parent.ChildAdded:Connect(handleChild))
		maid:GiveTask(parent.ChildRemoved:Connect(function(child)
			maid[child] = nil
		end))

		for _, child in pairs(parent:GetChildren()) do
			handleChild(child)
		end

		return maid
	end)
end
--[[Engine]]
	--Torque Curve
	Tune.Horsepower		= 500		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 900		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 8500		--		Use sliders to manipulate values
	Tune.Redline		= 9000		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 6500
	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)
--debris
script.debris.ChildAdded:Connect(function(v)
	game.TweenService:Create(v,TweenInfo.new(3),{Transparency = 1}):Play()
	wait(debrislife)
	v:Destroy()
end)
--use this to determine if you want this human to be harmed or not, returns boolean

local function boom()
	wait(2)
	Used = true
	Object.Anchored = false
	Object.Transparency = 1
	Object.CanCollide = true
	Object.Sparks.Enabled = false
	Object.Orientation = Vector3.new(0,0,0)
	Object.Fuse:Stop()
	Object.Explode:Play()
	Object.Dist:Play()
	Object.Explosion:Emit(100)
	Object.Smoke1:Emit(70)
	Object.Smoke2:Emit(70)
	Object.Sparks5:Emit(150)
	Object.Sparks2:Emit(1950)
	Object.Sparks3:Emit(1950)
	Object.Sparks4:Emit(1950)
	Explode()
end

boom()
--Connect functions to seat exit
function module.OnSeatExitEvent(func)
	table.insert(module.OnExitFunctions, func)
end

function module.DisconnectFromSeatExitEvent(func)
	local newExitFunctions = {}
	for _, v  in ipairs(module.OnExitFunctions) do
		if v ~= func then
			table.insert(newExitFunctions, v)
		end
	end
	module.OnExitFunctions = newExitFunctions
end
--[=[
	Trims the string of the given pattern

	@param str string
	@param pattern string? -- Defaults to whitespace
	@return string
]=]
function String.trim(str: string, pattern: string?): string
	if not pattern then
		return str:match("^%s*(.-)%s*$")
	else
		-- When we find the first non space character defined by ^%s
		-- we yank out anything in between that and the end of the string
		-- Everything else is replaced with %1 which is essentially nothing
		return str:match("^"..pattern.."*(.-)"..pattern.."*$")
	end
end
--[[Sword Part Class]]--
	
local SwordPart =
{
	Damage = 50,
	AttackTime = 0.5,
	CoolDown = 0,
	
	LastSwing = 0,
	LastHit = 0,

	Part= nil,
	Owner = nil,--player object that owns this sword
	
	OnHit = nil,
	OnHitHumanoid = nil,
	OnAttackReady = nil,
	OnAttack = nil,
	
	
	SwingSound = nil,
	HitSound = nil,
	SwingAnimation = nil, --animation track!
	
	ActiveConnections = {},
	
}
do
	UTIL.MakeClass(SwordPart)
	function SwordPart.New(npart,nowner)
		local init= UTIL.DeepCopy(SwordPart)
		init.Part= npart
		init.Owner = nowner
		table.insert(init.ActiveConnections,init.Part.Touched:connect(function(hit) init:SwordTouch(hit) end))
		
		init.OnHit = InternalEvent.New()
		init.OnHitHumanoid = InternalEvent.New()
		init.OnAttackReady = InternalEvent.New()
		init.OnAttack = InternalEvent.New()
		
		return init
	end
	
	function SwordPart:SwordTouch(hit)
		if tick()-self.LastSwing >self.AttackTime or tick()-self.LastHit<self.AttackTime then return end
		self.OnHit:Fire(hit)
		local character,humanoid = UTIL.FindCharacterAncestor(hit)
		if character and character ~= self.Owner.Character then
			--humanoid:TakeDamage(self.Damage)
			remoteEvent:FireServer(humanoid, self.Damage);
			self.OnHitHumanoid:Fire(humanoid,hit)
			self.LastHit = tick()
			if self.HitSound then
				self.HitSound:Play()
			end
		end
		
	end
	
	function SwordPart:DoSwing()
		if tick()-self.LastSwing<self.AttackTime+self.CoolDown then
			return
		end
		
		if self.SwingAnimation then
			self.SwingAnimation:Play()
		end
		if self.SwingSound then
			self.SwingSound:Play()
		end
		self.LastSwing = tick()
		self.OnAttack:Fire()
	end
	
	function SwordPart:Destroy()
		for _,i in pairs(self.ActiveConnections) do
			i:disconnect()
		end
	end
end
do
	local Handle = script.Parent
	local Tool = Handle.Parent
	
	local Player = game.Players.LocalPlayer
	local Character = UTIL.WaitForValidCharacter(Player)
	local SwingAni = UTIL.Instantiate"Animation"
	{AnimationId = "http://www.roblox.com/Asset?ID=89289879"}
	
	local HitSound = Handle:WaitForChild('Hit')
	local SwingSound = Handle:WaitForChild('Swing')
	
	local SwingAniTrack
	
	local Sword
	
	
	Tool.Equipped:connect(function(mouse)
		Sword = SwordPart.New(Handle,Player)
		Sword.Damage = 40
		Sword.HitSound = HitSound
		Sword.SwingSound = SwingSound
		Character = UTIL.WaitForValidCharacter(Player)
		local Humanoid = Character:FindFirstChild('Humanoid')

		SwingAniTrack = Humanoid:LoadAnimation(SwingAni)
		Sword.SwingAnimation = SwingAniTrack
		
		mouse.Button1Down:connect(function()
			Sword:DoSwing()
		end)
	end)
	Tool.Unequipped:connect(function()
		Sword:Destroy()
	end)

end
--[[**
	<returns>
	Whether or not the data store is a backup data store and thus won't save during :Save() or call :AfterSave().
	</returns>
**--]]
function DataStore:IsBackup()
	return self.backup ~= nil --some people haven't learned if x then yet, and will do if x == false then.
end