Advertisement
anaylsis

vulca

Jul 20th, 2015
896
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 61.84 KB | None | 0 0
  1. --[[
  2. Made by Fenrier.
  3. ]]
  4. Player=game:GetService("Players").LocalPlayer
  5. Character=Player.Character
  6. PlayerGui=Player.PlayerGui
  7. Backpack=Player.Backpack
  8. Torso=Character.Torso
  9. Head=Character.Head
  10. Humanoid=Character.Humanoid
  11. LeftArm=Character["Left Arm"]
  12. LeftLeg=Character["Left Leg"]
  13. RightArm=Character["Right Arm"]
  14. RightLeg=Character["Right Leg"]
  15. LS=Torso["Left Shoulder"]
  16. LH=Torso["Left Hip"]
  17. RS=Torso["Right Shoulder"]
  18. RH=Torso["Right Hip"]
  19. Neck=Torso.Neck
  20. it=Instance.new
  21. vt=Vector3.new
  22. cf=CFrame.new
  23. euler=CFrame.fromEulerAnglesXYZ
  24. angles=CFrame.Angles
  25. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  26. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  27. LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  28. LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
  29. RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  30. RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
  31. RootPart=Character.HumanoidRootPart
  32. RootJoint=RootPart.RootJoint
  33. RootCF=euler(-1.57,0,3.14)
  34. attack = false
  35. attackdebounce = false
  36. MMouse=nil
  37. combo=0
  38. mana=0
  39. local idle=0
  40. local Anim="Idle"
  41. local Effects={}
  42. local gun=false
  43. local shoot=false
  44. --player
  45. player=nil
  46. --save shoulders
  47. RSH, LSH=nil, nil
  48. --welds
  49. RW, LW=Instance.new("Weld"), Instance.new("Weld")
  50. RW.Name="Right Shoulder" LW.Name="Left Shoulder"
  51. LH=Torso["Left Hip"]
  52. RH=Torso["Right Hip"]
  53. TorsoColor=Torso.BrickColor
  54.  
  55. function swait(num)
  56. if num==0 or num==nil then
  57. --if Stagger.Value==false or Stun.Value<=100 then
  58. game:service'RunService'.Stepped:wait(0)
  59. --end
  60. else
  61. for i=0,num do
  62. game:service'RunService'.Stepped:wait(0)
  63. --[[if Stagger.Value==true or Stun.Value>=100 then
  64. break
  65. end]]
  66. end
  67. end
  68. end
  69.  
  70. if Character:findFirstChild("Ignis",true) ~= nil then
  71. Character:findFirstChild("Ignis",true).Parent = nil
  72. end
  73. if Player.PlayerGui:findFirstChild("WeaponGUI",true) ~= nil then
  74. Player.PlayerGui:findFirstChild("WeaponGUI",true).Parent = nil
  75. end
  76. if Character:findFirstChild("Stats",true) ~= nil then
  77. Character:findFirstChild("Stats",true).Parent = nil
  78. end
  79. local Stats=Instance.new("BoolValue")
  80. Stats.Name="Stats"
  81. Stats.Parent=Character
  82. local Atk=Instance.new("NumberValue")
  83. Atk.Name="Damage"
  84. Atk.Parent=Stats
  85. Atk.Value=1
  86. local Def=Instance.new("NumberValue")
  87. Def.Name="Defense"
  88. Def.Parent=Stats
  89. Def.Value=1
  90. local Speed=Instance.new("NumberValue")
  91. Speed.Name="Speed"
  92. Speed.Parent=Stats
  93. Speed.Value=1
  94. local Mvmt=Instance.new("NumberValue")
  95. Mvmt.Name="Movement"
  96. Mvmt.Parent=Stats
  97. Mvmt.Value=1
  98. local Block=Instance.new("BoolValue")
  99. Block.Name="Block"
  100. Block.Parent=Stats
  101. Block.Value=false
  102. local Stun=Instance.new("NumberValue")
  103. Stun.Name="Stun"
  104. Stun.Parent=Stats
  105. Stun.Value=0
  106. local Stunned=Instance.new("BoolValue")
  107. Stunned.Name="Stunned"
  108. Stunned.Parent=Stats
  109. Stunned.Value=false
  110. local Stagger=Instance.new("BoolValue")
  111. Stagger.Name="Stagger"
  112. Stagger.Parent=Stats
  113. Stagger.Value=false
  114. local StaggerHit=Instance.new("BoolValue")
  115. StaggerHit.Name="StaggerHit"
  116. StaggerHit.Parent=Stats
  117. StaggerHit.Value=false
  118. local RecentEnemy=Instance.new("ObjectValue")
  119. RecentEnemy.Name="RecentEnemy"
  120. RecentEnemy.Parent=Stats
  121. RecentEnemy.Value=nil
  122.  
  123. function NoOutline(Part)
  124. Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10
  125. end
  126.  
  127. function part(formfactor,parent,reflectance,transparency,brickcolor,name,size)
  128. local fp=it("Part")
  129. fp.formFactor=formfactor
  130. fp.Parent=parent
  131. fp.Reflectance=reflectance
  132. fp.Transparency=transparency
  133. fp.CanCollide=false
  134. fp.Locked=true
  135. fp.BrickColor=brickcolor
  136. fp.Name=name
  137. fp.Size=size
  138. fp.Position=Torso.Position
  139. NoOutline(fp)
  140. fp.Material="SmoothPlastic"
  141. fp:BreakJoints()
  142. return fp
  143. end
  144.  
  145. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  146. local mesh=it(Mesh)
  147. mesh.Parent=part
  148. if Mesh=="SpecialMesh" then
  149. mesh.MeshType=meshtype
  150. if meshid~="nil" then
  151. mesh.MeshId="http://www.roblox.com/asset/?id="..meshid
  152. end
  153. end
  154. mesh.Offset=offset
  155. mesh.Scale=scale
  156. return mesh
  157. end
  158.  
  159. function weld(parent,part0,part1,c0)
  160. local weld=it("Weld")
  161. weld.Parent=parent
  162. weld.Part0=part0
  163. weld.Part1=part1
  164. weld.C0=c0
  165. return weld
  166. end
  167.  
  168. local Color1=Torso.BrickColor
  169.  
  170. local fengui=it("GuiMain")
  171. fengui.Parent=Player.PlayerGui
  172. fengui.Name="WeaponGUI"
  173. local fenframe=it("Frame")
  174. fenframe.Parent=fengui
  175. fenframe.BackgroundColor3=Color3.new(255,255,255)
  176. fenframe.BackgroundTransparency=1
  177. fenframe.BorderColor3=Color3.new(17,17,17)
  178. fenframe.Size=UDim2.new(0.0500000007, 0, 0.100000001, 0)
  179. fenframe.Position=UDim2.new(0.4,0,0.1,0)
  180. local fenbarmana1=it("TextLabel")
  181. fenbarmana1.Parent=fenframe
  182. fenbarmana1.Text=" "
  183. fenbarmana1.BackgroundTransparency=0
  184. fenbarmana1.BackgroundColor3=Color3.new(0,0,0)
  185. fenbarmana1.SizeConstraint="RelativeXY"
  186. fenbarmana1.TextXAlignment="Center"
  187. fenbarmana1.TextYAlignment="Center"
  188. fenbarmana1.Position=UDim2.new(0,0,0,0)
  189. fenbarmana1.Size=UDim2.new(4,0,0.2,0)
  190. local fenbarmana2=it("TextLabel")
  191. fenbarmana2.Parent=fenframe
  192. fenbarmana2.Text=" "
  193. fenbarmana2.BackgroundTransparency=0
  194. fenbarmana2.BackgroundColor3=BrickColor.new("Really red").Color
  195. fenbarmana2.SizeConstraint="RelativeXY"
  196. fenbarmana2.TextXAlignment="Center"
  197. fenbarmana2.TextYAlignment="Center"
  198. fenbarmana2.Position=UDim2.new(0,0,0,0)
  199. fenbarmana2.Size=UDim2.new(4*mana/100,0,0.2,0)
  200. local fenbarmana3=it("TextLabel")
  201. fenbarmana3.Parent=fenframe
  202. fenbarmana3.Text=" "
  203. fenbarmana3.BackgroundTransparency=0
  204. fenbarmana3.BackgroundColor3=Color3.new(Col1,Col2,Col3)
  205. fenbarmana3.SizeConstraint="RelativeXY"
  206. fenbarmana3.TextXAlignment="Center"
  207. fenbarmana3.TextYAlignment="Center"
  208. fenbarmana3.Position=UDim2.new(0,0,0,0)
  209. fenbarmana3.Size=UDim2.new(0,0,0.2,0)
  210. local fenbarmana4=it("TextLabel")
  211. fenbarmana4.Parent=fenframe
  212. fenbarmana4.Text="Mana("..mana..")"
  213. fenbarmana4.BackgroundTransparency=1
  214. fenbarmana4.BackgroundColor3=Color3.new(0,0,0)
  215. fenbarmana4.SizeConstraint="RelativeXY"
  216. fenbarmana4.TextXAlignment="Center"
  217. fenbarmana4.TextYAlignment="Center"
  218. fenbarmana4.Position=UDim2.new(0,0,-0.3,0)
  219. fenbarmana4.Size=UDim2.new(4,0,0.2,0)
  220. fenbarmana4.FontSize="Size9"
  221. fenbarmana4.TextStrokeTransparency=0
  222. fenbarmana4.TextColor=BrickColor.new("White")
  223.  
  224. local modelzorz=Instance.new("Model")
  225. modelzorz.Parent=Character
  226. modelzorz.Name="Ignis"
  227.  
  228. local prt1=part(3,modelzorz,0,0,TorsoColor,"Part01",vt())
  229. local prt2=part(3,modelzorz,0,0,BrickColor.new("Black"),"Part02",vt())
  230. local prt3=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part03",vt())
  231. local prt4=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part04",vt())
  232. local prt8=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part08",vt())
  233. local prt9=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part09",vt())
  234. local prt10=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part10",vt())
  235. local prt11=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part11",vt())
  236. local prt12=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part12",vt())
  237. local gprt1=part(3,modelzorz,0,0.9,BrickColor.new("Dusty Rose"),"Gun Part01",vt())
  238. local gprt2=part(3,modelzorz,0.2,0,BrickColor.new("Dusty Rose"),"Gun Part02",vt())
  239. local gprt3=part(3,modelzorz,0.2,0,BrickColor.new("Dusty Rose"),"Gun Part03",vt())
  240. local gprt4=part(3,modelzorz,0.2,0,BrickColor.new("Dusty Rose"),"Gun Part04",vt())
  241. local gprt5=part(3,modelzorz,0.2,0,BrickColor.new("Dusty Rose"),"Gun Part05",vt())
  242. local gprt6=part(3,modelzorz,0.2,0,BrickColor.new("Dusty Rose"),"Gun Part06",vt())
  243. local gprt7=part(3,modelzorz,0,0,BrickColor.new("Really black"),"Gun Part07",vt())
  244. local gprt8=part(3,modelzorz,0.2,0,BrickColor.new("Dusty Rose"),"Gun Part08",vt())
  245. local gprt9=part(3,modelzorz,0,0,BrickColor.new("Really black"),"Gun Part09",vt())
  246. local gprt10=part(3,modelzorz,0.2,0,BrickColor.new("Dusty Rose"),"Gun Part10",vt())
  247. local gprt11=part(3,modelzorz,0,0,BrickColor.new("Black"),"Gun Part11",vt())
  248. local gprt12=part(3,modelzorz,0,0,BrickColor.new("Really red"),"Gun Part12",vt())
  249. local gprt13=part(3,modelzorz,0,0,BrickColor.new("Black"),"Gun Part13",vt())
  250. local gprt14=part(3,modelzorz,0,0,BrickColor.new("Black"),"Gun Part14",vt())
  251. local gprt15=part(3,modelzorz,0,0,BrickColor.new("Really red"),"Gun Part15",vt())
  252. local gprt16=part(3,modelzorz,0,.2,BrickColor.new("Really red"),"Gun Part16",vt())
  253.  
  254. local msh1=mesh("SpecialMesh",prt1,"Head","nil",vt(0,0,0),vt(2.5,6,2.5))
  255. local msh2=mesh("BlockMesh",prt2,"","",vt(0,0,0),vt(1.5,7,1.5))
  256. local msh3=mesh("BlockMesh",prt3,"","",vt(0,0,0),vt(1.6,3,1.6))
  257. local msh4=mesh("BlockMesh",prt4,"","",vt(0,0,0),vt(1.6,9,1))
  258. local msh8=mesh("BlockMesh",prt8,"","",vt(0,0,0),vt(1.6,4,1))
  259. local msh9=mesh("BlockMesh",prt9,"","",vt(0,0,0),vt(1.6,20,2))
  260. local msh10=mesh("SpecialMesh",prt10,"Wedge","nil",vt(0,0,0),vt(1.6,3,2))
  261. local msh11=mesh("BlockMesh",prt11,"","",vt(0,0,0),vt(1.6,17.5,1.5))
  262. local msh12=mesh("SpecialMesh",prt12,"Wedge","nil",vt(0,0,0),vt(1.6,2.1,1.5))
  263. local gmsh1=mesh("BlockMesh",gprt1,"","",vt(0,0,0),vt(1,1,1))
  264. local gmsh2=mesh("BlockMesh",gprt2,"","",vt(0,0,0),vt(2,4,2))
  265. local gmsh3=mesh("SpecialMesh",gprt3,"Wedge","nil",vt(0,0,0),vt(2,2,1))
  266. local gmsh4=mesh("BlockMesh",gprt4,"","",vt(0,0,0),vt(1.99,6,2))
  267. local gmsh5=mesh("SpecialMesh",gprt5,"Wedge","nil",vt(0,0,0),vt(1.99,2,2))
  268. local gmsh6=mesh("BlockMesh",gprt6,"","",vt(0,0,0),vt(2.1,8.6,2))
  269. local gmsh7=mesh("BlockMesh",gprt7,"","",vt(0,0,0),vt(2,8.5,1.99))
  270. local gmsh8=mesh("CylinderMesh",gprt8,"","",vt(0,0,0),vt(2,2,2))
  271. local gmsh9=mesh("CylinderMesh",gprt9,"","",vt(0,0,0),vt(1.5,2.01,1.5))
  272. local gmsh10=mesh("SpecialMesh",gprt10,"Wedge","nil",vt(0,0,0),vt(2,2,2))
  273. local gmsh11=mesh("BlockMesh",gprt11,"","",vt(0,0,0),vt(2.2,2,1))
  274. local gmsh12=mesh("BlockMesh",gprt12,"","",vt(0,0,0),vt(2.21,1.8,.8))
  275. local gmsh13=mesh("BlockMesh",gprt13,"","",vt(0,0,0),vt(2.22,.5,1))
  276. local gmsh14=mesh("BlockMesh",gprt14,"","",vt(0,0,0),vt(2.2,6,1))
  277. local gmsh15=mesh("BlockMesh",gprt15,"","",vt(0,0,0),vt(2.21,5,.9))
  278.  
  279. local wld1=weld(prt1,prt1,Torso,euler(0,1.57,-2.1)*cf(-1.8,-1.7,-.5))
  280. local wld2=weld(prt2,prt2,prt1,euler(0,0,0)*cf(0,0,0))
  281. local wld3=weld(prt3,prt3,prt2,euler(0,0,0)*cf(0,-1,0))
  282. local wld4=weld(prt4,prt4,prt3,euler(0,0,0)*cf(0,-1.2,-.1))
  283. local wld8=weld(prt8,prt8,prt4,euler(1.57,0,0)*cf(0,0,-0.5))
  284. local wld9=weld(prt9,prt9,prt4,euler(0,0,0)*cf(0,-3,0))
  285. local wld10=weld(prt10,prt10,prt9,euler(0,3.14,0)*cf(0,-2.3,0))
  286. local wld11=weld(prt11,prt11,prt4,euler(0,0,0)*cf(0,-2.85,-.36))
  287. local wld12=weld(prt12,prt12,prt11,euler(0,3.14,0)*cf(0,-1.95,0))
  288. local gwld1=weld(gprt1,gprt1,LeftLeg,euler(2.3,0,0)*cf(.6,-.8,.3))
  289. --local gwld1=weld(gprt1,gprt1,LeftArm,euler(1.57,0,0)*cf(0,.9,0))
  290. local gwld2=weld(gprt2,gprt2,gprt1,euler(.7,0,0)*cf(0,0,0))
  291. local gwld3=weld(gprt3,gprt3,gprt2,euler(1.57,3.14,0)*cf(0,.5,0))
  292. local gwld4=weld(gprt4,gprt4,gprt2,euler(0.87,0,0)*cf(0,-.6,.3))
  293. local gwld5=weld(gprt5,gprt5,gprt4,euler(0,3.14,0)*cf(0,-.8,0))
  294. local gwld6=weld(gprt6,gprt6,gprt4,euler(0,0,0)*cf(0,-.25,-.1))
  295. local gwld7=weld(gprt7,gprt7,gprt4,euler(0,0,0)*cf(0,-.25,-.1))
  296. local gwld8=weld(gprt8,gprt8,gprt7,euler(0,0,0)*cf(0,-.9,0))
  297. local gwld9=weld(gprt9,gprt9,gprt8,euler(0,0,0)*cf(0,0,0))
  298. local gwld10=weld(gprt10,gprt10,gprt6,euler(0,0,3.14)*cf(0,1.05,0))
  299. local gwld11=weld(gprt11,gprt11,gprt6,euler(0,0,0)*cf(0,.5,0.1))
  300. local gwld12=weld(gprt12,gprt12,gprt11,euler(0,0,0)*cf(0,0,0))
  301. local gwld13=weld(gprt13,gprt13,gprt11,euler(0,0,0)*cf(0,0,0))
  302. local gwld14=weld(gprt14,gprt14,gprt6,euler(0,0,0)*cf(0,-.1,-.11))
  303. local gwld15=weld(gprt15,gprt15,gprt14,euler(0,0,0)*cf(0,.05,0))
  304. local gwld16=weld(gprt16,gprt16,gprt11,euler(-1.57,0,0)*cf(0,0,0))
  305.  
  306. num=0
  307. num2=0
  308. for i=1,10 do
  309. local prt5=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part05",vt())
  310. local msh5=mesh("BlockMesh",prt5,"","",vt(0,0,0),vt(1.61,2,1.61))
  311. local wld5=weld(prt5,prt5,prt4,cf(0,0,1.05)*euler(1.57+num,0,0))
  312. if i>=3 and i<=9 then
  313. local prt6=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part06",vt())
  314. local msh6=mesh("BlockMesh",prt6,"","",vt(0,0,0),vt(1.6,1.5,2))
  315. local wld6=weld(prt6,prt6,prt5,cf(0,0.1,.3))
  316. local prt7=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part07",vt())
  317. local msh7=mesh("SpecialMesh",prt7,"FileMesh","9756362",vt(0,0,0),vt(.3,.3,.6))
  318. local wld7=weld(prt7,prt7,prt6,euler(0,0,0.785)*cf(0,0,0.2))
  319. end
  320. num=num+0.348
  321. end
  322.  
  323. num=0
  324. for i=1,4 do
  325. local gprt11=part(3,modelzorz,0,0,BrickColor.new("Black"),"Gun Part11",vt())
  326. local gmsh11=mesh("CylinderMesh",gprt11,"","",vt(0,0,0),vt(.6,2.2,.6))
  327. local gwld11=weld(gprt11,gprt11,gprt6,euler(0,0,1.57)*cf(0,-.5-num,0.1))
  328. num=num-.2
  329. end
  330.  
  331. local hitbox=part(3,nil,0,1,BrickColor.new("Black"),"Hitbox",vt(1,1,1))
  332. --hitbox.Anchored=false
  333. local hitbox2=part(3,nil,0,1,BrickColor.new("Black"),"Hitbox",vt(1,1,1))
  334. hitbox2.Anchored=true
  335.  
  336. if (script.Parent.className~="HopperBin") then
  337. Tool=Instance.new("HopperBin")
  338. Tool.Parent=Backpack
  339. Tool.Name="Ignis"
  340. script.Parent=Tool
  341. end
  342. Bin=script.Parent
  343.  
  344. local bodvel=Instance.new("BodyVelocity")
  345. local bg=Instance.new("BodyGyro")
  346.  
  347. so = function(id,par,vol,pit)
  348. coroutine.resume(coroutine.create(function()
  349. local sou = Instance.new("Sound",par or workspace)
  350. sou.Volume=vol
  351. sou.Pitch=pit or 1
  352. sou.SoundId=id
  353. swait()
  354. sou:play()
  355. game:GetService("Debris"):AddItem(sou,6)
  356. end))
  357. end
  358.  
  359. function clerp(a,b,t)
  360. local qa = {QuaternionFromCFrame(a)}
  361. local qb = {QuaternionFromCFrame(b)}
  362. local ax, ay, az = a.x, a.y, a.z
  363. local bx, by, bz = b.x, b.y, b.z
  364. local _t = 1-t
  365. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  366. end
  367.  
  368. function QuaternionFromCFrame(cf)
  369. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  370. local trace = m00 + m11 + m22
  371. if trace > 0 then
  372. local s = math.sqrt(1 + trace)
  373. local recip = 0.5/s
  374. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  375. else
  376. local i = 0
  377. if m11 > m00 then
  378. i = 1
  379. end
  380. if m22 > (i == 0 and m00 or m11) then
  381. i = 2
  382. end
  383. if i == 0 then
  384. local s = math.sqrt(m00-m11-m22+1)
  385. local recip = 0.5/s
  386. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  387. elseif i == 1 then
  388. local s = math.sqrt(m11-m22-m00+1)
  389. local recip = 0.5/s
  390. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  391. elseif i == 2 then
  392. local s = math.sqrt(m22-m00-m11+1)
  393. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  394. end
  395. end
  396. end
  397.  
  398. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  399. local xs, ys, zs = x + x, y + y, z + z
  400. local wx, wy, wz = w*xs, w*ys, w*zs
  401. local xx = x*xs
  402. local xy = x*ys
  403. local xz = x*zs
  404. local yy = y*ys
  405. local yz = y*zs
  406. local zz = z*zs
  407. return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
  408. end
  409.  
  410. function QuaternionSlerp(a, b, t)
  411. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  412. local startInterp, finishInterp;
  413. if cosTheta >= 0.0001 then
  414. if (1 - cosTheta) > 0.0001 then
  415. local theta = math.acos(cosTheta)
  416. local invSinTheta = 1/math.sin(theta)
  417. startInterp = math.sin((1-t)*theta)*invSinTheta
  418. finishInterp = math.sin(t*theta)*invSinTheta
  419. else
  420. startInterp = 1-t
  421. finishInterp = t
  422. end
  423. else
  424. if (1+cosTheta) > 0.0001 then
  425. local theta = math.acos(-cosTheta)
  426. local invSinTheta = 1/math.sin(theta)
  427. startInterp = math.sin((t-1)*theta)*invSinTheta
  428. finishInterp = math.sin(t*theta)*invSinTheta
  429. else
  430. startInterp = t-1
  431. finishInterp = t
  432. end
  433. end
  434. return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
  435. end
  436.  
  437. function hideanim()
  438. equipped=false
  439. for i=0,1,0.5 do
  440. swait()
  441. wld1.C0=clerp(wld1.C0,euler(0,-1.57,-1)*euler(.4,0,0)*cf(0,1,0),.4)
  442. gwld1.C0=clerp(gwld1.C0,euler(2,0,0)*cf(0,1,0),.4)
  443. Neck.C0=clerp(Neck.C0,necko*euler(-.2,0,-.4),.4)
  444. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4)
  445. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(2,0,.2),.4)
  446. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  447. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(.2,0,.2),.4)
  448. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  449. end
  450. for i=0,1,0.2 do
  451. swait()
  452. wld1.C0=clerp(wld1.C0,euler(0,-1.57,-1)*euler(.4,0,0)*cf(0,1,0),.4)
  453. gwld1.C0=clerp(gwld1.C0,euler(2,0,0)*cf(0,1,0),.4)
  454. Neck.C0=clerp(Neck.C0,necko*euler(-.2,0,-.4),.4)
  455. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4)
  456. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(3.4,0,.2),.4)
  457. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  458. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(.2,0,.2),.4)
  459. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  460. RH.C0=clerp(RH.C0,RHC0,.4)
  461. RH.C1=clerp(RH.C1,RHC1,.4)
  462. LH.C0=clerp(LH.C0,LHC0,.4)
  463. LH.C1=clerp(LH.C1,LHC1,.4)
  464. end
  465. Mvmt.Value=Mvmt.Value+.1
  466. wld1.Part1=Torso
  467. wld1.C0=euler(0,1.57,-2.1)*cf(-1.8,-1.7,-.5)
  468. gwld1.Part1=LeftLeg
  469. gwld1.C0=euler(2.3,0,0)*cf(.6,-.8,.3)
  470. for i=0,1,0.3 do
  471. swait()
  472. Neck.C0=clerp(Neck.C0,necko*euler(0,0,0),.4)
  473. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4)
  474. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,0),.4)
  475. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  476. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,0),.4)
  477. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  478. end
  479. end
  480.  
  481. function equipanim()
  482. equipped=true
  483. for i=0,1,0.5 do
  484. swait()
  485. Neck.C0=clerp(Neck.C0,necko*euler(-.2,0,-.4),.4)
  486. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4)
  487. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(2,0,.2),.4)
  488. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  489. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(.2,0,.2),.4)
  490. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  491. end
  492. for i=0,1,0.2 do
  493. swait()
  494. Neck.C0=clerp(Neck.C0,necko*euler(-.2,0,-.4),.4)
  495. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4)
  496. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(3.4,0,.2),.4)
  497. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  498. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(.2,0,.2),.4)
  499. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  500. end
  501. Mvmt.Value=Mvmt.Value-.1
  502. wld1.Part1=RightArm
  503. wld1.C0=euler(0,-1.57,-1)*euler(.4,0,0)*cf(0,1,0)
  504. gwld1.Part1=LeftArm
  505. --gwld1.C0=euler(1.57,0,0)*cf(0,1,0)
  506. gwld1.C0=euler(2,0,0)*cf(0,1,0)
  507. --[[for i=0,2,0.5 do
  508. swait()
  509. wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,0),.3)
  510. gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.4)
  511. Neck.C0=clerp(Neck.C0,necko*euler(-.1,0,-.2),.4)
  512. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4)
  513. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.5,0,.2),.4)
  514. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  515. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,0),.4)
  516. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  517. end]]
  518. end
  519.  
  520. function StaggerAnim()
  521. attack=true
  522. for i=1,math.random(2,4) do
  523. ClangEffect(BrickColor.new("New Yeller"),cf(hitbox.Position)*euler(math.random(-50,50)/100,math.random(-50,50),math.random(-50,50)/100),0,.1,.2,math.random(150,300)/1000)
  524. end
  525. for i=0,1,0.35 do
  526. swait()
  527. Torso.Velocity=RootPart.CFrame.lookVector*-40
  528. wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3)
  529. Neck.C0=clerp(Neck.C0,necko*euler(0,0,.5)*euler(.1,0,0),.3)
  530. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(-.2,0,-.4),.3)
  531. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.2,0,.7)*euler(0,-.7,0),.3)
  532. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  533. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.4)*euler(0,.4,0),.3)
  534. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  535. RH.C0=clerp(RH.C0,cf(1,-.8,0)*euler(0,1.57,0)*euler(-.5,0,.6),.3)
  536. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.2,.2),.3)
  537. end
  538. for i=0,1,0.2 do
  539. swait()
  540. Torso.Velocity=RootPart.CFrame.lookVector*-40
  541. wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3)
  542. Neck.C0=clerp(Neck.C0,necko*euler(0,0,.5)*euler(.1,0,0),.4)
  543. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-.2)*euler(-.5,0,-.4),.4)
  544. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.2,0,.7)*euler(0,-.7,0),.4)
  545. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  546. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.4)*euler(0,.4,0),.4)
  547. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  548. RH.C0=clerp(RH.C0,cf(1,-.8,0)*euler(0,1.57,0)*euler(-.5,0,.6),.4)
  549. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.2,.5),.4)
  550. end
  551. for i=0,1,0.1 do
  552. swait()
  553. wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3)
  554. Neck.C0=clerp(Neck.C0,necko*euler(0,0,.4)*euler(.5,0,0),.3)
  555. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-1.8)*euler(-.2,0,-.4),.3)
  556. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.3,0,.4)*euler(0,-.4,0),.3)
  557. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  558. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.3,0,-.2)*euler(0,.4,0),.3)
  559. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  560. RH.C0=clerp(RH.C0,cf(1,-.8,0)*euler(0,1.57,0)*euler(-.5,0,1.2),.3)
  561. LH.C0=clerp(LH.C0,cf(-1,0,-1)*euler(0,-1.57,0)*euler(0,.2,.2),.3)
  562. end
  563. swait(15)
  564. combo=0
  565. attack=false
  566. end
  567.  
  568. function StaggerHitt()
  569. attack=true
  570. for i=1,math.random(2,4) do
  571. ClangEffect(BrickColor.new("New Yeller"),cf(hitbox.Position)*euler(math.random(-50,50)/100,math.random(-50,50),math.random(-50,50)/100),0,.1,.2,math.random(150,300)/1000)
  572. end
  573. for i=0,1,0.1 do
  574. swait()
  575. wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3)
  576. Neck.C0=clerp(Neck.C0,necko*euler(0,0,.7)*euler(.1,0,0),.3)
  577. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(-.2,0,-.6),.3)
  578. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.4,0,.9)*euler(0,-.7,0),.3)
  579. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  580. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.4)*euler(0,.4,0),.3)
  581. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  582. RH.C0=clerp(RH.C0,cf(1,-.8,0)*euler(0,1.57,0)*euler(-.2,0,-.4),.3)
  583. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.2,.2),.3)
  584. end
  585. attack=false
  586. end
  587.  
  588. function StunAnim()
  589. attack=true
  590. Stunned.Value=true
  591. for i=0,1,0.3 do
  592. swait()
  593. Humanoid.WalkSpeed=0
  594. wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3)
  595. Neck.C0=clerp(Neck.C0,necko*euler(-.2,0,-.5),.2)
  596. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(.2,0,-3),.2)
  597. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.2,0,1.3),.2)
  598. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  599. LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(1,0,.4)*euler(0,-.1,0),.2)
  600. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  601. RH.C0=clerp(RH.C0,cf(1,-.6,0)*euler(0,1.57,0)*euler(-.5,0,.3),.25)
  602. LH.C0=clerp(LH.C0,cf(-1,-.8,0)*euler(0,-1.57,0)*euler(-.2,0,0),.25)
  603. end
  604. for i=0,1,0.3 do
  605. swait()
  606. Humanoid.WalkSpeed=0
  607. wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3)
  608. Neck.C0=clerp(Neck.C0,necko*euler(-.3,0,-.5),.2)
  609. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-.5)*euler(.8,0,-3),.2)
  610. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.8,0,1.3),.2)
  611. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  612. LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(1.2,0,.8)*euler(0,-.1,0),.2)
  613. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  614. RH.C0=clerp(RH.C0,cf(1,-.6,0)*euler(0,1.57,0)*euler(-.5,0,.6),.25)
  615. LH.C0=clerp(LH.C0,cf(-1,-.8,0)*euler(0,-1.57,0)*euler(.1,0,.7),.25)
  616. end
  617. for i=0,1,0.3 do
  618. swait()
  619. Humanoid.WalkSpeed=0
  620. wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3)
  621. Neck.C0=clerp(Neck.C0,necko*euler(-.3,0,-1),.2)
  622. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-2)*euler(1.57,0,-3),.2)
  623. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.8,0,1.3),.2)
  624. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  625. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.2,0,-.8)*euler(0,-.1,0),.2)
  626. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  627. RH.C0=clerp(RH.C0,cf(1,-.6,0)*euler(0,1.57,0)*euler(-.2,0,.6),.25)
  628. LH.C0=clerp(LH.C0,cf(-1,-.8,0)*euler(0,-1.57,0)*euler(-.1,0,.3),.25)
  629. end
  630. gairo=Instance.new("BodyGyro")
  631. gairo.Parent=RootPart
  632. gairo.maxTorque=Vector3.new(4e+005,4e+005,4e+005)*math.huge
  633. gairo.P=20e+003
  634. gairo.cframe=RootPart.CFrame
  635. v=Instance.new("BodyVelocity",RootPart)
  636. v.Name="BodVel"
  637. v.P=2000
  638. v.maxForce=Vector3.new(500000000,50000000,500000000)
  639. v.velocity=vt(0,-50,0)
  640. for i=0,1,0.1 do
  641. swait()
  642. Humanoid.WalkSpeed=0
  643. v.velocity=vt(0,-50,0)
  644. wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3)
  645. Neck.C0=clerp(Neck.C0,necko*euler(0,0,-1.57),.3)
  646. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-2.5)*euler(1.57,0,-3.14),.3)
  647. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1.57,0,1.5)*euler(.2,0,0),.3)
  648. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  649. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.5,0,-1.57)*euler(0,0,0),.3)
  650. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  651. RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(-.3,.5,0),.3)
  652. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(-.1,.2,0),.3)
  653. end
  654. for i=1,70 do
  655. swait()
  656. Humanoid.WalkSpeed=0
  657. v.velocity=vt(0,-50,0)
  658. end
  659. v.velocity=vt(0,0,0)
  660. for i=0,1,0.2 do
  661. swait()
  662. wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3)
  663. Neck.C0=clerp(Neck.C0,necko*euler(.2,0,0),.3)
  664. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-2)*euler(1,0,-4),.3)
  665. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1.57,0,1)*euler(.2,-1,0),.3)
  666. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  667. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.2,0,.2)*euler(0,0,0),.3)
  668. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  669. RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(-.3,.5,.4),.3)
  670. LH.C0=clerp(LH.C0,cf(-1,-1,-1)*euler(0,-1.57,0)*euler(-.1,.2,1),.3)
  671. end
  672. gairo.Parent=nil
  673. v.Parent=nil
  674. combo=0
  675. Stunned.Value=false
  676. attack=false
  677. end
  678.  
  679. function attackone()
  680. attack=true
  681. for i=0,1,0.2 do
  682. swait()
  683. wld1.C0=clerp(wld1.C0,euler(2.9,0,3.14)*cf(0,1,.2),.4)
  684. Neck.C0=clerp(Neck.C0,necko*euler(.2,0,.5),.4)
  685. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,-.5),.4)
  686. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(2,0,1),.4)
  687. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  688. LW.C0=clerp(LW.C0,cf(-1.3,0.5,-.3)*euler(.4,0,.2)*euler(0,-.2,0),.4)
  689. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  690. RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,.5,0),.4)
  691. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.5,0),.4)
  692. if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then
  693. break
  694. end
  695. end
  696. con1=hitbox.Touched:connect(function(hit) Damagefunc(hit,10,15,math.random(5,10),"Normal",RootPart,.5,1,math.random(3,10),nil,true) end)
  697. hitbox.Parent=modelzorz
  698. hitbox.Size=vt(.5,7,1)
  699. hitbox.CFrame=prt9.CFrame*cf(0,-1,.4)
  700. blcf=nil
  701. scfr=nil
  702. for i=0,1,0.3 do
  703. swait()
  704. local blcf = prt9.CFrame*cf(0,-1,0)
  705. if scfr and (prt9.Position-scfr.p).magnitude > .1 then
  706. local h = 7
  707. local a,b = Triangle((scfr*CFrame.new(0,h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p,(blcf*CFrame.new(0,h/2,0)).p)
  708. if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end
  709. local a,b = Triangle((blcf*CFrame.new(0,h/2,0)).p,(blcf*CFrame.new(0,-h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p)
  710. if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end
  711. scfr = blcf
  712. elseif not scfr then
  713. scfr = blcf
  714. end
  715. hitbox.CFrame=prt9.CFrame*cf(0,-1,.4)
  716. wld1.C0=clerp(wld1.C0,euler(1.2,0,3.14)*cf(0,1,0),.4)
  717. --wld1.C0=clerp(wld1.C0,euler(2,0,3.14)*cf(0,1,.2),.4)
  718. Neck.C0=clerp(Neck.C0,necko*euler(0,0,-.5)*euler(.2,0,0),.4)
  719. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,.5),.4)
  720. RW.C0=clerp(RW.C0,cf(1.2,0.5,-.3)*euler(.2,0,-.2)*euler(0,-.5,0),.4)
  721. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  722. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.4,0,-.2),.4)
  723. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  724. RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,-.5,0),.4)
  725. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,-.5,0),.4)
  726. if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then
  727. break
  728. end
  729. end
  730. for i=0,1,0.2 do
  731. swait()
  732. local blcf = prt9.CFrame*cf(0,-1,0)
  733. if scfr and (prt9.Position-scfr.p).magnitude > .1 then
  734. local h = 7
  735. local a,b = Triangle((scfr*CFrame.new(0,h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p,(blcf*CFrame.new(0,h/2,0)).p)
  736. if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end
  737. local a,b = Triangle((blcf*CFrame.new(0,h/2,0)).p,(blcf*CFrame.new(0,-h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p)
  738. if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end
  739. scfr = blcf
  740. elseif not scfr then
  741. scfr = blcf
  742. end
  743. hitbox.CFrame=prt9.CFrame*cf(0,-1,.4)
  744. wld1.C0=clerp(wld1.C0,euler(1.5,0,3.14)*euler(0,0,.3)*cf(0,1,0),.4)
  745. --wld1.C0=clerp(wld1.C0,euler(2,0,3.14)*cf(0,1,.2),.4)
  746. Neck.C0=clerp(Neck.C0,necko*euler(0,0,-.5)*euler(.2,0,0),.4)
  747. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,.5),.4)
  748. RW.C0=clerp(RW.C0,cf(1,0.5,-.5)*euler(.6,0,-1)*euler(0,-.7,0),.4)
  749. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  750. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.4,0,-.2),.4)
  751. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  752. RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,-.5,0),.4)
  753. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,-.5,0),.4)
  754. if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then
  755. break
  756. end
  757. end
  758. con1:disconnect()
  759. hitbox.Parent=nil
  760. attack=false
  761. end
  762.  
  763. function attacktwo()
  764. attack=true
  765. for i=0,1,0.2 do
  766. swait()
  767. wld1.C0=clerp(wld1.C0,euler(1.5,0,3.14)*cf(0,1,0),.4)
  768. Neck.C0=clerp(Neck.C0,necko*euler(0,0,-.7)*euler(.2,0,0),.4)
  769. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,.7),.4)
  770. RW.C0=clerp(RW.C0,cf(1,0.5,-.5)*euler(1.57,0,-1)*euler(0,1.2,0),.4)
  771. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  772. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.8,0,-.4),.4)
  773. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  774. RH.C0=clerp(RH.C0,cf(.8,-1,.2)*euler(0,1.57,0)*euler(0,-.7,0),.4)
  775. LH.C0=clerp(LH.C0,cf(-.8,-1,.2)*euler(0,-1.57,0)*euler(0,-.7,0),.4)
  776. if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then
  777. break
  778. end
  779. end
  780. con1=hitbox.Touched:connect(function(hit) Damagefunc(hit,10,15,math.random(5,10),"Normal",RootPart,.5,1,math.random(3,10),nil,true) end)
  781. hitbox.Parent=modelzorz
  782. hitbox.Size=vt(.5,7,1)
  783. hitbox.CFrame=prt9.CFrame*cf(0,-1,.4)
  784. blcf=nil
  785. scfr=nil
  786. for i=0,1,0.3 do
  787. swait()
  788. local blcf = prt9.CFrame*cf(0,-1,0)
  789. if scfr and (prt9.Position-scfr.p).magnitude > .1 then
  790. local h = 7
  791. local a,b = Triangle((scfr*CFrame.new(0,h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p,(blcf*CFrame.new(0,h/2,0)).p)
  792. if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end
  793. local a,b = Triangle((blcf*CFrame.new(0,h/2,0)).p,(blcf*CFrame.new(0,-h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p)
  794. if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end
  795. scfr = blcf
  796. elseif not scfr then
  797. scfr = blcf
  798. end
  799. hitbox.CFrame=prt9.CFrame*cf(0,-1,.4)
  800. wld1.C0=clerp(wld1.C0,euler(.5,0,3.14)*cf(0,1,.2),.4)
  801. Neck.C0=clerp(Neck.C0,necko*euler(0,0,.5)*euler(0,0,0),.4)
  802. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,-.5),.4)
  803. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.3,0,1)*euler(0,1.6,0),.4)
  804. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  805. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.2),.4)
  806. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  807. RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,.5,0),.4)
  808. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.5,0),.4)
  809. if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then
  810. break
  811. end
  812. end
  813. for i=0,1,0.2 do
  814. swait()
  815. local blcf = prt9.CFrame*cf(0,-1,0)
  816. if scfr and (prt9.Position-scfr.p).magnitude > .1 then
  817. local h = 7
  818. local a,b = Triangle((scfr*CFrame.new(0,h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p,(blcf*CFrame.new(0,h/2,0)).p)
  819. if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end
  820. local a,b = Triangle((blcf*CFrame.new(0,h/2,0)).p,(blcf*CFrame.new(0,-h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p)
  821. if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end
  822. scfr = blcf
  823. elseif not scfr then
  824. scfr = blcf
  825. end
  826. hitbox.CFrame=prt9.CFrame*cf(0,-1,.4)
  827. wld1.C0=clerp(wld1.C0,euler(.3,0,3.14)*cf(0,1,.2),.4)
  828. Neck.C0=clerp(Neck.C0,necko*euler(0,0,.5)*euler(.1,0,0),.4)
  829. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,-.5),.4)
  830. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1,0,.8)*euler(0,1.3,0),.4)
  831. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  832. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.2),.4)
  833. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  834. RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,.5,0),.4)
  835. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.5,0),.4)
  836. if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then
  837. break
  838. end
  839. end
  840. con1:disconnect()
  841. hitbox.Parent=nil
  842. attack=false
  843. end
  844.  
  845. function attackthree()
  846. attack=true
  847. for i=0,1,0.15 do
  848. swait()
  849. wld1.C0=clerp(wld1.C0,euler(2.9,0,3.14)*cf(0,1,.2),.4)
  850. gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.4)
  851. Neck.C0=clerp(Neck.C0,necko*euler(0,0,1.57),.4)
  852. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-.2)*euler(0,0,-1.57),.4)
  853. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.3,0,.5),.4)
  854. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  855. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.57,0,-1.57),.4)
  856. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  857. RH.C0=clerp(RH.C0,cf(.5,-1,-.2)*euler(0,1.57,0)*euler(-.4,1.57,0),.4)
  858. LH.C0=clerp(LH.C0,cf(-.5,-1,.2)*euler(0,-1.57,0)*euler(.2,1.57,0),.4)
  859. if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then
  860. break
  861. end
  862. end
  863. for i=1,2 do
  864. LW.C0=cf(-1.5,0.5,0)*euler(1.57,0,-1.57)
  865. Shootcombo()
  866. for i=0,1,0.3 do
  867. swait()
  868. gwld6.C0=clerp(gwld6.C0,euler(0,0,0)*cf(0,.5,-.1),.6)
  869. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.57,0,-1.57)*euler(.5,0,0),.5)
  870. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.5)
  871. if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then
  872. break
  873. end
  874. end
  875. for i=0,1,0.2 do
  876. swait()
  877. gwld6.C0=clerp(gwld6.C0,euler(0,0,0)*cf(0,-.25,-.1),.4)
  878. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.57,0,-1.57),.4)
  879. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  880. if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then
  881. break
  882. end
  883. end
  884. if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then
  885. break
  886. end
  887. end
  888. attack=false
  889. end
  890.  
  891. function attackfour()
  892. attack=true
  893. for i=0,1,0.2 do
  894. swait()
  895. wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.4)
  896. Neck.C0=clerp(Neck.C0,necko*euler(0,0,.2),.4)
  897. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,-.3),.4)
  898. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1,0,1.2)*euler(0,-2,0),.4)
  899. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  900. LW.C0=clerp(LW.C0,cf(-1.4,0.5,-.2)*euler(.7,0,.1)*euler(0,-.4,0),.4)
  901. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  902. RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,.3,0),.4)
  903. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.3,0),.4)
  904. if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then
  905. break
  906. end
  907. end
  908. con1=hitbox.Touched:connect(function(hit) Damagefunc(hit,15,20,math.random(5,10),"Normal",RootPart,.5,2,math.random(10,20),nil,true) end)
  909. hitbox.Parent=modelzorz
  910. hitbox.Size=vt(.5,7,1)
  911. hitbox.CFrame=prt9.CFrame*cf(0,-1,.4)
  912. blcf=nil
  913. scfr=nil
  914. for i=0,1,0.1 do
  915. swait()
  916. Torso.Velocity=RootPart.CFrame.lookVector*40
  917. local blcf = prt9.CFrame*cf(0,-1,0)
  918. if scfr and (prt9.Position-scfr.p).magnitude > .1 then
  919. local h = 7
  920. local a,b = Triangle((scfr*CFrame.new(0,h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p,(blcf*CFrame.new(0,h/2,0)).p)
  921. if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end
  922. local a,b = Triangle((blcf*CFrame.new(0,h/2,0)).p,(blcf*CFrame.new(0,-h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p)
  923. if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end
  924. scfr = blcf
  925. elseif not scfr then
  926. scfr = blcf
  927. end
  928. hitbox.CFrame=prt9.CFrame*cf(0,-1,.4)
  929. wld1.C0=clerp(wld1.C0,euler(.5,0,3.14)*cf(0,1,.2),.35)
  930. Neck.C0=clerp(Neck.C0,necko*euler(.2,0,-.6),.35)
  931. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,.6),.35)
  932. RW.C0=clerp(RW.C0,cf(1,0.5,-0.5)*euler(1.2,0,-1.2)*euler(0,-1.2,0),.35)
  933. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.35)
  934. LW.C0=clerp(LW.C0,cf(-1.4,0.5,-.2)*euler(-.4,0,-.7)*euler(0,0,0),.35)
  935. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.35)
  936. RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,-.6,0),.35)
  937. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,-.6,0),.35)
  938. if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then
  939. break
  940. end
  941. end
  942. con1:disconnect()
  943. hitbox.Parent=nil
  944. attack=false
  945. end
  946.  
  947. function Punishment()
  948. attack=true
  949. local ref=part(3,workspace,0,1,BrickColor.new("Black"),"Effect",vt())
  950. ref.Anchored=true
  951. ref.CFrame=RootPart.CFrame*cf(0,0,-2)
  952. game:GetService("Debris"):AddItem(ref,1)
  953. for _,c in pairs(workspace:children()) do
  954. local hum=c:findFirstChild("Humanoid")
  955. if hum~=nil then
  956. local head=c:findFirstChild("HumanoidRootPart")
  957. if head~=nil then
  958. if GetDist(head,ref,3)==true then
  959. if head.Parent:findFirstChild("Stats")~=nil then
  960. if head.Parent.Stats.Stunned.Value==true then
  961. Mvmt.Value=Mvmt.Value-1
  962. for i=0,1,0.3 do
  963. swait()
  964. wld1.C0=clerp(wld1.C0,euler(-2,0,3.14)*cf(0,1,.2),.4)
  965. gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.4)
  966. Neck.C0=clerp(Neck.C0,necko*euler(0,0,-1.57)*euler(.2,0,0),.4)
  967. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,1.57),.4)
  968. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.57,0,1.57)*euler(2,0,0),.4)
  969. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  970. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.4),.4)
  971. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  972. RH.C0=clerp(RH.C0,cf(.5,-1,.2)*euler(0,1.57,0)*euler(0,-1.57,0),.4)
  973. LH.C0=clerp(LH.C0,cf(-.5,-1,-.2)*euler(0,-1.57,0)*euler(0,-1.57,0),.4)
  974. end
  975. for i=0,1,0.18 do
  976. swait()
  977. wld1.C0=clerp(wld1.C0,euler(-1.57,0,3.14)*cf(0,1,.2),.4)
  978. gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.4)
  979. Neck.C0=clerp(Neck.C0,necko*euler(0,0,-1.57)*euler(.2,0,0),.4)
  980. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,1.57),.4)
  981. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.57,0,1.57),.4)
  982. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  983. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.4),.4)
  984. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  985. RH.C0=clerp(RH.C0,cf(.5,-1,.2)*euler(0,1.57,0)*euler(0,-1.57,0),.4)
  986. LH.C0=clerp(LH.C0,cf(-.5,-1,-.2)*euler(0,-1.57,0)*euler(0,-1.57,0),.4)
  987. end
  988. DecreaseStat(head.Parent,"Defense",.3,300)
  989. Damagefunc(head,10,20,math.random(5,10),"Normal",RootPart,.2,2,0,nil,nil,false)
  990. for i=0,1,0.05 do
  991. swait()
  992. MagicBlock(BrickColor.new("Really red"),cf(head.Parent.Torso.Position),1,1,1,2,2,2,.1,1)
  993. wld1.C0=clerp(wld1.C0,euler(-1.17,0,3.14)*cf(0,1,.2),.2)
  994. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,1.57),.2)
  995. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.57,0,1.57)*euler(-.4,0,0),.2)
  996. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.4),.4)
  997. RH.C0=clerp(RH.C0,cf(.5,-1,.2)*euler(0,1.57,0)*euler(0,-1.57,0),.4)
  998. LH.C0=clerp(LH.C0,cf(-.5,-1,-.2)*euler(0,-1.57,0)*euler(0,-1.57,0),.4)
  999. end
  1000. Neck.C0=necko*euler(0,0,-1.57)*euler(.2,0,0)
  1001. swait(10)
  1002. Mvmt.Value=Mvmt.Value+1
  1003. end
  1004. end
  1005. end
  1006. end
  1007. end
  1008. end
  1009. attack=false
  1010. end
  1011.  
  1012. function GunStance()
  1013. attack=true
  1014. gun=true
  1015. Mvmt.Value=Mvmt.Value-.4
  1016. for i=0,1,0.1 do
  1017. swait()
  1018. wld1.C0=clerp(wld1.C0,euler(2.9,0,3.14)*cf(0,1,.2),.2)
  1019. gwld6.C0=clerp(gwld6.C0,euler(0,0,0)*cf(0,-.25,-.1),.4)
  1020. --gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.4)
  1021. gwld1.C0=euler(1.57-8*i,0,0)*cf(0,1,0)
  1022. Neck.C0=clerp(Neck.C0,necko*euler(0,0,1.57)*euler(-.4,0,0),.2)
  1023. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-.2)*euler(0,0,-1.57),.2)
  1024. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.3,0,1),.2)
  1025. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1026. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.57,0,-1.57)*euler(1,0,0),.2)
  1027. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1028. RH.C0=clerp(RH.C0,cf(.5,-1,-.2)*euler(0,1.57,0)*euler(-.4,1.57,0),.2)
  1029. LH.C0=clerp(LH.C0,cf(-.5,-1,.2)*euler(0,-1.57,0)*euler(.2,1.57,0),.2)
  1030. end
  1031. RootJoint.C0=RootCF*cf(0,0,-.2)*euler(0,0,-1.57)
  1032. LW.C0=cf(-1.5,0.5,0)*euler(1.57,0,-1.57)
  1033. gairo=Instance.new("BodyGyro")
  1034. gairo.Parent=RootPart
  1035. gairo.maxTorque=Vector3.new(4e+005,4e+005,4e+005)*math.huge
  1036. gairo.P=20e+003
  1037. gairo.cframe=RootPart.CFrame
  1038. local offset=nil
  1039. while gun==true do
  1040. swait()
  1041. local gunpos=vt(MMouse.Hit.p.x,Head.Position.Y,MMouse.Hit.p.z)
  1042. offset=(Torso.Position.y-MMouse.Hit.p.y)/60
  1043. mag=(Torso.Position-MMouse.Hit.p).magnitude/80
  1044. offset=offset/mag
  1045. gairo.cframe=cf(Head.Position,gunpos)
  1046. gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.3)
  1047. Neck.C0=clerp(Neck.C0,necko*euler(0,0,1.57),.3)
  1048. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(offset,0,0),.2)
  1049. end
  1050. Mvmt.Value=Mvmt.Value+.4
  1051. if shoot==true then
  1052. for i=0,1,0.1 do
  1053. swait()
  1054. gwld6.C0=clerp(gwld6.C0,euler(0,0,0)*cf(0,.5,-.1),.6)
  1055. gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.2)
  1056. Neck.C0=clerp(Neck.C0,necko*euler(0,0,1.57)*euler(0,0,0),.2)
  1057. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.57,0,-1.57)*euler(1,0,0),.2)
  1058. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1059. end
  1060. end
  1061. gairo.Parent=nil
  1062. shoot=false
  1063. attack=false
  1064. end
  1065.  
  1066. function Shootcombo()
  1067. table.insert(Effects,{gprt16.CFrame.lookVector,"Shoot",30,gprt8.Position,5,10,0,1})
  1068. end
  1069.  
  1070. function Shoot1()
  1071. table.insert(Effects,{gprt16.CFrame.lookVector,"Shoot",100,gprt8.Position,10,20,math.random(10,20),2})
  1072. end
  1073.  
  1074. function DecreaseStat(Model,Stat,Amount,Duration)
  1075. if Model:findFirstChild("Stats")~=nil then
  1076. if Model.Stats[Stat]~=nil then
  1077. Model.Stats[Stat].Value=Model.Stats[Stat].Value-Amount
  1078. table.insert(Effects,{Model,"DecreaseStat",Stat,Amount,Duration})
  1079. end
  1080. end
  1081. end
  1082.  
  1083. function GetDist(Part1,Part2,magni)
  1084. local targ=Part1.Position-Part2.Position
  1085. local mag=targ.magnitude
  1086. if mag<=magni then
  1087. return true
  1088. else
  1089. return false
  1090. end
  1091. end
  1092.  
  1093. function MagniDamage(Part,magni,mindam,maxdam,knock,Type)
  1094. for _,c in pairs(workspace:children()) do
  1095. local hum=c:findFirstChild("Humanoid")
  1096. if hum~=nil then
  1097. local head=c:findFirstChild("Torso")
  1098. if head~=nil then
  1099. local targ=head.Position-Part.Position
  1100. local mag=targ.magnitude
  1101. if mag<=magni and c.Name~=Player.Name then
  1102. Damagefunc(head,mindam,maxdam,knock,Type,RootPart,.2,1,3)
  1103. end
  1104. end
  1105. end
  1106. end
  1107. end
  1108.  
  1109. function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  1110. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  1111. end
  1112.  
  1113. local Point=Torso.CFrame*cf(0,Torso.Size.Y,0)
  1114. LastPoint=Point
  1115. function effect(Color,Ref,LP,P1,returnn)
  1116. if LP==nil or P1==nil then return end
  1117. local effectsmsh=Instance.new("CylinderMesh")
  1118. effectsmsh.Scale=Vector3.new(0.2,1,0.2)
  1119. effectsmsh.Name="Mesh"
  1120. local effectsg=Instance.new("Part")
  1121. NoOutline(effectsg)
  1122. effectsg.formFactor=3
  1123. effectsg.CanCollide=false
  1124. effectsg.Name="Eff"
  1125. effectsg.Locked=true
  1126. effectsg.Anchored=true
  1127. effectsg.Size=Vector3.new(0.5,1,0.5)
  1128. effectsg.Parent=workspace
  1129. effectsmsh.Parent=effectsg
  1130. effectsg.BrickColor=BrickColor.new(Color)
  1131. effectsg.Reflectance=Ref
  1132. local point1=P1
  1133. local mg=(LP.p - point1.p).magnitude
  1134. effectsg.Size=Vector3.new(0.5,mg,0.5)
  1135. effectsg.CFrame=cf((LP.p+point1.p)/2,point1.p) * CFrame.Angles(math.rad(90),0,0)
  1136. effectsmsh.Scale=Vector3.new(0.2,1,0.2)
  1137. game:GetService("Debris"):AddItem(effectsg,2)
  1138. if returnn then return effectsg end
  1139. if not returnn then
  1140. table.insert(Effects,{effectsg,"Cylinder",0.2,0.01,0,0.01,effectsmsh})
  1141. end
  1142. end
  1143.  
  1144. local function CFrameFromTopBack(at, top, back)
  1145. local right = top:Cross(back)
  1146. return CFrame.new(at.x, at.y, at.z,
  1147. right.x, top.x, back.x,
  1148. right.y, top.y, back.y,
  1149. right.z, top.z, back.z)
  1150. end
  1151.  
  1152. function Triangle(a, b, c)
  1153. local edg1 = (c-a):Dot((b-a).unit)
  1154. local edg2 = (a-b):Dot((c-b).unit)
  1155. local edg3 = (b-c):Dot((a-c).unit)
  1156. if edg1 <= (b-a).magnitude and edg1 >= 0 then
  1157. a, b, c = a, b, c
  1158. elseif edg2 <= (c-b).magnitude and edg2 >= 0 then
  1159. a, b, c = b, c, a
  1160. elseif edg3 <= (a-c).magnitude and edg3 >= 0 then
  1161. a, b, c = c, a, b
  1162. else
  1163. assert(false, "unreachable")
  1164. end
  1165.  
  1166. local len1 = (c-a):Dot((b-a).unit)
  1167. local len2 = (b-a).magnitude - len1
  1168. local width = (a + (b-a).unit*len1 - c).magnitude
  1169.  
  1170. local maincf = CFrameFromTopBack(a, (b-a):Cross(c-b).unit, -(b-a).unit)
  1171.  
  1172. local list = {}
  1173.  
  1174. if len1 > 0.01 then
  1175. local w1 = Instance.new('WedgePart', m)
  1176. game:GetService("Debris"):AddItem(w1,5)
  1177. w1.Material = "SmoothPlastic"
  1178. w1.FormFactor = 'Custom'
  1179. w1.BrickColor = BrickColor.new("Bright red")
  1180. w1.Transparency = 0
  1181. w1.Reflectance = 0
  1182. w1.Material = "SmoothPlastic"
  1183. w1.CanCollide = false
  1184. NoOutline(w1)
  1185. local sz = Vector3.new(0.2, width, len1)
  1186. w1.Size = sz
  1187. local sp = Instance.new("SpecialMesh",w1)
  1188. sp.MeshType = "Wedge"
  1189. sp.Scale = Vector3.new(0,1,1) * sz/w1.Size
  1190. w1:BreakJoints()
  1191. w1.Anchored = true
  1192. w1.Parent = workspace
  1193. w1.Transparency = 0.7
  1194. table.insert(Effects,{w1,"Disappear",.05})
  1195. w1.CFrame = maincf*CFrame.Angles(math.pi,0,math.pi/2)*CFrame.new(0,width/2,len1/2)
  1196. table.insert(list,w1)
  1197. end
  1198.  
  1199. if len2 > 0.01 then
  1200. local w2 = Instance.new('WedgePart', m)
  1201. game:GetService("Debris"):AddItem(w2,5)
  1202. w2.Material = "SmoothPlastic"
  1203. w2.FormFactor = 'Custom'
  1204. w2.BrickColor = BrickColor.new("Bright red")
  1205. w2.Transparency = 0
  1206. w2.Reflectance = 0
  1207. w2.Material = "SmoothPlastic"
  1208. w2.CanCollide = false
  1209. NoOutline(w2)
  1210. local sz = Vector3.new(0.2, width, len2)
  1211. w2.Size = sz
  1212. local sp = Instance.new("SpecialMesh",w2)
  1213. sp.MeshType = "Wedge"
  1214. sp.Scale = Vector3.new(0,1,1) * sz/w2.Size
  1215. w2:BreakJoints()
  1216. w2.Anchored = true
  1217. w2.Parent = workspace
  1218. w2.Transparency = 0.7
  1219. table.insert(Effects,{w2,"Disappear",.05})
  1220. w2.CFrame = maincf*CFrame.Angles(math.pi,math.pi,-math.pi/2)*CFrame.new(0,width/2,-len1 - len2/2)
  1221. table.insert(list,w2)
  1222. end
  1223. return unpack(list)
  1224. end
  1225.  
  1226. function MagicBlock(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay,Type,parent)
  1227. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt())
  1228. prt.Anchored=true
  1229. prt.CFrame=cframe
  1230. msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  1231. game:GetService("Debris"):AddItem(prt,5)
  1232. if Type==1 or Type==nil then
  1233. table.insert(Effects,{prt,"Block1",delay,x3,y3,z3,msh})
  1234. elseif Type==2 then
  1235. table.insert(Effects,{prt,"Block2",delay,x3,y3,z3,msh})
  1236. end
  1237. end
  1238.  
  1239. function MagicCircle(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  1240. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt())
  1241. prt.Anchored=true
  1242. prt.CFrame=cframe
  1243. local msh=mesh("SpecialMesh",prt,"Sphere","nil",vt(0,0,0),vt(x1,y1,z1))
  1244. game:GetService("Debris"):AddItem(prt,2)
  1245. table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh})
  1246. end
  1247.  
  1248. function MagicCylinder(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  1249. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt())
  1250. prt.Anchored=true
  1251. prt.CFrame=cframe
  1252. local msh=mesh("CylinderMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  1253. game:GetService("Debris"):AddItem(prt,2)
  1254. table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh})
  1255. end
  1256.  
  1257. function MagicHead(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  1258. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt())
  1259. prt.Anchored=true
  1260. prt.CFrame=cframe
  1261. local msh=mesh("SpecialMesh",prt,"Head","nil",vt(0,0,0),vt(x1,y1,z1))
  1262. game:GetService("Debris"):AddItem(prt,2)
  1263. table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh})
  1264. end
  1265.  
  1266. function ClangEffect(brickcolor,cframe,duration,decrease,size,power)
  1267. local prt=part(3,workspace,0,1,brickcolor,"Effect",vt())
  1268. prt.Anchored=true
  1269. prt.CFrame=cframe
  1270. local msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(5,5,5))
  1271. game:GetService("Debris"):AddItem(prt,2)
  1272. table.insert(Effects,{prt,"CylinderClang",duration,decrease,size,power,prt.CFrame,nil})
  1273. end
  1274.  
  1275. function MagicWave(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  1276. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt())
  1277. prt.Anchored=true
  1278. prt.CFrame=cframe
  1279. local msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=20329976",vt(0,0,0),vt(x1,y1,z1))
  1280. game:GetService("Debris"):AddItem(prt,5)
  1281. table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh})
  1282. end
  1283.  
  1284. Damagefunc=function(hit,minim,maxim,knockback,Type,Property,Delay,KnockbackType,incstun,stagger,staghit,ranged)
  1285. if hit.Parent==nil then
  1286. return
  1287. end
  1288. if hit.Name=="Hitbox" and hit.Parent~=modelzorz then
  1289. StaggerHit.Value=true
  1290. end
  1291. h=hit.Parent:FindFirstChild("Humanoid")
  1292. for _,v in pairs(hit.Parent:children()) do
  1293. if v:IsA("Humanoid") then
  1294. h=v
  1295. end
  1296. end
  1297. if hit.Parent.Parent:FindFirstChild("Torso")~=nil then
  1298. h=hit.Parent.Parent:FindFirstChild("Humanoid")
  1299. end
  1300. if hit.Parent.className=="Hat" then
  1301. hit=hit.Parent.Parent:findFirstChild("Head")
  1302. end
  1303. if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then
  1304. if hit.Parent:findFirstChild("DebounceHit")~=nil then if hit.Parent.DebounceHit.Value==true then return end end
  1305. c=Instance.new("ObjectValue")
  1306. c.Name="creator"
  1307. c.Value=game:service("Players").LocalPlayer
  1308. c.Parent=h
  1309. RecentEnemy.Value=hit.Parent
  1310. game:GetService("Debris"):AddItem(c,.5)
  1311. minim=minim*Atk.Value
  1312. maxim=maxim*Atk.Value
  1313. Damage=math.random(minim,maxim)
  1314. blocked=false
  1315. enblock=nil
  1316. Stats=hit.Parent:findFirstChild("Stats")
  1317. if Stats~=nil then
  1318. enblock=Stats:findFirstChild("Block")
  1319. if Stats:findFirstChild("Defense")~=nil then
  1320. Damage=Damage/Stats.Defense.Value
  1321. if Damage<=3 and staghit==true then
  1322. if ranged~=true then
  1323. StaggerHit.Value=true
  1324. end
  1325. end
  1326. end
  1327. if Stats:findFirstChild("Stun")~=nil then
  1328. Stats.Stun.Value=Stats.Stun.Value+incstun
  1329. end
  1330. if Stats:findFirstChild("Stagger")~=nil then
  1331. if stagger==true then
  1332. Stats.Stagger.Value=true
  1333. end
  1334. end
  1335. end
  1336. if enblock~=nil then
  1337. if enblock.Value==true then
  1338. blocked=true
  1339. end
  1340. end
  1341. if blocked==true then
  1342. showDamage(hit.Parent,"Block",.5,BrickColor.new("Bright blue"))
  1343. if ranged~=true then
  1344. enblock.Value=false
  1345. Stagger.Value=true
  1346. end
  1347. else
  1348. Damage=math.floor(Damage)
  1349. h.Health=h.Health-Damage
  1350. showDamage(hit.Parent,Damage,.5,BrickColor:Red())
  1351. if Type=="NormalDecreaseMvmt1" then
  1352. DecreaseStat(hit.Parent,"Movement",.1,200)
  1353. end
  1354. if Type=="Knockdown" then
  1355. hum=hit.Parent.Humanoid
  1356. hum.PlatformStand=true
  1357. coroutine.resume(coroutine.create(function(HHumanoid)
  1358. swait(1)
  1359. HHumanoid.PlatformStand=false
  1360. end),hum)
  1361. local angle=(hit.Position-(Property.Position+Vector3.new(0,0,0))).unit
  1362. --hit.CFrame=cf(hit.Position,Vector3.new(angle.x,hit.Position.y,angle.z))*CFrame.fromEulerAnglesXYZ(math.pi/4,0,0)
  1363. local bodvol=Instance.new("BodyVelocity")
  1364. bodvol.velocity=angle*knockback
  1365. bodvol.P=5000
  1366. bodvol.maxForce=Vector3.new(8e+003, 8e+003, 8e+003)
  1367. bodvol.Parent=hit
  1368. rl=Instance.new("BodyAngularVelocity")
  1369. rl.P=3000
  1370. rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000
  1371. rl.angularvelocity=Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  1372. rl.Parent=hit
  1373. game:GetService("Debris"):AddItem(bodvol,.5)
  1374. game:GetService("Debris"):AddItem(rl,.5)
  1375. elseif Type=="Knockdown2" then
  1376. hum=hit.Parent.Humanoid
  1377. local angle=(hit.Position-(Property.Position+Vector3.new(0,0,0))).unit
  1378. local bodvol=Instance.new("BodyVelocity")
  1379. bodvol.velocity=angle*knockback
  1380. bodvol.P=5000
  1381. bodvol.maxForce=Vector3.new(8e+003, 8e+003, 8e+003)
  1382. bodvol.Parent=hit
  1383. game:GetService("Debris"):AddItem(bodvol,.5)
  1384. elseif Type=="Normal" or Type=="NormalDecreaseMvmt1" then
  1385. vp=Instance.new("BodyVelocity")
  1386. vp.P=500
  1387. vp.maxForce=Vector3.new(math.huge,0,math.huge)
  1388. if KnockbackType==1 then
  1389. vp.velocity=Property.CFrame.lookVector*knockback+Property.Velocity/1.05
  1390. elseif KnockbackType==2 then
  1391. vp.velocity=Property.CFrame.lookVector*knockback
  1392. end
  1393. game:GetService("Debris"):AddItem(vp,.5)
  1394. if knockback>0 then
  1395. vp.Parent=hit.Parent.Torso
  1396. end
  1397. end
  1398. end
  1399. debounce=Instance.new("BoolValue")
  1400. debounce.Name="DebounceHit"
  1401. debounce.Parent=hit.Parent
  1402. debounce.Value=true
  1403. game:GetService("Debris"):AddItem(debounce,Delay)
  1404. c=Instance.new("ObjectValue")
  1405. c.Name="creator"
  1406. c.Value=Player
  1407. c.Parent=h
  1408. game:GetService("Debris"):AddItem(c,.5)
  1409. CRIT=false
  1410. end
  1411. end
  1412.  
  1413. showDamage=function(Char,Dealt,du,Color)
  1414. m=Instance.new("Model")
  1415. m.Name=tostring(Dealt)
  1416. h=Instance.new("Humanoid")
  1417. h.Health=0
  1418. h.MaxHealth=0
  1419. h.Parent=m
  1420. c=Instance.new("Part")
  1421. c.Transparency=0
  1422. c.BrickColor=Color
  1423. c.Name="Head"
  1424. c.TopSurface=0
  1425. c.BottomSurface=0
  1426. c.formFactor="Plate"
  1427. c.Size=Vector3.new(1,.4,1)
  1428. ms=Instance.new("CylinderMesh")
  1429. ms.Scale=Vector3.new(.8,.8,.8)
  1430. if CRIT==true then
  1431. ms.Scale=Vector3.new(1,1.25,1)
  1432. end
  1433. ms.Parent=c
  1434. c.Reflectance=0
  1435. Instance.new("BodyGyro").Parent=c
  1436. c.Parent=m
  1437. if Char:findFirstChild("Head")~=nil then
  1438. c.CFrame=cf(Char["Head"].CFrame.p+Vector3.new(0,1.5,0))
  1439. elseif Char.Parent:findFirstChild("Head")~=nil then
  1440. c.CFrame=cf(Char.Parent["Head"].CFrame.p+Vector3.new(0,1.5,0))
  1441. end
  1442. f=Instance.new("BodyPosition")
  1443. f.P=2000
  1444. f.D=100
  1445. f.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  1446. f.position=c.Position+Vector3.new(0,3,0)
  1447. f.Parent=c
  1448. game:GetService("Debris"):AddItem(m,.5+du)
  1449. c.CanCollide=false
  1450. m.Parent=workspace
  1451. c.CanCollide=false
  1452. end
  1453.  
  1454. combo=0
  1455. function ob1d(mouse)
  1456. if gun==true and mana>=10 then
  1457. mana=mana+2e9
  1458. shoot=true
  1459. Shoot1()
  1460. gun=false
  1461. end
  1462. if attack==true or equipped==false then return end
  1463. hold=true
  1464. if combo==0 then
  1465. combo=1
  1466. attackone()
  1467. elseif combo==1 then
  1468. combo=2
  1469. attacktwo()
  1470. elseif combo==2 then
  1471. combo=3
  1472. attackthree()
  1473. elseif combo==3 then
  1474. combo=0
  1475. attackfour()
  1476. end
  1477. coroutine.resume(coroutine.create(function()
  1478. for i=1,50 do
  1479. if attack==false then
  1480. swait()
  1481. end
  1482. end
  1483. if attack==false then
  1484. combo=0
  1485. end
  1486. end))
  1487. end
  1488.  
  1489. function ob1u(mouse)
  1490. hold = false
  1491. end
  1492.  
  1493. buttonhold = false
  1494.  
  1495. eul=0
  1496. equipped=false
  1497. function key(key)
  1498. if key=="g" then
  1499. if gun==true then
  1500. gun=false
  1501. end
  1502. end
  1503. if attack==true then return end
  1504. if key=="f" then
  1505. attack=true
  1506. if equipped==false then
  1507. equipped=true
  1508. RSH=ch.Torso["Right Shoulder"]
  1509. LSH=ch.Torso["Left Shoulder"]
  1510. --
  1511. RSH.Parent=nil
  1512. LSH.Parent=nil
  1513. --
  1514. RW.Name="Right Shoulder"
  1515. RW.Part0=ch.Torso
  1516. RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  1517. RW.C1=cf(0, 0.5, 0)
  1518. RW.Part1=ch["Right Arm"]
  1519. RW.Parent=ch.Torso
  1520. --
  1521. LW.Name="Left Shoulder"
  1522. LW.Part0=ch.Torso
  1523. LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  1524. LW.C1=cf(0, 0.5, 0)
  1525. LW.Part1=ch["Left Arm"]
  1526. LW.Parent=ch.Torso
  1527. --
  1528. equipanim()
  1529. else
  1530. equipped=false
  1531. hideanim()
  1532. swait(0)
  1533. RW.Parent=nil
  1534. LW.Parent=nil
  1535. RSH.Parent=player.Character.Torso
  1536. LSH.Parent=player.Character.Torso
  1537. end
  1538. attack=false
  1539. end
  1540. if equipped==false then return end
  1541. if key=="g" then
  1542. if gun==false then
  1543. GunStance()
  1544. end
  1545. end
  1546. if key=="q" then
  1547. Punishment()
  1548. end
  1549. if key=="h" then
  1550. mana=100
  1551. end
  1552. if key=="j" then
  1553. test()
  1554. end
  1555. if attack==false then
  1556. RecentEnemy.Value=nil
  1557. end
  1558. end
  1559.  
  1560. function key2(key)
  1561.  
  1562.  
  1563. end
  1564.  
  1565. function s(mouse)
  1566. mouse.Button1Down:connect(function() ob1d(mouse) end)
  1567. mouse.Button1Up:connect(function() ob1u(mouse) end)
  1568. mouse.KeyDown:connect(key)
  1569. mouse.KeyUp:connect(key2)
  1570.  
  1571. player=Player
  1572. ch=Character
  1573. MMouse=mouse
  1574. end
  1575.  
  1576. function ds(mouse)
  1577. end
  1578.  
  1579. Bin.Selected:connect(s)
  1580. Bin.Deselected:connect(ds)
  1581. print("Vulca loaded.")
  1582.  
  1583. local mananum=0
  1584. local donum=0
  1585. local stunnum=0
  1586. local staggeranim=false
  1587. local stunanim=false
  1588. local Point=nil
  1589. local LastPoint=nil
  1590. while true do
  1591. hitbox2.Parent=hitbox.Parent
  1592. hitbox2.Size=hitbox.Size
  1593. hitbox2.CFrame=hitbox.CFrame
  1594. game:service'RunService'.RenderStepped:wait(0)
  1595. if Stagger.Value==true and staggeranim==false then
  1596. coroutine.resume(coroutine.create(function()
  1597. staggeranim=true
  1598. while attack==true do
  1599. swait()
  1600. end
  1601. StaggerAnim()
  1602. StaggerHit.Value=false
  1603. Stagger.Value=false
  1604. staggeranim=false
  1605. end))
  1606. end
  1607. if StaggerHit.Value==true and staggeranim==false then
  1608. coroutine.resume(coroutine.create(function()
  1609. staggeranim=true
  1610. while attack==true do
  1611. swait()
  1612. end
  1613. StaggerHitt()
  1614. StaggerHit.Value=false
  1615. Stagger.Value=false
  1616. staggeranim=false
  1617. end))
  1618. end
  1619. if Mvmt.Value<0 or Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then
  1620. Humanoid.WalkSpeed=0
  1621. else
  1622. Humanoid.WalkSpeed=16*Mvmt.Value
  1623. end
  1624. if Stun.Value>=100 and stunanim==false then
  1625. coroutine.resume(coroutine.create(function()
  1626. stunanim=true
  1627. while attack==true do
  1628. swait()
  1629. end
  1630. StunAnim()
  1631. Stun.Value=0
  1632. stunanim=false
  1633. end))
  1634. end
  1635. if stunnum>=10 then
  1636. if Stun.Value>0 then
  1637. Stun.Value=Stun.Value-1
  1638. end
  1639. stunnum=0
  1640. end
  1641. stunnum=stunnum+1
  1642. if donum>=.5 then
  1643. handidle=true
  1644. elseif donum<=0 then
  1645. handidle=false
  1646. end
  1647. if handidle==false then
  1648. donum=donum+0.003
  1649. else
  1650. donum=donum-0.003
  1651. end
  1652. local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
  1653. local velderp=RootPart.Velocity.y
  1654. hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,4,Character)
  1655. if equipped==true then
  1656. if attack==false then
  1657. idle=idle+1
  1658. else
  1659. idle=0
  1660. end
  1661. if idle>=500 then
  1662. if attack==false then
  1663. --Sheath()
  1664. end
  1665. end
  1666. if RootPart.Velocity.y > 1 and hitfloor==nil then
  1667. Anim="Jump"
  1668. if attack==false then
  1669. wld1.C0=clerp(wld1.C0,euler(2.9,0,3.14)*cf(0,1,.2),.2)
  1670. Neck.C0=clerp(Neck.C0,necko*euler(-0.2,0,0),.2)
  1671. Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.2)
  1672. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.2)
  1673. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1,0,0.5),.2)
  1674. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1675. LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(1,0,.8)*euler(0,-.7,0),.2)
  1676. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1677. RH.C0=clerp(RH.C0,cf(1,-1,-.3)*euler(-0.5,1.57,0)*euler(-.2,0,0),.2)
  1678. LH.C0=clerp(LH.C0,cf(-1,-1,-.3)*euler(-0.5,-1.57,0)*euler(-.2,0,0),.2)
  1679. end
  1680. elseif RootPart.Velocity.y < -1 and hitfloor==nil then
  1681. Anim="Fall"
  1682. if attack==false then
  1683. wld1.C0=clerp(wld1.C0,euler(2.9,0,3.14)*cf(0,1,.2),.2)
  1684. Neck.C0=clerp(Neck.C0,necko*euler(0.4,0,0),.2)
  1685. Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.2)
  1686. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.2)
  1687. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(2,0,1),.2)
  1688. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1689. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-0.3,0,-0.2),.2)
  1690. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1691. RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0.4,1.57,0),.2)
  1692. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(-0.2,-1.57,0),.2)
  1693. end
  1694. elseif torvel<1 and hitfloor~=nil then
  1695. Anim="Idle"
  1696. if attack==false then
  1697. --wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,0),.15)
  1698. wld1.C0=clerp(wld1.C0,euler(2.9+(donum/3),0,3.14)*cf(0,1,.2),.15)
  1699. gwld6.C0=clerp(gwld6.C0,euler(0,0,0)*cf(0,-.25,-.1),.15)
  1700. gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.15)
  1701. Neck.C0=clerp(Neck.C0,necko*euler(.2-(donum/5),0,0),.15)
  1702. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.15)
  1703. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.3+(donum/3),0,.5-(donum/3)),.15)
  1704. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.15)
  1705. LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(.7+(donum/3),0,.4+(donum/3))*euler(0,-.4,0),.15)
  1706. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.15)
  1707. RH.C0=clerp(RH.C0,RHC0,.2)
  1708. RH.C1=clerp(RH.C1,RHC1,.2)
  1709. LH.C0=clerp(LH.C0,LHC0,.2)
  1710. LH.C1=clerp(LH.C1,LHC1,.2)
  1711. end
  1712. elseif torvel>2 and torvel<22 and hitfloor~=nil then
  1713. Anim="Walk"
  1714. if attack==false then
  1715. gwld6.C0=clerp(gwld6.C0,euler(0,0,0)*cf(0,-.25,-.1),.2)
  1716. wld1.C0=clerp(wld1.C0,euler(2.9+(donum/3),0,3.14)*euler(0,.5,0)*cf(0,1,.2),.2)
  1717. Neck.C0=clerp(Neck.C0,necko*euler(0,0,.5),.2)
  1718. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0.1,0,-.5),.2)
  1719. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1-(donum/3),0,.8-(donum/3)),.2)
  1720. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1721. LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(.5+(donum/3),0,.8+(donum/3))*euler(0,-.7,0),.2)
  1722. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1723. RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,.6,0),.2)
  1724. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.5,0),.2)
  1725. end
  1726. elseif torvel>=22 and hitfloor~=nil then
  1727. Anim="Run"
  1728. if attack==false then
  1729. gwld6.C0=clerp(gwld6.C0,euler(0,0,0)*cf(0,-.25,-.1),.2)
  1730. wld1.C0=clerp(wld1.C0,euler(2.9+(donum/3),0,3.14)*cf(0,1,.2),.2)
  1731. Neck.C0=clerp(Neck.C0,necko*euler(0,0,.5),.2)
  1732. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0.1,0,-.5),.2)
  1733. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1-(donum/3),0,.8-(donum/3)),.2)
  1734. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1735. LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(.5+(donum/3),0,.8+(donum/3))*euler(0,-.7,0),.2)
  1736. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2)
  1737. RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,.6,0),.2)
  1738. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.5,0),.2)
  1739. end
  1740. end
  1741. end
  1742. if #Effects>0 then
  1743. --table.insert(Effects,{prt,"Block1",delay})
  1744. for e=1,#Effects do
  1745. if Effects[e]~=nil then
  1746. --for j=1,#Effects[e] do
  1747. local Thing=Effects[e]
  1748. if Thing~=nil then
  1749. local Part=Thing[1]
  1750. local Mode=Thing[2]
  1751. local Delay=Thing[3]
  1752. local IncX=Thing[4]
  1753. local IncY=Thing[5]
  1754. local IncZ=Thing[6]
  1755. if Thing[2]=="DecreaseStat" then
  1756. Thing[5]=Thing[5]-1
  1757. if Thing[5]<=0 then
  1758. if Thing[1]:findFirstChild("Stats")~=nil then
  1759. Thing[1].Stats[Thing[3]].Value=Thing[1].Stats[Thing[3]].Value+Thing[4]
  1760. end
  1761. table.remove(Effects,e)
  1762. end
  1763. end
  1764. if Thing[2]=="Shoot" then
  1765. local Look=Thing[1]
  1766. local hit,pos = rayCast(Thing[4],Look,20,modelzorz)
  1767. local mag=(Thing[4]-pos).magnitude
  1768. MagicHead(BrickColor.new("Really red"),CFrame.new((Thing[4]+pos)/2,pos)*angles(1.57,0,0),1,mag*5,1,.5,0,.5,0.1)
  1769. Thing[4]=Thing[4]+(Look*20)
  1770. Thing[3]=Thing[3]-1
  1771. if hit~=nil then
  1772. Thing[3]=0
  1773. if Thing[8]==1 then
  1774. Damagefunc(hit,Thing[5],Thing[6],Thing[7],"Normal",RootPart,0,2,math.random(1,5),nil,nil,true)
  1775. elseif Thing[8]==2 then
  1776. Damagefunc(hit,Thing[5],Thing[6],Thing[7],"NormalDecreaseMvmt1",RootPart,0,2,math.random(1,5),nil,nil,true)
  1777. end
  1778. ref=part(3,workspace,0,1,BrickColor.new("Really red"),"Reference",vt())
  1779. ref.Anchored=true
  1780. ref.CFrame=cf(pos)
  1781. MagicCircle(BrickColor.new("Really red"),cf(pos),5,5,5,1,1,1,0.03)
  1782. game:GetService("Debris"):AddItem(ref,1)
  1783. end
  1784. if Thing[3]<=0 then
  1785. table.remove(Effects,e)
  1786. end
  1787. end
  1788. if Thing[2]=="CylinderClang" then
  1789. if Thing[3]<=1 then
  1790. Thing[1].CFrame=Thing[1].CFrame*CFrame.new(0,2.5*Thing[5],0)*CFrame.fromEulerAnglesXYZ(Thing[6],0,0)
  1791. Thing[7]=Thing[1].CFrame
  1792. effect("New Yeller",0,Thing[8],Thing[7])
  1793. Thing[8]=Thing[7]
  1794. Thing[3]=Thing[3]+Thing[4]
  1795. else
  1796. Part.Parent=nil
  1797. table.remove(Effects,e)
  1798. end
  1799. --[[Mesh=Thing[7]
  1800. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  1801. Thing[1].Transparency=Thing[1].Transparency+Thing[3]]
  1802. end
  1803. if Thing[2]~="Shoot" and Thing[2]~="DecreaseStat" then
  1804. if Thing[1].Transparency<=1 then
  1805. if Thing[2]=="Block1" then
  1806. Thing[1].CFrame=Thing[1].CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  1807. Mesh=Thing[7]
  1808. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  1809. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  1810. elseif Thing[2]=="Block2" then
  1811. Thing[1].CFrame=Thing[1].CFrame
  1812. Mesh=Thing[7]
  1813. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  1814. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  1815. elseif Thing[2]=="Cylinder" then
  1816. Mesh=Thing[7]
  1817. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  1818. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  1819. elseif Thing[2]=="Blood" then
  1820. Mesh=Thing[7]
  1821. Thing[1].CFrame=Thing[1].CFrame*cf(0,.5,0)
  1822. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  1823. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  1824. elseif Thing[2]=="Elec" then
  1825. Mesh=Thing[7]
  1826. Mesh.Scale=Mesh.Scale+vt(Thing[7],Thing[8],Thing[9])
  1827. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  1828. elseif Thing[2]=="Disappear" then
  1829. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  1830. end
  1831. else
  1832. Part.Parent=nil
  1833. table.remove(Effects,e)
  1834. end
  1835. end
  1836. end
  1837. --end
  1838. end
  1839. end
  1840. end
  1841. fenbarmana2:TweenSize(UDim2.new(4*mana/100,0,0.2,0),nil,1,0.4,true)
  1842. fenbarmana4.Text="Mana("..mana..")"
  1843. gmsh15.Scale=vt(2.21,5*mana/100,.9)
  1844. gwld15.C0=euler(0,0,0)*cf(0,0,0)*cf(0,.5/(100/(100-mana)),0)
  1845. if mana>=100 then
  1846. mana=100
  1847. else
  1848. if mananum<=8 then
  1849. mananum=mananum+1
  1850. else
  1851. mananum=0
  1852. mana=mana+1
  1853. end
  1854. end
  1855. end
  1856. while wait() do Shoot1() end
  1857.  
  1858. --[[
  1859. Copyrighted (C) Fenrier 2014
  1860. ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement