function Animate(l,s,L,Q,H,t)SetWelds()weld1C1=l weld2C1=s weld3C1=L tweldC1=Q;(TweenService:Create(neck,TweenInfo.new(H),{C0=OriginalC0*CFrame.Angles(Answer,0,NeckRotation)})):Play()SEs.FireClient:FireServer(k,"\065\110\105\109\097\116\101\070\069",{l;s,L,Q},H,Answer,0,NeckRotation,chr,Tool.Hig.Value)if script:IsDescendantOf(chr)then(TweenService:Create(weld1,TweenInfo.new(H),{C1=l*CFrame.new(0,Tool.Hig.Value,0)})):Play();(TweenService:Create(weld2,TweenInfo.new(H),{C1=s*CFrame.new(0,Tool.Hig.Value,0)})):Play();(TweenService:Create(weld3,TweenInfo.new(H),{C1=L*CFrame.new(0,Tool.Hig.Value,0)})):Play();(TweenService:Create(tweld,TweenInfo.new(H),{C1=Q*CFrame.new(0,Tool.Hig.Value,0)})):Play()end if t then H=H+t end wait(H)end chr.Humanoid.Died:connect(function()game.Workspace.CurrentCamera.FieldOfView=70 end)Mouse.Move:connect(function()local l=Player:GetMouse()local s=l.Hit.p local L=head.Position.Y-s.Y local Q=(head.Position-s).magnitude Answer=math.asin(L/Q)Gyro.cframe=l.Hit if Stance~="\078\111\116\104\105\110\103"then Answer=0 else if Stance=="\078\111\116\104\105\110\103"then if Answer>math.rad(20)then Answer=math.rad(20)elseif Answer<math.rad(-10)then Answer=math.rad(-10)else if torso.Parent.Humanoid.Sit then Answer=0 end end end end if Stance=="\078\111\116\104\105\110\103"then SEs.FireClient:FireServer(k,"\065\103\108\105\110",chr,Answer,{Answer,0;NeckRotation},.1,Turning)if not Turning then(TweenService:Create(neck,TweenInfo.new(.1),{C0=OriginalC0*CFrame.Angles(Answer,0,NeckRotation)})):Play()end;(TweenService:Create(fakeneck,TweenInfo.new(.1),{C0=OriginalC0*CFrame.Angles(0,0,0)})):Play();(TweenService:Create(tiltweld,TweenInfo.new(.1),{C0=CFrame.new(0,0,0)*CFrame.Angles(Answer,0,0)})):Play()if Gyro.Parent~=tilt and Tool.Skrimish.Value then Gyro.Parent=tilt chr.Humanoid.AutoRotate=false elseif Gyro.Parent==tilt and not Tool.Skrimish.Value then Gyro.Parent=script chr.Humanoid.AutoRotate=true chr.Humanoid.AutoRotate=true end else if Gyro.Parent==tilt then Gyro.Parent=script chr.Humanoid.AutoRotate=true chr.Humanoid.AutoRotate=true end SEs.FireClient:FireServer(k,"\065\103\108\105\110",chr,Answer,{Answer,0,NeckRotation},.1,Turning,true)if not Turning then(TweenService:Create(neck,TweenInfo.new(.1),{C0=OriginalC0*CFrame.Angles(Answer,0,NeckRotation)})):Play()end;(TweenService:Create(fakeneck,TweenInfo.new(.1),{C0=OriginalC0*CFrame.Angles(0,0,0)})):Play();(TweenService:Create(tiltweld,TweenInfo.new(.1),{C0=CFrame.new(0,0,0)*CFrame.Angles(0,0,0)})):Play()end if tick()-Cooldown>LastCheck then local s=l.UnitRay.Unit.Direction if math.abs(s.Y-LastUnit.Y)>=.01 then if s.Y>LastUnit.Y then AttackDirection="\085"else AttackDirection="\068"end else if CalcHorizontalAngle(LastUnit*Vector3.new(1,0,1),s*Vector3.new(1,0,1))>0 then AttackDirection="\082"else AttackDirection="\076"end end LastUnit=s end end)weld1C1=weld1.C1 weld2C1=weld2.C1 weld3C1=weld3.C1 tweldC1=tweld.C1 wait(.1)


