--EQUIP ANIMATION

Debounce = false

Stance = "Nothing"


local KeyUsed = {}
local function KeyChecked(key)
	for i=1,#KeyUsed do
		if key == KeyUsed[i] then
			return true
		end
	end
	return false
end
Character = Player.Character
Mouse.KeyDown:connect(function(key)
	key = string.lower(key)
	if key == "y" then
SEs.ChangeVal:FireServer(k,Tool.Skrimish,not Tool.Skrimish.Value)
	elseif key == "c" and not Attacking then
		SEs.Crouch:FireServer(k,script.CRC,Character)
	elseif Stance == "Nothing" and not Debounce then
    	if key == "" then
	    	CarrySabre()
	    elseif key == "" then
	    	PresentSabre()
       	elseif key == "" then
     		AtEase()	
     	elseif key == "" then
	    	EyeRight()
    end		


	elseif Stance ~= "Nothing" and not Debounce
		and KeyChecked(key) then
	    if Stance == "Carry" then
	    	CarrySabre()
	    elseif Stance == "Present" then
	    	PresentSabre()
       	elseif Stance == "Ease" then
     		AtEase()	
     	elseif Stance == "Right" then
	    	EyeRight()
	    end
	end
end)


Mouse.Button1Down:connect(function()
	if Stance == "Nothing" then
	if not Attacking and not Blocking then
		SEs.ChangeVal:FireServer(k,Tool.Direction,AttackDirection)
		Attack = true
		Attacking = true
		if AttackDirection == "U" then
Turning = true
NeckRotation = math.rad(10)
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(10), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0.1+((0.6)), 0.1+((0.4))) * CFrame.fromEulerAnglesXYZ(math.rad(-20)+(math.rad(-100)), math.rad(-10), 0)* CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0.1+((0.6)), 0.1+((0.4))) * CFrame.fromEulerAnglesXYZ(math.rad(-20)+(math.rad(-100)), math.rad(-10), 0)* CFrame.new(0,1.5,0)	
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,math.rad(10),0)
,0.2)	
Turning = false
			repeat wait() until not Attack
			PlaySound(Tool.Handle.Swing)
			BladeReady = true
Turning = true
NeckRotation = math.rad(-10)
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(-10), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0.7+((-0.3)), 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120)+(math.rad(95)), math.rad(-10), 0)* CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0.7+((-0.3)), 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120)+(math.rad(95)), math.rad(-10), 0)* CFrame.new(0,1.5,0)
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,math.rad(-10),0)
,0.1)	
			BladeReady = false
			wait(0.2)
NeckRotation = math.rad(0)
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0.4+((-0.3)), 0.5+((-0.4))) * CFrame.fromEulerAnglesXYZ(math.rad(-25)+(math.rad(5)), math.rad(-10), 0)* CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0.4+((-0.3)), 0.5+((-0.4))) * CFrame.fromEulerAnglesXYZ(math.rad(-25)+(math.rad(5)), math.rad(-10), 0)* CFrame.new(0,1.5,0)
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
,0.2)	
Turning = false

		elseif AttackDirection == "D" then
Turning = true
NeckRotation = math.rad(10)
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(10), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0.1+((-0.1)), 0.1+((-0.4))) * CFrame.fromEulerAnglesXYZ(math.rad(-20)+(math.rad(30)), math.rad(-10)+(math.rad(10)), 0)* CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0.1+((-0.1)), 0.1+((-0.4))) * CFrame.fromEulerAnglesXYZ(math.rad(-20)+(math.rad(30)), math.rad(-10)+(math.rad(10)), 0)* CFrame.new(0,1.5,0)
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,math.rad(10),0)
,0.2)	
Turning = false
			repeat wait() until not Attack
			PlaySound(Tool.Handle.Swing)
			BladeReady = true
Turning = true
NeckRotation = math.rad(-60)
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(-60), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-0.7, -0.65, 1.6+0.55) * CFrame.fromEulerAnglesXYZ(math.rad(-5), 0+(math.rad(-10)), 0)* CFrame.new(0,1.5,0)
,CFrame.new(-0.7, 0.1+1.4, 0+0.8) * CFrame.fromEulerAnglesXYZ(math.rad(5)+(math.rad(-80)), 0+(math.rad(-10)), 0)* CFrame.new(0,1.5,0)
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,math.rad(-60),0)
,0.1)		

			BladeReady = false
