Pinkstack/roblox-luau-corpus-text huggingface dataset:
--Precalculated paths


local t,f,n=true,false,{}
local r={
[58]={{71,61,59,41,30,56,58},t},
[49]={{71,61,59,41,39,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{71,61,59,41,30,56,58,20,19},t},
[59]={{71,61,59},t},
[63]={{71,61,59,41,30,56,58,23,62,63},t},
[34]={{71,61,59,41,39,35,34},t},
[21]={{71,61,59,41,30,56,58,20,21},t},
[48]={{71,61,59,41,39,35,34,32,31,29,28,44,45,49,48},t},
[27]={{71,61,59,41,39,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{71,61,59,41,39,35,34,32,31},t},
[56]={{71,61,59,41,30,56},t},
[29]={{71,61,59,41,39,35,34,32,31,29},t},
[13]={n,f},
[47]={{71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{71,61,59,41,39,35,34,32,31,29,28,44,45},t},
[57]={{71,61,59,41,30,56,57},t},
[36]={{71,61,59,41,39,35,37,36},t},
[25]={{71,61,59,41,39,35,34,32,31,29,28,27,26,25},t},
[71]={{71},t},
[20]={{71,61,59,41,30,56,58,20},t},
[60]={{71,61,60},t},
[8]={n,f},
[4]={n,f},
[75]={{71,72,76,73,75},t},
[22]={{71,61,59,41,30,56,58,20,21,22},t},
[74]={{71,72,76,73,74},t},
[62]={{71,61,59,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{71,61,59,41,39,35,37},t},
[2]={n,f},
[35]={{71,61,59,41,39,35},t},
[53]={{71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{71,72,76,73},t},
[72]={{71,72},t},
[33]={{71,61,59,41,39,35,37,36,33},t},
[69]={{71,61,69},t},
[65]={{71,61,59,41,30,56,58,20,19,66,64,65},t},
[26]={{71,61,59,41,39,35,34,32,31,29,28,27,26},t},
[68]={{71,61,59,41,30,56,58,20,19,66,64,67,68},t},
[76]={{71,72,76},t},
[50]={{71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{71,61,59,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{71,61,59,41,39,35,34,32,31,29,28,27,26,25,24},t},
[23]={{71,61,59,41,30,56,58,23},t},
[44]={{71,61,59,41,39,35,34,32,31,29,28,44},t},
[39]={{71,61,59,41,39},t},
[32]={{71,61,59,41,39,35,34,32},t},
[3]={n,f},
[30]={{71,61,59,41,30},t},
[51]={{71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{71,61,59,41,30,56,58,20,19,66,64,67},t},
[61]={{71,61},t},
[55]={{71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{71,61,59,41,39,40,38,42},t},
[40]={{71,61,59,41,39,40},t},
[52]={{71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{71,61,59,41},t},
[17]={n,f},
[38]={{71,61,59,41,39,40,38},t},
[28]={{71,61,59,41,39,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{71,61,59,41,30,56,58,20,19,66,64},t},
}
return r
---Creator function return object keys


local KEY_BASE_FRAME = "BaseFrame"
local KEY_BASE_MESSAGE = "BaseMessage"
local KEY_UPDATE_TEXT_FUNC = "UpdateTextFunction"
local KEY_GET_HEIGHT = "GetHeightFunction"
local KEY_FADE_IN = "FadeInFunction"
local KEY_FADE_OUT = "FadeOutFunction"
local KEY_UPDATE_ANIMATION = "UpdateAnimFunction"
--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.Name = "weld1"
weld1.Part0 = torso
weld1.Parent = torso
weld1.Part1 = arms[1]
weld1.C1 = CFrame.new(1.2, 0, 0.) * CFrame.fromEulerAnglesXYZ(math.rad(-10), math.rad(-6), 0)
welds[1] = weld1
local weld2 = Instance.new("Weld")
weld2.Name = "weld2"
weld2.Part0 = torso
weld2.Parent = torso
weld2.Part1 = arms[2]
weld2.C1 = CFrame.new(-1.2, 1, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), -.4)
welds[2] = 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(1.2, 0, 0.) * CFrame.fromEulerAnglesXYZ(math.rad(-10), math.rad(-6), 0)
welds[1] = weld1
local weld2 = Instance.new("Weld")
weld2.Name = "weld2"
weld2.Part0 = torso
weld2.Parent = torso
weld2.Part1 = arms[2]
weld2.C1 = CFrame.new(-1.2, 1, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), -.4)
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

end
end)
--Prefabricate objects


local Camera		= Instance.new("Camera")
	Camera.FieldOfView	= 20

local ViewportFrame	= Instance.new("ViewportFrame")
	ViewportFrame.BackgroundColor3			= Color3.new()
	ViewportFrame.BackgroundTransparency	= 1
	ViewportFrame.LightDirection			= Vector3.new(0,1,0)
	ViewportFrame.Ambient					= Color3.new(1,1,1)
	ViewportFrame.Size						= UDim2.new(0,100,0,100)

local Decal			= Instance.new("Decal")
	Decal.Face			= Enum.NormalId.Top
--todo: remove this once TouchTapInWorld is on all platforms


local touchWorkspaceEventEnabled = pcall(function() local test = UserInputService.TouchTapInWorld end)

local function layoutGestureArea(portraitMode)
	if GestureArea and not GestureAreaManagedByControlScript then
		if portraitMode then
			GestureArea.Size = UDim2.new(1, 0, .6, 0)
			GestureArea.Position = UDim2.new(0, 0, 0, 0)
		else
			GestureArea.Size = UDim2.new(1, 0, .5, -18)
			GestureArea.Position = UDim2.new(0, 0, 0, 0)
		end
	end
end
-------------------------


function onClicked()
R.Function1.Disabled = true

FX.ROLL.BrickColor = BrickColor.new("CGA brown")
FX.ROLL.loop.Disabled = true

FX.REVERB.BrickColor = BrickColor.new("CGA brown")
FX.REVERB.loop.Disabled = true

FX.GATE.BrickColor = BrickColor.new("CGA brown")
FX.GATE.loop.Disabled = true

FX.PHASER.BrickColor = BrickColor.new("CGA brown")
FX.PHASER.loop.Disabled = true

FX.SLIPROLL.BrickColor = BrickColor.new("CGA brown")
FX.SLIPROLL.loop.Disabled = true

FX.FILTER.BrickColor = BrickColor.new("CGA brown")
FX.FILTER.loop.Disabled = true

FX.ECHO.BrickColor = BrickColor.new("CGA brown")
FX.ECHO.loop.Disabled = true

FX.TRANS.BrickColor = BrickColor.new("CGA brown")
FX.TRANS.loop.Disabled = true

FX.MultiTapDelay.BrickColor = BrickColor.new("CGA brown")
FX.MultiTapDelay.loop.Disabled = true

FX.DELAY.BrickColor = BrickColor.new("CGA brown")
FX.DELAY.loop.Disabled = true

FX.REVROLL.BrickColor = BrickColor.new("CGA brown")
FX.REVROLL.loop.Disabled = true
R.loop.Disabled = false
R.Function2.Disabled = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
-- Gets a part from the cache, or creates one if no more are available.


function PartCacheStatic:GetPart(): BasePart
	assert(getmetatable(self) == PartCacheStatic, ERR_NOT_INSTANCE:format("GetPart", "PartCache.new"))
	
	if #self.Open == 0 then
		warn("No parts available in the cache! Creating [" .. self.ExpansionSize .. "] new part instance(s) - this amount can be edited by changing the ExpansionSize property of the PartCache instance... (This cache now contains a grand total of " .. tostring(#self.Open + #self.InUse + self.ExpansionSize) .. " parts.)")
		for i = 1, self.ExpansionSize, 1 do
			table.insert(self.Open, MakeFromTemplate(self.Template, self.CurrentCacheParent))
		end
	end
	local part = self.Open[#self.Open]
	self.Open[#self.Open] = nil
	table.insert(self.InUse, part)
	return part
end
--On lines 10 and 29 change Gold to the name of your money and Exp to the stat you wish to upgrade.



local Humanoid = script.Parent.Humanoid -- Change Enemy to the name of your Monsters Humanoid
function PwntX_X() 
local tag = Humanoid:findFirstChild("creator") 
	if tag ~= nil then 
		if tag.Value ~= nil then 
local Leaderstats = tag.Value:findFirstChild("leaderstats") 
if Leaderstats ~= nil then 
Leaderstats.ABFightCoins.Value = Leaderstats.ABFightCoins.Value + 2 --How Much Money Given
wait(0.1)
script:remove()
			end 
		end 
	end 
end 
Humanoid.Died:connect(PwntX_X)
--- RUNTIME ---



Humanoid:GetPropertyChangedSignal("Health"):Connect(function()
	if Debounce == true then return end
	-- Clone script.Indicator to Character.Face, rotate, float via StudsOffset tween, and fade a BillboardGui damage indicator when the dummy is attacked
	
	-- Get the damage dealt
	local Damage = Humanoid.MaxHealth - Humanoid.Health
	
	Debounce = true
	Humanoid.Health += Damage
	Debounce = false
	
	-- Clone script.Indicator to Character.Face
	local Indicator = script.Indicator:Clone()
	Indicator.Enabled = true
	Indicator.Parent = Character.Face
	
	Indicator.TextLabel.Text = Damage
	
	-- Rotate the indicator a random amount of degrees
	Indicator.StudsOffset = Vector3.new(math.random(-15,15)/10,3,math.random(-50,50)/100)
	Indicator.TextLabel.Rotation = math.random(-30, 30)
	
	-- Float via StudsOffset tween and fade out over time with BillboardGui's TextTransparency property
	local Tween = TweenService:Create(Indicator, TweenInfo.new(3, Enum.EasingStyle.Cubic, Enum.EasingDirection.In), {StudsOffset = Vector3.new(Indicator.StudsOffset.X, math.random(30,60)/10, Indicator.StudsOffset.Z)})
	Tween:Play()
	
	local Tween = TweenService:Create(Indicator.TextLabel, TweenInfo.new(3, Enum.EasingStyle.Cubic, Enum.EasingDirection.In), {TextTransparency = 1})
	Tween:Play()
	local Tween = TweenService:Create(Indicator.TextLabel, TweenInfo.new(3, Enum.EasingStyle.Cubic, Enum.EasingDirection.In), {TextStrokeTransparency = 1})
	Tween:Play()
	
	task.wait(3)
	
	Indicator:Destroy()
	
end)
--mayo's pedal script


local mouse = game.Players.LocalPlayer:GetMouse()
local car = script.Parent.Car.Value
local handler = car:WaitForChild("PedalsFE")

script.Parent.Values.Throttle.Changed:connect(function()
	local gas = script.Parent.Values.Throttle.Value^1*math.rad(32)
	handler:FireServer("PedalUpdate","Gas",gas)
end)

script.Parent.Values.Brake.Changed:connect(function()
	local bp = script.Parent.Values.Brake.Value^1*math.rad(26)
	handler:FireServer("PedalUpdate","Brake",bp)
end)

script.Parent.Values.Gear.Changed:connect(function()
	handler:FireServer("PedalUpdate","Clutch",0.55)
end)

script.Parent.Values.PBrake.Changed:connect(function()
	if script.Parent.Values.PBrake.Value == true then
		handler:FireServer("PBrake")
	end
end)

script.Parent.Values.Gear.Changed:connect(function()
	if script.Parent.Values.Gear.Changed then
		handler:FireServer("Pedal")
		wait(.15)
		handler:FireServer("Shift")
	end
end)

mouse.KeyDown:connect(function(key)
	if script.Parent.Values.MouseSteerOn.Value == false and key=="w" then
		handler:FireServer("Pedal")
	end	
end)

mouse.KeyDown:connect(function(key)
	if script.Parent.Values.MouseSteerOn.Value == false and key=="s" then
		handler:FireServer("Pedal")
	end
end)

mouse.Button1Down:connect(function()
	if script.Parent.Values.MouseSteerOn.Value == true then
		handler:FireServer("Pedal")
	end	
end)

mouse.Button2Down:connect(function()
	if script.Parent.Values.MouseSteerOn.Value == true then
		handler:FireServer("Pedal")
	end
end)
--// All global vars will be wiped/replaced except script
--// All guis are autonamed client.Variables.CodeName..gui.Name



return function(data)
	local gui = script.Parent.Parent
	local playergui = service.PlayerGui
	local str = data.Message
	local time = data.Time or 15
	
	--client.UI.Make("HintHolder")
	local container = client.UI.Get("HintHolder",nil,true)
	if not container then 
		local holder = service.New("ScreenGui")
		local hTable = client.UI.Register(holder)
		local frame = service.New("ScrollingFrame", holder)
		client.UI.Prepare(holder)
		hTable.Name = "HintHolder"
		frame.Name = "Frame"
		frame.BackgroundTransparency = 1
		frame.Size = UDim2.new(1, 0, 0,150)
		frame.CanvasSize = UDim2.new(0, 0, 0, 0)
		frame.ChildAdded:connect(function(c)
			if #frame:GetChildren() == 0 then
				frame.Visible = false
			else
				frame.Visible = true
			end
		end)
		
		frame.ChildRemoved:connect(function(c)
			if #frame:GetChildren() == 0 then
				frame.Visible = false
			else
				frame.Visible = true
			end
		end)
		
		container = hTable
		hTable:Ready()
	end
	container = container.Object.Frame
	
	--// First things first account for notif :)
	local notif = client.UI.Get("Notif")
	if notif then
		container.Position = UDim2.new(0,0,0,30)
	else
		container.Position = UDim2.new(0,0,0,0)
	end
	
	local children = container:children()
	
	gui.Position = UDim2.new(0,0,0,-100)
	gui.Frame.msg.Text = str
	local bounds = gui.Frame.msg.TextBounds.X
	
	local function moveGuis(m,ignore)
		m = m or 0
		local max = #container:children()
		for i,v in pairs(container:children()) do
			if v~=ignore then
				local y = (i+m)*28
				v.Position = UDim2.new(0,0,0,y)
				if i~=max then v.Size = UDim2.new(1,0,0,28) end
			end
		end
	end
	
	local lom = -1
	moveGuis(-1)
	gui.Parent = container
	if #container:children()>5 then lom = -2 end
	UDim2.new(0,0,0,(#container:children()+lom)*28)
	moveGuis(-1)
	--gui:TweenPosition(UDim2.new(0,0,0,(#container:children()+lom)*28),nil,nil,0.3,true,function() if gui and gui.Parent then moveGuis(-1) end end)
	
	if #container:children()>5 then
		local gui = container:children()[1]
		moveGuis(-2,gui)
		gui:Destroy()
		--gui:TweenPosition(UDim2.new(0,0,0,-100),nil,nil,0.2,true,function() if gui and gui.Parent then gui:Destroy() end end)
	end
	
	wait(data.Time or 5)
	
	if gui and gui.Parent then 
		moveGuis(-2,gui)
		gui:Destroy()
		--gui:TweenPosition(UDim2.new(0,0,0,-100),nil,nil,0.2,true,function() if gui and gui.Parent then gui:Destroy() end end)
	end
end
--Functions--



UIS.InputBegan:Connect(function(input, isTyping)
	if isTyping then return end
	if input.KeyCode == Enum.KeyCode.F and Enabled == true and Usable == true then
		ButtonDown = true
		Key = "F"
		script.Function:FireServer("Mochi Roll", mouse.Hit.Position)
		
		local BV = Instance.new("BodyVelocity")
		BV.MaxForce = Vector3.new(25000,0,25000)
		BV.Parent = c.HumanoidRootPart
				
		while ButtonDown == true do
			c.HumanoidRootPart.CFrame = CFrame.new(c.HumanoidRootPart.Position, Vector3.new(mouse.Hit.Position.X,c.HumanoidRootPart.Position.Y,mouse.Hit.Position.Z))
			BV.Velocity = c.HumanoidRootPart.CFrame.lookVector * 75
			RS.Heartbeat:Wait()
		end
		Enabled = true
		BV:Destroy()
	end
end)

UIS.InputEnded:Connect(function(input, IsTyping)
	if IsTyping then return end
	if input.KeyCode == Enum.KeyCode.F and Key == "F" then
		--FireServer--
		script.Function:FireServer("Release", mouse.Hit.Position)
		ButtonDown = false
		Key = nil
	end
end)
------------------------------------------------------------------------------------------------------------------------------------------------------



	LocalMouse.WheelForward:connect(function()
		if (CameraZoomCount + 1) <= MaxCameraZoomCount then
			CameraZoomCount = CameraZoomCount + 1
		end 
	end)

	LocalMouse.WheelBackward:connect(function()
		if (CameraZoomCount - 1) >= -MaxCameraZoomCount then
			CameraZoomCount = CameraZoomCount - 1
		end 
	end)

	RunService.RenderStepped:connect(function(delta)
		if LocalPlayer.Character then
			local Head = LocalPlayer.Character:WaitForChild('Head')
			local Diff = CameraZoomCount * delta

			LocalCamera.CFrame = LocalCamera.CFrame:lerp(
				CFrame.new(Head.CFrame.X, Head.CFrame.Y, Head.CFrame.Z)
					* CFrame.new(0, 10, -12.5)
						* CFrame.new(0, -Diff + (0.7 ^ CameraZoomCount), Diff)
					* CFrame.Angles(0, math.rad(180), 0)
					* CFrame.Angles(math.rad(-45 + (1.75 ^ CameraZoomCount) + (CameraZoomCount * 2)), 0, 0), 0.25)
		end 
	end)
-- Also set this to true if you want the thumbstick to not affect throttle, only triggers when a gamepad is conected


local onlyTriggersForThrottle = false
local ZERO_VECTOR3 = Vector3.new(0,0,0)

local betterHandlingInputStatesFlagExists, betterHandlingInputStatesFlagEnabled = pcall(function()
	return UserSettings():IsUserFeatureEnabled("UserBetterHandlingVehicleInputStates")
end)
local FFlagBetterHandlingVehicleInputStates = betterHandlingInputStatesFlagExists and betterHandlingInputStatesFlagEnabled

local FFlagUserClickToMoveFollowPathRefactorSuccess, FFlagUserClickToMoveFollowPathRefactorResult = pcall(function() return UserSettings():IsUserFeatureEnabled("UserClickToMoveFollowPathRefactor") end)
local FFlagUserClickToMoveFollowPathRefactor = FFlagUserClickToMoveFollowPathRefactorSuccess and FFlagUserClickToMoveFollowPathRefactorResult

local AUTO_PILOT_DEFAULT_MAX_STEERING_ANGLE = 35
-- Directions of resizing for each handle's dragged face


local AxisSizeMultipliers = {
	[Enum.NormalId.Top] = Vector3.new(0, 1, 0);
	[Enum.NormalId.Bottom] = Vector3.new(0, 1, 0);
	[Enum.NormalId.Front] = Vector3.new(0, 0, 1);
	[Enum.NormalId.Back] = Vector3.new(0, 0, 1);
	[Enum.NormalId.Left] = Vector3.new(1, 0, 0);
	[Enum.NormalId.Right] = Vector3.new(1, 0, 0);
};
-------- OMG HAX



r = game:service("RunService")


local damage = 5


local slash_damage = 10
local lunge_damage = 15

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


local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = .7

local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Parent = sword
LungeSound.Volume = .6

local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1


function blow(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
	if humanoid~=nil and humanoid ~= hum and hum ~= nil then
		-- final check, make sure sword is in-hand

		local right_arm = vCharacter:FindFirstChild("Right Arm")
		if (right_arm ~= nil) then
			local joint = right_arm:FindFirstChild("RightGrip")
			if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
				tagHumanoid(humanoid, vPlayer)
				humanoid:TakeDamage(damage)
				wait(1)
				untagHumanoid(humanoid)
			end
		end


	end
end


function tagHumanoid(humanoid, player)
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = player
	creator_tag.Name = "creator"
	creator_tag.Parent = humanoid
end

function untagHumanoid(humanoid)
	if humanoid ~= nil then
		local tag = humanoid:findFirstChild("creator")
		if tag ~= nil then
			tag.Parent = nil
		end
	end
end


function attack()
	damage = slash_damage
	SlashSound:play()
	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Slash"
	anim.Parent = Tool
end

function lunge()
	damage = lunge_damage

	LungeSound:play()

	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Lunge"
	anim.Parent = Tool
	
	
	force = Instance.new("BodyVelocity")
	force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
	force.Parent = Tool.Parent.Torso
	wait(.1)
	swordOut()
	wait(.1)
	force.Parent = nil
	wait(.2)
	swordUp()

	damage = slash_damage
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

function swordAcross()
	-- parry
end


Tool.Enabled = true
local last_attack = 0
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

	t = r.Stepped:wait()

	if (t - last_attack < .2) then
		lunge()
	else
		attack()
	end

	last_attack = t

	--wait(.5)

	Tool.Enabled = true
end


function onEquipped()
	UnsheathSound:play()
end


script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)


connection = sword.Touched:connect(blow)
-- (Hat Giver Script - Loaded.)



debounce = true

function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Hat")
		p = Instance.new("Part")
		h.Name = "Army Hat"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = 0
		p.Size = Vector3.new(1, 1, 1) 
		p.BottomSurface = 0 
		p.TopSurface = 0 
		p.Locked = true 
		script.Parent.Mesh:clone().Parent = p
		h.Parent = hit.Parent
		h.AttachmentPos = Vector3.new(0, -0.15, 0.03)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
-----------------------------------------------------------------------------------------------



local player=game.Players.LocalPlayer
local mouse=player:GetMouse()

local car = script.Parent.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])

local gauges = script.Parent
local values = script.Parent.Parent.Values
local isOn = script.Parent.Parent.IsOn
local RPM = 0
local RPM2 = 0

gauges:WaitForChild("Tach")
gauges:WaitForChild("ln")
gauges:WaitForChild("bln")
gauges:WaitForChild("Gear")

car.DriveSeat.HeadsUpDisplay = false

local _pRPM = _Tune.PeakRPM
local _lRPM = _Tune.Redline

local currentUnits = 1
local revEnd = math.ceil(_lRPM/1000)
local BST = 0
if _Tune.Aspiration == "Single" then
BST = _Tune.Boost
end
if _Tune.Aspiration == "Double" then
BST = _Tune.Boost*2
end
if _Tune.Aspiration == "Super" then
BST = _Tune.Boost
end