Pinkstack/roblox-luau-corpus-text huggingface dataset:
----------------------------------------------------------------------------------------------------
--------------------=[ CFRAME ]=--------------------------------------------------------------------
----------------------------------------------------------------------------------------------------


	,EnableHolster = false
	,HolsterTo = 'Torso'				 -- Put the name of the body part you wanna holster to
	,HolsterPos = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
	
	,RightArmPos = CFrame.new(-0.85, -0.2, -1.2) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))	--Server
	,LeftArmPos = CFrame.new(1.05,0.9,-1.4) * CFrame.Angles(math.rad(-100),math.rad(25),math.rad(-20))	--server
	
	,ServerGunPos = CFrame.new(-.3, -1, -0.4) * CFrame.Angles(math.rad(-90), math.rad(-90), math.rad(0))
	,GunPos = CFrame.new(0.15, -0.15, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))

	,RightPos = CFrame.new(-.65, -0.2, -1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))	--Client
	,LeftPos = CFrame.new(1.2,0.1,-1.6) * CFrame.Angles(math.rad(-120),math.rad(35),math.rad(-20))	--Client
}

return Config
-- Kind of messy right? Lol.


function onChat(msg,newPlayer)
if script.Chat5.Value == "" then
script.Chat5.Value = newPlayer.Name..": "..msg
elseif script.Chat5.Value ~= "" then
if script.Chat4.Value == "" then
script.Chat4.Value = newPlayer.Name..": "..msg
elseif script.Chat4.Value ~= "" then
if script.Chat3.Value == "" then
script.Chat3.Value = newPlayer.Name..": "..msg
elseif script.Chat3.Value ~= "" then
if script.Chat2.Value == "" then
script.Chat2.Value = newPlayer.Name..": "..msg
elseif script.Chat2.Value ~= "" then
if script.Chat1.Value == "" then
script.Chat1.Value = newPlayer.Name..": "..msg
elseif script.Chat1.Value ~= "" then
script.Chat1.Value = script.Chat2.Value
script.Chat2.Value = script.Chat3.Value
script.Chat3.Value = script.Chat4.Value
script.Chat4.Value = script.Chat5.Value
script.Chat5.Value = newPlayer.Name..": "..msg
end
end
end
end
end
end
function onEnter(newPlayer)
newPlayer.Chatted:connect(function(msg) onChat(msg,newPlayer) end)
end
game.Players.ChildAdded:connect(onEnter)
--Precalculated paths


local t,f,n=true,false,{}
local r={
[58]={{32,33,36,37,35,39,41,30,56,58},t},
[49]={{32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{32,33,36,37,35,39,41,30,56,58,20,19},t},
[59]={{32,33,36,37,35,39,41,59},t},
[63]={{32,33,36,37,35,39,41,30,56,58,23,62,63},t},
[34]={{32,34},t},
[21]={{32,33,36,37,35,39,41,30,56,58,20,21},t},
[48]={{32,31,29,28,44,45,49,48},t},
[27]={{32,31,29,28,27},t},
[14]={n,f},
[31]={{32,31},t},
[56]={{32,33,36,37,35,39,41,30,56},t},
[29]={{32,31,29},t},
[13]={n,f},
[47]={{32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{32,31,29,28,44,45},t},
[57]={{32,33,36,37,35,39,41,30,56,57},t},
[36]={{32,33,36},t},
[25]={{32,31,29,28,27,26,25},t},
[71]={{32,33,36,37,35,39,41,59,61,71},t},
[20]={{32,33,36,37,35,39,41,30,56,58,20},t},
[60]={{32,33,36,37,35,39,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{32,33,36,37,35,39,41,59,61,71,72,76,73,75},t},
[22]={{32,33,36,37,35,39,41,30,56,58,20,21,22},t},
[74]={{32,33,36,37,35,39,41,59,61,71,72,76,73,74},t},
[62]={{32,33,36,37,35,39,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{32,33,36,37},t},
[2]={n,f},
[35]={{32,33,36,37,35},t},
[53]={{32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{32,33,36,37,35,39,41,59,61,71,72,76,73},t},
[72]={{32,33,36,37,35,39,41,59,61,71,72},t},
[33]={{32,33},t},
[69]={{32,33,36,37,35,39,41,60,69},t},
[65]={{32,33,36,37,35,39,41,30,56,58,20,19,66,64,65},t},
[26]={{32,31,29,28,27,26},t},
[68]={{32,33,36,37,35,39,41,30,56,58,20,19,66,64,67,68},t},
[76]={{32,33,36,37,35,39,41,59,61,71,72,76},t},
[50]={{32,31,29,28,44,45,49,48,47,50},t},
[66]={{32,33,36,37,35,39,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{32,31,29,28,27,26,25,24},t},
[23]={{32,33,36,37,35,39,41,30,56,58,23},t},
[44]={{32,31,29,28,44},t},
[39]={{32,33,36,37,35,39},t},
[32]={{32},t},
[3]={n,f},
[30]={{32,33,36,37,35,39,41,30},t},
[51]={{32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{32,33,36,37,35,39,41,30,56,58,20,19,66,64,67},t},
[61]={{32,33,36,37,35,39,41,59,61},t},
[55]={{32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{32,31,29,28,44,45,49,48,47,46},t},
[42]={{32,33,36,37,35,38,42},t},
[40]={{32,33,36,37,35,40},t},
[52]={{32,31,29,28,44,45,49,48,47,52},t},
[54]={{32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{32,33,36,37,35,39,41},t},
[17]={n,f},
[38]={{32,33,36,37,35,38},t},
[28]={{32,31,29,28},t},
[5]={n,f},
[64]={{32,33,36,37,35,39,41,30,56,58,20,19,66,64},t},
}
return r
--//Backfire//--
--(Instructions)
--1: Put your ExhaustH into the 'Body' of the car.
--2: Make sure you exhaust is seperated into 2 meshes, the inside and the outer exhaust.
--3: Name the inside of the exhaust (the black part) 'Hot1'
--4: Put this script into the 'Plugins'
--5: Now when you rev your exhaust will heat up.


local randomability = math.random (1, 10)
	--[[
if script.Parent.Values.RPM.Value > 9400 and randomability <=1 and script.Parent.Values.Throttle.Value ~= 1 then
	car.Body.Exhaust.BFLight1.SpotLight.Enabled = true
	wait (0.03)
	car.Body.Exhaust.BFLight1.SpotLight.Enabled = false
	wait (0.07)
end
]]
if script.Parent.Values.RPM.Value > 5000 then
	if FE then
		handler:FireServer("heat1")
	else
	car.Body.ExhaustH.Hot1.Decal.Transparency = math.min(car.Body.ExhaustH.Hot1.Decal.Transparency+.005,1)
	car.Body.ExhaustH.Hot2.Decal.Transparency = math.min(car.Body.ExhaustH.Hot1.Decal.Transparency+.005,1)
	end
else
	if FE then
		handler:FireServer("heat2")
	else
	car.Body.ExhaustH.Hot1.Decal.Transparency = math.max(car.Body.ExhaustH.Hot1.Decal.Transparency-.01,0)
	car.Body.ExhaustH.Hot2.Decal.Transparency = math.max(car.Body.ExhaustH.Hot1.Decal.Transparency-.01,0)
	end
end

if car.Body.ExhaustH.Hot1.Decal.Transparency > .8 then
	if FE then
		handler:FireServer("heat3")
	else
	car.Body.ExhaustH.Hot1.Spark.Enabled = true
	car.Body.ExhaustH.Hot2.Spark.Enabled = true
	end
	else
		if FE then
		handler:FireServer("heat4")
	else
	car.Body.ExhaustH.Hot1.Spark.Enabled = false
	car.Body.ExhaustH.Hot2.Spark.Enabled = false
	end
end
--//Script
--Plaka()
--CarColor()



Stats.Locked.Changed:Connect(function()
ToogleLock(Stats.Locked.Value)
end)
Stats.Color.Changed:Connect(function()
CarColor()
end)



Fuel = script.Parent.Parent.Stats.Fuel
MainPart = script.Parent.Parent.Body.Main
while wait(.5) do
if oldpos == nil then
oldpos = MainPart.Position
else
newpos = MainPart.Position
Fuel.Value = Fuel.Value - (oldpos - newpos).Magnitude/150
oldpos = newpos
end
end
--/Recoil Modification


module.camRecoil = {
	RecoilUp 		= 1
	,RecoilTilt 	= 0.75
	,RecoilLeft 	= 0.8
	,RecoilRight 	= 0.8
}

module.gunRecoil = {
	RecoilUp 		= 1
	,RecoilTilt 	= 0.75
	,RecoilLeft 	= 0.8
	,RecoilRight 	= 0.8
}

module.AimRecoilReduction = 1
module.AimSpreadReduction = 1

module.MinRecoilPower 			= 1
module.MaxRecoilPower 			= 1
module.RecoilPowerStepAmount 	= 1

module.MinSpread 				= 1
module.MaxSpread 				= 1					
module.AimInaccuracyStepAmount 	= 1
module.AimInaccuracyDecrease 	= 1
module.WalkMult 				= 1

module.MuzzleVelocityMod	 	= 1

return module
-- Disable StarterGui


repeat
	success = pcall(function()
		StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
		StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, false)
		StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
		StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.SelfView, false)
	end)
	
	if not success then
		task.wait(1)
	end
until success
--[=[
	Use  to test that the given GuiObject or Rect is left, center, or right
	aligned with the other GuiObject or Rect.

	This can be especially useful to determine if a given pair of elements are
	under the influence of the same `UIListLayout`.

	```lua
	expect(a).toBeAlignedVertically(b, Enum.VerticalAlignment.Top) -- Jest
	expect(a).to.be.alignedVertically(b, Enum.VerticalAlignment.Top) -- TestEZ
	```

	![Example of alignedVertically(a, b, Enum.VerticalAlignment.Top)](/alignedVertically(a,%20b,%20Enum.VerticalAlignment.Top).png)

	```lua
	expect(a).toBeAlignedVertically(b, Enum.VerticalAlignment.Bottom) -- Jest
	expect(a).to.be.alignedVertically(b, Enum.VerticalAlignment.Bottom) -- TestEZ
	```

	![Example of alignedVertically(a, b, Enum.VerticalAlignment.Bottom)](/alignedVertically(a,%20b,%20Enum.VerticalAlignment.Bottom).png)


	@tag alignment
	@within CollisionMatchers2D
]=]


local function alignedVertically(a: GuiObject | Rect, b: GuiObject | Rect, verticalAlignment: Enum.VerticalAlignment)
	local aRect = toRect(a)
	local bRect = toRect(b)

	if verticalAlignment == Enum.VerticalAlignment.Top then
		return returnValue(aRect.Min.Y == bRect.Min.Y, "", "")
	elseif verticalAlignment == Enum.VerticalAlignment.Center then
		local aMiddle = (aRect.Min + aRect.Max) / 2
		local bMiddle = (bRect.Min + bRect.Max) / 2
		return returnValue(aMiddle.Y == bMiddle.Y, "", "")
	elseif verticalAlignment == Enum.VerticalAlignment.Bottom then
		return returnValue(aRect.Max.Y == bRect.Max.Y, "", "")
	end

	return returnValue(false, "Invalid VerticalAlignment!")
end

return alignedVertically
--//VIPERGUTZ
--//TASER ANIMATIONS



local Tool = script.Parent
local IdleAnimation
local IdleTrack = nil

IdleAnimation = Tool:WaitForChild("Idle")

script.Parent.Equipped:Connect(function(mouse)
	local MyCharacter = Tool.Parent
	local MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
	local MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
	
	if IdleAnimation then
		IdleTrack = MyHumanoid:LoadAnimation(IdleAnimation)
		IdleTrack.Priority = Enum.AnimationPriority.Movement
	end
	if IdleTrack then
		IdleTrack:Play()
	end
end)

script.Parent.Unequipped:Connect(function(mouse)
	if IdleTrack then
		IdleTrack:Stop()
	end
end)
--[[
	Main RenderStep Update. The camera controller and occlusion module both have opportunities
	to set and modify (respectively) the CFrame and Focus before it is set once on CurrentCamera.
	The camera and occlusion modules should only return CFrames, not set the CFrame property of
	CurrentCamera directly.
--]]


function CameraModule:Update(dt)
	if self.activeCameraController then
		self.activeCameraController:UpdateMouseBehavior()

		local newCameraCFrame, newCameraFocus = self.activeCameraController:Update(dt)
		self.activeCameraController:ApplyVRTransform()
		if self.activeOcclusionModule then
			newCameraCFrame, newCameraFocus = self.activeOcclusionModule:Update(dt, newCameraCFrame, newCameraFocus)
		end

		-- Here is where the new CFrame and Focus are set for this render frame
		game.Workspace.CurrentCamera.CFrame = newCameraCFrame
		game.Workspace.CurrentCamera.Focus = newCameraFocus

		-- Update to character local transparency as needed based on camera-to-subject distance
		if self.activeTransparencyController then
			self.activeTransparencyController:Update()
		end

		if CameraInput.getInputEnabled() then
			CameraInput.resetInputForFrameEnd()
		end
	end
end
--[[Transmission]]


	Tune.TransModes		= {"Auto", "Semi", "Manual"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
		>First mode is default mode													]]
	
	--Automatic Settings
	Tune.AutoShiftMode	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
	Tune.AutoUpThresh	= -300		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)
	
	--Gear Ratios
	Tune.FinalDrive		= 3.06			-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	3.70		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		3.53		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		2.04		,
		--[[ 3 ]]		1.38		,
		--[[ 4 ]]		1.03		,
		--[[ 5 ]]		0.81		,
		--[[ 6 ]]		0.64		,
	}
	Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]


local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local on = 0

script:WaitForChild("Rev")
script:WaitForChild("Turbo")

if not FE then
	for i,v in pairs(car.DriveSeat:GetChildren()) do
		for _,a in pairs(script:GetChildren()) do
			if v.Name==a.Name then v:Stop() wait() v:Destroy() end
		end
	end
	for i,v in pairs(script:GetChildren()) do
		v.Parent=car.DriveSeat
	end
	
	car.DriveSeat.Rev:Play()
	car.DriveSeat.Turbo:Play()
	
	while wait() do
		local _RPM = script.Parent.Values.RPM.Value
		
		if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end
		car.DriveSeat.Rev.Pitch = (car.DriveSeat.Rev.SetPitch.Value + car.DriveSeat.Rev.SetRev.Value*_RPM/_Tune.Redline)*on^2
		car.DriveSeat.Turbo.Pitch = (car.DriveSeat.Turbo.SetPitch.Value + car.DriveSeat.Turbo.SetRev.Value*_RPM/_Tune.Redline)*on^2
	end
else
	local handler = car.AC6_FE_Sounds
	handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)
	handler:FireServer("playSound","Rev")
	handler:FireServer("newSound","Turbo",car.DriveSeat,script.Turbo.SoundId,0,script.Turbo.Volume,true)
	handler:FireServer("playSound","Turbo")
	local pitch=0
	local pitch2=0
	while wait() do
		local _RPM = script.Parent.Values.RPM.Value
		
		if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end
		pitch = (script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline)*on^2
		pitch2 = (script.Turbo.SetPitch.Value + script.Turbo.SetRev.Value*_RPM/_Tune.Redline)*on^2
		handler:FireServer("updateSound","Rev",script.Rev.SoundId,pitch,script.Rev.Volume)
		handler:FireServer("updateSound","Turbo",script.Turbo.SoundId,pitch2,script.Turbo.Volume)
	end
end
--[[Output Scaling Factor]]


local hpScaling = _Tune.WeightScaling*10
local FBrakeForce = _Tune.FBrakeForce
local RBrakeForce = _Tune.RBrakeForce
local PBrakeForce = _Tune.PBrakeForce
if not workspace:PGSIsEnabled() then
	hpScaling = _Tune.LegacyScaling*10
	FBrakeForce = _Tune.FLgcyBForce
	RBrakeForce = _Tune.RLgcyBForce
	PBrakeForce = _Tune.LgcyPBForce
end
----------------------------------------------------------------------
--------------------[ BLOOD HANDLING ]--------------------------------
----------------------------------------------------------------------



local createBlood = script:WaitForChild("createBlood")
createBlood.OnServerEvent:connect(function(_, H, P, D, gunIgnore, S)
	local bloodCF = CF(P, P + D) * CFANG(RAD(-90), 0, 0)
	local Blood = Instance.new("Part")
	Blood.Transparency = 1
	Blood.Anchored = true
	Blood.CanCollide = false
	Blood.FormFactor = "Custom"
	Blood.Size = V3(0.2, 1, 0.2)
	Blood.TopSurface = 0
	Blood.BottomSurface = 0
	
	local Particles = Instance.new("ParticleEmitter")
	Particles.Color = ColorSequence.new(S.bloodSettings.Color)
	Particles.LightEmission = 0
	Particles.Size = NumberSequence.new(S.bloodSettings.Size)
	Particles.Texture = S.bloodSettings.Texture
	Particles.Transparency = NumberSequence.new(
		{
			NumberSequenceKeypoint.new(0, S.bloodSettings.startTransparency);
			NumberSequenceKeypoint.new(1, 1);
		}
	)
	Particles.EmissionDirection = Enum.NormalId.Top
	Particles.Lifetime = NumberRange.new(S.bloodSettings.Lifetime - 0.05, S.bloodSettings.Lifetime + 0.05)
	Particles.Rate = S.bloodSettings.Rate
	Particles.Rotation = NumberRange.new(0, 90)
	Particles.Speed = NumberRange.new(S.bloodSettings.Speed)
	Particles.VelocitySpread = S.bloodSettings.Spread
	Particles.Parent = Blood
	
	Blood.Parent = gunIgnore
	Blood.CFrame = bloodCF
	if (not H.Anchored) then
		local Weld = Instance.new("Weld", Blood)
		Weld.Part0 = H
		Weld.Part1 = Blood
		Weld.C0 = H.CFrame:toObjectSpace(bloodCF)
		Blood.Anchored = false
	end
	delay(0.15, function()
		Particles.Enabled = false
		wait(S.bloodSettings.Lifetime + 0.05)
		Blood:Destroy()
	end)
end)
---------------------------------










local button = script.Parent
local startcolor = button.BrickColor
local DB = false

local toolfolder = button.Parent["Place Tool in Here! <<"]
local toolstorage = {}
for i, tool in pairs(toolfolder:GetChildren()) do
	table.insert(toolstorage, tool:clone())
end
toolfolder:Destroy()

local block = button.Parent:FindFirstChild("Block")
if block ~= nil then
	if block:FindFirstChild("NameDisplay") then
		if block.NameDisplay.TextLabel.Text == "Custom Giver!" then
			if #toolstorage > 0 then
				block.NameDisplay.TextLabel.Text = toolstorage[1].Name
			else
				block.NameDisplay.TextLabel.Text = ""
			end
		end
	end
end


button.Touched:connect(function(hit)
	if DB then return end
	if hit == nil then return end
	if hit.Parent == nil then return end
	
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if player ~= nil then
		if player:FindFirstChild("Backpack") then
			local allow = true
			if #allow_team > 0 then
				local teams = game:GetService("Teams"):GetChildren()
				if #teams > 0 then
					allow = false
					for i, team in pairs(teams) do
						for i, allowedteamname in pairs(allow_team) do
							if team.Name == allowedteamname then
								if player.TeamColor == team.TeamColor then
									allow = true
								end
							end
						end
					end
				end
			end
			if not allow_duplicates then
				for i, tool in pairs(toolstorage) do
					if player.Backpack:FindFirstChild(tool.Name) then
						allow = false
					end
				end
			end
			if allow then
				DB = true
				button.BrickColor = BrickColor.new("Black")
				for i, tool in pairs(toolstorage) do
					local newtool = tool:clone()
					newtool.Parent = player.Backpack
				end
				wait(2)
				button.BrickColor = startcolor
				DB = false
			end
		end
	end
end)
-- functions


	
function stopAllAnimations()
	local oldAnim = currentAnim
		
	-- return to idle If finishing an emote
	if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
		oldAnim = "idle"
	end
		
	currentAnim = ""
	if (currentAnimKeyframeHandler ~= nil) then
		currentAnimKeyframeHandler:disconnect()
	end
		
	if (oldAnimTrack ~= nil) then
		oldAnimTrack:Stop()
		oldAnimTrack:Destroy()
		oldAnimTrack = nil
	end
	if (currentAnimTrack ~= nil) then
		currentAnimTrack:Stop()
		currentAnimTrack:Destroy()
		currentAnimTrack = nil
	end
	return oldAnim
end
	
function keyFrameReachedFunc(frameName)
	if (frameName == "End") then
		--		print("Keyframe : ".. frameName)
		local repeatAnim = stopAllAnimations()
		playAnimation(repeatAnim, 0.0, Humanoid)
	end
end
-------- OMG HAX



r = game:service("RunService")


local damage = 0


local slash_damage = 0


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


local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "0"
SlashSound.Parent = sword
SlashSound.Volume = 1


local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "0"
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 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()
	UnsheathSound:play()
end


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


connection = sword.Touched:connect(blow)
-- VisualComponents by Travis, modified for native visuals. 



local RS = game:GetService("RunService")
local panels = {}
wait(5)

function SetUp()

	for _,v in pairs(game.Workspace.VisualComponents.Panels:GetChildren()) do
		local temp = {}
		for image = 1,8 do		
			table.insert(temp,v.VisualScreen.Main["Image"..image])
		end
		table.insert(panels,temp)
	end
end
SetUp()

local len = #panels 
local max = 3000
local max8 = max/8;
for i,v in pairs(workspace.VisualComponents.Panels:GetChildren()) do
	RS.RenderStepped:connect(function()
		v.VisualScreen.Main.Image1.Visible = workspace.VisualComponents.Values.On.Value
		v.VisualScreen.Main.Image2.Visible = workspace.VisualComponents.Values.On.Value
		v.VisualScreen.Main.Image3.Visible = workspace.VisualComponents.Values.On.Value
		v.VisualScreen.Main.Image4.Visible = workspace.VisualComponents.Values.On.Value
		v.VisualScreen.Main.Image5.Visible = workspace.VisualComponents.Values.On.Value
		v.VisualScreen.Main.Image6.Visible = workspace.VisualComponents.Values.On.Value
		v.VisualScreen.Main.Image7.Visible = workspace.VisualComponents.Values.On.Value
		v.VisualScreen.Main.Image8.Visible = workspace.VisualComponents.Values.On.Value
	end)
end
RS.RenderStepped:connect(function(delta)
	local t = script.Value.Value
	local tempArr = {}	
	for image = 1,8 do 
		tempArr[image] = (t + image) * max8 % max
	end	
	for index = 1,len do 
		local temp2 = panels[index]
		for key, value in pairs(tempArr) do				
			temp2[key].Size = UDim2.new(0,value*10000,0,value*10000)
		end
	end
end)