wait(0.2)
NeckRotation = 0
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0+((0.1)), 0.2+((-0.1))) * CFrame.fromEulerAnglesXYZ(math.rad(-45)+(math.rad(25)), math.rad(-20)+(math.rad(10)), 0)* CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0+((0.1)), 0.2+((-0.1))) * CFrame.fromEulerAnglesXYZ(math.rad(-45)+(math.rad(25)), math.rad(-20)+(math.rad(10)), 0)* CFrame.new(0,1.5,0)
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
,0.3)	
Turning = false

		elseif AttackDirection == "L" then
Turning = true
NeckRotation = math.rad(-30)
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(-30), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-1.5+((0.7)), 0.1+((0.6)), 0.1+((-1.4))) * CFrame.fromEulerAnglesXYZ(math.rad(-20)+(math.rad(-95)), math.rad(-10)+(math.rad(10)), 0+(math.rad(-75)))* CFrame.new(0,1.5,0)
,CFrame.new(-1.5+((0.7)), 0.1+((0.6)), 0.1+((-1.4))) * CFrame.fromEulerAnglesXYZ(math.rad(-20)+(math.rad(-95)), math.rad(-10)+(math.rad(10)), 0+(math.rad(-75)))* CFrame.new(0,1.5,0)
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,math.rad(-30),0)
,0.3)
Turning = false	
			repeat wait() until not Attack
			PlaySound(Tool.Handle.Swing)
			BladeReady = true
Turning = true
NeckRotation = math.rad(20)
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(20), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-0.7, 1.12, 0.48) * CFrame.fromEulerAnglesXYZ(math.rad(-115)+(math.rad(130)), 0, math.rad(-75))* CFrame.new(0,1.5,0)
,CFrame.new(-0.7, 0.8, -1.2) * CFrame.fromEulerAnglesXYZ(math.rad(-115)+(math.rad(70)), 0, math.rad(-75))* CFrame.new(0,1.5,0)
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,math.rad(20),0)
,0.1)	
			BladeReady = false
			wait(0.2)
NeckRotation = math.rad(0)
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-0.9+((-0.6)), 1.2+((-1.1)), -0.9+((1))) * CFrame.fromEulerAnglesXYZ(math.rad(-55)+(math.rad(35)), 0+(math.rad(-10)), math.rad(-75)+(math.rad(75)))* CFrame.new(0,1.5,0)
,CFrame.new(-0.9+((-0.6)), 1.2+((-1.1)), -0.9+((1))) * CFrame.fromEulerAnglesXYZ(math.rad(-55)+(math.rad(35)), 0+(math.rad(-10)), math.rad(-75)+(math.rad(75)))* CFrame.new(0,1.5,0)
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
,0.3)		
Turning = false
		elseif AttackDirection == "R" then
Turning = true
NeckRotation = math.rad(10)

Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(10), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-1.5+((0.3)), 0.1+((0.7)), 0.1+((0.65))) * CFrame.fromEulerAnglesXYZ(math.rad(-20)+(math.rad(-55)), math.rad(-10)+(math.rad(40)), 0+(math.rad(10)))* CFrame.new(0,1.5,0)
,CFrame.new(-1.5+((0.3)), 0.1+((0.7)), 0.1+((0.65))) * CFrame.fromEulerAnglesXYZ(math.rad(-20)+(math.rad(-55)), math.rad(-10)+(math.rad(40)), 0+(math.rad(10)))* CFrame.new(0,1.5,0)
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,math.rad(10),0)
,0.3)		
Turning = false
			repeat wait() until not Attack
			PlaySound(Tool.Handle.Swing)
			BladeReady = true
