Laith8888

Roblox Vanta NPC script

Feb 8th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 58.20 KB | None | 0 0
  1. if script.Parent~=game.Workspace then
  2. script.Parent=game.Workspace
  3. script.Disabled=false
  4. end
  5. --New boss for Black Magic
  6. it=Instance.new
  7. vt=Vector3.new
  8. cf=CFrame.new
  9. euler=CFrame.fromEulerAnglesXYZ
  10. angles=CFrame.Angles
  11. if workspace:findFirstChild("Vanta",true) ~= nil then
  12. workspace:findFirstChild("Vanta",true).Parent = nil
  13. end
  14. function NoOutline(Part)
  15. Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10
  16. end
  17. function swait(num)
  18. if num==0 or num==nil then
  19. game:service'RunService'.RenderStepped:wait()
  20. else
  21. for i=0,num do
  22. game:service'RunService'.RenderStepped:wait()
  23. end
  24. end
  25. end
  26. function part(formfactor,parent,reflectance,transparency,brickcolor,name,size)
  27. local fp=it("Part")
  28. fp.formFactor=formfactor
  29. fp.Parent=parent
  30. fp.Reflectance=reflectance
  31. fp.Transparency=transparency
  32. fp.CanCollide=false
  33. fp.Locked=true
  34. fp.BrickColor=brickcolor
  35. fp.Name=name
  36. fp.Size=size
  37. NoOutline(fp)
  38. fp.Material="SmoothPlastic"
  39. fp:BreakJoints()
  40. return fp
  41. end
  42. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  43. local mesh=it(Mesh)
  44. mesh.Parent=part
  45. if Mesh=="SpecialMesh" then
  46. mesh.MeshType=meshtype
  47. mesh.MeshId=meshid
  48. end
  49. mesh.Offset=offset
  50. mesh.Scale=scale
  51. return mesh
  52. end
  53. function weld(parent,part0,part1,c0)
  54. local weld=it("Weld")
  55. weld.Parent=parent
  56. weld.Part0=part0
  57. weld.Part1=part1
  58. weld.C0=c0
  59. return weld
  60. end
  61. local Character=Instance.new("Model")
  62. Character.Parent=workspace
  63. Character.Name="Vanta"
  64. local Head=part(0,Character,0,1,BrickColor.new("Black"),"Head",vt(2,1,1))
  65. local Torso=part(0,Character,0,1,BrickColor.new("Black"),"Torso",vt(2,2,1))
  66. local LeftArm=part(0,Character,0,1,BrickColor.new("Black"),"Left Arm",vt(1,2,1))
  67. local RightArm=part(0,Character,0,1,BrickColor.new("Black"),"Right Arm",vt(1,2,1))
  68. local LeftLeg=part(0,Character,0,1,BrickColor.new("Black"),"Left Leg",vt(1,2,1))
  69. local RightLeg=part(0,Character,0,1,BrickColor.new("Black"),"Right Leg",vt(1,2,1))
  70. local RootPart=part(0,Character,0,1,BrickColor.new("White"),"HumanoidRootPart",vt(2,2,1))
  71. Head.CanCollide=true
  72. Torso.CanCollide=true
  73. LeftArm.CanCollide=true
  74. RightArm.CanCollide=true
  75. LeftLeg.CanCollide=true
  76. RightLeg.CanCollide=true
  77. RootPart.CanCollide=false
  78. local HMesh=mesh("SpecialMesh",Head,"Head","",vt(0,0,0),vt(1.25,1.25,1.25))
  79. --[[local Neck=weld(Torso,Torso,Head,cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0))
  80. Neck.C1=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)]]
  81. local Neck=weld(Torso,Torso,Head,cf(0,1,0))
  82. Neck.C1=cf(0,-0.5,0)
  83. local RW=weld(Torso,Torso,RightArm,cf(1.5,0.5,0))
  84. RW.C1=cf(0,0.5,0)
  85. local LW=weld(Torso,Torso,LeftArm,cf(-1.5,0.5,0))
  86. LW.C1=cf(0,0.5,0)
  87. local RH=weld(Torso,Torso,RightLeg,cf(0.5,-1,0))
  88. RH.C1=cf(0,1,0)
  89. local LH=weld(Torso,Torso,LeftLeg,cf(-0.5,-1,0))
  90. LH.C1=cf(0,1,0)
  91. local RootJoint=weld(Torso,Torso,RootPart,cf(0,0,0))
  92. local Humanoid=Instance.new("Humanoid")
  93. Humanoid.Parent=Character
  94. Humanoid.MaxHealth=math.huge
  95. Humanoid.Health=math.huge
  96. coroutine.resume(coroutine.create(function()
  97. for i=1,20 do
  98. Humanoid.Health=Humanoid.MaxHealth
  99. end
  100. Humanoid:TakeDamage(1)
  101. end))
  102. local MainPosition=workspace.Baseplate.CFrame*cf(0,100,0)*euler(0,1.57,0)
  103. Torso.CFrame=MainPosition
  104. local Mode=Instance.new("IntValue")
  105. Mode.Parent=Character
  106. Mode.Value=2
  107. Mode.Name="ModeValue"
  108. so = function(id,par,vol,pit)
  109. coroutine.resume(coroutine.create(function()
  110. local sou = Instance.new("Sound",par or workspace)
  111. sou.Volume=vol
  112. sou.Pitch=pit or 1
  113. sou.SoundId=id
  114. wait()
  115. sou:play()
  116. game:GetService("Debris"):AddItem(sou,6)
  117. end))
  118. end
  119. function MagicBlock(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  120. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt())
  121. prt.Anchored=true
  122. prt.CFrame=cframe
  123. msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  124. game:GetService("Debris"):AddItem(prt,2)
  125. coroutine.resume(coroutine.create(function(Part,Mesh)
  126. for i=0,1,delay do
  127. wait()
  128. Part.CFrame=Part.CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  129. Part.Transparency=i
  130. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  131. end
  132. Part.Parent=nil
  133. end),prt,msh)
  134. end
  135. function MagicBlock2(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  136. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt())
  137. prt.Anchored=true
  138. prt.CFrame=cframe
  139. msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  140. game:GetService("Debris"):AddItem(prt,2)
  141. coroutine.resume(coroutine.create(function(Part,Mesh)
  142. for i=0,1,delay do
  143. wait()
  144. Part.Transparency=i
  145. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  146. end
  147. Part.Parent=nil
  148. end),prt,msh)
  149. end
  150. function MagicCircle(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  151. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt())
  152. prt.Anchored=true
  153. prt.CFrame=cframe
  154. local msh=mesh("SpecialMesh",prt,"Sphere","",vt(0,0,0),vt(x1,y1,z1))
  155. game:GetService("Debris"):AddItem(prt,2)
  156. coroutine.resume(coroutine.create(function(Part,Mesh)
  157. local wld=nil
  158. for i=0,1,delay do
  159. wait()
  160. Part.CFrame=Part.CFrame
  161. Part.Transparency=i
  162. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  163. end
  164. Part.Parent=nil
  165. end),prt,msh)
  166. end
  167. function MagicCircle2(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  168. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  169. prt.Anchored=true
  170. prt.CFrame=cframe
  171. local msh=mesh("CylinderMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  172. game:GetService("Debris"):AddItem(prt,5)
  173. coroutine.resume(coroutine.create(function(Part,Mesh)
  174. for i=0,1,delay do
  175. wait()
  176. Part.CFrame=Part.CFrame
  177. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  178. local prt2=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  179. prt2.Anchored=true
  180. prt2.CFrame=cframe*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  181. local msh2=mesh("SpecialMesh",prt2,"Sphere","",vt(0,0,0),vt(0.5,0.5,0.5))
  182. game:GetService("Debris"):AddItem(prt2,2)
  183. coroutine.resume(coroutine.create(function(Part,Mesh)
  184. for i=0,1,0.05 do
  185. wait()
  186. Part.CFrame=Part.CFrame*cf(0,0.5,0)
  187. end
  188. Part.Parent=nil
  189. end),prt2,msh2)
  190. end
  191. for i=0,1,delay do
  192. wait()
  193. Part.CFrame=Part.CFrame
  194. Part.Transparency=i
  195. Mesh.Scale=Mesh.Scale-vt(x3,y3,z3)
  196. end
  197. Part.Parent=nil
  198. end),prt,msh)
  199. end
  200. function MagicCrystal(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  201. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt())
  202. prt.Anchored=true
  203. prt.CFrame=cframe
  204. local msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=9756362",vt(0,0,0),vt(x1,y1,z1))
  205. game:GetService("Debris"):AddItem(prt,4)
  206. coroutine.resume(coroutine.create(function(Part,Mesh)
  207. local wld=nil
  208. for i=0,1,delay do
  209. wait()
  210. Part.CFrame=Part.CFrame
  211. Part.Transparency=i
  212. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  213. end
  214. Part.Parent=nil
  215. end),prt,msh)
  216. end
  217. function MagicCylinder(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  218. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.2,0.2,0.2))
  219. prt.Anchored=true
  220. prt.CFrame=cframe
  221. msh=mesh("SpecialMesh",prt,"Head","",vt(0,0,0),vt(x1,y1,z1))
  222. game:GetService("Debris"):AddItem(prt,5)
  223. coroutine.resume(coroutine.create(function(Part,Mesh)
  224. for i=0,1,delay do
  225. wait()
  226. Part.CFrame=Part.CFrame
  227. Part.Transparency=i
  228. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  229. end
  230. Part.Parent=nil
  231. end),prt,msh)
  232. end
  233. function MagicRing(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  234. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  235. prt.Anchored=true
  236. prt.CFrame=cframe
  237. msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=3270017",vt(0,0,0),vt(x1,y1,z1))
  238. game:GetService("Debris"):AddItem(prt,5)
  239. coroutine.resume(coroutine.create(function(Part,Mesh)
  240. for i=0,1,delay do
  241. wait()
  242. Part.CFrame=Part.CFrame
  243. Part.Transparency=i
  244. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  245. end
  246. Part.Parent=nil
  247. end),prt,msh)
  248. end
  249. function MagicWaveThing(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  250. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  251. prt.Anchored=true
  252. prt.CFrame=cframe
  253. msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=1051557",vt(0,0,0),vt(x1,y1,z1))
  254. game:GetService("Debris"):AddItem(prt,5)
  255. coroutine.resume(coroutine.create(function(Part,Mesh)
  256. for i=0,1,delay do
  257. wait()
  258. Part.CFrame=Part.CFrame*euler(0,0.7,0)
  259. Part.Transparency=i
  260. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  261. end
  262. Part.Parent=nil
  263. end),prt,msh)
  264. end
  265. function WaveEffect2(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  266. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  267. prt.Anchored=true
  268. prt.CFrame=cframe
  269. msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=1323306",vt(0,0,0),vt(x1,y1,z1))
  270. game:GetService("Debris"):AddItem(prt,2)
  271. coroutine.resume(coroutine.create(function(Part,Mesh)
  272. for i=0,1,delay do
  273. wait()
  274. Part.CFrame=Part.CFrame
  275. Part.Transparency=i
  276. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  277. end
  278. Part.Parent=nil
  279. end),prt,msh)
  280. end
  281. function SummonCrystals()
  282. local Cryst={}
  283. Part1=workspace.Baseplate
  284. local numbah=0
  285. for i=1,4 do
  286. Crys=Instance.new("Model")
  287. Crys.Parent=workspace
  288. Crys.Name="Crystal"
  289. CHead=part(0,Crys,0,0,BrickColor.new("Black"),"Head",vt(8,8,8))
  290. CTorso=part(0,Crys,0,1,BrickColor.new("Black"),"Torso",vt())
  291. CHMesh=mesh("SpecialMesh",CHead,"FileMesh","http://www.roblox.com/asset/?id=9756362",vt(0,0,0),vt(10,11,10))
  292. local Neck=weld(CTorso,CTorso,CHead,cf(0,0,0))
  293. Hum=Instance.new("Humanoid")
  294. Hum.Parent=Crys
  295. CTorso.CFrame=Part1.CFrame*cf(5,10,0)*euler(0,numbah,0)
  296. MagicCircle(BrickColor.new("Really black"),CHead.CFrame,50,50,50,1,12,1,0.05)
  297. wait(0)
  298. CTorso.Anchored=true
  299. coroutine.resume(coroutine.create(function(Model,CrysHum)
  300. while CrysHum.Health>0 do
  301. wait()
  302. end
  303. print("ded")
  304. Tors=Model.Torso
  305. Hed=Model.Head
  306. for i=0,1,0.1 do
  307. wait()
  308. Hed.Transparency=i
  309. end
  310. print("ez ded")
  311. Model.Parent=nil
  312. end),Crys,Hum)
  313. numbah=numbah+1.57
  314. wait(0.875)
  315. end
  316. coroutine.resume(coroutine.create(function(ModeVal)
  317. while ModeVal.Value==2 do
  318. wait()
  319. local dedcrystals=true
  320. model=workspace
  321. for _,c in pairs(model:children()) do
  322. if c.Name=="Crystal" then
  323. dedcrystals=false
  324. end
  325. end
  326. if dedcrystals==true then
  327. ModeVal.Value=3
  328. print("CRYSTALS ARE DED")
  329. end
  330. end
  331. print("goe keel vanta nao")
  332. end),Mode)
  333. end
  334. local BodPos=Instance.new("BodyPosition")
  335. BodPos.P=500
  336. BodPos.D=100
  337. BodPos.Name="VantaPos"
  338. BodPos.maxForce=vt(math.huge,math.huge,math.huge)
  339. BodPos.position=workspace.Baseplate.Position+vt(0,50,0)
  340. BodPos.Parent=RootPart
  341. local BPRef=part(3,Character,0,0.5,BrickColor.new("Black"),"Reference",vt())
  342. BPRef.Anchored=true
  343. for i=0,1,0.1 do
  344. wait()
  345. end
  346. BPRef.CFrame=Torso.CFrame
  347. BodPos.position=BPRef.Position
  348. local BodGy=Instance.new("BodyGyro")
  349. BodGy.maxTorque=Vector3.new(4e+005,4e+005,4e+005)*math.huge
  350. BodGy.P=2000
  351. BodGy.D=100
  352. BodGy.Name="VantaGyro"
  353. CF=RootPart.CFrame
  354. BodGy.Parent=RootPart
  355. BodGy.cframe=CF
  356. --local music=workspace.PlayMusic
  357. local intro=true
  358. local DarkLegEffect=true
  359. wait(1)
  360. if intro==true then
  361. wait(5)
  362. --music.Value=true
  363. coroutine.resume(coroutine.create(function(Leg1,Leg2)
  364. while DarkLegEffect==true do
  365. wait(0.1)
  366. MagicBlock(BrickColor.new("Really black"),Leg1.CFrame*cf(0,-1,0),5,5,5,0.5,0.5,0.5,0.1)
  367. MagicBlock(BrickColor.new("Really black"),Leg2.CFrame*cf(0,-1,0),5,5,5,0.5,0.5,0.5,0.1)
  368. end
  369. end),RightLeg,LeftLeg)
  370. MagicCircle2(BrickColor.new("Black"),Torso.CFrame*euler(1.57,0,0),10,0.1,10,0.1,0,0.1,0.02)
  371. for _,c in pairs(Character:children()) do
  372. if c.className=="Part" and c.Name~="HumanoidRootPart" and c.Name~="Reference" then
  373. c.Transparency=1
  374. coroutine.resume(coroutine.create(function(Part)
  375. for i=1,0,-0.05 do
  376. wait()
  377. Part.Transparency=i
  378. end
  379. Part.Transparency=0
  380. end),c)
  381. end
  382. end
  383. for i=0,1,0.01 do
  384. wait()
  385. RootJoint.C0=cf(0,0,0)*euler(1-0.8*i,0,0)
  386. RW.C0=cf(1.5,0.5,0)*euler(-0.5+0.2*i,0,1.57-1.37*i)
  387. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  388. LW.C0=cf(-1.5,0.5,0)*euler(-0.5+0.2*i,0,-1.57+1.37*i)
  389. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  390. RH.C0=cf(0.5,-1,0)*euler(-1+0.7*i,0,0.2)
  391. RH.C1=cf(0,1,0)
  392. LH.C0=cf(-0.5,-1,0)*euler(-1+0.7*i,0,-0.2)
  393. LH.C1=cf(0,1,0)
  394. BPRef.CFrame=BPRef.CFrame*cf(0,0,-0.1)
  395. BodPos.position=BPRef.Position
  396. end
  397. --wait(0.5)
  398. for i=0,1,0.02 do
  399. wait()
  400. Neck.C0=cf(0,1,0)*euler(0.2*i,0,0)
  401. RW.C0=cf(1.5,0.5,0)*euler(-0.3+1.5*i,0,0.2+0.2*i)
  402. LW.C0=cf(-1.5,0.5,0)*euler(-0.3+1.5*i,0,-0.2-0.2*i)
  403. end
  404. for i=0,1,0.1 do
  405. wait()
  406. RW.C0=cf(1.5-0.3*i,0.5,-0.5*i)*euler(1.2+0.37*i,0,0.4-1.57*i)
  407. LW.C0=cf(-1.5+0.3*i,0.5,-0.5*i)*euler(1.2+0.37*i,0,-0.4+1.57*i)
  408. end
  409. MagicCircle(BrickColor.new("Really black"),RootPart.CFrame,4,4,4,3,3,3,0.04)
  410. Crystals={}
  411. numb=0
  412. for i=1,4 do
  413. local Cryst1=part(3,Character,0,0,BrickColor.new("Black"),"Crystal",vt())
  414. local CrystMsh=mesh("SpecialMesh",Cryst1,"FileMesh","http://www.roblox.com/asset/?id=9756362",vt(0,0,0),vt(1.5,2,1.5))
  415. Cryst1.Anchored=true
  416. Cryst1.CFrame=RootPart.CFrame*euler(0,numb,0)*cf(0,0,5)
  417. MagicCrystal(BrickColor.new("Really black"),Cryst1.CFrame,1,1,1,0.2,0.4,0.2,0.1)
  418. numb=numb+1.57
  419. table.insert(Crystals,Cryst1)
  420. end
  421. wait(0.5)
  422. for i=0,1,0.05 do
  423. wait()
  424. Neck.C0=cf(0,1,0)*euler(0.2-0.2*i,0,0)
  425. RW.C0=cf(1.2+0.3*i,0.5,-0.5+0.5*i)*euler(1.57-1.57*i,0,-1.17+1.27*i)
  426. LW.C0=cf(-1.2-0.3*i,0.5,-0.5+0.5*i)*euler(1.57-1.67*i,0,1.17-1.27*i)
  427. end
  428. for i=0,1,0.1 do
  429. wait()
  430. RW.C0=cf(1.5,0.5,0)*euler(3.2*i,0,0.1-0.1*i)
  431. LW.C0=cf(-1.5,0.5,0)*euler(-0.1+0.1*i,0,-0.1-0.3*i)
  432. end
  433. wait(0.5)
  434. for i=1,#Crystals do
  435. Crystals[i].Parent=nil
  436. MagicCircle(BrickColor.new("Really black"),Crystals[i].CFrame,10,10,10,0.5,8,0.5,0.1)
  437. wait(0.2)
  438. end
  439. for i=0,1,0.04 do
  440. wait()
  441. RW.C0=cf(1.5,0.5,0)*euler(3.2-3.2*i,0,0.1)
  442. LW.C0=cf(-1.5,0.5,0)*euler(0,0,-0.1-0.3+0.3*i)
  443. end
  444. wait(0.5)
  445. for i=0,1,0.05 do
  446. wait()
  447. RW.C0=cf(1.5,0.5,0)*euler(0,0,0.1+1.37*i)
  448. LW.C0=cf(-1.5,0.5,0)*euler(0,0,-0.1-1.37*i)
  449. end
  450. numb=2
  451. for i=0,1,0.1 do
  452. wait()
  453. RW.C0=cf(1.5,0.5,0)*euler(0,0,1.47+0.1*i*numb)
  454. LW.C0=cf(-1.5,0.5,0)*euler(0,0,-1.47-0.1*i*numb)
  455. numb=numb-0.1
  456. end
  457. RW.C0=cf(1.5,0.5,0)*euler(0,0,1.57)
  458. LW.C0=cf(-1.5,0.5,0)*euler(0,0,-1.57)
  459. SummonCrystals()
  460. --wait(3.5)
  461. for i=0,1,0.1 do
  462. wait()
  463. RW.C0=cf(1.5,0.5,0)*euler(0.1*i,0,1.57-1.47*i)
  464. LW.C0=cf(-1.5,0.5,0)*euler(0.1*i,0,-1.57+1.47*i)
  465. end
  466. for i=0,1,0.1 do
  467. wait()
  468. RootJoint.C0=cf(0,0,0)*euler(0.2-0.1*i,0,0)
  469. RW.C0=cf(1.5-0.5*i,0.5,-0.5*i)*euler(0.1+1.37*i,0,0.1-1.37*i)
  470. LW.C0=cf(-1.5+0.5*i,0.5,-0.5*i)*euler(0.1+1.07*i,0,-0.1+1.17*i)
  471. end
  472. n=2
  473. for i=0,1,0.1 do
  474. wait()
  475. Neck.C0=cf(0,1,0)*euler(-0.2*i*n,0,0)
  476. RootJoint.C0=cf(0,0,0)*euler(0.1-0.1*i*n,0,0)
  477. RW.C0=cf(1,0.5,-0.5)*euler(1.47+0.1*i*n,0,-1.27-0.1*i*n)
  478. LW.C0=cf(-1,0.5,-0.5)*euler(1.17+0.1*i*n,0,1.07+0.1*i*n)
  479. n=n-0.1
  480. end
  481. --[[local Shield1=part(3,Character,0,1,BrickColor.new("Dark stone grey"),"Shield1",vt())
  482. local Smsh1=mesh("SpecialMesh",Shield1,"FileMesh","http://www.roblox.com/asset/?id=90782182",vt(0,0,0),vt(0.4,0.5,0.4))
  483. Smsh1.TextureId="http://www.roblox.com/asset/?id=90782359"
  484. Smsh1.VertexColor=vt(0.5,0.5,0.5)
  485. local swld1=weld(Torso,Torso,Shield1,cf(0,1.45,0))
  486. local Shield2=part(3,Character,0,1,BrickColor.new("Dark stone grey"),"Shield2",vt())
  487. local Smsh2=mesh("SpecialMesh",Shield2,"FileMesh","http://www.roblox.com/asset/?id=90782182",vt(0,0,0),vt(0.4,0.5,0.4))
  488. Smsh2.TextureId="http://www.roblox.com/asset/?id=90782359"
  489. Smsh2.VertexColor=vt(0.5,0.5,0.5)
  490. local swld1=weld(Torso,Torso,Shield2,cf(0,-1.45,0)*euler(3.14,0,0))
  491. coroutine.resume(coroutine.create(function(Part1,Mesh1,Part2,Mesh2)
  492. for i=1,0.5,-0.02 do
  493. wait()
  494. Part1.Transparency=i
  495. Part2.Transparency=i
  496. end
  497. wait(1)
  498. for i=0.5,1,0.01 do
  499. wait()
  500. Part1.Transparency=i
  501. Part2.Transparency=i
  502. end
  503. end),Shield1,Smsh1,Shield2,Smsh2)]]
  504. wait(1)
  505. n=2
  506. num=1
  507. for i=0,1,0.02 do
  508. wait()
  509. RW.C0=cf(1+0.5*i*n,0.5,-0.5+0.5*i*n)*euler(1.57-1.57*i*n,0,-1.37+1.57*i*n)
  510. LW.C0=cf(-1-0.5*i*n,0.5,-0.5+0.5*i*n)*euler(1.27-1.27*i*n,0,1.17-1.37*i*n)
  511. n=n-0.02
  512. end
  513. wait(5)
  514. else
  515. print("NOE INTRO")
  516. --music.Value=true
  517. coroutine.resume(coroutine.create(function(Leg1,Leg2)
  518. while DarkLegEffect==true do
  519. wait(0.1)
  520. MagicBlock(BrickColor.new("Really black"),Leg1.CFrame*cf(0,-1,0),5,5,5,0.5,0.5,0.5,0.1)
  521. MagicBlock(BrickColor.new("Really black"),Leg2.CFrame*cf(0,-1,0),5,5,5,0.5,0.5,0.5,0.1)
  522. end
  523. end),RightLeg,LeftLeg)
  524. for _,c in pairs(Character:children()) do
  525. if c.className=="Part" and c.Name~="HumanoidRootPart" and c.Name~="Reference" then
  526. c.Transparency=0
  527. end
  528. end
  529. Neck.C0=cf(0,1,0)*euler(-0.2,0,0)
  530. RootJoint.C0=cf(0,0,0)*euler(0,0,0)
  531. RW.C0=cf(1.5,0.5,0)*euler(0,0,0.2)
  532. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  533. LW.C0=cf(-1.5,0.5,0)*euler(0,0,-0.2)
  534. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  535. RH.C0=cf(0.5,-1,0)*euler(-0.3,0,0.2)
  536. RH.C1=cf(0,1,0)
  537. LH.C0=cf(-0.5,-1,0)*euler(-0.3,0,-0.2)
  538. LH.C1=cf(0,1,0)
  539. wait(1)
  540. end
  541. print("START BOSS BATTLE")
  542. function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  543. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  544. end
  545. function findNearestTorso(pos)
  546. local list = game.Workspace:children()
  547. local torso = nil
  548. local dist = 1000
  549. local temp = nil
  550. local human = nil
  551. local temp2 = nil
  552. for x = 1, #list do
  553. temp2 = list[x]
  554. if (temp2.className == "Model") and (temp2.Name~="Vanta") and temp2.Name~="Crystal" then
  555. temp = temp2:findFirstChild("Torso")
  556. human = temp2:findFirstChild("Humanoid")
  557. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  558. if (temp.Position - pos).magnitude < dist then
  559. torso = temp
  560. dist = (temp.Position - pos).magnitude
  561. end
  562. end
  563. end
  564. end
  565. return torso,dist
  566. end
  567. function findRandomTorso(pos)
  568. local list = game.Workspace:children()
  569. local torso = nil
  570. local dist = 1000
  571. local temp = nil
  572. local human = nil
  573. local temp2 = nil
  574. local list2 = {}
  575. for x = 1, #list do
  576. temp2 = list[x]
  577. if (temp2.className == "Model") and (temp2.Name~="Vanta") and temp2.Name~="Crystal" then
  578. temp = temp2:findFirstChild("Torso")
  579. human = temp2:findFirstChild("Humanoid")
  580. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  581. if pos.magnitude < dist then
  582. torso = temp
  583. table.insert(list2,temp)
  584. end
  585. end
  586. end
  587. end
  588. if #list2>0 then
  589. rand=math.random(1,#list2)
  590. return list2[rand],dist
  591. else
  592. return nil,dist
  593. end
  594. end
  595. Damagefunc=function(hit,minim,maxim,knockback,Type,Property,Delay)
  596. if hit.Parent==nil then
  597. return
  598. end
  599. CPlayer=Bin
  600. h=hit.Parent:FindFirstChild("Humanoid")
  601. for _,v in pairs(hit.Parent:children()) do
  602. if v:IsA("Humanoid") then
  603. h=v
  604. end
  605. end
  606. if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent.Name~="Crystal" and hit.Parent:FindFirstChild("Torso")~=nil then
  607. if hit.Parent:findFirstChild("DebounceHit")~=nil then if hit.Parent.DebounceHit.Value==true then return end end
  608. --[[ if game.Players:GetPlayerFromCharacter(hit.Parent)~=nil then
  609. return
  610. end]]
  611. -- hs(hit,1.2)
  612. c=Instance.new("ObjectValue")
  613. c.Name="creator"
  614. c.Value=game:service("Players").LocalPlayer
  615. c.Parent=h
  616. game:GetService("Debris"):AddItem(c,.5)
  617. Damage=math.random(minim,maxim)
  618. -- h:TakeDamage(Damage)
  619. blocked=false
  620. block=hit.Parent:findFirstChild("Block")
  621. if block~=nil then
  622. if block.className=="IntValue" then
  623. if block.Value>0 then
  624. blocked=true
  625. block.Value=block.Value-1
  626. end
  627. end
  628. end
  629. if blocked==false then
  630. -- h:TakeDamage(Damage)
  631. h.Health=h.Health-Damage
  632. showDamage(hit.Parent,Damage,.5,BrickColor:Red())
  633. else
  634. h.Health=h.Health-(Damage/2)
  635. showDamage(hit.Parent,Damage/2,.5,BrickColor.new("Bright blue"))
  636. end
  637. if Type=="Knockdown" then
  638. hum=hit.Parent.Humanoid
  639. hum.PlatformStand=true
  640. coroutine.resume(coroutine.create(function(HHumanoid)
  641. wait(1)
  642. HHumanoid.PlatformStand=false
  643. end),hum)
  644. local angle=(hit.Position-(Property.Position+Vector3.new(0,0,0))).unit
  645. --hit.CFrame=CFrame.new(hit.Position,Vector3.new(angle.x,hit.Position.y,angle.z))*CFrame.fromEulerAnglesXYZ(math.pi/4,0,0)
  646. local bodvol=Instance.new("BodyVelocity")
  647. bodvol.velocity=angle*knockback
  648. bodvol.P=5000
  649. bodvol.maxForce=Vector3.new(8e+003, 8e+003, 8e+003)
  650. bodvol.Parent=hit
  651. rl=Instance.new("BodyAngularVelocity")
  652. rl.P=3000
  653. rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000
  654. rl.angularvelocity=Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  655. rl.Parent=hit
  656. game:GetService("Debris"):AddItem(bodvol,.5)
  657. game:GetService("Debris"):AddItem(rl,.5)
  658. elseif Type=="Normal" then
  659. vp=Instance.new("BodyVelocity")
  660. vp.P=500
  661. vp.maxForce=Vector3.new(math.huge,0,math.huge)
  662. -- vp.velocity=Character.Torso.CFrame.lookVector*Knockback
  663. vp.velocity=Property.CFrame.lookVector*knockback+Property.Velocity/1.05
  664. if knockback>0 then
  665. vp.Parent=hit.Parent.Torso
  666. end
  667. game:GetService("Debris"):AddItem(vp,.5)
  668. elseif Type=="Up" then
  669. local bodyVelocity=Instance.new("BodyVelocity")
  670. bodyVelocity.velocity=vt(0,20,0)
  671. bodyVelocity.P=5000
  672. bodyVelocity.maxForce=Vector3.new(8e+003, 8e+003, 8e+003)
  673. bodyVelocity.Parent=hit
  674. game:GetService("Debris"):AddItem(bodyVelocity,.5)
  675. elseif Type=="Snare" then
  676. bp=Instance.new("BodyPosition")
  677. bp.P=2000
  678. bp.D=100
  679. bp.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  680. bp.position=hit.Parent.Torso.Position
  681. bp.Parent=hit.Parent.Torso
  682. game:GetService("Debris"):AddItem(bp,1)
  683. elseif Type=="Freeze" then
  684. BodPos2=Instance.new("BodyPosition")
  685. BodPos2.P=50000
  686. BodPos2.D=1000
  687. BodPos2.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  688. BodPos2.position=hit.Parent.Torso.Position
  689. BodPos2.Parent=hit.Parent.Torso
  690. BodGy2 = it("BodyGyro")
  691. BodGy2.maxTorque = Vector3.new(4e+005,4e+005,4e+005)*math.huge
  692. BodGy2.P = 20e+003
  693. BodGy2.Parent=hit.Parent.Torso
  694. BodGy2.cframe = hit.Parent.Torso.CFrame
  695. hit.Parent.Torso.Anchored=true
  696. coroutine.resume(coroutine.create(function(Part)
  697. wait(1.5)
  698. Part.Anchored=false
  699. end),hit.Parent.Torso)
  700. game:GetService("Debris"):AddItem(BodPos2,3)
  701. game:GetService("Debris"):AddItem(BodGy2,3)
  702. end
  703. debounce=Instance.new("BoolValue")
  704. debounce.Name="DebounceHit"
  705. debounce.Parent=hit.Parent
  706. debounce.Value=true
  707. game:GetService("Debris"):AddItem(debounce,Delay)
  708. c=Instance.new("ObjectValue")
  709. c.Name="creator"
  710. c.Value=Player
  711. c.Parent=h
  712. game:GetService("Debris"):AddItem(c,.5)
  713. CRIT=false
  714. hitDeb=true
  715. AttackPos=6
  716. end
  717. end
  718. showDamage=function(Char,Dealt,du,Color)
  719. m=Instance.new("Model")
  720. m.Name=tostring(Dealt)
  721. h=Instance.new("Humanoid")
  722. h.Health=0
  723. h.MaxHealth=0
  724. h.Parent=m
  725. c=Instance.new("Part")
  726. c.Transparency=0
  727. c.BrickColor=Color
  728. c.Name="Head"
  729. c.TopSurface=0
  730. c.BottomSurface=0
  731. c.formFactor="Plate"
  732. c.Size=Vector3.new(1,.4,1)
  733. ms=Instance.new("CylinderMesh")
  734. ms.Scale=Vector3.new(.8,.8,.8)
  735. if CRIT==true then
  736. ms.Scale=Vector3.new(1,1.25,1)
  737. end
  738. ms.Parent=c
  739. c.Reflectance=0
  740. Instance.new("BodyGyro").Parent=c
  741. c.Parent=m
  742. if Char:findFirstChild("Head")~=nil then
  743. c.CFrame=CFrame.new(Char["Head"].CFrame.p+Vector3.new(0,1.5,0))
  744. else
  745. c.CFrame=CFrame.new(Char["Torso"].CFrame.p+Vector3.new(0,1.5,0))
  746. end
  747. f=Instance.new("BodyPosition")
  748. f.P=2000
  749. f.D=100
  750. f.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  751. f.position=c.Position+Vector3.new(0,3,0)
  752. f.Parent=c
  753. game:GetService("Debris"):AddItem(m,.5+du)
  754. c.CanCollide=false
  755. m.Parent=workspace
  756. c.CanCollide=false
  757. end
  758. function MagniDamage(Part,magni,mindam,maxdam,knock,Type,Baseplate)
  759. for _,c in pairs(workspace:children()) do
  760. local hum=c:findFirstChild("Humanoid")
  761. if hum~=nil then
  762. local head=c:findFirstChild("Torso")
  763. if head~=nil then
  764. local targ=head.Position-Part.Position
  765. local mag=targ.magnitude
  766. if mag<=magni and c.Name~=Character.Name then
  767. Damagefunc(head,mindam,maxdam,knock,Type,Baseplate,0)
  768. end
  769. end
  770. end
  771. end
  772. end
  773. local HealtVal=Instance.new("IntValue")
  774. HealtVal.Name="Max Health Value"
  775. HealtVal.Parent=Character
  776. HealtVal.Value=5000
  777. local HealtVal2=Instance.new("IntValue")
  778. HealtVal2.Name="Current Health Value"
  779. HealtVal2.Parent=Character
  780. HealtVal2.Value=5000
  781. local HealthNum=Instance.new("IntValue")
  782. HealthNum.Name="Divis Numb"
  783. HealthNum.Parent=Character
  784. HealthNum.Value=HealtVal2.Value/3
  785. local HealthNumber=1666
  786. Anim=Instance.new("StringValue")
  787. Anim.Name="Animation"
  788. Anim.Parent=Character
  789. Anim.Value="Walking"
  790. mode=Mode
  791. local target,distance=nil,nil
  792. local attacking=false
  793. while Humanoid.Health>0 do
  794. wait()
  795. while mode.Value==2 do
  796. Humanoid.PlatformStand=false
  797. Humanoid.Sit=false
  798. if Torso.Parent==nil or Humanoid.Health<=0 then
  799. Humanoid.Parent=nil
  800. RootPart.Parent=Character
  801. BPRef.CFrame=workspace.Baseplate.CFrame*cf(0,100,0)*euler(0,1.57,0)
  802. BodPos.position=BPRef.Position
  803. BodPos.Parent=RootPart
  804. RootPart.CFrame=BPRef.CFrame
  805. BodPos.position=BPRef.Position
  806. Torso.Parent=Character
  807. Head.Parent=Character
  808. LeftArm.Parent=Character
  809. RightArm.Parent=Character
  810. LeftLeg.Parent=Character
  811. RightLeg.Parent=Character
  812. Neck.Parent=Torso
  813. RootJoint.Parent=Torso
  814. RW.Parent=Torso
  815. LW.Parent=Torso
  816. RH.Parent=Torso
  817. LH.Parent=Torso
  818. wait(.1)
  819. Humanoid.MaxHealth=math.huge
  820. Humanoid.Health=math.huge
  821. coroutine.resume(coroutine.create(function()
  822. for i=1,20 do
  823. Humanoid.Health=math.huge
  824. Neck.Parent=Torso
  825. RootJoint.Parent=Torso
  826. RW.Parent=Torso
  827. LW.Parent=Torso
  828. RH.Parent=Torso
  829. LH.Parent=Torso
  830. end
  831. Humanoid:TakeDamage(1)
  832. end))
  833. end
  834. RH.C0=cf(0.5,-1,0)*euler(-0.3,0,0.2)
  835. RH.C1=cf(0,1,0)
  836. LH.C0=cf(-0.5,-1,0)*euler(-0.3,0,-0.2)
  837. LH.C1=cf(0,1,0)
  838. BodPos.maxForce=vt(math.huge,math.huge,math.huge)
  839. local move=1
  840. if math.random(1,2)==1 then
  841. move=1
  842. target,distance=findRandomTorso(Torso.Position)
  843. else
  844. move=2
  845. target,distance=findNearestTorso(Torso.Position)
  846. end
  847. if target~=nil then
  848. if math.random(1,5)==1 then
  849. MagicBlock(BrickColor.new("Really black"),Torso.CFrame,15,15,15,6,6,6,0.1)
  850. local pos=cf(math.random(-10,10),math.random(50,70),math.random(-10,10))
  851. BPRef.CFrame=cf(target.Position)*pos
  852. Torso.CFrame=BPRef.CFrame
  853. BodPos.position=BPRef.Position
  854. MagicBlock(BrickColor.new("Really black"),Torso.CFrame,15,15,15,6,6,6,0.1)
  855. end
  856. BodGy.cframe=CF*euler(0,math.random(-50,50),0)
  857. local pos=cf(math.random(-10,10),math.random(50,70),math.random(-10,10))
  858. --BPRef.CFrame=cf(target.Position)*pos
  859. --BodPos.position=BPRef.Position
  860. attack=math.random(1,3)
  861. attacking=true
  862. if attack==1 then --Dark Rain
  863. coroutine.resume(coroutine.create(function()
  864. while attacking==true do
  865. wait()
  866. BPRef.CFrame=cf(target.Position)*pos
  867. BodPos.position=BPRef.Position
  868. end
  869. end))
  870. n=2
  871. for i=0,1,0.1 do
  872. wait()
  873. Neck.C0=cf(0,1,0)*euler(-0.2+0.6*i*n,0,0)
  874. RW.C0=cf(1.5,0.5,0)*euler(3.14*i*n,0,0.2-0.2*i*n)
  875. LW.C0=cf(-1.5,0.5,0)*euler(0,0,-0.2-0.2*i*n)
  876. n=n-0.1
  877. end
  878. for i=1,math.random(10,20) do
  879. local orb=part(3,Character,0,1,BrickColor.new("Really black"),"Orb",vt())
  880. so("http://roblox.com/asset/?id=183763498",orb,1,1.2)
  881. local omsh=mesh("SpecialMesh",orb,"Sphere","",vt(0,0,0),vt(10,10,10))
  882. local owld=weld(orb,orb,Torso,cf(0,-5,0))
  883. MagicCircle(BrickColor.new("Really black"),orb.CFrame,10,10,10,1,1,1,0.1)
  884. coroutine.resume(coroutine.create(function(Part,Mesh,Weld)
  885. local ceef1=math.random(-50,50)
  886. local ceef2=math.random(-2,8)
  887. local ceef3=math.random(100,200)/100
  888. local n=2
  889. for i=0,1,0.1 do
  890. wait()
  891. Part.Transparency=Part.Transparency-0.07
  892. owld.C0=cf(ceef2*i*n,-5,0)*euler(ceef3*i*n,ceef1,0)
  893. n=n-0.1
  894. end
  895. wait(1)
  896. Part.Parent=nil
  897. local spread=vt((math.random(-1,0)+math.random())*16,(math.random(-1,0)+math.random())*16,(math.random(-1,0)+math.random())*16)*(Part.Position-(Part.Position+vt(0,-1,0))).magnitude/100
  898. local TheHit=Part.Position+vt(0,-1,0)
  899. local MouseLook=cf((Part.Position+TheHit)/2,TheHit+spread)
  900. local hit,pos = rayCast(Part.Position,MouseLook.lookVector,999,Character)
  901. local mag=(Part.Position-pos).magnitude
  902. MagicCylinder(BrickColor.new("Really black"),CFrame.new((Part.Position+pos)/2,pos)*angles(1.57,0,0) ,1,mag*5,1,0.5,0,0.5,0.05)
  903. MagicBlock(BrickColor.new("Really black"),Part.CFrame,8,8,8,0.5,0.5,0.5,0.1)
  904. MagicBlock(BrickColor.new("Really black"),cf(pos),15,15,15,6,6,6,0.1)
  905. MagicRing(BrickColor.new("Really black"),cf(pos)*euler(1.57,math.random(-100,100)/100,math.random(-100,100)/100),1,1,1,2,2,2,0.05)
  906. local ref=part(3,workspace,0,1,BrickColor.new("Really black"),"Effect",vt())
  907. ref.CFrame=cf(pos)
  908. so("http://roblox.com/asset/?id=183763487",ref,1,1)
  909. coroutine.resume(coroutine.create(function(Part)
  910. wait(1)
  911. Part.Parent=nil
  912. end),ref)
  913. MagniDamage(ref,15,5,10,0,"Normal",RootPart)
  914. if hit~=nil then
  915. Damagefunc(hit,20,40,1,"Knockdown",RootPart,0)
  916. end
  917. end),orb,omsh,owld)
  918. wait(0.2)
  919. end
  920. n=2
  921. for i=0,1,0.1 do
  922. wait()
  923. Neck.C0=cf(0,1,0)*euler(0.4-0.6*i*n,0,0)
  924. RW.C0=cf(1.5,0.5,0)*euler(3.14-3.14*i*n,0,0.2*i*n)
  925. LW.C0=cf(-1.5,0.5,0)*euler(0,0,-0.4+0.2*i*n)
  926. n=n-0.1
  927. end
  928. attacking=false
  929. wait(2)
  930. elseif attack==2 then --Nocturne
  931. coroutine.resume(coroutine.create(function()
  932. while attacking==true do
  933. wait()
  934. Pos=target.Position
  935. BodGy.cframe=cf(Torso.Position,Pos)
  936. end
  937. end))
  938. n=2
  939. for i=0,1,0.1 do
  940. wait()
  941. Neck.C0=cf(0,1,0)*euler(-0.2+0.2*i*n,0,0)
  942. RW.C0=cf(1.5,0.5,0)*euler(1.57*i*n,0,0.2-0.6*i*n)
  943. LW.C0=cf(-1.5,0.5,0)*euler(1.57*i*n,0,-0.2+0.6*i*n)
  944. n=n-0.1
  945. end
  946. local orb=part(3,Character,0,1,BrickColor.new("Really black"),"Orb",vt())
  947. local omsh=mesh("SpecialMesh",orb,"Sphere","",vt(0,0,0),vt(10,10,10))
  948. local owld=weld(orb,orb,Torso,cf(0,-0.5,3))
  949. so("http://roblox.com/asset/?id=137463716",orb,1,0.6)
  950. for i=1,0.3,-0.01 do
  951. wait()
  952. orb.Transparency=i
  953. omsh.Scale=omsh.Scale+vt(0.2,0.2,0.2)
  954. MagicBlock(BrickColor.new("Really black"),orb.CFrame,8,8,8,0.5,0.5,0.5,0.1)
  955. local ef=part(3,workspace,0,0,BrickColor.new("Really black"),"Effect",vt())
  956. ef.Anchored=true
  957. local emsh=mesh("SpecialMesh",ef,"Sphere","",vt(0,0,0),vt(2,math.random(1000,1500)/100,2))
  958. local ceef=euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))*cf(0,math.random(5,10),0)
  959. ef.CFrame=orb.CFrame*ceef
  960. game:GetService("Debris"):AddItem(ef,2)
  961. coroutine.resume(coroutine.create(function(Part,Mesh)
  962. for i=0,1,0.1 do
  963. wait()
  964. Part.Transparency=i
  965. Part.CFrame=Part.CFrame*cf(0,-1,0)
  966. end
  967. Part.Parent=nil
  968. end),ef,emsh)
  969. end
  970. attacking=false
  971. wait(1)
  972. orb.Parent=nil
  973. local hit,pos = rayCast(orb.Position,Head.CFrame.lookVector,999,Character)
  974. print(hit)
  975. local mag=(orb.Position-pos).magnitude
  976. MagicCircle(BrickColor.new("Really black"),cf(pos),15,15,15,8,8,8,0.02)
  977. MagicBlock(BrickColor.new("Really black"),cf(pos),15,15,15,8,8,8,0.02)
  978. MagicCylinder(BrickColor.new("Really black"),CFrame.new((orb.Position+pos)/2,pos)*euler(1.57,0,0),10,mag*5,10,0.5,0,0.5,0.01)
  979. for i=1,2 do
  980. MagicRing(BrickColor.new("Really black"),cf(pos)*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50)),3,3,3,1,1,1,0.04)
  981. end
  982. for i=1,5 do
  983. tehcf=CFrame.new((orb.Position+pos)/2,pos)*euler(1.57,0,0)*cf(0,(mag/5)*(i/2),0)
  984. MagicRing(BrickColor.new("Really black"),tehcf*euler(1.57,0,0),1,1,1,0.5,0.5,0.5,0.01)
  985. end
  986. for i=0,5 do
  987. tehcf=CFrame.new((orb.Position+pos)/2,pos)*euler(1.57,0,0)*cf(0,(-mag/5)*(i/2),0)
  988. MagicRing(BrickColor.new("Really black"),tehcf*euler(1.57,0,0),1,1,1,0.5,0.5,0.5,0.01)
  989. end
  990. local ref=part(3,workspace,0,1,BrickColor.new("Really black"),"Effect",vt())
  991. ref.CFrame=cf(pos)
  992. so("http://roblox.com/asset/?id=183763506",Torso,1,0.6)
  993. so("http://roblox.com/asset/?id=178452221",Torso,1,0.6)
  994. so("http://www.roblox.com/Asset?ID=87767777",Torso,1,1)
  995. so("http://roblox.com/asset/?id=183763506",ref,1,0.6)
  996. so("http://roblox.com/asset/?id=178452221",ref,1,0.6)
  997. so("http://www.roblox.com/Asset?ID=87767777",ref,1,1)
  998. coroutine.resume(coroutine.create(function(Part)
  999. wait(1)
  1000. Part.Parent=nil
  1001. end),ref)
  1002. MagniDamage(ref,20,10,30,40,"Knockdown",ref)
  1003. if hit~=nil then
  1004. Damagefunc(hit,30,70,50,"Knockdown",RootPart,0)
  1005. end
  1006. wait(1)
  1007. n=2
  1008. for i=0,1,0.1 do
  1009. wait()
  1010. Neck.C0=cf(0,1,0)*euler(-0.2*i*n,0,0)
  1011. RW.C0=cf(1.5,0.5,0)*euler(1.57-1.57*i*n,0,0.2-0.6+0.6*i*n)
  1012. LW.C0=cf(-1.5,0.5,0)*euler(1.57-1.57*i*n,0,-0.2+0.6-0.6*i*n)
  1013. n=n-0.1
  1014. end
  1015. elseif attack==3 then --Terror blast
  1016. n=2
  1017. for i=0,1,0.1 do
  1018. wait()
  1019. Neck.C0=cf(0,1,0)*euler(-0.2-0.2*i*n,0,0)
  1020. RW.C0=cf(1.5-0.5*i*n,0.5,-0.5*i*n)*euler(1.4*i*n,0,0.2-1.4*i*n)
  1021. LW.C0=cf(-1.5+0.5*i*n,0.5,-0.5*i*n)*euler(1.6*i*n,0,-0.2+1.6*i*n)
  1022. n=n-0.1
  1023. end
  1024. so("http://roblox.com/asset/?id=160772554",Torso,1,0.6)
  1025. so("http://roblox.com/asset/?id=161006069",Torso,1,0.6)
  1026. local charging=true
  1027. for _,c in pairs(workspace:children()) do
  1028. if c.className=="Model" then
  1029. if c:findFirstChild("Torso")~=nil and c:findFirstChild("Humanoid")~=nil and c.Name~="Vanta" then
  1030. print(c)
  1031. local Tors=c:findFirstChild("Torso")
  1032. coroutine.resume(coroutine.create(function(Part)
  1033. local ef=part(3,Character,0,0.5,BrickColor.new("Really black"),"Laser",vt(0.2,0.2,0.2))
  1034. ef.Anchored=true
  1035. local emsh=mesh("SpecialMesh",ef,"Head","",vt(0,0,0),vt(1,1,1))
  1036. game:GetService("Debris"):AddItem(ef,5)
  1037. while charging==true do
  1038. wait()
  1039. local TheHit=Part.Position
  1040. local MouseLook=cf((Torso.Position+TheHit)/2,TheHit)
  1041. local hit,pos = rayCast(Torso.Position,MouseLook.lookVector,999,Character)
  1042. local mag=(Torso.Position-pos).magnitude
  1043. ef.CFrame=CFrame.new((Torso.Position+pos)/2,pos)*euler(1.57,0,0)
  1044. emsh.Scale=vt(1,mag*5,1)
  1045. end
  1046. ef.Parent=nil
  1047. local TheHit=Part.Position
  1048. local MouseLook=cf((Torso.Position+TheHit)/2,TheHit)
  1049. wait()
  1050. local hit,pos = rayCast(Torso.Position,MouseLook.lookVector,999,Character)
  1051. local mag=(Torso.Position-pos).magnitude
  1052. if hit~=nil then
  1053. Damagefunc(hit,20,40,50,"Knockdown",RootPart,0)
  1054. MagicCircle(BrickColor.new("Really black"),cf(pos),5,5,5,6,6,6,0.02)
  1055. MagicBlock(BrickColor.new("Really black"),cf(pos),5,5,5,7,7,7,0.02)
  1056. MagicCylinder(BrickColor.new("Really black"),CFrame.new((Torso.Position+pos)/2,pos)*euler(1.57,0,0),5,mag*5,5,0.5,0,0.5,0.01)
  1057. so("http://roblox.com/asset/?id=183763515",hit,1,1)
  1058. so("http://roblox.com/asset/?id=183763512",hit,1,1)
  1059. end
  1060. end),Tors)
  1061. end
  1062. end
  1063. end
  1064. wait(1)
  1065. n=2
  1066. for i=0,1,0.2 do
  1067. wait()
  1068. Neck.C0=cf(0,1,0)*euler(-0.4+0.2*i*n,0,0)
  1069. RW.C0=cf(1+0.5*i*n,0.5,-0.5+0.5*i*n)*euler(1.4+0.17*i*n,0,-1.2+2.77*i*n)
  1070. LW.C0=cf(-1-0.5*i*n,0.5,-0.5+0.5*i*n)*euler(1.6-0.03*i*n,0,1.4-2.97*i*n)
  1071. n=n-0.2
  1072. end
  1073. charging=false
  1074. wait(1)
  1075. n=2
  1076. for i=0,1,0.1 do
  1077. wait()
  1078. Neck.C0=cf(0,1,0)*euler(-0.2,0,0)
  1079. RW.C0=cf(1.5,0.5,0)*euler(1.57-1.57*i*n,0,1.57-1.37*i*n)
  1080. LW.C0=cf(-1.5,0.5,0)*euler(1.57-1.57*i*n,0,-1.57+1.37*i*n)
  1081. n=n-0.1
  1082. end
  1083. wait(2)
  1084. end
  1085. attacking=false
  1086. else
  1087. print("CAN'T FIND TARGET")
  1088. end
  1089. wait(1)
  1090. end
  1091. Humanoid.MaxHealth=HealtVal.Value
  1092. Humanoid.Health=HealtVal2.Value
  1093. coroutine.resume(coroutine.create(function()
  1094. for i=1,20 do
  1095. Humanoid.Health=HealtVal2.Value
  1096. end
  1097. Humanoid:TakeDamage(1)
  1098. end))
  1099. MagicBlock(BrickColor.new("Really black"),Torso.CFrame,15,15,15,6,6,6,0.1)
  1100. BPRef.CFrame=MainPosition
  1101. Torso.CFrame=BPRef.CFrame
  1102. BodPos.position=BPRef.Position
  1103. MagicBlock(BrickColor.new("Really black"),Torso.CFrame,15,15,15,6,6,6,0.1)
  1104. BodGy.cframe=CF
  1105. wait(0.5)
  1106. n=2
  1107. for i=0,1,0.05 do
  1108. wait()
  1109. BPRef.CFrame=MainPosition*cf(0,-60*i,0)
  1110. BodPos.position=BPRef.Position
  1111. Neck.C0=cf(0,1,0)*euler(-0.2-0.2*i*n,0,0)
  1112. RW.C0=cf(1.5-0.5*i*n,0.5,-0.5*i*n)*euler(1.4*i*n,0,0.2-1.4*i*n)
  1113. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  1114. LW.C0=cf(-1.5+0.5*i*n,0.5,-0.5*i*n)*euler(1.6*i*n,0,-0.2+1.6*i*n)
  1115. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  1116. RH.C0=cf(0.5,-1,0)*euler(-0.3+0.3*i*n,0,0.2)
  1117. RH.C1=cf(0,1,0)
  1118. LH.C0=cf(-0.5,-1,0)*euler(-0.3+0.3*i*n,0,-0.2)
  1119. LH.C1=cf(0,1,0)
  1120. n=n-0.05
  1121. end
  1122. wait(1)
  1123. DarkLegEffect=false
  1124. local Head2=part(0,Character,0,1,BrickColor.new("Really black"),"Shade Head",vt(10,5,5))
  1125. local Torso2=part(0,Character,0,1,BrickColor.new("Really black"),"Shade Torso",vt(10,10,5))
  1126. local LeftArm2=part(0,Character,0,1,BrickColor.new("Really black"),"Shade Left Arm",vt(5,10,5))
  1127. local RightArm2=part(0,Character,0,1,BrickColor.new("Really black"),"Shade Right Arm",vt(5,10,5))
  1128. local LeftLeg2=part(0,Character,0,1,BrickColor.new("Really black"),"Shade Left Leg",vt(5,10,5))
  1129. local RightLeg2=part(0,Character,0,1,BrickColor.new("Really black"),"Shade Right Leg",vt(5,10,5))
  1130. Head2.CFrame=Head.CFrame
  1131. Torso2.CFrame=Head.CFrame
  1132. LeftArm2.CFrame=Head.CFrame
  1133. RightArm2.CFrame=Head.CFrame
  1134. LeftLeg2.CFrame=Head.CFrame
  1135. RightLeg2.CFrame=Head.CFrame
  1136. local HMesh2=mesh("SpecialMesh",Head2,"Head","",vt(0,0,0),vt(1.25,1.25,1.25))
  1137. local Neck2=weld(Torso2,Torso2,Head2,cf(0,5,0))
  1138. Neck2.C1=cf(0,-2.5,0)
  1139. local RW2=weld(Torso2,Torso2,RightArm2,cf(7.5,2.5,0))
  1140. RW2.C1=cf(0,2.5,0)
  1141. local LW2=weld(Torso2,Torso2,LeftArm2,cf(-7.5,2.5,0))
  1142. LW2.C1=cf(0,2.5,0)
  1143. local RH2=weld(Torso2,Torso2,RightLeg2,cf(2.5,-5,0))
  1144. RH2.C1=cf(0,5,0)
  1145. local LH2=weld(Torso2,Torso2,LeftLeg2,cf(-2.5,-5,0))
  1146. LH2.C1=cf(0,5,0)
  1147. local RootJoint2=weld(Torso2,Torso2,Torso,cf(0,2.5,0))
  1148. local DarkBody=true
  1149. local cf1=0
  1150. local cf2=4
  1151. local cf3=0
  1152. local cf4=6
  1153. local cf5=2
  1154. local cf6=0
  1155. local cf7=-6
  1156. local cf8=2
  1157. local cf9=0
  1158. local cf10=2
  1159. local cf11=-4
  1160. local cf12=0
  1161. local cf13=-2
  1162. local cf14=-4
  1163. local cf15=0
  1164. coroutine.resume(coroutine.create(function()
  1165. --Destroy all CC, Dark body assume angles of normal body
  1166. while DarkBody==true do
  1167. wait()
  1168. for _,c in pairs(Character:children()) do
  1169. for _,v in pairs(c:children()) do
  1170. if v.className=="BodyGyro" or v.className=="BodyPosition" or v.className=="BodyVelocity" or v.className=="BodyAngularVelocity" then
  1171. if v.Name~="VantaGyro" and v.Name~="VantaPos" then
  1172. print("dai")
  1173. v.Parent=nil
  1174. end
  1175. end
  1176. end
  1177. end
  1178. Neck2.C0=cf(cf1,cf2,cf3)*Neck.C0
  1179. RW2.C0=cf(cf4,cf5,cf6)*RW.C0
  1180. LW2.C0=cf(cf7,cf8,cf9)*LW.C0
  1181. RH2.C0=cf(cf10,cf11,cf12)*RH.C0
  1182. LH2.C0=cf(cf13,cf14,cf15)*LH.C0
  1183. end
  1184. end))
  1185. n=2
  1186. n2=1
  1187. for i=0,1,0.1 do
  1188. wait()
  1189. Neck.C0=cf(0,1,0)*euler(-0.4+0.4*i*n,0,0)
  1190. RW.C0=cf(1+0.5*i*n,0.5,-0.5+0.5*i*n)*euler(1.4+0.17*i*n,0,-1.2+2.77*i*n)
  1191. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  1192. LW.C0=cf(-1-0.5*i*n,0.5,-0.5+0.5*i*n)*euler(1.6-0.03*i*n,0,1.4-2.97*i*n)
  1193. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  1194. RH.C0=cf(0.5,-1,0)*euler(0,0,0.2+0.2*i*n)
  1195. RH.C1=cf(0,1,0)
  1196. LH.C0=cf(-0.5,-1,0)*euler(0,0,-0.2-0.2*i*n)
  1197. LH.C1=cf(0,1,0)
  1198. Head2.Transparency=n2
  1199. Torso2.Transparency=n2
  1200. LeftArm2.Transparency=n2
  1201. RightArm2.Transparency=n2
  1202. LeftLeg2.Transparency=n2
  1203. RightLeg2.Transparency=n2
  1204. n=n-0.1
  1205. n2=n2-0.05
  1206. end
  1207. wait(0.5)
  1208. RootJoint.C0=cf(0,-14.5,0)*euler(0,0,0)
  1209. BodPos.Parent=nil
  1210. Humanoid.WalkSpeed=25
  1211. n=2
  1212. for i=0,1,0.1 do
  1213. wait()
  1214. Neck.C0=cf(0,1,0)*euler(-0.2*i*n,0,0)
  1215. RW.C0=cf(1.5,0.5,0)*euler(1.57-1.57*i*n,0,1.57-1.27*i*n)
  1216. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  1217. LW.C0=cf(-1.5,0.5,0)*euler(1.57-1.57*i*n,0,-1.57+1.27*i*n)
  1218. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  1219. RH.C0=cf(0.5,-1,0)*euler(0,0,0.4-0.4*i*n)
  1220. RH.C1=cf(0,1,0)
  1221. LH.C0=cf(-0.5,-1,0)*euler(0,0,-0.4+0.4*i*n)
  1222. LH.C1=cf(0,1,0)
  1223. n=n-0.1
  1224. end
  1225. BodGy.maxTorque=Vector3.new(40000000,400000000,40000000)
  1226. BodGy.P=2000
  1227. BodGy.D=100
  1228. --BodGy.cframe=CF*euler(0,0,0)
  1229. coroutine.resume(coroutine.create(function()
  1230. --Movement function
  1231. local flying=false
  1232. while DarkBody==true do
  1233. wait()
  1234. --[[print(RootPart.Velocity.z)
  1235. if RootPart.Velocity.x>=6 or RootPart.Velocity.x<=-6 or RootPart.Velocity.z>=6 or RootPart.Velocity.z<=6 then
  1236. Anim.Value="Walking"
  1237. else
  1238. Anim.Value="Standing"
  1239. end]]
  1240. local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
  1241. if flying==true then
  1242. Anim.Value="Flying"
  1243. elseif torvel<1 then
  1244. Anim.Value="Standing"
  1245. elseif torvel<30 then
  1246. Anim.Value="Walking"
  1247. end
  1248. target=findNearestTorso(RootPart.Position)
  1249. local hit,pos=rayCast(RootPart.Position,cf(RootPart.Position,RootPart.Position-vt(0,1,0)).lookVector,50,Character)
  1250. if hit==nil and flying==false then
  1251. flying=true
  1252. BodPos.maxForce=vt(0,math.huge,0)
  1253. if target~=nil then
  1254. BodPos.position=target.Position
  1255. else
  1256. BodPos.position=Torso2.Position
  1257. end
  1258. BodPos.Parent=RootPart
  1259. coroutine.resume(coroutine.create(function()
  1260. local ground=false
  1261. while ground==false do
  1262. wait()
  1263. if target~=nil then
  1264. BodPos.position=target.Position
  1265. end
  1266. local hit,pos=rayCast(RootPart.Position,cf(RootPart.Position,RootPart.Position-vt(0,1,0)).lookVector,50,Character)
  1267. if hit~=nil then
  1268. ground=true
  1269. flying=false
  1270. end
  1271. end
  1272. BodPos.Parent=nil
  1273. end))
  1274. end
  1275. if target~=nil then
  1276. local pos=Vector3.new(target.Parent.Torso.Position.x,RootPart.Position.Y,target.Parent.Torso.Position.z)
  1277. BodGy.cframe=cf(RootPart.Position,pos)
  1278. Humanoid:MoveTo(target.Position)
  1279. end
  1280. end
  1281. end))
  1282. coroutine.resume(coroutine.create(function()
  1283. --Movement animations
  1284. --[[function onRunning(speed)
  1285. if speed>1 then
  1286. Anim.Value="Walking"
  1287. else
  1288. Anim.Value="Standing"
  1289. end
  1290. end
  1291. Humanoid.Running:connect(onRunning)]]
  1292. local con1=nil
  1293. local con2=nil
  1294. while DarkBody==true do
  1295. wait()
  1296. local walkingoffset1=0
  1297. local walkingoffset2=0
  1298. if attacking==false then
  1299. if Anim.Value=="Standing" then
  1300. RH.C0=cf(0.5,-1,0)*euler(0,0,0)
  1301. RH.C1=cf(0,1,0)
  1302. LH.C0=cf(-0.5,-1,0)*euler(0,0,0)
  1303. LH.C1=cf(0,1,0)
  1304. elseif Anim.Value=="Walking" then
  1305. n=2
  1306. for i=0,1,0.1 do
  1307. if Anim.Value=="Walking" then
  1308. --con1=LeftLeg2.Touched:connect(function(hit) Damagefunc(hit,5,10,math.random(5,10),"Normal",RootPart,.5) end)
  1309. --con2=RightLeg2.Touched:connect(function(hit) Damagefunc(hit,5,10,math.random(5,10),"Normal",RootPart,.5) end)
  1310. wait()
  1311. walkingoffset1=1.2*i*n
  1312. walkingoffset2=-1.2*i*n
  1313. end
  1314. RH.C0=cf(0.5,-1,0)*euler(walkingoffset1,0,0)
  1315. RH.C1=cf(0,1,0)
  1316. LH.C0=cf(-0.5,-1,0)*euler(walkingoffset2,0,0)
  1317. LH.C1=cf(0,1,0)
  1318. n=n-0.1
  1319. end
  1320. while Anim.Value=="Walking" and DarkBody==true do
  1321. wait()
  1322. n=2
  1323. for i=0,1,0.05 do
  1324. if Anim.Value=="Walking" then
  1325. wait()
  1326. walkingoffset1=1.2-2.4*i*n
  1327. walkingoffset2=-1.2+2.4*i*n
  1328. end
  1329. RH.C0=cf(0.5,-1,0)*euler(walkingoffset1,0,0)
  1330. RH.C1=cf(0,1,0)
  1331. LH.C0=cf(-0.5,-1,0)*euler(walkingoffset2,0,0)
  1332. LH.C1=cf(0,1,0)
  1333. n=n-0.05
  1334. end
  1335. n=2
  1336. for i=0,1,0.05 do
  1337. if Anim.Value=="Walking" then
  1338. wait()
  1339. walkingoffset1=-1.2+2.4*i*n
  1340. walkingoffset2=1.2-2.4*i*n
  1341. end
  1342. RH.C0=cf(0.5,-1,0)*euler(walkingoffset1,0,0)
  1343. RH.C1=cf(0,1,0)
  1344. LH.C0=cf(-0.5,-1,0)*euler(walkingoffset2,0,0)
  1345. LH.C1=cf(0,1,0)
  1346. n=n-0.05
  1347. end
  1348. end
  1349. if Anim.Value=="Standing" then
  1350. n=2
  1351. for i=0,1,0.1 do
  1352. wait()
  1353. RH.C0=cf(0.5,-1,0)*euler(walkingoffset1-walkingoffset1*i*n,0,0)
  1354. RH.C1=cf(0,1,0)
  1355. LH.C0=cf(-0.5,-1,0)*euler(walkingoffset2-walkingoffset2*i*n,0,0)
  1356. LH.C1=cf(0,1,0)
  1357. n=n-0.1
  1358. end
  1359. end
  1360. elseif Anim.Value=="Flying" then
  1361. while Anim.Value=="Flying" and DarkBody==true do
  1362. wait(.1)
  1363. RH.C0=cf(0.5,-1,0)*euler(-0.2,0,0.2)
  1364. RH.C1=cf(0,1,0)
  1365. LH.C0=cf(-0.5,-1,0)*euler(-0.2,0,-0.2)
  1366. LH.C1=cf(0,1,0)
  1367. MagicBlock(BrickColor.new("Really black"),LeftLeg2.CFrame*cf(0,-5,0),30,30,30,2,2,2,0.1)
  1368. MagicBlock(BrickColor.new("Really black"),RightLeg2.CFrame*cf(0,-5,0),30,30,30,2,2,2,0.1)
  1369. end
  1370. end
  1371. end
  1372. end
  1373. end))
  1374. coroutine.resume(coroutine.create(function()
  1375. while Humanoid.Health>=HealtVal.Value-HealthNum.Value do
  1376. wait()
  1377. end
  1378. HealthNum.Value=HealthNum.Value+HealthNumber
  1379. mode.Value=2
  1380. end))
  1381. while mode.Value==3 do
  1382. Humanoid.PlatformStand=false
  1383. Humanoid.Sit=false
  1384. Humanoid.Parent=Character
  1385. if Torso.Parent==nil then
  1386. Humanoid.Parent=Character
  1387. RootPart.Parent=Character
  1388. BodPos.position=workspace["Map"].ReferenceMiddle.Position+vt(0,50,0)
  1389. BodPos.Parent=RootPart
  1390. RootPart.CFrame=BPRef.CFrame
  1391. BPRef.CFrame=Torso.CFrame
  1392. BodPos.position=BPRef.Position
  1393. Torso.Parent=Character
  1394. Head.Parent=Character
  1395. LeftArm.Parent=Character
  1396. RightArm.Parent=Character
  1397. LeftLeg.Parent=Character
  1398. RightLeg.Parent=Character
  1399. Neck.Parent=Torso
  1400. RootJoint.Parent=Torso
  1401. RW.Parent=Torso
  1402. LW.Parent=Torso
  1403. RH.Parent=Torso
  1404. LH.Parent=Torso
  1405. wait(.1)
  1406. Humanoid.MaxHealth=HealtVal.Value
  1407. Humanoid.Health=HealtVal2.Value
  1408. coroutine.resume(coroutine.create(function()
  1409. for i=1,20 do
  1410. Humanoid.Health=HealtVal2.Value
  1411. Neck.Parent=Torso
  1412. RootJoint.Parent=Torso
  1413. RW.Parent=Torso
  1414. LW.Parent=Torso
  1415. RH.Parent=Torso
  1416. LH.Parent=Torso
  1417. end
  1418. Humanoid:TakeDamage(1)
  1419. end))
  1420. end
  1421. Neck.C0=cf(0,1,0)*euler(-0.2,0,0)
  1422. RW.C0=cf(1.5,0.5,0)*euler(0,0,0.3)
  1423. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  1424. LW.C0=cf(-1.5,0.5,0)*euler(0,0,-0.3)
  1425. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  1426. wait(1)
  1427. local targetting=false
  1428. if target~=nil then
  1429. targetting=true
  1430. local dist=(RootPart.Position - target.Position).magnitude
  1431. if Anim.Value=="Floating" then
  1432. dist=500
  1433. end
  1434. coroutine.resume(coroutine.create(function()
  1435. while targetting==true do
  1436. target=findNearestTorso(RootPart.Position)
  1437. if target==nil then
  1438. target=Torso2
  1439. end
  1440. wait(0)
  1441. end
  1442. end))
  1443. if dist>=50 then
  1444. attack=math.random(1,2)
  1445. if attack==1 then --Dark Rain
  1446. local n=2
  1447. for i=0,1,0.1 do
  1448. wait()
  1449. Neck.C0=cf(0,1,0)*euler(-0.2+0.6*i*n,0,0)
  1450. RW.C0=cf(1.5,0.5,0)*euler(3.14*i*n,0,0.3-0.3*i*n)
  1451. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  1452. LW.C0=cf(-1.5,0.5,0)*euler(-0.2*i*n,0,-0.3)
  1453. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  1454. n=n-0.1
  1455. end
  1456. for i=1,math.random(20,40) do
  1457. wait(.05)
  1458. MagicBlock(BrickColor.new("Really black"),RightArm2.CFrame*cf(0,-5,0),30,30,30,2,2,2,0.1)
  1459. local orb=part(3,Character,0,0.5,BrickColor.new("Really black"),"Orb",vt())
  1460. orb.Anchored=true
  1461. so("http://roblox.com/asset/?id=183763498",orb,1,1.2)
  1462. local omsh=mesh("SpecialMesh",orb,"Sphere","",vt(0,0,0),vt(10,10,10))
  1463. orb.CFrame=cf(target.Position+vt(math.random(-10,10),math.random(50,100),math.random(-10,10)))
  1464. MagicCircle(BrickColor.new("Really black"),orb.CFrame,10,10,10,1,1,1,0.1)
  1465. coroutine.resume(coroutine.create(function(Part,Mesh,Weld)
  1466. wait(1)
  1467. Part.Parent=nil
  1468. local spread=vt((math.random(-1,0)+math.random())*16,(math.random(-1,0)+math.random())*16,(math.random(-1,0)+math.random())*16)*(Part.Position-(Part.Position+vt(0,-1,0))).magnitude/100
  1469. local TheHit=Part.Position+vt(0,-1,0)
  1470. local MouseLook=cf((Part.Position+TheHit)/2,TheHit+spread)
  1471. local hit,pos = rayCast(Part.Position,MouseLook.lookVector,999,Character)
  1472. local mag=(Part.Position-pos).magnitude
  1473. MagicCylinder(BrickColor.new("Really black"),CFrame.new((Part.Position+pos)/2,pos)*angles(1.57,0,0) ,1,mag*5,1,0.5,0,0.5,0.05)
  1474. MagicBlock(BrickColor.new("Really black"),Part.CFrame,8,8,8,0.5,0.5,0.5,0.1)
  1475. MagicBlock(BrickColor.new("Really black"),cf(pos),15,15,15,6,6,6,0.1)
  1476. MagicRing(BrickColor.new("Really black"),cf(pos)*euler(1.57,math.random(-100,100)/100,math.random(-100,100)/100),1,1,1,2,2,2,0.05)
  1477. local ref=part(3,workspace,0,1,BrickColor.new("Really black"),"Effect",vt())
  1478. ref.CFrame=cf(pos)
  1479. so("http://roblox.com/asset/?id=183763487",ref,1,1)
  1480. coroutine.resume(coroutine.create(function(Part)
  1481. wait(1)
  1482. Part.Parent=nil
  1483. end),ref)
  1484. MagniDamage(ref,15,5,10,0,"Normal",RootPart)
  1485. if hit~=nil then
  1486. Damagefunc(hit,20,40,1,"Knockdown",RootPart,0)
  1487. end
  1488. end),orb,omsh,owld)
  1489. end
  1490. wait(0.5)
  1491. local n=2
  1492. for i=0,1,0.1 do
  1493. wait()
  1494. Neck.C0=cf(0,1,0)*euler(0.4-0.6*i*n,0,0)
  1495. RW.C0=cf(1.5,0.5,0)*euler(3.14-3.14*i*n,0,0.3*i*n)
  1496. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  1497. LW.C0=cf(-1.5,0.5,0)*euler(-0.2+0.2*i*n,0,-0.3)
  1498. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  1499. n=n-0.1
  1500. end
  1501. wait(1)
  1502. elseif attack==2 then --Nocturne
  1503. local n=2
  1504. for i=0,1,0.1 do
  1505. wait()
  1506. Neck.C0=cf(0,1,0)*euler(-0.2+0.6*i*n,0,0)
  1507. RW.C0=cf(1.5,0.5,0)*euler(3.14*i*n,0,0.3-0.9*i*n)
  1508. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  1509. LW.C0=cf(-1.5,0.5,0)*euler(3.14*i*n,0,-0.3+0.9*i*n)
  1510. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  1511. n=n-0.1
  1512. end
  1513. local orb=part(3,Character,0,1,BrickColor.new("Really black"),"Orb",vt())
  1514. local omsh=mesh("SpecialMesh",orb,"Sphere","",vt(0,0,0),vt(15,15,15))
  1515. local owld=weld(orb,orb,Torso,cf(0,-10,0))
  1516. so("http://roblox.com/asset/?id=137463716",orb,1,0.6)
  1517. for i=1,0.3,-0.01 do
  1518. wait()
  1519. orb.Transparency=i
  1520. omsh.Scale=omsh.Scale+vt(0.5,0.5,0.5)
  1521. MagicBlock(BrickColor.new("Really black"),orb.CFrame,15,15,15,2,2,2,0.1)
  1522. local ef=part(3,workspace,0,0,BrickColor.new("Really black"),"Effect",vt())
  1523. ef.Anchored=true
  1524. local emsh=mesh("SpecialMesh",ef,"Sphere","",vt(0,0,0),vt(2,math.random(1000,1500)/100,2))
  1525. local ceef=euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))*cf(0,math.random(10,20),0)
  1526. ef.CFrame=orb.CFrame*ceef
  1527. game:GetService("Debris"):AddItem(ef,2)
  1528. coroutine.resume(coroutine.create(function(Part,Mesh)
  1529. for i=0,1,0.1 do
  1530. wait()
  1531. Part.Transparency=i
  1532. Part.CFrame=Part.CFrame*cf(0,-1,0)
  1533. end
  1534. Part.Parent=nil
  1535. end),ef,emsh)
  1536. end
  1537. local Pos=cf(orb.Position,target.Position).lookVector
  1538. wait(.5)
  1539. orb.Parent=nil
  1540. local hit,pos = rayCast(orb.Position,Pos,999,Character)
  1541. local mag=(orb.Position-pos).magnitude
  1542. MagicCircle(BrickColor.new("Really black"),cf(pos),15,15,15,8,8,8,0.02)
  1543. MagicBlock(BrickColor.new("Really black"),cf(pos),15,15,15,8,8,8,0.02)
  1544. MagicCylinder(BrickColor.new("Really black"),CFrame.new((orb.Position+pos)/2,pos)*euler(1.57,0,0),10,mag*5,10,0.5,0,0.5,0.01)
  1545. for i=1,2 do
  1546. MagicRing(BrickColor.new("Really black"),cf(pos)*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50)),3,3,3,1,1,1,0.04)
  1547. end
  1548. for i=1,5 do
  1549. tehcf=CFrame.new((orb.Position+pos)/2,pos)*euler(1.57,0,0)*cf(0,(mag/5)*(i/2),0)
  1550. MagicRing(BrickColor.new("Really black"),tehcf*euler(1.57,0,0),1,1,1,0.5,0.5,0.5,0.01)
  1551. end
  1552. for i=0,5 do
  1553. tehcf=CFrame.new((orb.Position+pos)/2,pos)*euler(1.57,0,0)*cf(0,(-mag/5)*(i/2),0)
  1554. MagicRing(BrickColor.new("Really black"),tehcf*euler(1.57,0,0),1,1,1,0.5,0.5,0.5,0.01)
  1555. end
  1556. local ref=part(3,workspace,0,1,BrickColor.new("Really black"),"Effect",vt())
  1557. ref.CFrame=cf(pos)
  1558. so("http://roblox.com/asset/?id=183763506",Torso,1,0.6)
  1559. so("http://roblox.com/asset/?id=178452221",Torso,1,0.6)
  1560. so("http://www.roblox.com/Asset?ID=87767777",Torso,1,1)
  1561. so("http://roblox.com/asset/?id=183763506",ref,1,0.6)
  1562. so("http://roblox.com/asset/?id=178452221",ref,1,0.6)
  1563. so("http://www.roblox.com/Asset?ID=87767777",ref,1,1)
  1564. coroutine.resume(coroutine.create(function(Part)
  1565. wait(1)
  1566. Part.Parent=nil
  1567. end),ref)
  1568. MagniDamage(ref,20,10,30,40,"Knockdown",ref)
  1569. if hit~=nil then
  1570. Damagefunc(hit,30,70,50,"Knockdown",RootPart,0)
  1571. end
  1572. wait(1)
  1573. local n=2
  1574. for i=0,1,0.1 do
  1575. wait()
  1576. Neck.C0=cf(0,1,0)*euler(0.4-0.6*i*n,0,0)
  1577. RW.C0=cf(1.5,0.5,0)*euler(3.14-3.14*i*n,0,-0.6+0.9*i*n)
  1578. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  1579. LW.C0=cf(-1.5,0.5,0)*euler(3.14-3.14*i*n,0,0.6-0.9*i*n)
  1580. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  1581. n=n-0.1
  1582. end
  1583. end
  1584. else
  1585. attack=math.random(1,2)
  1586. if attack==1 then --Titan Fall
  1587. attacking=true
  1588. Humanoid.WalkSpeed=0
  1589. local n=2
  1590. for i=0,1,0.05 do
  1591. wait()
  1592. cf4=6-2*i*n
  1593. cf5=2+2*i*n
  1594. cf6=-2*i*n
  1595. cf7=-6+2*i*n
  1596. cf8=2+2*i*n
  1597. cf9=-2*i*n
  1598. Neck.C0=cf(0,1,0)*euler(-0.2+0.8*i*n,0,0)
  1599. RW.C0=cf(1.5-0.5*i*n,0.5+0.5*i*n,-0.5*i*n)*euler(3.14*i*n,0,0.3-0.9*i*n)
  1600. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  1601. LW.C0=cf(-1.5+0.5*i*n,0.5+0.5*i*n,-0.5*i*n)*euler(3.14*i*n,0,-0.3+0.9*i*n)
  1602. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  1603. n=n-0.05
  1604. end
  1605. wait(0.3)
  1606. so("http://www.roblox.com/asset/?id=169445121",Torso2,1,0.6)
  1607. n=2
  1608. for i=0,1,0.2 do
  1609. wait()
  1610. MagicBlock(BrickColor.new("Really black"),RightArm2.CFrame*cf(0,-5,0),30,30,30,2,2,2,0.1)
  1611. MagicBlock(BrickColor.new("Really black"),LeftArm2.CFrame*cf(0,-5,0),30,30,30,2,2,2,0.1)
  1612. cf11=-4+2*i*n
  1613. cf12=-2*i*n
  1614. cf5=4-4*i*n
  1615. cf8=4-4*i*n
  1616. RootJoint.C0=cf(0,-14.5+3*i*n,0)*euler(0,0,0)
  1617. Neck.C0=cf(0,1,0)*euler(0.6-1*i*n,0,0)
  1618. RW.C0=cf(1,1-1*i*n,-0.5)*euler(3.14-2.64*i*n,0,-0.6)
  1619. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  1620. LW.C0=cf(-1,1-1*i*n,-0.5)*euler(3.14-2.64*i*n,0,0.6)
  1621. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  1622. RH.C0=cf(0.5,-1+0.5*i*n,-0.5*i*n)*euler(-0.1*i*n,0,0)
  1623. RH.C1=cf(0,1,0)
  1624. LH.C0=cf(-0.5,-1,0)*euler(-0.6*i*n,0,0)
  1625. LH.C1=cf(0,1,0)
  1626. n=n-0.2
  1627. end
  1628. local cf2=RootPart.CFrame*cf(0,500,-20)
  1629. local ref=part(3,workspace,0,1,BrickColor.new("Really black"),"Effect",vt())
  1630. ref.CFrame=cf2
  1631. ref.Anchored=true
  1632. local TheHit=ref.Position+vt(0,-1,0)
  1633. local MouseLook=cf((ref.Position+TheHit)/2,TheHit)
  1634. local hit,pos = rayCast(ref.Position,MouseLook.lookVector,999,Character)
  1635. local ref2=part(3,workspace,0,1,BrickColor.new("Really black"),"Effect",vt())
  1636. ref2.CFrame=cf(pos)
  1637. ref2.Anchored=true
  1638. local mag=(ref.Position-pos).magnitude
  1639. MagicCylinder(BrickColor.new("Really black"),CFrame.new((ref.Position+pos)/2,pos)*angles(1.57,0,0),5,mag*5,5,1,0,1,0.05)
  1640. MagicCircle(BrickColor.new("Really black"),ref2.CFrame,15,15,15,8,8,8,0.02)
  1641. MagicBlock(BrickColor.new("Really black"),ref2.CFrame,15,15,15,3,3,3,0.02)
  1642. WaveEffect2(BrickColor.new("Really black"),ref2.CFrame,5,5,5,2,3,2,0.05)
  1643. MagicRing(BrickColor.new("Really black"),cf(ref2.Position)*euler(1.57,0,0),5,5,5,4,4,4,0.05)
  1644. MagniDamage(ref2,25,20,50,math.random(10,30),"Knockdown",ref2)
  1645. --so("http://roblox.com/asset/?id=144844438",ref2,1,0.8)
  1646. so("http://roblox.com/asset/?id=87784452",ref2,1,0.8)
  1647. so("http://roblox.com/asset/?id=183763515",ref2,1,0.8)
  1648. game:GetService("Debris"):AddItem(ref,2)
  1649. game:GetService("Debris"):AddItem(ref2,2)
  1650. wait(1)
  1651. n=2
  1652. for i=0,1,0.1 do
  1653. wait()
  1654. cf4=4+2*i*n
  1655. cf5=2*i*n
  1656. cf6=-2+2*i*n
  1657. cf7=-4-2*i*n
  1658. cf8=2*i*n
  1659. cf9=-2+2*i*n
  1660. cf11=-4+2-2*i*n
  1661. cf12=-2+2*i*n
  1662. RootJoint.C0=cf(0,-14.5+3-3*i*n,0)*euler(0,0,0)
  1663. Neck.C0=cf(0,1,0)*euler(-0.4+0.2*i*n,0,0)
  1664. RW.C0=cf(1+0.5*i*n,0.5*i*n,-0.5+0.5*i*n)*euler(0.5-0.5*i*n,0,-0.6+0.9*i*n)
  1665. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  1666. LW.C0=cf(-1-0.5*i*n,0.5*i*n,-0.5+0.5*i*n)*euler(0.5-0.5*i*n,0,0.6-0.9*i*n)
  1667. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  1668. RH.C0=cf(0.5,-0.5-0.5*i*n,-0.5+0.5*i*n)*euler(-0.1+0.1*i*n,0,0)
  1669. RH.C1=cf(0,1,0)
  1670. LH.C0=cf(-0.5,-1,0)*euler(-0.6+0.6*i*n,0,0)
  1671. LH.C1=cf(0,1,0)
  1672. n=n-0.1
  1673. end
  1674. wait(1)
  1675. Humanoid.WalkSpeed=25
  1676. attacking=false
  1677. elseif attack==2 then --Dark Stomp
  1678. attacking=true
  1679. Humanoid.WalkSpeed=0
  1680. local n=2
  1681. for i=0,1,0.1 do
  1682. wait()
  1683. cf11=-4+2*i*n
  1684. cf12=-2*i*n
  1685. --cf13=-2
  1686. --cf14=-4
  1687. --cf15=0
  1688. RootJoint.C0=cf(0,-14.5,0)*euler(0.2*i*n,0,0)
  1689. Neck.C0=cf(0,1,0)*euler(-0.2-0.4*i*n,0,0)
  1690. RW.C0=cf(1.5,0.5,0)*euler(-0.2*i*n,0,0.3)
  1691. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  1692. LW.C0=cf(-1.5,0.5,0)*euler(-0.2*i*n,0,-0.3)
  1693. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  1694. RH.C0=cf(0.5,-1+0.5*i*n,-0.5*i*n)*euler(0.2*i*n,0,0)
  1695. RH.C1=cf(0,1,0)
  1696. LH.C0=cf(-0.5,-1,0)*euler(-0.2*i*n,0,0)
  1697. LH.C1=cf(0,1,0)
  1698. n=n-0.1
  1699. end
  1700. so("http://www.roblox.com/asset/?id=169445046",RightLeg2,1,0.6)
  1701. local n=2
  1702. for i=0,1,0.2 do
  1703. wait()
  1704. cf11=-2-2*i*n
  1705. RH.C0=cf(0.5,-0.5-0.5*i*n,-0.5)*euler(0.2+0.1*i*n,0,0)
  1706. RH.C1=cf(0,1,0)
  1707. n=n-0.2
  1708. end
  1709. MagicCylinder(BrickColor.new("Really black"),cf(RightLeg2.Position+vt(0,-4,0)),10,4,10,5,3,5,0.05)
  1710. local numb=-8
  1711. local basecf=RootPart.CFrame
  1712. for i=1,4 do
  1713. local cf2=basecf*cf(0,0,numb)
  1714. local ref=part(3,workspace,0,1,BrickColor.new("Really black"),"Effect",vt())
  1715. ref.CFrame=cf2
  1716. ref.Anchored=true
  1717. local TheHit=ref.Position+vt(0,-1,0)
  1718. local MouseLook=cf((ref.Position+TheHit)/2,TheHit)
  1719. local hit,pos = rayCast(ref.Position,MouseLook.lookVector,999,Character)
  1720. local ref2=part(3,workspace,0,1,BrickColor.new("Really black"),"Effect",vt())
  1721. ref2.CFrame=cf(pos)
  1722. ref2.Anchored=true
  1723. MagicCircle(BrickColor.new("Really black"),ref2.CFrame,15,15,15,8,8,8,0.02)
  1724. MagicWaveThing(BrickColor.new("Really black"),ref2.CFrame,5,5,5,2,2,2,0.05)
  1725. MagniDamage(ref2,20,20,30,math.random(5,20),"Normal",RootPart)
  1726. so("http://www.roblox.com/asset/?id=161006093",ref2,1,0.6)
  1727. game:GetService("Debris"):AddItem(ref,2)
  1728. game:GetService("Debris"):AddItem(ref2,2)
  1729. numb=numb-15
  1730. wait(0.4)
  1731. end
  1732. --wait(1)
  1733. local n=2
  1734. for i=0,1,0.1 do
  1735. wait()
  1736. cf12=-2+2*i*n
  1737. RootJoint.C0=cf(0,-14.5,0)*euler(0.2-0.2*i*n,0,0)
  1738. Neck.C0=cf(0,1,0)*euler(-0.6+0.4*i*n,0,0)
  1739. RW.C0=cf(1.5,0.5,0)*euler(-0.2+0.2*i*n,0,0.3)
  1740. RW.C1=cf(0,0.5,0)*euler(0,0,0)
  1741. LW.C0=cf(-1.5,0.5,0)*euler(-0.2+0.2*i*n,0,-0.3)
  1742. LW.C1=cf(0,0.5,0)*euler(0,0,0)
  1743. RH.C0=cf(0.5,-1,-0.5+0.5*i*n)*euler(0.3-0.3*i*n,0,0)
  1744. RH.C1=cf(0,1,0)
  1745. LH.C0=cf(-0.5,-1,0)*euler(-0.2+0.2*i*n,0,0)
  1746. LH.C1=cf(0,1,0)
  1747. n=n-0.1
  1748. end
  1749. Humanoid.WalkSpeed=25
  1750. attacking=false
  1751. wait(1)
  1752. elseif attack==3 then
  1753. end
  1754. end
  1755. targetting=false
  1756. end
  1757. end
  1758. --Destroy body
  1759. DarkBody=false
  1760. HealtVal2.Value=Humanoid.Health
  1761. Head2.Anchored=true
  1762. Torso2.Anchored=true
  1763. LeftArm2.Anchored=true
  1764. RightArm2.Anchored=true
  1765. LeftLeg2.Anchored=true
  1766. RightLeg2.Anchored=true
  1767. Neck2.Parent=nil
  1768. RW2.Parent=nil
  1769. LW2.Parent=nil
  1770. RH2.Parent=nil
  1771. LH2.Parent=nil
  1772. RootJoint2.Parent=nil
  1773. coroutine.resume(coroutine.create(function()
  1774. for i=0.5,1,0.05 do
  1775. wait()
  1776. Head2.Transparency=i
  1777. Torso2.Transparency=i
  1778. LeftArm2.Transparency=i
  1779. RightArm2.Transparency=i
  1780. LeftLeg2.Transparency=i
  1781. RightLeg2.Transparency=i
  1782. end
  1783. Head2.Parent=nil
  1784. Torso2.Parent=nil
  1785. LeftArm2.Parent=nil
  1786. RightArm2.Parent=nil
  1787. LeftLeg2.Parent=nil
  1788. RightLeg2.Parent=nil
  1789. end))
  1790. DarkLegEffect=true
  1791. coroutine.resume(coroutine.create(function(Leg1,Leg2)
  1792. while DarkLegEffect==true do
  1793. wait(0.1)
  1794. MagicBlock(BrickColor.new("Really black"),Leg1.CFrame*cf(0,-1,0),5,5,5,0.5,0.5,0.5,0.1)
  1795. MagicBlock(BrickColor.new("Really black"),Leg2.CFrame*cf(0,-1,0),5,5,5,0.5,0.5,0.5,0.1)
  1796. end
  1797. end),RightLeg,LeftLeg)
  1798. Humanoid.MaxHealth=math.huge
  1799. Humanoid.Health=math.huge
  1800. coroutine.resume(coroutine.create(function()
  1801. for i=1,20 do
  1802. Humanoid.Health=Humanoid.MaxHealth
  1803. end
  1804. Humanoid:TakeDamage(1)
  1805. end))
  1806. RootJoint.C0=cf(0,0,0)
  1807. MagicBlock(BrickColor.new("Really black"),Torso.CFrame,15,15,15,6,6,6,0.1)
  1808. BPRef.CFrame=MainPosition
  1809. Torso.CFrame=BPRef.CFrame
  1810. BodPos.position=BPRef.Position
  1811. BodGy.Parent=Torso
  1812. MagicBlock(BrickColor.new("Really black"),Torso.CFrame,15,15,15,6,6,6,0.1)
  1813. BodGy.cframe=CF*euler(0,1.57,0)
  1814. BodPos.Parent=RootPart
  1815. BodPos.maxForce=vt(math.huge,math.huge,math.huge)
  1816. coroutine.resume(coroutine.create(function()
  1817. for i=0,40 do
  1818. wait()
  1819. BodPos.Parent=RootPart
  1820. end
  1821. end))
  1822. for i=0,1,0.1 do
  1823. wait()
  1824. RH.C0=cf(0.5,-1,0)*euler(-0.3*i,0,0.2*i)
  1825. RH.C1=cf(0,1,0)
  1826. LH.C0=cf(-0.5,-1,0)*euler(-0.3*i,0,-0.2*i)
  1827. LH.C1=cf(0,1,0)
  1828. end
  1829. if Humanoid.Health>0 then
  1830. SummonCrystals()
  1831. end
  1832. wait(1)
  1833. end
  1834. DarkLegEffect=false
Add Comment
Please, Sign In to add comment