Advertisement
DigitalZer3

Untitled

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