Tool=script.Parent Handle=Tool:WaitForChild("\072\097\110\100\108\101")RunAnim=Tool:WaitForChild("\082\117\110\065\110\105\109")Returned=Tool:WaitForChild("\082\101\116\117\114\110\101\100")Debris=game:GetService("\068\101\098\114\105\115")Players=game:GetService("\080\108\097\121\101\114\115")Anims={"\082\105\103\104\116\083\108\097\115\104";"\076\101\102\116\083\108\097\115\104";"\079\118\101\114\072\101\097\100\083\119\105\110\103","\076\101\102\116\083\119\105\110\103\070\097\115\116";"\082\105\103\104\116\083\119\105\110\103\070\097\115\116"}BaseDamage=5 SlashDamage=10 SwingDamage=15 Damage=BaseDamage SlashSound=Instance.new("\083\111\117\110\100")SlashSound.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"SlashSound.Parent=Handle SlashSound.Volume=.7 UnsheathSound=Instance.new("\083\111\117\110\100")UnsheathSound.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"UnsheathSound.Parent=Handle UnsheathSound.Volume=.5 function Blow(E)if E and E.Parent then local J=E.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")if Character and(Player and(Humanoid and(J and(J~=Humanoid and(J.Health>0 and Humanoid.Health>0)))))then local E=Character:FindFirstChild("\082\105\103\104\116 \065\114\109")if E then local Z=E:FindFirstChild("\082\105\103\104\116\071\114\105\112")if Z and(Z.Part0==Handle or Z.Part1==Handle)then TagHumanoid(J,Player)J:TakeDamage(Damage)end end end end end function TagHumanoid(E,J)for E,J in pairs(E:GetChildren())do if J.Name=="\099\114\101\097\116\111\114"then J:Destroy()end end local Z=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")Z.Value=J Z.Name="\099\114\101\097\116\111\114"Debris:AddItem(Z,1)Z.Parent=E end function OnActivated()if Tool.Enabled and Returned.Value then Character=Tool.Parent Player=Players:GetPlayerFromCharacter(Character)Humanoid=Character:FindFirstChild("\072\117\109\097\110\111\105\100")Tool.Enabled=false local E={}for J,Z in pairs(Anims)do if Z~=LastAnim then table.insert(E,Z)end end NewAnim=E[math.random(1,#E)]LastAnim=NewAnim RunAnim.Value=NewAnim if Humanoid and NewAnim then SlashSound:Play()if NewAnim=="\079\118\101\114\072\101\097\100\083\119\105\110\103"then Damage=SwingDamage else Damage=SlashDamage end wait(.75)Damage=BaseDamage end Tool.Enabled=true end end function OnEquipped(E)UnsheathSound:Play()end Tool.Activated:connect(OnActivated)Tool.Equipped:connect(OnEquipped)Connection=Handle.Touched:connect(Blow)


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

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

Anims = {"RightSlash", "LeftSlash", "OverHeadSwing", "LeftSwingFast", "RightSwingFast"}

BaseDamage = 5
SlashDamage = 10
SwingDamage = 15
Damage = BaseDamage

SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = Handle
SlashSound.Volume = 0.7

UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = Handle
UnsheathSound.Volume = 0.5

function Blow(Hit)
	if Hit and Hit.Parent then
		local humanoid = Hit.Parent:FindFirstChild("Humanoid")
		if Character and Player and Humanoid and humanoid and humanoid ~= Humanoid and humanoid.Health > 0 and Humanoid.Health > 0 then
			local right_arm = Character:FindFirstChild("Right Arm")
			if right_arm then
				local joint= right_arm:FindFirstChild("RightGrip")
				if joint and (joint.Part0 == Handle or joint.Part1 == Handle) then
					TagHumanoid(humanoid, Player)
					humanoid:TakeDamage(Damage)
				end
			end
		end
	end
end

function TagHumanoid(humanoid, player)
	for i, v in pairs(humanoid:GetChildren()) do
		if v.Name == "creator" then
			v:Destroy()
		end
	end
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = player
	creator_tag.Name = "creator"
	Debris:AddItem(creator_tag, 1)
	creator_tag.Parent = humanoid
end

function OnActivated()
	if Tool.Enabled and Returned.Value then
		Character = Tool.Parent
		Player = Players:GetPlayerFromCharacter(Character)
		Humanoid = Character:FindFirstChild("Humanoid")
		Tool.Enabled = false
		local TempAnims = {}
		for i, v in pairs(Anims) do
			if v ~= LastAnim then
				table.insert(TempAnims, v)
			end
		end
		NewAnim = TempAnims[math.random(1, #TempAnims)]
		LastAnim = NewAnim
		RunAnim.Value = NewAnim
		if Humanoid and NewAnim then
			SlashSound:Play()
			if NewAnim == "OverHeadSwing" then
				Damage = SwingDamage
			else
				Damage = SlashDamage
			end
			wait(0.75)
			Damage = BaseDamage
		end
		Tool.Enabled = true
	end
end

function OnEquipped(Mouse)
	UnsheathSound:Play()
end

Tool.Activated:connect(OnActivated)
Tool.Equipped:connect(OnEquipped)

Connection = Handle.Touched:connect(Blow)


