r=game:service("\082\117\110\083\101\114\118\105\099\101")local J=0 local p=0 local A=false function blow(J)local p=J.Parent:findFirstChild("\073\109\109\111\114\116\097\108")local G=script.Parent.Parent local W=game.Players:playerFromCharacter(G)local Q=G:findFirstChild("\073\109\109\111\114\116\097\108")if p~=nil and(p~=Q and Q~=nil)then if A==false then A=true tagHumanoid(p,W)zomghit=0+script.Parent.AddDam.Value p:TakeDamage(zomghit)untagHumanoid(p)wait(.35)A=false end end end function tagHumanoid(J,p)local A=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")A.Value=p A.Name="\099\114\101\097\116\111\114"A.Parent=J end function untagHumanoid(J)if J~=nil then local p=J:findFirstChild("\099\114\101\097\116\111\114")if p~=nil then p.Parent=nil end end end function attack()J=p local A=script.Parent.Handle.Slash1 local G=script.Parent.Handle.Slash2 Slashsounds={A,G}Whoosh=Slashsounds[math.random(1,#Slashsounds)]Whoosh:play()local W=script.Parent.Parent local Q=W:findFirstChild("\073\109\109\111\114\116\097\108")Move1=Q:LoadAnimation(script.Parent.Handle.LeftSlash)Move2=Q:LoadAnimation(script.Parent.Handle.OverHeadSwing)Move3=Q:LoadAnimation(script.Parent.Handle.RightSlash)MovesLikeJagger={Move1;Move2;Move3}IGotThem=MovesLikeJagger[math.random(1,#MovesLikeJagger)]IGotThem:Play()wait(.1)Whoosh:play()wait(.1)end script.Parent.Enabled=true function onActivated()if not script.Parent.Enabled then return end script.Parent.Enabled=false local J=script.Parent.Parent local p=J.Immortal if p==nil then print("\072\117\109\097\110\111\105\100 \110\111\116 \102\111\117\110\100")return end attack()wait(.1)script.Parent.Enabled=true end function onEquipped()script.Parent.Handle.LightsaberOn:play()script.Parent.Handle.IdleLoop:Play()end function onUnequipped()script.Parent.Handle.LightsaberOff:stop()script.Parent.Handle.IdleLoop:Stop()end script.Parent.Activated:connect(onActivated)script.Parent.Equipped:connect(onEquipped)script.Parent.Unequipped:connect(onUnequipped)connection=script.Parent.Handle.Touched:connect(blow)


r = game:service("RunService")


local damage = 0

local slash_damage = 0

local debounce = false
function blow(hit)
	local humanoid = hit.Parent:findFirstChild("Immortal")
	local vCharacter = script.Parent.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local hum = vCharacter:findFirstChild("Immortal") -- 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
		if debounce == false then				
			debounce = true
			tagHumanoid(humanoid, vPlayer)
			zomghit = 0 + script.Parent.AddDam.Value
			humanoid:TakeDamage(zomghit)
			untagHumanoid(humanoid)
			wait(0.35)
			debounce = false	
		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
	
	local Slash1 = script.Parent.Handle.Slash1

	local Slash2 = script.Parent.Handle.Slash2

	Slashsounds={Slash1, Slash2}
	
	Whoosh=(Slashsounds[math.random(1,#Slashsounds)])
	Whoosh:play()
	local vCharacter = script.Parent.Parent
	local hum = vCharacter:findFirstChild("Immortal")
	
	Move1 = hum:LoadAnimation(script.Parent.Handle.LeftSlash)
	Move2 = hum:LoadAnimation(script.Parent.Handle.OverHeadSwing)
	Move3 = hum:LoadAnimation(script.Parent.Handle.RightSlash)

	
	MovesLikeJagger={Move1, Move2, Move3}
	IGotThem=(MovesLikeJagger[math.random(1,#MovesLikeJagger)])
	IGotThem:Play()
	--hum.WalkSpeed = 0
	wait(.1)
	Whoosh:play()
	wait(.1)
	--hum.WalkSpeed = 16
end

script.Parent.Enabled = true

function onActivated()

	if not script.Parent.Enabled then
		return
	end

	script.Parent.Enabled = false

	local character = script.Parent.Parent;
	local humanoid = character.Immortal
	if humanoid == nil then
		print("Humanoid not found")
		return 
	end

	attack()

	wait(.1)

	script.Parent.Enabled = true
end


function onEquipped()
	--if Tool.Handle.LightsaberOn.isPlaying == false then
		script.Parent.Handle.LightsaberOn:play()
		script.Parent.Handle.IdleLoop:Play()	
	--end
end

function onUnequipped()

	script.Parent.Handle.LightsaberOff:stop()
	script.Parent.Handle.IdleLoop:Stop()
end

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

connection = script.Parent.Handle.Touched:connect(blow)


