r=game:service("\082\117\110\083\101\114\118\105\099\101")local b=20 local O=18 local I=36 sword=script.Parent.Handle Tool=script.Parent local T=Instance.new("\083\111\117\110\100")T.SoundId="\114\098\120\097\115\115\101\116\058\047\047\115\111\117\110\100\115\092\115\119\111\114\100\115\108\097\115\104\046\119\097\118"T.Parent=sword T.Volume=.7 local C=Instance.new("\083\111\117\110\100")C.SoundId="\114\098\120\097\115\115\101\116\058\047\047\115\111\117\110\100\115\092\115\119\111\114\100\108\117\110\103\101\046\119\097\118"C.Parent=sword C.Volume=.6 local H=Instance.new("\083\111\117\110\100")H.SoundId="\114\098\120\097\115\115\101\116\058\047\047\115\111\117\110\100\115\092\117\110\115\104\101\097\116\104\046\119\097\118"H.Parent=sword H.Volume=1 function DarkKill(b,O,I)if b:FindFirstChild("\070\111\114\099\101\070\105\101\108\100")~=nil then return end local T=b:GetChildren()local C={}tagHumanoid(O,I)O.Health=0 for b=1,#T,1 do if T[b].className=="\080\097\114\116"then C[b]=T[b].BrickColor T[b].BrickColor=BrickColor.new(26)T[b].CanCollide=true T[b].Anchored=true end end wait(.25)for b=1,#T,1 do if T[b].className=="\080\097\114\116"then local O=Instance.new("\066\111\100\121\086\101\108\111\099\105\116\121")O.velocity=(Vector3.new(math.random()-.5,0,math.random()-.5)).unit*80 O.maxForce=Vector3.new(100000.0,100000.0,100000.0)O.Parent=T[b]end end for b=1,#T,1 do if T[b].className=="\080\097\114\116"then T[b].Anchored=false end end end function blow(O)local I=O.Parent:findFirstChild("\072\117\109\097\110\111\105\100")local T=Tool.Parent local C=game.Players:playerFromCharacter(T)local H=T:findFirstChild("\072\117\109\097\110\111\105\100")if I~=nil and(I~=H and H~=nil)then local O=T:FindFirstChild("\082\105\103\104\116 \065\114\109")if O~=nil then local T=O:FindFirstChild("\082\105\103\104\116\071\114\105\112")if T~=nil and(T.Part0==sword or T.Part1==sword)then H.Health=H.Health+b*.4 if I.Health>b then tagHumanoid(I,C)I:TakeDamage(b)else DarkKill(I.Parent,I,C)end end end end end function tagHumanoid(b,O)local I=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")I.Value=O I.Name="\099\114\101\097\116\111\114"I.Parent=b game.Debris:AddItem(I,1)end function attack()b=O T:play()local I=Instance.new("\083\116\114\105\110\103\086\097\108\117\101")I.Name="\116\111\111\108\097\110\105\109"I.Value="\083\108\097\115\104"I.Parent=Tool end function lunge()b=I C:play()local T=Instance.new("\083\116\114\105\110\103\086\097\108\117\101")T.Name="\116\111\111\108\097\110\105\109"T.Value="\076\117\110\103\101"T.Parent=Tool local H=Instance.new("\066\111\100\121\086\101\108\111\099\105\116\121")H.velocity=Vector3.new(0,10,0)H.Parent=Tool.Parent.Torso wait(.25)swordOut()wait(.25)H.Parent=nil wait(.5)swordUp()b=O 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() end Tool.Enabled=true local y=0 function onActivated()if not Tool.Enabled then return end Tool.Enabled=false local b=Tool.Parent local O=b.Humanoid if O==nil then print("\072\117\109\097\110\111\105\100 \110\111\116 \102\111\117\110\100")return end t=r.Stepped:wait()if t-y<.2 then lunge()else attack()end y=t Tool.Enabled=true end function onEquipped()H:play()end script.Parent.Activated:connect(onActivated)script.Parent.Equipped:connect(onEquipped)connection=sword.Touched:connect(blow)


r = game:service("RunService")


local damage = 20


local slash_damage = 18
local lunge_damage = 36

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 DarkKill(character, humanoid, attacker)

	if (character:FindFirstChild("ForceField") ~= nil) then return end

	local childs = character:GetChildren()

	local colors = {}

	tagHumanoid(humanoid, attacker)
	humanoid.Health = 0

	for i=1,#childs do
		if (childs[i].className == "Part") then
			colors[i] = childs[i].BrickColor
			childs[i].BrickColor = BrickColor.new(26)
			childs[i].CanCollide = true
			childs[i].Anchored = true
		end
	end

	wait(.25)
	
	for i=1,#childs do
		if (childs[i].className == "Part") then
			local b = Instance.new("BodyVelocity")
			b.velocity = Vector3.new(math.random() - .5, 0, math.random() - .5).unit * 80
			b.maxForce = Vector3.new(1e5,1e5,1e5)
			b.Parent = childs[i]
		end
	end

	for i=1,#childs do
		if (childs[i].className == "Part") then
			childs[i].Anchored = false
		end
	end

	
	

	



end




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
				hum.Health = hum.Health + (damage * .4)
				if humanoid.Health > damage then
					tagHumanoid(humanoid, vPlayer)
					humanoid:TakeDamage(damage)
				else
					DarkKill(humanoid.Parent, humanoid, vPlayer)
				end
			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
	game.Debris:AddItem(creator_tag, 1)
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
	
	
	local force = Instance.new("BodyVelocity")
	force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
	force.Parent = Tool.Parent.Torso
	wait(.25)
	swordOut()
	wait(.25)
	force.Parent = nil
	wait(.5)
	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)