function Animate(w1,w2,w3,tw,Time,Delay)

SetWelds()

weld1C1 = w1
weld2C1 = w2
weld3C1 = w3
tweldC1 = tw

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

SEs.FireClient:FireServer(k,"AnimateFE",{w1,w2,w3,tw},Time,Answer,0,NeckRotation,chr,Tool.Hig.Value)

if script:IsDescendantOf(chr) then
TweenService:Create(weld1,TweenInfo.new(Time),
	{C1=w1*CFrame.new(0,Tool.Hig.Value,0)}):Play()

TweenService:Create(weld2,TweenInfo.new(Time),
	{C1=w2*CFrame.new(0,Tool.Hig.Value,0)}):Play()

TweenService:Create(weld3,TweenInfo.new(Time),
	{C1=w3*CFrame.new(0,Tool.Hig.Value,0)}):Play()
			
TweenService:Create(tweld,TweenInfo.new(Time),
    {C1=tw*CFrame.new(0,Tool.Hig.Value,0)}):Play()
end

if Delay then Time = Time + Delay end
wait(Time) 
end

chr.Humanoid.Died:connect(function()
game.Workspace.CurrentCamera.FieldOfView = 70
end)

Mouse.Move:connect(function() -- Thanks to Ultimatedar for this logic, heavily edited by me.
    local Mouse = Player:GetMouse()
	local Direction = Mouse.Hit.p
	local B = head.Position.Y-Direction.Y
	local Dist = (head.Position-Direction).magnitude
	Answer = math.asin(B/Dist)
	Gyro.cframe = Mouse.Hit
	if Stance ~= "Nothing" then
	Answer = 0
	else if Stance == "Nothing" then
		if Answer > math.rad(20) then
			Answer = math.rad(20)
		elseif Answer < math.rad(-10) then
			Answer = math.rad(-10)
	    else if torso.Parent.Humanoid.Sit then
						Answer = 0
				end
	end
	end
	end
	
if (Stance == "Nothing") then

SEs.FireClient:FireServer(k,"Aglin",chr,Answer,{Answer,0,NeckRotation},0.1,Turning)

if not Turning then	
TweenService:Create(neck,TweenInfo.new(0.1),{C0=OriginalC0*CFrame.Angles(Answer,0,NeckRotation)}):Play()
end

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(Answer,0,0)}):Play()

if Gyro.Parent ~= tilt and Tool.Skrimish.Value then Gyro.Parent = tilt chr.Humanoid.AutoRotate = false 
elseif Gyro.Parent == tilt and not Tool.Skrimish.Value then Gyro.Parent = script chr.Humanoid.AutoRotate = true
 chr.Humanoid.AutoRotate = true
 end

else
	
if Gyro.Parent == tilt then Gyro.Parent = script chr.Humanoid.AutoRotate = true
 chr.Humanoid.AutoRotate = true
 end	

SEs.FireClient:FireServer(k,"Aglin",chr,Answer,{Answer,0,NeckRotation},0.1,Turning,true)
if not Turning then	
TweenService:Create(neck,TweenInfo.new(0.1),{C0=OriginalC0*CFrame.Angles(Answer,0,NeckRotation)}):Play()
end

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()
	
end
	if tick() - Cooldown > LastCheck then
		local NextUnit = Mouse.UnitRay.Unit.Direction
		if math.abs(NextUnit.Y - LastUnit.Y) >= 0.01 then
			if NextUnit.Y > LastUnit.Y then
				AttackDirection = "U"
			else
				AttackDirection = "D"
			end
		else
			if CalcHorizontalAngle(LastUnit*Vector3.new(1,0,1), NextUnit*Vector3.new(1,0,1)) > 0 then
				AttackDirection = "R"
			else
				AttackDirection = "L"
			end
		end
		LastUnit = NextUnit
	end	
end)

weld1C1 = weld1.C1
weld2C1 = weld2.C1
weld3C1 = weld3.C1
tweldC1 = tweld.C1

wait(0.1)
