r=game:service("\082\117\110\083\101\114\118\105\099\101")local o=100 local A=100 local P=100 sword=script.Parent.Handle Tool=script.Parent local c=sword.SoundSlash local G=sword.SoundUnsheath function getHumanoid(o)local A=o:getChildren()for o=1,#A,1 do if A[o].className=="\072\117\109\097\110\111\105\100"then return A[o]end end return nil end function blow(A)if A.Parent==nil then return end local P=getHumanoid(A.Parent)local c=Tool.Parent local G=game.Players:playerFromCharacter(c)local T=c:findFirstChild("\072\117\109\097\110\111\105\100")if P~=nil and(P~=T and T~=nil)then local A=c:FindFirstChild("\082\105\103\104\116 \065\114\109")if A~=nil then local c=A:FindFirstChild("\082\105\103\104\116\071\114\105\112")if c~=nil and(c.Part0==sword or c.Part1==sword)then tagHumanoid(P,G)P:TakeDamage(o)wait(1)untagHumanoid(P)end end end end function tagHumanoid(o,A)local P=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")P.Value=A P.Name="\099\114\101\097\116\111\114"P.Parent=o end function untagHumanoid(o)if o~=nil then local A=o:findFirstChild("\099\114\101\097\116\111\114")if A~=nil then A.Parent=nil end end end function attack()o=A c:play()local P=Instance.new("\083\116\114\105\110\103\086\097\108\117\101")P.Name="\116\111\111\108\097\110\105\109"P.Value="\083\108\097\115\104"P.Parent=Tool end function fire(o)local A=script.Parent.Handle:clone()A.CFrame=CFrame.new(Tool.Parent.Head.Position+(o-Tool.Parent.Head.Position).unit*6,o)A.CanCollide=true A.Name="\080\114\111\106\101\099\116\105\108\101"local P=Instance.new("\066\111\100\121\086\101\108\111\099\105\116\121")P.velocity=(o-Tool.Parent.Head.Position).unit*100 P.Parent=A local c=Instance.new("\066\111\100\121\065\110\103\117\108\097\114\086\101\108\111\099\105\116\121")c.angularvelocity=A.CFrame:vectorToWorldSpace(Vector3.new(0,15,0))c.Parent=A local G=script.Parent.ProjectileScript:clone()G.Disabled=false G.Parent=A local T=game.Players:findFirstChild(Tool.Parent.Name)if T==nil then return end tagHumanoid(A,T)A.Parent=workspace end function swordAcross() end Tool.Enabled=true local T=0 function onActivated(o)if not Tool.Enabled then return end Tool.Enabled=false local A=Tool.Parent local P=A.Humanoid if P==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()attack()fire(P.TargetPoint)Tool.Enabled=true end function onEquipped(o)G:play()end script.Parent.Activated:connect(onActivated)script.Parent.Equipped:connect(onEquipped)connection=sword.Touched:connect(blow)
-------- OMG HAX

r = game:service("RunService")

local damage = 100

local slash_damage = 100
local lunge_damage = 100

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

local SlashSound = sword.SoundSlash

local UnsheathSound = sword.SoundUnsheath

function getHumanoid(obj)
	local get = obj:getChildren()
	for i = 1, #get do
		if get[i].className == "Humanoid" then
			return get[i]
		end
	end
	return nil
end

function blow(hit)
	if hit.Parent == nil then
		return
	end -- happens when bullet hits sword

	local humanoid = getHumanoid(hit.Parent)
	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 fire(pos)
	local bullet = script.Parent.Handle:clone()
	bullet.CFrame = CFrame.new(Tool.Parent.Head.Position + (pos - Tool.Parent.Head.Position).unit * 6, pos)
	bullet.CanCollide = true
	bullet.Name = "Projectile"

	local velo = Instance.new("BodyVelocity")
	velo.velocity = (pos - Tool.Parent.Head.Position).unit * 100
	velo.Parent = bullet

	local spin = Instance.new("BodyAngularVelocity")
	spin.angularvelocity = bullet.CFrame:vectorToWorldSpace(Vector3.new(0, 15, 0))
	spin.Parent = bullet

	local newscript = script.Parent.ProjectileScript:clone()
	newscript.Disabled = false
	newscript.Parent = bullet

	local player = game.Players:findFirstChild(Tool.Parent.Name)
	if player == nil then
		return
	end
	tagHumanoid(bullet, player)

	bullet.Parent = workspace
end

function swordAcross()
	-- parry
end

Tool.Enabled = true
local last_attack = 0
function onActivated(mouse)
	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()

	attack()
	fire(humanoid.TargetPoint)

	--wait(.5)

	Tool.Enabled = true
end

function onEquipped(mouse)
	UnsheathSound:play()
end

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

connection = sword.Touched:connect(blow)