Turning = true
NeckRotation = math.rad(-30)
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(-30), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(0, -1.18, 1.34) * CFrame.fromEulerAnglesXYZ(math.rad(-75)+(math.rad(90)), math.rad(30)+(math.rad(-35)), math.rad(10)+(math.rad(60)))* CFrame.new(0,1.5,0)
,CFrame.new(0, 0.1, 1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-75)+(math.rad(45)), math.rad(30)+(math.rad(-35)), math.rad(10)+(math.rad(60)))* CFrame.new(0,1.5,0)
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,math.rad(-30),0)
,0.1)		

			BladeReady = false
			wait(0.2)
NeckRotation = math.rad(0)
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0.1, 0.1) * CFrame.fromEulerAnglesXYZ(math.rad(-30)+(math.rad(10)), math.rad(-5)+(math.rad(-5)), math.rad(70)+(math.rad(-70)))* CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0.1, 0.1) * CFrame.fromEulerAnglesXYZ(math.rad(-30)+(math.rad(10)), math.rad(-5)+(math.rad(-5)), math.rad(70)+(math.rad(-70)))* CFrame.new(0,1.5,0)
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
,0.3)	
Turning = false	
		end
		SEs.ChangeVal:FireServer(k,Tool.Direction,"")
		Attacking = false
	end
	end
end)

Mouse.Button2Down:connect(function()
		if Stance == "Nothing" then
	if not Blocking and not Attacking then
	    SEs.ChangeVal:FireServer(k,Tool.Direction,"")
		Block = true
		Blocking = true
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-1.5+((0.6)), 0.1+((0.5)), 0.1+((-1.2))) * CFrame.fromEulerAnglesXYZ(math.rad(-20)+(math.rad(-60)), math.rad(-10)+(math.rad(10)), 0+(math.rad(-65)))* CFrame.new(0,1.5,0)
,CFrame.new(-1.5+((0.6)), 0.1+((0.5)), 0.1+((-1.2))) * CFrame.fromEulerAnglesXYZ(math.rad(-20)+(math.rad(-60)), math.rad(-10)+(math.rad(10)), 0+(math.rad(-65)))* CFrame.new(0,1.5,0)
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
,0.2)		
SEs.ChangeVal:FireServer(k,Tool.Block,true)
		repeat wait() until not Block
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-0.9+((-0.6)), 0.6+((-0.5)), -1.1+((1.2))) * CFrame.fromEulerAnglesXYZ(math.rad(-80)+(math.rad(60)), math.rad(0)+(math.rad(-10)), math.rad(-65)+(math.rad(65)))* CFrame.new(0,1.5,0)
,CFrame.new(-0.9+((-0.6)), 0.6+((-0.5)), -1.1+((1.2))) * CFrame.fromEulerAnglesXYZ(math.rad(-80)+(math.rad(60)), math.rad(0)+(math.rad(-10)), math.rad(-65)+(math.rad(65)))* CFrame.new(0,1.5,0)
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
,0.2)		
SEs.ChangeVal:FireServer(k,Tool.Block,false)
		Blocking = false
	end
	end
end)

Mouse.Button1Up:connect(function()
	if Stance == "Nothing" then
	Attack = false
	end
end)

Mouse.Button2Up:connect(function()
	if Stance == "Nothing" then
	Block = false
	end
end)
end
else
print("sh")
end
else
print("arms")
end
end

script.CRC.Changed:Connect(function()
	if not script.CRC.Value then
		TweenService:Create(torso.Parent.Humanoid,TweenInfo.new(0.3),
	{CameraOffset = torso.Parent.Humanoid.CameraOffset + (Vector3.new(0,0,0) - torso.Parent.Humanoid.CameraOffset)}):Play()
Tool.Hig.Value = 0	
Animate(
 weld1C1
,weld2C1
,weld3C1
,tweldC1
,0.3)	
chr.Humanoid.WalkSpeed = script.Speed.Value	
	        else
		TweenService:Create(torso.Parent.Humanoid,TweenInfo.new(0.3),
	{CameraOffset = torso.Parent.Humanoid.CameraOffset + (Vector3.new(0,-1,0) - torso.Parent.Humanoid.CameraOffset)}):Play()
Tool.Hig.Value = 1
chr.Humanoid.WalkSpeed = 0	
Animate(
 weld1C1
,weld2C1
,weld3C1
,tweldC1
,0.3)	
	end
end)	

function DamageHorse(Humanoid, SpeedDamage)
	SEs.Damage:FireServer(k,Tool,Humanoid)
end

function DamageConstruct(Hit)
	SEs.Damage:FireServer(k,Tool,Hit)   
end


function IsHorse(Hit) -- This function is incredibly ugly.
	if Hit.Parent.Name == "Horse" then
		HorseHumanoid = Hit.Parent.Humanoid
		return true
	elseif Hit.Parent.Parent.Name == "Horse" then
		HorseHumanoid = Hit.Parent.Parent.Humanoid
		return true
	elseif Hit.Parent.Parent ~= game then
		if Hit.Parent.Parent.Parent.Name == "Horse" then
			HorseHumanoid = Hit.Parent.Parent.Parent.Humanoid
			return true
		elseif Hit.Parent.Parent.Parent ~= game then
			if Hit.Parent.Parent.Parent.Parent.Name == "Horse" then
				HorseHumanoid = Hit.Parent.Parent.Parent.Parent.Humanoid
				return true
			else
				return false
			end
		else
			return false
		end
	else
		return false
	end
end
local BladeDebounce = false
function Blade(Hit)
if BladeReady then
		if IsHorse(Hit) and not BladeDebounce and Hit.Parent ~= Tool.Parent and HorseHumanoid.Parent:FindFirstChild("CurrentSpeed") then
		if HorseHumanoid.Parent.CurrentSpeed.Value > 15 then
			local WallDetection = Ray.new(Character.Torso.Position, (Tool.Blade.Position - Character.Torso.Position).unit*(Tool.Blade.Position - Character.Torso.Position).magnitude)
			local Ignore = {Character, arms[2].Mweld3.Part1.Parent, Hit.Parent}
			local WallHit, WallHitPos = game.Workspace:FindPartOnRayWithIgnoreList(WallDetection, Ignore)	
			if not WallHit then
				BladeDebounce = true		
				DamageHorse(HorseHumanoid, true)
				PlaySound(Tool.Blade.HitFlesh)
				wait(0.4)
				BladeDebounce = false
			end
		end
	elseif IsHorse(Hit) and not BladeDebounce and Hit.Parent ~= Tool.Parent then
		local WallDetection = Ray.new(Character.Torso.Position, (Tool.Blade.Position - Character.Torso.Position).unit*(Tool.Blade.Position - Character.Torso.Position).magnitude)
		local Ignore = {Character, arms[2].Mweld3.Part1.Parent, Hit.Parent}
		local WallHit, WallHitPos = game.Workspace:FindPartOnRayWithIgnoreList(WallDetection, Ignore)	
		if not WallHit then
			BladeDebounce = true		
			DamageHorse(HorseHumanoid, false)
			PlaySound(Tool.Blade.HitFlesh)
			wait(0.4)
			BladeDebounce = false
		end
	elseif Hit.Parent:FindFirstChild("Integrity") and not BladeDebounce then
			BladeDebounce = true
			DamageConstruct(Hit)
			PlaySound(Tool.Blade.HitConstruct)
			wait(0.4)
			BladeDebounce = false
			
			
	else if Hit.Parent:FindFirstChild("Humanoid") and Hit.Parent:FindFirstChild("Torso") and not BladeDebounce and Hit.Parent ~= Tool.Parent then
		for _,V in ipairs(Hit.Parent:GetChildren()) do
			if V:IsA("Tool") then
				HitTool = V
			end
		end

		if HitTool then
			if HitTool:FindFirstChild("Direction") then
				if CheckIfBlocked(HitTool.Direction.Value, Tool.Direction.Value, HitTool.Block.Value, Tool.Block.Value) and CheckIfFacing(Tool.Parent.Head,Hit.Parent.Head) > 1.5 then
					if HitTool.Handle.Block.Volume == 0.5 then 
					    HitTool.Handle.Block.Volume = 1	
					    PlaySound(HitTool.Handle.Block,Character)	
					    wait(0.4)
					    HitTool.Handle.Block.Volume = 0.5		
					end				
				else
					local WallDetection = Ray.new(Character.Torso.Position, (Tool.Blade.Position - Character.Torso.Position).unit*(Tool.Blade.Position - Character.Torso.Position).magnitude)
					local Ignore = {Character, arms[2].Mweld3.Part1.Parent, Hit.Parent}
					local WallHit, WallHitPos = game.Workspace:FindPartOnRayWithIgnoreList(WallDetection, Ignore)	
						BladeDebounce = true		
						DamagePlayer(Hit.Parent.Humanoid,Hit)
						PlaySound(Tool.Blade.HitFlesh)
						wait(0.4)
						BladeDebounce = false
				end
			else
				local WallDetection = Ray.new(Character.Torso.Position, (Tool.Blade.Position - Character.Torso.Position).unit*(Tool.Blade.Position - Character.Torso.Position).magnitude)
				local Ignore = {Character, arms[2].Mweld3.Part1.Parent, Hit.Parent}
				local WallHit, WallHitPos = game.Workspace:FindPartOnRayWithIgnoreList(WallDetection, Ignore)	
					BladeDebounce = true		
					DamagePlayer(Hit.Parent.Humanoid,Hit)
					PlaySound(Tool.Blade.HitFlesh)
					wait(0.4)
					BladeDebounce = false
			end
		else
			local WallDetection = Ray.new(Character.Torso.Position, (Tool.Blade.Position - Character.Torso.Position).unit*(Tool.Blade.Position - Character.Torso.Position).magnitude)
			local Ignore = {Character, arms[2].Mweld3.Part1.Parent, Hit.Parent}
			local WallHit, WallHitPos = game.Workspace:FindPartOnRayWithIgnoreList(WallDetection, Ignore)	
				BladeDebounce = true		
				DamagePlayer(Hit.Parent.Humanoid,Hit)
				PlaySound(Tool.Blade.HitFlesh)
				wait(0.4)
				BladeDebounce = false
		end			

	end
end
end
end

function CheckIfBlocked(One,Two,BlockOne,BlockTwo)
	if One == "U" and Two == "U" then
		return true
	elseif One == "D" and Two == "D" then
		return true
	elseif One == "L" and Two == "R" then
		return true
	elseif One == "R" and Two == "L" then
		return true
	elseif BlockOne or BlockTwo then
		return true
	end
end

function CheckIfFacing(One,Two)
	local Magnitude = ((One.CFrame.lookVector*Vector3.new(1,0,1)) - (Two.CFrame.lookVector*Vector3.new(1,0,1))).magnitude
	return Magnitude
end

Tool:waitForChild("Blade")
Tool.Blade.Touched:connect(Blade)
function DamagePlayer(Humanoid,Hit)
	if game.Players:GetPlayerFromCharacter(Humanoid.Parent) then
		if game.Players:GetPlayerFromCharacter(Humanoid.Parent).TeamColor ~= game.Players.LocalPlayer.TeamColor or Tool.TK.Value then
			DamageHumanoid(Humanoid,Hit)
		end
	else
		DamageHumanoid(Humanoid,Hit)
	end
end

function DamageHumanoid(Humanoid,Hit)
	if Hit.Name == "Torso" or Hit.Name == "Head" then
			SEs.Damage:FireServer(k,Tool,Humanoid.Parent["Left Arm"],Player)
	else
			SEs.Damage:FireServer(k,Tool,Humanoid.Parent["Left Leg"],Player)
	end
end

function AtEase()
local n = 6
	if Stance == "Nothing" then
if not script.CRC.Value then Player.Character.Humanoid.WalkSpeed = 12 else Player.Character.Humanoid.WalkSpeed = 0 end
		script.Speed.Value = 12					Debounce = true
		Stance = "Ease"

Animate(
 CFrame.new(1.5+((-1/6)*n), 0-((0.3/6)*n), 0-((0.8/6)*n)) * CFrame.fromEulerAnglesXYZ(math.rad(0)+(math.rad(40/6)*n), math.rad(0), 0-(math.rad(45/6)*n)) * CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0.1, 0.165-((0.065))) * CFrame.fromEulerAnglesXYZ(math.rad(-35)+(math.rad(15)), math.rad(-10), 0) * CFrame.new(0,1.5,0)	
,CFrame.new(-1.5, -0.27+((0.37)), -1+((1.1))) * CFrame.fromEulerAnglesXYZ(math.rad(-123)+(math.rad(103)), math.rad(-10), 0) * CFrame.new(0,1.5,0)	
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
,0.2)		

		Debounce = false
	else
		Debounce = true		
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0.1, 0.165-((0.065))) * CFrame.fromEulerAnglesXYZ(math.rad(-35)+(math.rad(15)), math.rad(-10), 0) * CFrame.new(0,1.5,0)	
,CFrame.new(-1.5, -0.27+((0.37)), -1+((1.1))) * CFrame.fromEulerAnglesXYZ(math.rad(-123)+(math.rad(103)), math.rad(-10), 0) * CFrame.new(0,1.5,0)	
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
,0.2)	

if not script.CRC.Value then Player.Character.Humanoid.WalkSpeed = 16 else Player.Character.Humanoid.WalkSpeed = 0 end
		script.Speed.Value = 16					Debounce = false
		Stance = "Nothing"
	end
end


function CarrySabre()
	if Stance == "Nothing" and BladeReady == false and SwordDebounce == false and Attacking == false and Blocking == false then
		Debounce = true
		Stance = "Carry"
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0.1-((0.37)), 0.1-((1.1))) * CFrame.fromEulerAnglesXYZ(math.rad(-20)+(math.rad(-103)), math.rad(-10), 0) * CFrame.new(0,1.5,0)	
,CFrame.new(-1.5, 0.1, 0.1+((0.065))) * CFrame.fromEulerAnglesXYZ(math.rad(-20)+(math.rad(-15)), math.rad(-10), 0) * CFrame.new(0,1.5,0)	
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
,0.2)		

if not script.CRC.Value then Player.Character.Humanoid.WalkSpeed = 18 else Player.Character.Humanoid.WalkSpeed = 0 end
		script.Speed.Value = 18	
		Debounce = false
	elseif Stance == "Carry" and BladeReady == false and SwordDebounce == false and Attacking == false and Blocking == false then
		Debounce = true		
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0.1, 0.165-((0.065))) * CFrame.fromEulerAnglesXYZ(math.rad(-35)+(math.rad(15)), math.rad(-10), 0) * CFrame.new(0,1.5,0)	
,CFrame.new(-1.5, -0.27+((0.37)), -1+((1.1))) * CFrame.fromEulerAnglesXYZ(math.rad(-123)+(math.rad(103)), math.rad(-10), 0) * CFrame.new(0,1.5,0)	
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
,0.2)		
		Debounce = false
if not script.CRC.Value then Player.Character.Humanoid.WalkSpeed = 16 else Player.Character.Humanoid.WalkSpeed = 0 end
		script.Speed.Value = 16			Stance = "Nothing"
	end
end

function PresentSabre()
	if Stance == "Nothing" and BladeReady == false and SwordDebounce == false and Attacking == false and Blocking == false then
		Debounce = true
		Stance = "Present"
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-1.5+((0.35)), 0.1-((1.1)), 0.1+((0.5))) * CFrame.fromEulerAnglesXYZ(math.rad(-20)+(math.rad(-70)), math.rad(-10)+(math.rad(-80)), 0) * CFrame.new(0,1.5,0)	
,CFrame.new(-1.5+((0.45)), 0.1-((0.45)), 0.1+((0.35))) * CFrame.fromEulerAnglesXYZ(math.rad(-20)+(math.rad(-100)), math.rad(-10)+(math.rad(-65)), 0) * CFrame.new(0,1.5,0)	
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
,0.3)		

if not script.CRC.Value then Player.Character.Humanoid.WalkSpeed = 12 else Player.Character.Humanoid.WalkSpeed = 0 end
		script.Speed.Value = 12
	Debounce = false
	elseif Stance == "Present" and BladeReady == false and SwordDebounce == false and Attacking == false and Blocking == false then
		Debounce = true		
Animate(
 CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(0)) * CFrame.new(0,1.5,0)
,CFrame.new(-1.5, 0.1, 0.165-((0.065))) * CFrame.fromEulerAnglesXYZ(math.rad(-35)+(math.rad(15)), math.rad(-10), 0) * CFrame.new(0,1.5,0)	
,CFrame.new(-1.5, -0.27+((0.37)), -1+((1.1))) * CFrame.fromEulerAnglesXYZ(math.rad(-123)+(math.rad(103)), math.rad(-10), 0) * CFrame.new(0,1.5,0)	
,CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
,0.3)		
		Debounce = false
if not script.CRC.Value then Player.Character.Humanoid.WalkSpeed = 16 else Player.Character.Humanoid.WalkSpeed = 0 end
		script.Speed.Value = 16			Stance = "Nothing"
	end
end

function EyeRight()
	if Stance == "Nothing" then
		Debounce = true
if not script.CRC.Value then Player.Character.Humanoid.WalkSpeed = 6 else Player.Character.Humanoid.WalkSpeed = 0 end
		script.Speed.Value = 6	
Stance = "Right"
Turning = true
NeckRotation = math.rad(-60)
TweenService:Create(neck,TweenInfo.new(0.2),{C0=OriginalC0*CFrame.Angles(0,0,NeckRotation)}):Play()
wait(0.2)
Turning = false
if not script.CRC.Value then Player.Character.Humanoid.WalkSpeed = 6 else Player.Character.Humanoid.WalkSpeed = 0 end
	script.Speed.Value = 6
		Debounce = false
	else
		Debounce = true		
Turning = true
NeckRotation = math.rad(0)
TweenService:Create(neck,TweenInfo.new(0.2),{C0=OriginalC0*CFrame.Angles(0,0,NeckRotation)}):Play()
wait(0.2)
Turning = false
		Debounce = false
if not script.CRC.Value then Player.Character.Humanoid.WalkSpeed = 16 else Player.Character.Humanoid.WalkSpeed = 0 end
		script.Speed.Value = 16	
		Stance = "Nothing"
	end
end

local Speed = script.Speed

if Player.Character:WaitForChild("Humanoid") then
Player.Character.Humanoid.Changed:connect(function()
		if Player.Character.Humanoid.WalkSpeed > 0 then
			Speed.Value = Player.Character.Humanoid.WalkSpeed
		end
		if script.CRC.Value then	
			Player.Character.Humanoid.WalkSpeed = 0
		end
end)
end



function CalcHorizontalAngle(OriginPos, AimPos) -- A-Level maths put to use!
	local B = AimPos - OriginPos
	local C = CFrame.new(Vector3.new(0,0,0), Player.Character.Head.CFrame.lookVector)*CFrame.Angles(0,math.rad(-90),0)
	local D = 10*C.lookVector
	local A = B.magnitude*Player.Character.Head.CFrame.lookVector
	
	AdotB = A.X*B.X + A.Z*B.Z
	magA = A.magnitude
	magB = B.magnitude
	Angle1 = math.deg(math.acos(AdotB/(magA*magB)))
	
	DdotB = D.X*B.X + D.Z*B.Z
	magD = D.magnitude
	magB = B.magnitude
	Angle2 = math.deg(math.acos(DdotB/(magD*magB)))	
	
	if Angle2 >= 90 then
		Angle1 = -Angle1
	end
	
	return Angle1	
end
	
function Unequip()
Gyro.Parent = script chr.Humanoid.AutoRotate = true
	
SEs.UnEquip:FireServer(Tool)
local chr = Player.Character

TweenService:Create(neck,TweenInfo.new(0.1),{C0=OriginalC0*CFrame.Angles(0,0,0)}):Play()

TweenService:Create(fakeneck,TweenInfo.new(0.1),{C0=OriginalC0*CFrame.Angles(0,0,0)}):Play()

TweenService:Create(tiltweld,TweenInfo.new(0.1),{C0=CFrame.new(0,0,0) * CFrame.Angles(0,0,0)}):Play()

script.Speed.Value = 16
chr.Humanoid.WalkSpeed = 16 

Player.PlayerGui.MainGui:WaitForChild("HitMarker").Visible = false

SEs.ChangeVal:FireServer(k,Tool.Block,false)
Camera.FieldOfView = 70