Advertisement
Guest User

Untitled

a guest
Mar 13th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.62 KB | None | 0 0
  1. --Archangel Gauntlet, made by yeox769.
  2. --Feel free to use this in your scripts, but please give credit if you do so.
  3. --Credit goes to the Kaerin script for some of the animations, and to pitaden for one of the meshes (Warglaive of Azzinoth).
  4.  
  5. wait(0.5)
  6. player = game.Players.LocalPlayer
  7. char = player.Character
  8. hmnd = char.Humanoid
  9. larm = char["Left Arm"]
  10. rarm = char["Right Arm"]
  11. lleg = char["Left Leg"]
  12. rleg = char["Right Leg"]
  13. torso = char.Torso
  14. mouse = player:GetMouse()
  15. lght = game.Lighting
  16. bdclr = char["Body Colors"]
  17. Neck = torso.Neck
  18.  
  19. -- More variables, just in case.
  20. Player=game:GetService("Players").LocalPlayer
  21. Character=Player.Character
  22. PlayerGui=Player.PlayerGui
  23. Backpack=Player.Backpack
  24. Torso=Character.Torso
  25. Head=Character.Head
  26. Humanoid=Character.Humanoid
  27. m=Instance.new('Model',Character)
  28. LeftArm=Character["Left Arm"]
  29. LeftLeg=Character["Left Leg"]
  30. RightArm=Character["Right Arm"]
  31. RightLeg=Character["Right Leg"]
  32. LS=Torso["Left Shoulder"]
  33. LH=Torso["Left Hip"]
  34. RS=Torso["Right Shoulder"]
  35. RH=Torso["Right Hip"]
  36. Face = Head.face
  37. Neck=Torso.Neck
  38. it=Instance.new
  39. attacktype=1
  40. vt=Vector3.new
  41. cf=CFrame.new
  42. euler=CFrame.fromEulerAnglesXYZ
  43. angles=CFrame.Angles
  44. cloaked=false
  45. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  46. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  47. LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  48. LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
  49. RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  50. RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
  51. RootPart=Character.HumanoidRootPart
  52. RootJoint=RootPart.RootJoint
  53. RootCF=euler(-1.57,0,3.14)
  54. attack = false
  55. attackdebounce = false
  56. deb=false
  57. equipped=true
  58. hand=false
  59. MMouse=nil
  60. combo=0
  61. mana=0
  62. trispeed=.2
  63. attackmode='none'
  64. local idle=0
  65. local Anim="Idle"
  66. local Effects={}
  67. local gun=false
  68. local shoot=false
  69. player=nil
  70. mana=0
  71.  
  72. it = Instance.new
  73. -- Music --
  74. z = it("Sound",char)
  75. z.Looped = true
  76. z.SoundId = "rbxassetid://174532761"
  77. z.Volume = 0
  78. z:Play()
  79. themeBegan = false
  80.  
  81. function fadeInTheme()
  82. i = 0
  83. while i < 1 do
  84. z.Volume = z.Volume + 0.02
  85. i = i + 0.02
  86. wait()
  87. end
  88. end
  89.  
  90. delay(0,fadeInTheme)
  91.  
  92. -- Functions --
  93.  
  94. local inv = function()
  95. while true do
  96. wait()
  97. hmnd.MaxHealth = math.huge
  98. hmnd.Health = math.huge
  99. if char:FindFirstChild("ForceField") == nil then
  100. ff = it("ForceField",char)
  101. ff.Visible = false
  102. end
  103. end
  104. end
  105.  
  106. delay(0,inv)
  107.  
  108. local part = function(name,parent,brkclr,mtrl,rfl,trns,sz)
  109. prt = it("Part",parent)
  110. prt.Name = name
  111. prt.CanCollide = false
  112. prt.BrickColor = BrickColor.new(brkclr)
  113. if brkclr == "White" then
  114. prt.Color = Color3.new(255,255,255)
  115. end
  116. if brkclr == "Gold" then
  117. prt.Color = Color3.fromRGB(245, 190, 75)
  118. end
  119. prt.Material = mtrl
  120. prt.Reflectance = rfl
  121. prt.Transparency = trns
  122. prt.Size = sz
  123. prt.Anchored = true
  124. return prt
  125. end
  126. local mesh = function(meshtype,parent,meshid,textureid,scale)
  127. msh = it("SpecialMesh",parent)
  128. if meshtype == "FileMesh" then
  129. msh.MeshId = meshid
  130. msh.TextureId = textureid
  131. end
  132. msh.MeshType = meshtype
  133. msh.Scale = scale
  134. return(msh)
  135. end
  136. local weld = function(part1,part2,x1,y1,z1,x2,y2,z2)
  137. w = it("Weld",part1)
  138. w.Part0 = part1
  139. w.Part1 = part2
  140. if part1.Anchored or part2.Anchored then
  141. part1.Anchored = false
  142. part2.Anchored = false
  143. end
  144. w.C0 = (CFrame.new(x1,y1,z1)*CFrame.Angles(math.rad(z2),math.rad(y2),math.rad(x2)))
  145. return(w)
  146. end
  147. local emit = function(parent,tex,startcolor, endcolor, startsize,endsize,lightem,emdir,lif,rate,speed,rotspeed,sprdang)
  148. emm = it("ParticleEmitter",parent)
  149. emm.Texture = tex
  150. emm.Color = ColorSequence.new({ColorSequenceKeypoint.new(0,startcolor),ColorSequenceKeypoint.new(1,endcolor)})
  151. emm.Size = NumberSequence.new({NumberSequenceKeypoint.new(0,startsize),NumberSequenceKeypoint.new(1,endsize)})
  152. emm.LightEmission = lightem
  153. emm.EmissionDirection = emdir
  154. emm.Lifetime = NumberRange.new(lif)
  155. emm.Rate = rate
  156. emm.Speed = NumberRange.new(speed)
  157. emm.RotSpeed = NumberRange.new(rotspeed)
  158. emm.SpreadAngle = Vector2.new(sprdang,sprdang)
  159. end
  160.  
  161. function clerp(a,b,t)
  162. local qa = {QuaternionFromCFrame(a)}
  163. local qb = {QuaternionFromCFrame(b)}
  164. local ax, ay, az = a.x, a.y, a.z
  165. local bx, by, bz = b.x, b.y, b.z
  166. local _t = 1-t
  167. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  168. end
  169.  
  170. function QuaternionFromCFrame(cf)
  171. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  172. local trace = m00 + m11 + m22
  173. if trace > 0 then
  174. local s = math.sqrt(1 + trace)
  175. local recip = 0.5/s
  176. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  177. else
  178. local i = 0
  179. if m11 > m00 then
  180. i = 1
  181. end
  182. if m22 > (i == 0 and m00 or m11) then
  183. i = 2
  184. end
  185. if i == 0 then
  186. local s = math.sqrt(m00-m11-m22+1)
  187. local recip = 0.5/s
  188. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  189. elseif i == 1 then
  190. local s = math.sqrt(m11-m22-m00+1)
  191. local recip = 0.5/s
  192. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  193. elseif i == 2 then
  194. local s = math.sqrt(m22-m00-m11+1)
  195. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  196. end
  197. end
  198. end
  199.  
  200. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  201. local xs, ys, zs = x + x, y + y, z + z
  202. local wx, wy, wz = w*xs, w*ys, w*zs
  203. local xx = x*xs
  204. local xy = x*ys
  205. local xz = x*zs
  206. local yy = y*ys
  207. local yz = y*zs
  208. local zz = z*zs
  209. 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))
  210. end
  211.  
  212. function QuaternionSlerp(a, b, t)
  213. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  214. local startInterp, finishInterp;
  215. if cosTheta >= 0.0001 then
  216. if (1 - cosTheta) > 0.0001 then
  217. local theta = math.acos(cosTheta)
  218. local invSinTheta = 1/math.sin(theta)
  219. startInterp = math.sin((1-t)*theta)*invSinTheta
  220. finishInterp = math.sin(t*theta)*invSinTheta
  221. else
  222. startInterp = 1-t
  223. finishInterp = t
  224. end
  225. else
  226. if (1+cosTheta) > 0.0001 then
  227. local theta = math.acos(-cosTheta)
  228. local invSinTheta = 1/math.sin(theta)
  229. startInterp = math.sin((t-1)*theta)*invSinTheta
  230. finishInterp = math.sin(t*theta)*invSinTheta
  231. else
  232. startInterp = t-1
  233. finishInterp = t
  234. end
  235. end
  236. 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
  237. end
  238.  
  239. local sine = 0
  240. local change = 1
  241. local val = 0
  242.  
  243. mouse=Player:GetMouse()
  244. RSH, LSH=nil, nil
  245. --welds
  246. RW, LW=Instance.new("Weld"), Instance.new("Weld")
  247. RW.Name="Right Shoulder" LW.Name="Left Shoulder"
  248. LH=Torso["Left Hip"]
  249. RH=Torso["Right Hip"]
  250. TorsoColor=Torso.BrickColor
  251. function NoOutline(Part)
  252. Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10
  253. end
  254. player=Player
  255. ch=Character
  256. RSH=ch.Torso["Right Shoulder"]
  257. LSH=ch.Torso["Left Shoulder"]
  258. --
  259. RSH.Parent=nil
  260. LSH.Parent=nil
  261. --
  262. RW.Name="Right Shoulder"
  263. RW.Part0=ch.Torso
  264. RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  265. RW.C1=cf(0, 0.5, 0)
  266. RW.Part1=ch["Right Arm"]
  267. RW.Parent=ch.Torso
  268. --
  269. LW.Name="Left Shoulder"
  270. LW.Part0=ch.Torso
  271. LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  272. LW.C1=cf(0, 0.5, 0)
  273. LW.Part1=ch["Left Arm"]
  274. LW.Parent=ch.Torso
  275.  
  276. function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  277. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  278. end
  279.  
  280. -- Character Model --
  281.  
  282. fxb = part("FXBase",char,"Institutional white","Plastic",0,1,Vector3.new(2.5,0.5,2.5))
  283. fxw = weld(rarm,fxb,0,-0.5,0,0,0,0)
  284. fx1 = part("FX1",char,"Institutional white","Plastic",0,1,Vector3.new(0.05,0.05,0.05))
  285. weld(fxb,fx1,0,0,1.25,0,0,0)
  286. emit(fx1,"rbxasset://textures/particles/sparkles_main.dds",Color3.new(1,1,1),Color3.new(1,1,1),1,0,1,"Left",0.5,150,0,0,0)
  287. fx2 = part("FX2",char,"Institutional white","Plastic",0,1,Vector3.new(0.05,0.05,0.05))
  288. weld(fxb,fx2,-1.25,0,-0.625,0,0,0)
  289. emit(fx2,"rbxasset://textures/particles/sparkles_main.dds",Color3.new(1,1,1),Color3.new(1,1,1),1,0,1,"Left",0.5,150,0,0,0)
  290. fx3 = part("FX3",char,"Institutional white","Plastic",0,1,Vector3.new(0.05,0.05,0.05))
  291. weld(fxb,fx3,1.25,0,-0.625,0,0,0)
  292. emit(fx3,"rbxasset://textures/particles/sparkles_main.dds",Color3.new(1,1,1),Color3.new(1,1,1),1,0,1,"Left",0.5,150,0,0,0)
  293. local gntmd = Instance.new("Model",char)
  294. gntmd.Name = "Gauntlet"
  295. p = part("Part",gntmd,"White","Granite",0,0,Vector3.new(1.15, 0.95, 1.15))
  296. weld(rarm,p,0,-0.25,0,0,0,0)
  297. p = part("Part",gntmd,"Gold","Marble",0,0,Vector3.new(1.1, 1.1, 1.1))
  298. weld(rarm,p,0,-0.25,0,0,0,0)
  299. p = part("Orb",gntmd,"Institutional white","Neon",0,0,Vector3.new(0.05, 0.15, 0.15))
  300. weld(rarm,p,0.59,0.25,0,0,0,0)
  301. mesh("Sphere",p,"","",Vector3.new(1,1,1))
  302. p = part("Part",gntmd,"White","Granite",0,0,Vector3.new(1.15, 0.65, 0.5))
  303. weld(rarm,p,0.325,0.5,0,0,90,0)
  304. mesh("Wedge",p,"","",Vector3.new(1,1,1))
  305. p = part("Part",gntmd,"Gold","Marble",0,0,Vector3.new(1.1, 0.65, 0.4))
  306. weld(rarm,p,0.25,0.45,0,0,-90,0)
  307. mesh("Wedge",p,"","",Vector3.new(1,1,1))
  308. p = part("Wings",gntmd,"Gold","Marble",0.1,0,Vector3.new(0.75, 0.2, 0.2))
  309. weld(rarm,p,0.59,0.35,0,0,-90,0)
  310. mesh("FileMesh",p,"rbxassetid://442958617","",Vector3.new(0.01, 0.01, 0.002))
  311. p = part("Thing",gntmd,"Gold","Marble",0.1,0,Vector3.new(0.75, 0.2, 0.75))
  312. weld(rarm,p,0.575,0,0,90,0,90)
  313. mesh("FileMesh",p,"rbxassetid://11996935","",Vector3.new(0.75, 0.05, 0.25))
  314. p = part("Claw1",gntmd,"Gold","Marble",0.1,0,Vector3.new(0.75, 0.2, 0.75))
  315. weld(rarm,p,0.55,0.5,0,-90,0,90)
  316. mesh("FileMesh",p,"http://www.roblox.com/Asset?ID=105262978","",Vector3.new(0.15, 0.2, 0.5))
  317. p = part("Claw2",gntmd,"Gold","Marble",0.1,0,Vector3.new(0.75, 0.2, 0.75))
  318. weld(rarm,p,0.55,-0.15,0,90,180,90)
  319. mesh("FileMesh",p,"http://www.roblox.com/Asset?ID=105262978","",Vector3.new(0.15, 0.2, 0.5))
  320.  
  321.  
  322. -- Animations --
  323.  
  324. function fx()
  325. r = 0
  326. while true do
  327. r = r + 5
  328. wait()
  329. fxw.C0 = CFrame.new(0,-0.5,0)*CFrame.Angles(0,math.rad(r),0)
  330. end
  331. end
  332. delay(0,fx)
  333.  
  334. function Animate()
  335. while true do
  336. wait()
  337. sine = sine + change
  338. local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
  339. local velderp=RootPart.Velocity.y
  340. hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,4,Character)
  341. if equipped==true or equipped==false then
  342. if attack==false then
  343. idle=idle+1
  344. else
  345. idle=0
  346. end
  347. if idle>=500 then
  348. if attack==false then
  349. --Sheath()
  350. end
  351. end
  352. if RootPart.Velocity.y > 1 and hitfloor==nil then
  353. Anim="Jump"
  354. if attack==false then
  355. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(-10),math.rad(0),math.rad(0)),.3)
  356. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(10),math.rad(0),math.rad(0)),.3)
  357. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(math.rad(20),math.rad(0),math.rad(15)),.3)
  358. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(math.rad(20),math.rad(0),math.rad(-15)),.3)
  359. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3)
  360. end
  361. elseif RootPart.Velocity.y < -1 and hitfloor==nil then
  362. Anim="Fall"
  363. if attack==false then
  364. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(10),math.rad(0),math.rad(0)),.3)
  365. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-10),math.rad(0),math.rad(0)),.3)
  366. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(math.rad(-50),math.rad(0),math.rad(30)),.3)
  367. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(math.rad(-50),math.rad(0),math.rad(-30)),.3)
  368. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3)
  369. end
  370. elseif torvel<1 and hitfloor~=nil then
  371. Anim="Idle"
  372. if attack==false then
  373. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(-40)),.3)
  374. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(10),math.rad(0),math.rad(40)),.3)
  375. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(math.rad(-10),math.rad(0),math.rad(10)),.3)
  376. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(math.rad(10),math.rad(10),math.rad(-10)),.3)
  377. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-60),math.rad(-10)),.3)
  378. end
  379. elseif torvel>2 and torvel<22 and hitfloor~=nil then
  380. Anim="Walk"
  381. if attack==false then
  382. change=3
  383. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(10),math.rad(0),math.rad(0)),.3)
  384. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-10),math.rad(0),math.rad(0)),.3)
  385. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(math.rad(-20),math.rad(0),math.rad(15)),.3)
  386. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(math.rad(-20),math.rad(0),math.rad(-15)),.3)
  387. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3)
  388. end
  389. elseif torvel>=22 and hitfloor~=nil then
  390. Anim="Run"
  391. if attack==false then
  392. end
  393. end
  394. end
  395. end
  396. end
  397.  
  398. delay(0,Animate)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement