Advertisement
ohhhhhhshdhashdahsd

Gaunglets

Apr 25th, 2016
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.83 KB | None | 0 0
  1. --[[
  2. Herex's Mechanic Gauntlets
  3. Heyo, Fen's first 2014 script. If ever you want details of Herex, who he is, and his backstory,
  4. just message me.
  5. ]]
  6. Player = game:GetService("Players").LocalPlayer
  7. Character = Player.Character
  8. PlayerGui = Player.PlayerGui
  9. Backpack = Player.Backpack
  10. Torso = Character.Torso
  11. Head = Character.Head
  12. Humanoid = Character.Humanoid
  13. LeftArm = Character["Left Arm"]
  14. LeftLeg = Character["Left Leg"]
  15. RightArm = Character["Right Arm"]
  16. RightLeg = Character["Right Leg"]
  17. LS = Torso["Left Shoulder"]
  18. LH = Torso["Left Hip"]
  19. RS = Torso["Right Shoulder"]
  20. RH = Torso["Right Hip"]
  21. Neck = Torso.Neck
  22. it=Instance.new
  23. vt=Vector3.new
  24. cf=CFrame.new
  25. euler=CFrame.fromEulerAnglesXYZ
  26. angles=CFrame.Angles
  27. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  28. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  29. RootPart=Character.HumanoidRootPart
  30. RootJoint=RootPart.RootJoint
  31. RootCF=euler(-1.57,0,3.14)
  32. attack = false
  33. attackdebounce = false
  34. MMouse=nil
  35. combo=0
  36. Mode="Normal"
  37. --player
  38. player = nil
  39. --save shoulders
  40. RSH, LSH = nil, nil
  41. --welds
  42. RW, LW = Instance.new("Weld"), Instance.new("Weld")
  43. RW.Name="Right Shoulder" LW.Name="Left Shoulder"
  44. local AnimJoints = {}
  45. table.insert(AnimJoints,RW)
  46. table.insert(AnimJoints,LW)
  47.  
  48.  
  49. if Character:findFirstChild("Mechanic Gauntlets",true) ~= nil then
  50. Character:findFirstChild("Mechanic Gauntlets",true).Parent = nil
  51. end
  52.  
  53.  
  54. function part(formfactor,parent,reflectance,transparency,brickcolor,name,size)
  55. local fp = it("Part")
  56. fp.formFactor = formfactor
  57. fp.Parent = parent
  58. fp.Reflectance = reflectance
  59. fp.Transparency = transparency
  60. fp.CanCollide = false
  61. fp.Locked=true
  62. fp.BrickColor = brickcolor
  63. fp.Name = name
  64. fp.Size = size
  65. fp.Position = Torso.Position
  66. fp.BottomSurface="Smooth"
  67. fp.TopSurface="Smooth"
  68. fp:BreakJoints()
  69. return fp
  70. end
  71.  
  72. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  73. local mesh = it(Mesh)
  74. mesh.Parent = part
  75. if Mesh=="SpecialMesh" then
  76. mesh.MeshType = meshtype
  77. mesh.MeshId = meshid
  78. end
  79. mesh.Offset=offset
  80. mesh.Scale=scale
  81. return mesh
  82. end
  83.  
  84. function weld(parent,part0,part1,c0)
  85. local weld = it("Weld")
  86. weld.Parent = parent
  87. weld.Part0 = part0
  88. weld.Part1 = part1
  89. weld.C0 = c0
  90. return weld
  91. end
  92.  
  93. function SetWeld(weld, i, loops, origpos,origangle, nextpos,nextangle,smooth)
  94. smooth = smooth or 1
  95. local obj
  96. for i, v in pairs(AnimJoints) do
  97. if v[1] == weld then
  98. obj = v
  99. break
  100. end
  101. end
  102. if not obj then
  103. obj = {weld,NV}
  104. table.insert(AnimJoints,obj)
  105. end
  106.  
  107. local perc = (smooth == 1 and math.sin((math.pi/2)/loops*i)) or i/loops
  108.  
  109. local tox,toy,toz = 0,0,0
  110. tox = math.abs(origangle.x - nextangle.x) *perc
  111. toy = math.abs(origangle.y - nextangle.y) *perc
  112. toz = math.abs(origangle.z - nextangle.z) *perc
  113. tox = (origangle.x > nextangle.x and -tox) or tox
  114. toy = (origangle.y > nextangle.y and -toy) or toy
  115. toz = (origangle.z > nextangle.z and -toz) or toz
  116.  
  117. local tox2,toy2,toz2 = 0,0,0
  118. tox2 = math.abs(origpos.x - nextpos.x) *perc
  119. toy2 = math.abs(origpos.y - nextpos.y) *perc
  120. toz2 = math.abs(origpos.z - nextpos.z) *perc
  121. tox2 = (origpos.x > nextpos.x and -tox2) or tox2
  122. toy2 = (origpos.y > nextpos.y and -toy2) or toy2
  123. toz2 = (origpos.z > nextpos.z and -toz2) or toz2
  124.  
  125. obj[2] = Vector3.new(origangle.x + tox, origangle.y + toy, origangle.z + toz)
  126. weld.C0 = CFrame.new(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2) * CFrame.Angles(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  127. end
  128.  
  129. local Hitbox=part(3,nil,0,0,BrickColor.new("Really Black"),"Hitbox",vt(1,1,1))
  130. Hitbox.Anchored=true
  131. Hitbox.Transparency=1
  132. local modelzorz = Instance.new("Model")
  133. modelzorz.Parent = Character
  134. modelzorz.Name = "Mechanic Gauntlets"
  135.  
  136. --[[LEFT GAUNTLET]]--
  137. local Lprt1=part(3,modelzorz,0,0,BrickColor.new("Grey"),"Left Part1",vt(1,1,1))
  138. local Lprt3=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Left Part3",vt(1,1,1))
  139. local Lprt5=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Left Part5",vt(1,1,1))
  140. local Lprt6=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Left Part6",vt(1,1,1))
  141. local Lprt7=part(3,modelzorz,0,0,BrickColor.new("Grey"),"Left Part7",vt(1,1,1))
  142. local Lprt8=part(3,modelzorz,0,0,BrickColor.new("Grey"),"Left Part8",vt(1,1,1))
  143. local Lprt9=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Left Part9",vt(1,1,1))
  144. local Lprt10=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Left Part10",vt(1,1,1))
  145. local Lprt11=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Left Part11",vt(1,1,1))
  146.  
  147. Lmsh1=mesh("BlockMesh",Lprt1,"","",vt(0,0,0),vt(1.03,1,1.03))
  148. Lmsh3=mesh("BlockMesh",Lprt3,"","",vt(0,0,0),vt(0.1,1.05,1.06))
  149. Lmsh5=mesh("BlockMesh",Lprt5,"","",vt(0,0,0),vt(1.025,2,0.2))
  150. Lmsh6=mesh("BlockMesh",Lprt6,"","",vt(0,0,0),vt(0.2,2,1.025))
  151. Lmsh7=mesh("CylinderMesh",Lprt7,"","",vt(0,0,0),vt(0.4,0.2,0.4))
  152. Lmsh8=mesh("CylinderMesh",Lprt8,"","",vt(0,0,0),vt(0.3,0.21,0.3))
  153. Lmsh9=mesh("SpecialMesh",Lprt9,"FileMesh","http://www.roblox.com/asset/?id=3270017",vt(0,0,0),vt(0.17,0.17,0.1))
  154. Lmsh10=mesh("SpecialMesh",Lprt10,"FileMesh","http://www.roblox.com/asset/?id=3270017",vt(0,0,0),vt(0.07,0.07,0.1))
  155. Lmsh11=mesh("BlockMesh",Lprt11,"","",vt(0,0,0),vt(0.15,0.02,0.02))
  156.  
  157. local Lwld1=weld(Lprt1,Lprt1,LeftArm,euler(0,0,0)*cf(0,0.51,0))
  158. local Lwld3=weld(Lprt3,Lprt3,Lprt1,euler(0,0,0)*cf(0.3,0,0))
  159. local Lwld5=weld(Lprt5,Lprt5,Lprt1,euler(0,0,0)*cf(0,-0.55,0))
  160. local Lwld6=weld(Lprt6,Lprt6,Lprt1,euler(0,0,0)*cf(0,-0.55,0))
  161. local Lwld7=weld(Lprt7,Lprt7,Lprt1,euler(0,0,1.57)*cf(0.45,-1.2,0))
  162. local Lwld8=weld(Lprt8,Lprt8,Lprt7,euler(0,0,0)*cf(0,0,0))
  163. local Lwld9=weld(Lprt9,Lprt9,Lprt7,euler(1.57,0,0)*cf(-0.02,0.1,0))
  164. local Lwld10=weld(Lprt10,Lprt10,Lprt7,euler(1.57,0,0)*cf(0,0.1,0))
  165. local Lwld11=weld(Lprt11,Lprt11,Lprt7,euler(0,0,0)*cf(0.07,0.1,0))
  166.  
  167. numb=0.4
  168. for i=1,4 do
  169. local Lprt2=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Left Part2",vt(1,1,1))
  170. Lmsh2=mesh("BlockMesh",Lprt2,"","",vt(0,0,0),vt(1.06,1.05,0.1))
  171. local Lwld2=weld(Lprt2,Lprt2,Lprt1,euler(0,0,0)*cf(0,0,numb))
  172. local Lprt4=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Left Part4",vt(1,1,1))
  173. Lmsh4=mesh("SpecialMesh",Lprt4,"Wedge","",vt(0,0,0),vt(0.09,0.1,0.3))
  174. local Lwld4=weld(Lprt4,Lprt4,Lprt2,euler(1.57,-1.57,0)*cf(0.54,0.5,0))
  175. numb=numb-0.275
  176. end
  177.  
  178. numb=0
  179. for i=1,4 do
  180. local Lprt7=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Left Part7",vt(1,1,1))
  181. Lmsh7=mesh("SpecialMesh",Lprt7,"Wedge","",vt(0,0,0),vt(0.2,0.1,0.3))
  182. local Lwld7=weld(Lprt7,Lprt7,Lprt1,euler(1.57,0,3.14)*cf(0,-0.5,0.54)*euler(0,numb,0))
  183. numb=numb+1.57
  184. end
  185.  
  186. --[[RIGHT GAUNTLET]]--
  187. local Rprt1=part(3,modelzorz,0,0,BrickColor.new("Grey"),"Right Part1",vt(1,1,1))
  188. local Rprt3=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Right Part3",vt(1,1,1))
  189. local Rprt5=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Right Part5",vt(1,1,1))
  190. local Rprt6=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Right Part6",vt(1,1,1))
  191. local Rprt7=part(3,modelzorz,0,0,BrickColor.new("Grey"),"Right Part7",vt(1,1,1))
  192. local Rprt8=part(3,modelzorz,0,0,BrickColor.new("Grey"),"Right Part8",vt(1,1,1))
  193. local Rprt9=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Right Part9",vt(1,1,1))
  194. local Rprt10=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Right Part10",vt(1,1,1))
  195. local Rprt11=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Right Part11",vt(1,1,1))
  196.  
  197. Rmsh1=mesh("BlockMesh",Rprt1,"","",vt(0,0,0),vt(1.03,1,1.03))
  198. Rmsh3=mesh("BlockMesh",Rprt3,"","",vt(0,0,0),vt(0.1,1.05,1.06))
  199. Rmsh5=mesh("BlockMesh",Rprt5,"","",vt(0,0,0),vt(1.025,2,0.2))
  200. Rmsh6=mesh("BlockMesh",Rprt6,"","",vt(0,0,0),vt(0.2,2,1.025))
  201. Rmsh7=mesh("CylinderMesh",Rprt7,"","",vt(0,0,0),vt(0.4,0.2,0.4))
  202. Rmsh8=mesh("CylinderMesh",Rprt8,"","",vt(0,0,0),vt(0.3,0.21,0.3))
  203. Rmsh9=mesh("SpecialMesh",Rprt9,"FileMesh","http://www.roblox.com/asset/?id=3270017",vt(0,0,0),vt(0.17,0.17,0.1))
  204. Rmsh10=mesh("SpecialMesh",Rprt10,"FileMesh","http://www.roblox.com/asset/?id=3270017",vt(0,0,0),vt(0.07,0.07,0.1))
  205. Rmsh11=mesh("BlockMesh",Rprt11,"","",vt(0,0,0),vt(0.15,0.02,0.02))
  206.  
  207. local Rwld1=weld(Rprt1,Rprt1,RightArm,euler(0,3.14,0)*cf(0,0.51,0))
  208. local Rwld3=weld(Rprt3,Rprt3,Rprt1,euler(0,0,0)*cf(0.3,0,0))
  209. local Rwld5=weld(Rprt5,Rprt5,Rprt1,euler(0,0,0)*cf(0,-0.55,0))
  210. local Rwld6=weld(Rprt6,Rprt6,Rprt1,euler(0,0,0)*cf(0,-0.55,0))
  211. local Rwld7=weld(Rprt7,Rprt7,Rprt1,euler(0,0,1.57)*cf(0.45,-1.2,0))
  212. local Rwld8=weld(Rprt8,Rprt8,Rprt7,euler(0,0,0)*cf(0,0,0))
  213. local Rwld9=weld(Rprt9,Rprt9,Rprt7,euler(1.57,0,0)*cf(-0.02,0.1,0))
  214. local Rwld10=weld(Rprt10,Rprt10,Rprt7,euler(1.57,0,0)*cf(0,0.1,0))
  215. local Rwld11=weld(Rprt11,Rprt11,Rprt7,euler(0,0,0)*cf(0.07,0.1,0))
  216.  
  217. numb=0.4
  218. for i=1,4 do
  219. local Rprt2=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Right Part2",vt(1,1,1))
  220. Rmsh2=mesh("BlockMesh",Rprt2,"","",vt(0,0,0),vt(1.06,1.05,0.1))
  221. local Rwld2=weld(Rprt2,Rprt2,Rprt1,euler(0,0,0)*cf(0,0,numb))
  222. local Rprt4=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Right Part4",vt(1,1,1))
  223. Rmsh4=mesh("SpecialMesh",Rprt4,"Wedge","",vt(0,0,0),vt(0.09,0.1,0.3))
  224. local Rwld4=weld(Rprt4,Rprt4,Rprt2,euler(1.57,-1.57,0)*cf(0.54,0.5,0))
  225. numb=numb-0.275
  226. end
  227.  
  228. numb=0
  229. for i=1,4 do
  230. local Rprt7=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Right Part7",vt(1,1,1))
  231. Rmsh7=mesh("SpecialMesh",Rprt7,"Wedge","",vt(0,0,0),vt(0.2,0.1,0.3))
  232. local Rwld7=weld(Rprt7,Rprt7,Rprt1,euler(1.57,0,3.14)*cf(0,-0.5,0.54)*euler(0,numb,0))
  233. numb=numb+1.57
  234. end
  235.  
  236. if (script.Parent.className ~= "HopperBin") then
  237. Tool = Instance.new("HopperBin")
  238. Tool.Parent = Backpack
  239. Tool.Name = "Mechanic Gauntlets"
  240. script.Parent = Tool
  241. end
  242. Bin = script.Parent
  243.  
  244. local Bg = it("BodyGyro")
  245. Bg.maxTorque = Vector3.new(4e+005,4e+005,4e+005)*math.huge
  246. Bg.P = 20e+003
  247. Bg.Parent = nil
  248.  
  249. so = function(id,par,vol,pit)
  250. coroutine.resume(coroutine.create(function()
  251. local sou = Instance.new("Sound",par or workspace)
  252. sou.Volume=vol
  253. sou.Pitch=pit or 1
  254. sou.SoundId=id
  255. wait()
  256. sou:play()
  257. wait(6)
  258. sou:Remove()
  259. end))
  260. end
  261.  
  262. function hideanim()
  263. equipped=false
  264. end
  265.  
  266. function equipanim()
  267. equipped=true
  268. Neck.C0=necko
  269. for i = 0,1,0.1 do
  270. wait()
  271. LW.C0=cf(-1.5,0.5,0)*euler(0.2*i,1.57*i,0)
  272. LW.C1=cf(0, 0.5, 0)*euler(-0.2*i,0,0)
  273. RW.C0=cf(1.5,0.5,0)*euler(0.1*i,0,-0.2*i)
  274. end
  275. end
  276.  
  277. function attackone()
  278. attack=true
  279. local armprt=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Part",vt(1,1,1))
  280. armprt.Transparency=1
  281. local armprtwld=weld(armprt,armprt,LeftArm,euler(0,0,0)*cf(0,1,0))
  282. for i=0,1,0.2 do
  283. wait()
  284. ElecEffect(armprt.CFrame,1,1,1)
  285. RootJoint.C0=RootCF*euler(0,0,0.2*i)
  286. LW.C0=cf(-1.5,0.5,0)*euler(0.2,1.57,0)
  287. LW.C1=cf(0, 0.5, 0)*euler(-0.2-0.4*i,0,0)
  288. RW.C0=cf(1.5,0.5,0)*euler(0.1,0,-0.2+0.8*i)
  289. end
  290. local boom=part(3,workspace,0,0,BrickColor.new("Really Black"),"Part",vt(1,1,1))
  291. boom.Transparency=1
  292. boom.Anchored=true
  293. boom.CFrame=Head.CFrame*cf(0,-1,-4)
  294. so("http://www.roblox.com/asset/?id=153092315",boom,1,0.5)
  295. for i=0,1,0.2 do
  296. wait()
  297. ElecEffect(armprt.CFrame,1,1,1)
  298. Neck.C0=necko*euler(0,0,0.6*i)
  299. RootJoint.C0=RootCF*euler(0,0,0.2-0.8*i)
  300. LW.C0=cf(-1.5,0.5,0)*euler(0.2+1.37*i,1.57,0)
  301. LW.C1=cf(0, 0.5, 0)*euler(-0.6+0.2*i,0,0)
  302. RW.C0=cf(1.5,0.5,0)*euler(0.1,0,0.6)
  303. end
  304. boommsh=mesh("SpecialMesh",boom,"Sphere","",vt(0,0,0),vt(2.5,2.5,2.5))
  305. boom.Transparency=0.5
  306. boom.Anchored=true
  307. boom.CFrame=Head.CFrame*cf(0,-1,-4)
  308. Hitbox.Parent=workspace
  309. Hitbox.CFrame=boom.CFrame
  310. con1=Hitbox.Touched:connect(function(hit) Damagefunc1(hit,1,5,0) end)
  311. coroutine.resume(coroutine.create(function(Part,Mesh)
  312. while Part.Parent~=nil do
  313. wait()
  314. derp=math.random()
  315. Mesh.Scale=vt(2.5+derp,2.5+derp,2.5+derp)
  316. ElecEffect(Part.CFrame,2,2,2)
  317. MagicBlock(BrickColor.new("Really Black"),Part.CFrame,1,1,1,0.1,0.1,0.1)
  318. Hitbox.CFrame=boom.CFrame*cf(math.random(-1,0)+math.random(),math.random(-1,0)+math.random(),math.random(-1,0)+math.random())
  319. end
  320. end),boom,boommsh)
  321. for i=0,1,0.2 do
  322. wait()
  323. LW.C0=cf(-1.5,0.5,0)*euler(1.57,1.57,0)
  324. LW.C1=cf(0, 0.5, 0)*euler(-0.4+0.1*i,0,0)
  325. end
  326. coroutine.resume(coroutine.create(function(Part1,Part2,Part3,Con)
  327. wait(2)
  328. Con:disconnect()
  329. Part2.Parent=nil
  330. Part3.Parent=nil
  331. Part1.Parent=nil
  332. wait(1)
  333. end),Hitbox,boom,armprt,con1)
  334. --[[Hitbox.Parent=nil
  335. con1:disconnect()
  336. boom.Parent=nil
  337. armprt.Parent=nil]]
  338. attack=false
  339. end
  340.  
  341. function attacktwo()
  342. attack=true
  343. for i=0,1,0.2 do
  344. wait()
  345. Neck.C0=necko*euler(0,0,0.6-0.6*i)
  346. RootJoint.C0=RootCF*euler(0,0,-0.6+0.6*i)
  347. LW.C0=cf(-1.5,0.5,0)*euler(1.57,1.57-1.57*i,0)
  348. LW.C1=cf(0, 0.5, 0)*euler(-0.3+0.3*i,0,0)
  349. RW.C0=cf(1.5,0.5,0)*euler(0.1+1.47*i,0,0.6-0.6*i)
  350. end
  351. local boom=part(3,modelzorz,0,0,BrickColor.new("Really Black"),"Part",vt(1,1,1))
  352. boom.Transparency=0.5
  353. boommsh=mesh("SpecialMesh",boom,"Sphere","",vt(0,0,0),vt(0,0,0))
  354. local boomwld=weld(boom,boom,Head,euler(0,0,0)*cf(0,1,4))
  355. con1=Hitbox.Touched:connect(function(hit) Damagefunc1(hit,5,10,20) end)
  356. for i=0,1,0.2 do
  357. wait()
  358. ElecEffect(boom.CFrame,3,3,3)
  359. LW.C0=cf(-1.5,0.5,0)*euler(1.57,0,0.1*i)
  360. RW.C0=cf(1.5,0.5,0)*euler(1.57,0,-0.1*i)
  361. boommsh.Scale=vt(0.5*(i*3),0.5*(i*3),0.5*(i*3))
  362. Hitbox.CFrame=boom.CFrame
  363. end
  364. con1:disconnect()
  365. boomwld.Parent=nil
  366. boom.Anchored=true
  367. coroutine.resume(coroutine.create(function(Part)
  368. local c=game.Workspace:GetChildren()
  369. for i=1,#c do
  370. local hum=c[i]:findFirstChild("Humanoid")
  371. if hum~=nil and hum.Health~=0 then
  372. local head=c[i]:findFirstChild("Head")
  373. if head~=nil then
  374. local targ=head.Position - Part.Position
  375. local mag=targ.magnitude
  376. if mag<=10 and c[i].Name~=Player.Name then
  377. attackdebounce=false
  378. Damagefunc1(head,10,20,70)
  379. end
  380. end
  381. end
  382. end
  383. so("http://www.roblox.com/asset/?id=2974249",Part,1,1)
  384. so("http://www.roblox.com/asset/?id=1369158",Part,1,2)
  385. numb=0
  386. for i=0,20 do
  387. wait()
  388. MagicBlock(BrickColor.new("Really Black"),Part.CFrame,0.5,0.5,0.5,1,1,1)
  389. if numb>=8 then
  390. MagicRing(BrickColor.new("Really Black"),Part.CFrame,1,1,1,math.random(-50,50),math.random(-50,50),math.random(-50,50),0.5,0.5,0.5)
  391. numb=0
  392. end
  393. numb=numb+1
  394. end
  395. end),boom)
  396. for i=0,1,0.2 do
  397. wait()
  398. LW.C0=cf(-1.5,0.5,0)*euler(1.57,0,0.1-0.7*i)
  399. RW.C0=cf(1.5,0.5,0)*euler(1.57,0,-0.1+0.7*i)
  400. end
  401. wait(0.2)
  402. boom.Parent=nil
  403. attack=false
  404. end
  405.  
  406. function attackthree()
  407. attack=true
  408. for i=0,1,0.1 do
  409. wait()
  410. LW.C0=cf(-1.5,0.5,0)*euler(1.57-1.57*i,0,-0.6)
  411. RW.C0=cf(1.5,0.5,0)*euler(1.57-1.57*i,0,0.6)
  412. end
  413. so("http://www.roblox.com/asset/?id=153092348",Torso,1,1)
  414. vel=Instance.new("BodyVelocity")
  415. vel.Parent=RootPart
  416. vel.maxForce=vt(4e+005,4e+005,4e+005)*1
  417. vel.velocity=Head.CFrame.lookVector*50
  418. ArmHit=false
  419. armcon=RightArm.Touched:connect(function(hit)
  420. if hit~=nil and hit.Parent:findFirstChild("Humanoid")~=nil and ArmHit==false then
  421. vel.Parent=nil
  422. ArmHit=true
  423. print("HITTED")
  424. Damagefunc1(hit,10,30,20)
  425. MagicBlock(BrickColor.new("Really Black"),hit.CFrame*cf(0,-1,0),0.5,0.5,0.5,1,1,1)
  426. for i=1,3 do
  427. Lightning(hit.Position,hit.Position+vt(math.random(-10,10),math.random(-10,10),math.random(-10,10)),5,1,"Really Black",0.3,0.1)
  428. end
  429. so("http://www.roblox.com/asset/?id=153092334",Torso,1,1)
  430. for i=0,1,0.2 do
  431. wait()
  432. Neck.C0=necko*euler(0,0,-1+2*i)
  433. RootJoint.C0=RootCF*euler(0,0,1-2*i)
  434. LW.C0=cf(-1.5,0.5,0)*euler(-0.2,0,-0.6)
  435. RW.C0=cf(1.5,0.5,0)*euler(1.57-1.77*i,0,1)
  436. end
  437. wait(0.4)
  438. for i=0,1,0.1 do
  439. wait()
  440. Neck.C0=necko*euler(0,0,1-1*i)
  441. RootJoint.C0=RootCF*euler(0,0,-1+1*i)
  442. LW.C0=cf(-1.5,0.5,0)*euler(-0.2+0.4*i,1.57*i,-0.6+0.6*i)
  443. LW.C1=cf(0, 0.5, 0)*euler(-0.2*i,0,0)
  444. RW.C0=cf(1.5,0.5,0)*euler(-0.2+0.3*i,0,1-1.2*i)
  445. end
  446. end
  447. end)
  448. for i=0,1,0.2 do
  449. wait()
  450. MagicBlock(BrickColor.new("Really Black"),RightArm.CFrame*cf(0,-2.5,0),0.5,0.5,0.5,0.6,0.6,0.6)
  451. Neck.C0=necko*euler(0,0,-1*i)
  452. RootJoint.C0=RootCF*euler(0,0,1*i)
  453. LW.C0=cf(-1.5,0.5,0)*euler(-0.2*i,0,-0.6)
  454. RW.C0=cf(1.5,0.5,0)*euler(1.57*i,0,0.6+0.4*i)
  455. end
  456. for i=0,1,0.1 do
  457. wait()
  458. MagicBlock(BrickColor.new("Really Black"),RightArm.CFrame*cf(0,-2.5,0),0.5,0.5,0.5,0.6,0.6,0.6)
  459. end
  460. vel.Parent=nil
  461. wait(0.5)
  462. if ArmHit==false then
  463. armcon:disconnect()
  464. for i=0,1,0.1 do
  465. wait()
  466. Neck.C0=necko*euler(0,0,-1+1*i)
  467. RootJoint.C0=RootCF*euler(0,0,1-1*i)
  468. LW.C0=cf(-1.5,0.5,0)*euler(-0.2+0.4*i,1.57*i,-0.6+0.6*i)
  469. LW.C1=cf(0, 0.5, 0)*euler(-0.2*i,0,0)
  470. RW.C0=cf(1.5,0.5,0)*euler(1.57-1.47*i,0,1-1.2*i)
  471. end
  472. end
  473. attack=false
  474. end
  475.  
  476. function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  477. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  478. end
  479.  
  480. function Lightning(p0,p1,tym,ofs,col,th,tra)
  481. local magz = (p0 - p1).magnitude local curpos = p0 local trz = {-ofs,ofs}
  482. for i=1,tym do
  483. local li = Instance.new("Part",workspace) li.TopSurface =0 li.BottomSurface = 0 li.Anchored = true li.Transparency = tra or 0.4 li.BrickColor = BrickColor.new(col)
  484. li.formFactor = "Custom" li.CanCollide = false li.Size = Vector3.new(th,th,magz/tym) local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)])
  485. light1=Instance.new("PointLight")
  486. light1.Brightness=.8
  487. light1.Color=Color3.new(.2,255,.2)
  488. light1.Range=8
  489. light1.Parent=li
  490. local trolpos = CFrame.new(curpos,p1)*CFrame.new(0,0,magz/tym).p+ofz
  491. if tym == i then
  492. local magz2 = (curpos - p1).magnitude li.Size = Vector3.new(th,th,magz2)
  493. li.CFrame = CFrame.new(curpos,p1)*CFrame.new(0,0,-magz2/2)
  494. else
  495. li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/tym/2)
  496. end
  497. curpos = li.CFrame*CFrame.new(0,0,magz/tym/2).p game.Debris:AddItem(li,.4)
  498. end
  499. end
  500.  
  501. function ElecEffect(cff,x,y,z)
  502. local prt=part(3,workspace,0,0,BrickColor.new("Really Black"),"Part",vt(1,1,1))
  503. prt.Anchored=true
  504. xval=math.random()
  505. yval=math.random()
  506. zval=math.random()
  507. msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(xval,yval,zval))
  508. coroutine.resume(coroutine.create(function(Part,Mesh,Frame,xvaal,yvaal,zvaal)
  509. Part.CFrame=Frame*cf(math.random(-x,x),math.random(-y,y),math.random(-z,z))
  510. for i=1,10 do
  511. wait()
  512. xvaal=xvaal-0.1
  513. yvaal=yvaal-0.1
  514. zvaal=zvaal-0.1
  515. Mesh.Scale=vt(xvaal,yvaal,zvaal)
  516. Part.Transparency=Part.Transparency+0.09
  517. end
  518. Part.Parent=nil
  519. end),prt,msh,cff,xval,yval,zval)
  520. end
  521.  
  522. function MagicBlock(brickcolor,cframe,x1,y1,z1,x3,y3,z3)
  523. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  524. prt.Anchored=true
  525. prt.CFrame=cframe*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  526. local msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  527. coroutine.resume(coroutine.create(function(Part,Mesh)
  528. for i=0,1,0.1 do
  529. wait()
  530. Part.CFrame=Part.CFrame
  531. Part.Transparency=i
  532. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  533. end
  534. Part.Parent=nil
  535. end),prt,msh)
  536. end
  537.  
  538. function MagicRing(brickcolor,cframe,x1,y1,z1,x2,y2,z2,x3,y3,z3)
  539. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  540. prt.Anchored=true
  541. prt.CFrame=cframe*euler(x2,y2,z2)
  542. local msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=3270017",vt(0,0,0),vt(x1,y1,z1))
  543. coroutine.resume(coroutine.create(function(Part,Mesh)
  544. for i=0,1,0.03 do
  545. wait()
  546. Part.CFrame=Part.CFrame
  547. Part.Transparency=i
  548. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  549. end
  550. Part.Parent=nil
  551. end),prt,msh)
  552. end
  553.  
  554. so = function(id,par,vol,pit)
  555. coroutine.resume(coroutine.create(function()
  556. local sou = Instance.new("Sound",par or workspace)
  557. sou.Volume=vol
  558. sou.Pitch=pit or 1
  559. sou.SoundId=id
  560. wait()
  561. sou:play()
  562. wait(6)
  563. sou:Remove()
  564. end))
  565. end
  566.  
  567. function findNearestTorso(pos)
  568. local list = game:service("Workspace"):children()
  569. local torso = nil
  570. local dist = 50
  571. local temp = nil
  572. local human = nil
  573. local temp2 = nil
  574. for x = 1, #list do
  575. temp2 = list[x]
  576. if (temp2.className == "Model") and (temp2 ~= Character) and (temp2.Name ~= "Fenrier") then
  577. temp = temp2:findFirstChild("Torso")
  578. human = temp2:findFirstChild("Humanoid")
  579. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  580. if (temp.Position - pos).magnitude < dist then
  581. torso = temp
  582. dist = (temp.Position - pos).magnitude
  583. end
  584. end
  585. end
  586. end
  587. return torso
  588. end
  589.  
  590. Damagefunc1=function(hit,minim,maxim,Knockback)
  591. if hit.Parent==nil then
  592. return
  593. end
  594. CPlayer=Bin
  595. h=hit.Parent:FindFirstChild("Humanoid")
  596. if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then
  597. if attackdebounce == false then
  598. attackdebounce = true
  599. coroutine.resume(coroutine.create(function()
  600. wait(0.2)
  601. attackdebounce = false
  602. end))
  603. --[[ if game.Players:GetPlayerFromCharacter(hit.Parent)~=nil then
  604. return
  605. end]]
  606. -- hs(hit,1.2)
  607. c=Instance.new("ObjectValue")
  608. c.Name="creator"
  609. c.Value=game:service("Players").LocalPlayer
  610. c.Parent=h
  611. game:GetService("Debris"):AddItem(c,.5)
  612. Damage=math.random(minim,maxim)
  613. -- h:TakeDamage(Damage)
  614. blocked=false
  615. block=hit.Parent:findFirstChild("Block")
  616. if block~=nil then
  617. print("herp")
  618. if block.Value>0 then
  619. blocked=true
  620. block.Value=block.Value-1
  621. print(block.Value)
  622. end
  623. end
  624. if blocked==false then
  625. -- h:TakeDamage(Damage)
  626. h.Health=h.Health-Damage
  627. showDamage(hit.Parent,Damage,.5,BrickColor:Red())
  628. else
  629. h.Health=h.Health-(Damage/2)
  630. showDamage(hit.Parent,1,.5,BrickColor.new("Grey"))
  631. end
  632. vp=Instance.new("BodyVelocity")
  633. vp.P=500
  634. vp.maxForce=Vector3.new(math.huge,0,math.huge)
  635. -- vp.velocity=Character.Torso.CFrame.lookVector*Knockback
  636. vp.velocity=Head.CFrame.lookVector*Knockback+Head.Velocity/1.05
  637. if Knockback>0 then
  638. vp.Parent=hit.Parent.Torso
  639. end
  640. game:GetService("Debris"):AddItem(vp,.25)
  641. c=Instance.new("ObjectValue")
  642. c.Name="creator"
  643. c.Value=Player
  644. c.Parent=h
  645. game:GetService("Debris"):AddItem(c,.5)
  646. CRIT=false
  647. hitDeb=true
  648. AttackPos=6
  649. end
  650. end
  651. end
  652.  
  653. showDamage=function(Char,Dealt,du,Color)
  654. m=Instance.new("Model")
  655. m.Name=tostring(Dealt)
  656. h=Instance.new("Humanoid")
  657. h.Health=0
  658. h.MaxHealth=0
  659. h.Parent=m
  660. c=Instance.new("Part")
  661. c.Transparency=0
  662. c.BrickColor=Color
  663. c.Name="Head"
  664. c.TopSurface=0
  665. c.BottomSurface=0
  666. c.formFactor="Plate"
  667. c.Size=Vector3.new(1,.4,1)
  668. ms=Instance.new("CylinderMesh")
  669. ms.Scale=Vector3.new(.8,.8,.8)
  670. if CRIT==true then
  671. ms.Scale=Vector3.new(1,1.25,1)
  672. end
  673. ms.Parent=c
  674. c.Reflectance=0
  675. Instance.new("BodyGyro").Parent=c
  676. c.Parent=m
  677. c.CFrame=CFrame.new(Char["Head"].CFrame.p+Vector3.new(0,1.5,0))
  678. f=Instance.new("BodyPosition")
  679. f.P=2000
  680. f.D=100
  681. f.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  682. f.position=c.Position+Vector3.new(0,3,0)
  683. f.Parent=c
  684. game:GetService("Debris"):AddItem(m,.5+du)
  685. c.CanCollide=false
  686. m.Parent=workspace
  687. c.CanCollide=false
  688. end
  689.  
  690. function ob1d(mouse)
  691. if attack == true then return end
  692. hold=true
  693. if combo==0 then
  694. combo=1
  695. attackone()
  696. elseif combo==1 then
  697. combo=2
  698. attacktwo()
  699. elseif combo==2 then
  700. combo=3
  701. attackthree()
  702. end
  703. coroutine.resume(coroutine.create(function()
  704. wait(0.5)
  705. if attack==false then
  706. combo=0
  707. Neck.C0=necko
  708. RootJoint.C0=RootCF
  709. LW.C0=cf(-1.5,0.5,0)*euler(0.2,1.57,0)
  710. LW.C1=cf(0, 0.5, 0)*euler(-0.2,0,0)
  711. RW.C0=cf(1.5,0.5,0)*euler(0.1,0,-0.2)
  712. end
  713. end))
  714. end
  715.  
  716. function ob1u(mouse)
  717. hold = false
  718. end
  719.  
  720. buttonhold = false
  721.  
  722. eul=0
  723. function key(key)
  724. if attack == true then return end
  725. if key=="z" then
  726. for i=1,5 do
  727. ElecEffect(Torso.CFrame,5,5,5)
  728. end
  729. end
  730. end
  731.  
  732. function key2(key)
  733.  
  734. end
  735.  
  736. function s(mouse)
  737. mouse.Button1Down:connect(function() ob1d(mouse) end)
  738. mouse.Button1Up:connect(function() ob1u(mouse) end)
  739. mouse.KeyDown:connect(key)
  740. mouse.KeyUp:connect(key2)
  741. unsheathed = true
  742. player = Player
  743. ch = Character
  744. MMouse = mouse
  745. RSH = ch.Torso["Right Shoulder"]
  746. LSH = ch.Torso["Left Shoulder"]
  747. --
  748. RSH.Parent = nil
  749. LSH.Parent = nil
  750. --
  751. RW.Part0 = ch.Torso
  752. RW.C0 = CFrame.new(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  753. RW.C1 = CFrame.new(0, 0.5, 0)
  754. RW.Part1 = ch["Right Arm"]
  755. RW.Parent = ch.Torso
  756. --_G.R = RW
  757. --
  758. LW.Part0 = ch.Torso
  759. LW.C0 = CFrame.new(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  760. LW.C1 = CFrame.new(0, 0.5, 0)
  761. LW.Part1 = ch["Left Arm"]
  762. LW.Parent = ch.Torso
  763. --_G.L = LW
  764. --
  765. equipanim()
  766. end
  767.  
  768. function ds(mouse)
  769. hideanim()
  770. wait(0)
  771. RW.Parent = nil
  772. LW.Parent = nil
  773. RSH.Parent = player.Character.Torso
  774. LSH.Parent = player.Character.Torso
  775. end
  776.  
  777. Bin.Selected:connect(s)
  778. Bin.Deselected:connect(ds)
  779. --[[function onRunning(speed)
  780. if attack==true then return end
  781. if speed>0 then
  782. walking = true
  783. for i = 0,1,0.1 do
  784. wait()
  785. LW.C0=cf(-1.5,0.5,0)*euler(0.2-0.4*i,1.57,0)
  786. end
  787. else
  788. walking = false
  789. for i = 0,1,0.1 do
  790. wait()
  791. LW.C0=cf(-1.5,0.5,0)*euler(-0.2+0.4*i,1.57,0)
  792. end
  793. end
  794. end
  795. Character.Humanoid.Running:connect(onRunning) ]]
  796. Anim="Idle"
  797. Switching=false
  798. while true do
  799. wait()
  800. local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
  801. if RootPart.Velocity.y > 2 then
  802. if Anim~="Jump" then
  803. Anim="Jump"
  804. end
  805. elseif RootPart.Velocity.y < -2 then
  806. if Anim~="Fall" then
  807. Anim="Fall"
  808. end
  809. elseif torvel < 1 then
  810. if Anim~="Idle" then
  811. Anim="Idle"
  812. coroutine.resume(coroutine.create(function()
  813. while Anim=="Idle" do
  814. for i = 0,1,0.02 do
  815. if Anim=="Idle" and attack==false then
  816. wait()
  817. LW.C0=cf(-1.5,0.5,0)*euler(0.2-0.1*i,1.57-0.05*i,0)
  818. RW.C0=cf(1.5,0.5-0.1*i,0)*euler(0.1+0.1*i,0,-0.2)
  819. end
  820. end
  821. for i = 0,1,0.02 do
  822. if Anim=="Idle" and attack==false then
  823. wait()
  824. LW.C0=cf(-1.5,0.5,0)*euler(0.1+0.1*i,1.52+0.05*i,0)
  825. RW.C0=cf(1.5,0.4+0.1*i,0)*euler(0.2-0.1*i,0,-0.2)
  826. end
  827. end
  828. wait(0)
  829. end
  830. if Anim=="Walk" then
  831. print("Switch to Walk")
  832. Switching=true
  833. for i=0,1,0.1 do
  834. wait()
  835. LW.C0=cf(-1.5,0.5,0)*euler(0.2+0.8*i,1.57-1.57*i,0)
  836. LW.C1=cf(0, 0.5, 0)*euler(-0.2+0.2*i,0,0)
  837. RW.C0=cf(1.5,0.5,0)*euler(0.1-0.9*i,0,-0.2+0.2*i)
  838. end
  839. Switching=false
  840. end
  841. end))
  842. end
  843. elseif torvel < 19 then
  844. if Anim~="Walk" then
  845. Anim="Walk"
  846. coroutine.resume(coroutine.create(function()
  847. wait(0.1)
  848. while Switching==true do
  849. wait()
  850. end
  851. while Anim=="Walk" do
  852. for i=0,1,0.1 do
  853. if Anim=="Walk" and attack==false then
  854. wait()
  855. LW.C0=cf(-1.5,0.5,0)*euler(1-2*i,0,0)
  856. RW.C0=cf(1.5,0.5,0)*euler(-1+2*i,0,0)
  857. end
  858. end
  859. for i=0,1,0.1 do
  860. if Anim=="Walk" and attack==false then
  861. wait()
  862. LW.C0=cf(-1.5,0.5,0)*euler(-1+2*i,0,0)
  863. RW.C0=cf(1.5,0.5,0)*euler(1-2*i,0,0)
  864. end
  865. end
  866. wait(0)
  867. end
  868. end))
  869. end
  870. elseif torvel >= 19 then
  871. if Anim~="Run" then
  872. Anim="Run"
  873. end
  874. end
  875.  
  876. end
  877. print("Mechanic Gauntlets loaded.")
  878.  
  879. --[[
  880. Copyrighted (C) Fenrier 2014
  881. ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement