Advertisement
frog2128

caaa

Mar 10th, 2015
524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.67 KB | None | 0 0
  1. --[[
  2. Cyber Bruiser Class 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. --player
  42. player=nil
  43. --save shoulders
  44. RSH, LSH=nil, nil
  45. --welds
  46. RW, LW=Instance.new("Weld"), Instance.new("Weld")
  47. RW.Name="Right Shoulder" LW.Name="Left Shoulder"
  48. LH=Torso["Left Hip"]
  49. RH=Torso["Right Hip"]
  50. Charge=0
  51.  
  52. function swait(num)
  53. if num==0 or num==nil then
  54. game:service'RunService'.RenderStepped:wait()
  55. else
  56. for i=0,num do
  57. game:service'RunService'.RenderStepped:wait()
  58. end
  59. end
  60. end
  61.  
  62. if Character:findFirstChild("Kaltos Arm",true) ~= nil then
  63. Character:findFirstChild("Kaltos Arm",true).Parent = nil
  64. end
  65. if Player.PlayerGui:findFirstChild("WeaponGUI",true) ~= nil then
  66. Player.PlayerGui:findFirstChild("WeaponGUI",true).Parent = nil
  67. end
  68.  
  69.  
  70. function NoOutline(Part)
  71. Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10
  72. end
  73.  
  74. function part(formfactor,parent,reflectance,transparency,brickcolor,name,size)
  75. local fp=it("Part")
  76. fp.formFactor=formfactor
  77. fp.Parent=parent
  78. fp.Reflectance=reflectance
  79. fp.Transparency=transparency
  80. fp.CanCollide=false
  81. fp.Locked=true
  82. fp.BrickColor=brickcolor
  83. fp.Name=name
  84. fp.Size=size
  85. fp.Position=Torso.Position
  86. NoOutline(fp)
  87. fp.Material="SmoothPlastic"
  88. fp:BreakJoints()
  89. return fp
  90. end
  91.  
  92. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  93. local mesh=it(Mesh)
  94. mesh.Parent=part
  95. if Mesh=="SpecialMesh" then
  96. mesh.MeshType=meshtype
  97. mesh.MeshId=meshid
  98. end
  99. mesh.Offset=offset
  100. mesh.Scale=scale
  101. return mesh
  102. end
  103.  
  104. function weld(parent,part0,part1,c0)
  105. local weld=it("Weld")
  106. weld.Parent=parent
  107. weld.Part0=part0
  108. weld.Part1=part1
  109. weld.C0=c0
  110. return weld
  111. end
  112.  
  113. local Color1=Torso.BrickColor
  114.  
  115. local fengui=it("GuiMain")
  116. fengui.Parent=Player.PlayerGui
  117. fengui.Name="WeaponGUI"
  118. local fenframe=it("Frame")
  119. fenframe.Parent=fengui
  120. fenframe.BackgroundColor3=Color3.new(255,255,255)
  121. fenframe.BackgroundTransparency=1
  122. fenframe.BorderColor3=Color3.new(17,17,17)
  123. fenframe.Size=UDim2.new(0.0500000007, 0, 0.100000001, 0)
  124. fenframe.Position=UDim2.new(0.4,0,0.1,0)
  125. local fenbarmana1=it("TextLabel")
  126. fenbarmana1.Parent=fenframe
  127. fenbarmana1.Text=" "
  128. fenbarmana1.BackgroundTransparency=0
  129. fenbarmana1.BackgroundColor3=Color3.new(0,0,0)
  130. fenbarmana1.SizeConstraint="RelativeXY"
  131. fenbarmana1.TextXAlignment="Center"
  132. fenbarmana1.TextYAlignment="Center"
  133. fenbarmana1.Position=UDim2.new(0,0,0,0)
  134. fenbarmana1.Size=UDim2.new(4,0,0.2,0)
  135. local fenbarmana2=it("TextLabel")
  136. fenbarmana2.Parent=fenframe
  137. fenbarmana2.Text=" "
  138. fenbarmana2.BackgroundTransparency=0
  139. fenbarmana2.BackgroundColor3=Torso.Color
  140. fenbarmana2.SizeConstraint="RelativeXY"
  141. fenbarmana2.TextXAlignment="Center"
  142. fenbarmana2.TextYAlignment="Center"
  143. fenbarmana2.Position=UDim2.new(0,0,0,0)
  144. fenbarmana2.Size=UDim2.new(4*mana/100,0,0.2,0)
  145. local fenbarmana4=it("TextLabel")
  146. fenbarmana4.Parent=fenframe
  147. fenbarmana4.Text="Energy("..mana..")"
  148. fenbarmana4.BackgroundTransparency=1
  149. fenbarmana4.BackgroundColor3=Color3.new(0,0,0)
  150. fenbarmana4.SizeConstraint="RelativeXY"
  151. fenbarmana4.TextXAlignment="Center"
  152. fenbarmana4.TextYAlignment="Center"
  153. fenbarmana4.Position=UDim2.new(0,0,-0.3,0)
  154. fenbarmana4.Size=UDim2.new(4,0,0.2,0)
  155. fenbarmana4.FontSize="Size9"
  156. fenbarmana4.TextStrokeTransparency=0
  157. fenbarmana4.TextColor=BrickColor.new("White")
  158.  
  159. local modelzorz=Instance.new("Model")
  160. modelzorz.Parent=Character
  161. modelzorz.Name="Kaltos Arm"
  162.  
  163. --local prt1=part(3,modelzorz,0,0,Torso.BrickColor,"Handle",vt())
  164. local prt1=part(3,modelzorz,0,0,BrickColor.new("Black"),"Handle",vt())
  165. local prt2=part(3,modelzorz,0,0,BrickColor.new("White"),"Part2",vt())
  166. local prt3=part(3,modelzorz,0,0,BrickColor.new("White"),"Part3",vt())
  167. local prt4=part(3,modelzorz,0,0,BrickColor.new("Black"),"Part4",vt()) --
  168. local prt5=part(3,modelzorz,0,0,BrickColor.new("Black"),"Part5",vt()) --
  169. local prt6=part(3,modelzorz,0,0,BrickColor.new("Black"),"Part6",vt())
  170. local prt7=part(3,modelzorz,0,0,BrickColor.new("White"),"Part7",vt())
  171. local prt10=part(3,modelzorz,0,0,BrickColor.new("White"),"Part10",vt())
  172. local prt11=part(3,modelzorz,0,0,BrickColor.new("Black"),"Part11",vt()) --
  173. local prt12=part(3,modelzorz,0,0,BrickColor.new("Black"),"Part12",vt())
  174. local prt13=part(3,modelzorz,0,0.5,BrickColor.new("Really black"),"Part13",vt())
  175. local prt14=part(3,modelzorz,0,0,BrickColor.new("Black"),"Part14",vt())
  176. local prt15=part(3,modelzorz,0,0,Torso.BrickColor,"Part15",vt())
  177. local prt16=part(3,modelzorz,0,0.5,BrickColor.new("Really black"),"Part16",vt())
  178. local prt17=part(3,modelzorz,0,0.5,BrickColor.new("Really black"),"Part17",vt())
  179. local prt18=part(3,modelzorz,0,0.5,BrickColor.new("Really black"),"Part18",vt())
  180. local prt19=part(3,modelzorz,0,0,BrickColor.new("Black"),"Part19",vt())
  181. local prt20=part(3,modelzorz,0,0,Torso.BrickColor,"Part20",vt())
  182. local prt21=part(3,modelzorz,0,0,Torso.BrickColor,"Part21",vt())
  183.  
  184. local msh1=mesh("BlockMesh",prt1,"","",vt(0,0,0),vt(5,3.5,3.5))
  185. local msh2=mesh("BlockMesh",prt2,"","",vt(0,0,0),vt(8,3,3))
  186. local msh3=mesh("CylinderMesh",prt3,"","",vt(0,0,0),vt(3,5,3))
  187. local msh4=mesh("BlockMesh",prt4,"","",vt(0,0,0),vt(1,5.1,4))
  188. local msh5=mesh("BlockMesh",prt5,"","",vt(0,0,0),vt(1,5.1,4))
  189. local msh6=mesh("CylinderMesh",prt6,"","",vt(0,0,0),vt(5,2.5,5))
  190. local msh7=mesh("CylinderMesh",prt7,"","",vt(0,0,0),vt(5.4,2.4,5.4))
  191. local msh10=mesh("SpecialMesh",prt10,"Sphere","",vt(0,0,0),vt(4,4,4))
  192. local msh11=mesh("BlockMesh",prt11,"","",vt(0,0,0),vt(1,4,4))
  193. local msh12=mesh("CylinderMesh",prt12,"","",vt(0,0,0),vt(3,6,3))
  194. local msh14=mesh("SpecialMesh",prt14,"Head","",vt(0,0,0),vt(4,9,4))
  195. local msh15=mesh("CylinderMesh",prt15,"","",vt(0,0,0),vt(7,3,7))
  196. local msh16=mesh("BlockMesh",prt16,"","",vt(0,0,0),vt(3,7,3))
  197. local msh17=mesh("BlockMesh",prt17,"","",vt(0,0,0),vt(2,12,2))
  198. local msh18=mesh("BlockMesh",prt18,"","",vt(0,0,0),vt(3,3,3))
  199. local msh19=mesh("SpecialMesh",prt19,"Head","",vt(0,0,0),vt(6,5,6))
  200. local msh20=mesh("CylinderMesh",prt20,"","",vt(0,0,0),vt(4,5,4))
  201. local msh21=mesh("SpecialMesh",prt21,"FileMesh","http://www.roblox.com/asset/?id=9756362",vt(0,0,0),vt(1.7,1.2,.8))
  202.  
  203. local wld1=weld(prt1,prt1,Torso,euler(0,0,0)*cf(0,-0.4,-.7))
  204. local wld2=weld(prt2,prt2,prt1,euler(0,0,0)*cf(0,0,0))
  205. local wld3=weld(prt3,prt3,prt1,euler(1.57,0,0)*cf(0,0,0))
  206. local wld4=weld(prt4,prt4,prt3,euler(0,0.785,0)*cf(0,0,0))
  207. local wld5=weld(prt5,prt5,prt3,euler(0,-0.785,0)*cf(0,0,0))
  208. local wld6=weld(prt6,prt6,prt2,euler(1.57,0,0)*cf(-1,-0.5,0))
  209. local wld7=weld(prt7,prt7,prt6,euler(0,0,0)*cf(-.05,0,-.1))
  210. local wld10=weld(prt10,prt10,prt6,euler(0,0,0)*cf(0,0,0))
  211. local wld11=weld(prt11,prt11,prt10,euler(0,0.785,0)*cf(0,0,0))
  212. local wld12=weld(prt12,prt12,prt2,euler(0,0,1.57)*cf(.7,0.2,0)*euler(0,0,0.4))
  213. local wld13=weld(prt13,prt13,prt12,euler(0,0,0)*cf(0,.6,0)*euler(0,0,0))
  214. local wld14=weld(prt14,prt14,prt13,cf(0,.8,0)*euler(0,0,1))
  215. local wld15=weld(prt15,prt15,prt14,euler(1.5,-.7,0)*cf(0,1.2,0.2))
  216. local wld16=weld(prt16,prt16,prt15,cf(0,1.2,0)*euler(1.57,-.8,0))
  217. local wld17=weld(prt17,prt17,prt16,cf(0,1.2,0)*euler(0,0,0.5)*cf(0,.7,0))
  218. local wld18=weld(prt18,prt18,prt17,euler(0,0,0)*cf(0,1.8,0))
  219. local wld19=weld(prt19,prt19,prt15,euler(0,0,0)*cf(0,0,0))
  220. local wld20=weld(prt20,prt20,prt19,euler(0,0,0)*cf(0,0,0))
  221. local wld21=weld(prt21,prt21,prt15,cf(-0.2,0,.5)*euler(0,0.6,0))
  222.  
  223. for i=0,1.5,0.5 do
  224. local prt8=part(3,modelzorz,0,0,BrickColor.new("Black"),"Part8",vt())
  225. local prt9=part(3,modelzorz,0,0,BrickColor.new("White"),"Part9",vt())
  226. local msh8=mesh("CylinderMesh",prt8,"","",vt(0,0,0),vt(1,6,1))
  227. local msh9=mesh("CylinderMesh",prt9,"","",vt(0,0,0),vt(1.5,1.5,1.5))
  228. local wld8=weld(prt8,prt8,prt7,cf(0,.6,0)*euler(1.57,-0.2-i,0))
  229. local wld9=weld(prt9,prt9,prt8,euler(0,0,0)*cf(0,.3,0))
  230. end
  231.  
  232. for i=0.25,-0.45,-0.35 do
  233. local prt22=part(3,modelzorz,0,0,BrickColor.new("Black"),"Part22",vt())
  234. local prt23=part(3,modelzorz,0,0,BrickColor.new("White"),"Part23",vt())
  235. local msh22=mesh("CylinderMesh",prt22,"","",vt(0,0,0),vt(2.5,9,2.5))
  236. local msh23=mesh("CylinderMesh",prt23,"","",vt(0,0,0),vt(2.6,2,2.6))
  237. local wld22=weld(prt22,prt22,prt15,euler(0,0,1.57)*cf(.8,0,i)*euler(0,0.6,0))
  238. local wld23=weld(prt23,prt23,prt22,cf(0,0.6,0))
  239. end
  240.  
  241. for i=0,6.28,2.093 do
  242. local prt24=part(3,modelzorz,0,0,BrickColor.new("Black"),"Part24",vt())
  243. local msh24=mesh("CylinderMesh",prt24,"","",vt(0,0,0),vt(3,7,3))
  244. local wld24=weld(prt24,prt24,prt16,cf(.2,0,0)*euler(0,i,0)) --+2.093
  245. end
  246.  
  247. local hitbox=part(3,nil,0,1,BrickColor.new("Black"),"Hitbox",vt(1,1,1))
  248. hitbox.Anchored=false
  249.  
  250. if (script.Parent.className~="HopperBin") then
  251. Tool=Instance.new("HopperBin")
  252. Tool.Parent=Backpack
  253. Tool.Name="Kaltos Arm"
  254. script.Parent=Tool
  255. end
  256. Bin=script.Parent
  257.  
  258. local bodvel=Instance.new("BodyVelocity")
  259. local bg=Instance.new("BodyGyro")
  260.  
  261. so = function(id,par,vol,pit)
  262. coroutine.resume(coroutine.create(function()
  263. local sou = Instance.new("Sound",par or workspace)
  264. sou.Volume=vol
  265. sou.Pitch=pit or 1
  266. sou.SoundId=id
  267. swait()
  268. sou:play()
  269. game:GetService("Debris"):AddItem(sou,6)
  270. end))
  271. end
  272.  
  273. function clerp(a,b,t)
  274. local qa = {QuaternionFromCFrame(a)}
  275. local qb = {QuaternionFromCFrame(b)}
  276. local ax, ay, az = a.x, a.y, a.z
  277. local bx, by, bz = b.x, b.y, b.z
  278. local _t = 1-t
  279. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  280. end
  281.  
  282. function QuaternionFromCFrame(cf)
  283. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  284. local trace = m00 + m11 + m22
  285. if trace > 0 then
  286. local s = math.sqrt(1 + trace)
  287. local recip = 0.5/s
  288. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  289. else
  290. local i = 0
  291. if m11 > m00 then
  292. i = 1
  293. end
  294. if m22 > (i == 0 and m00 or m11) then
  295. i = 2
  296. end
  297. if i == 0 then
  298. local s = math.sqrt(m00-m11-m22+1)
  299. local recip = 0.5/s
  300. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  301. elseif i == 1 then
  302. local s = math.sqrt(m11-m22-m00+1)
  303. local recip = 0.5/s
  304. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  305. elseif i == 2 then
  306. local s = math.sqrt(m22-m00-m11+1)
  307. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  308. end
  309. end
  310. end
  311.  
  312. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  313. local xs, ys, zs = x + x, y + y, z + z
  314. local wx, wy, wz = w*xs, w*ys, w*zs
  315. local xx = x*xs
  316. local xy = x*ys
  317. local xz = x*zs
  318. local yy = y*ys
  319. local yz = y*zs
  320. local zz = z*zs
  321. 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))
  322. end
  323.  
  324. function QuaternionSlerp(a, b, t)
  325. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  326. local startInterp, finishInterp;
  327. if cosTheta >= 0.0001 then
  328. if (1 - cosTheta) > 0.0001 then
  329. local theta = math.acos(cosTheta)
  330. local invSinTheta = 1/math.sin(theta)
  331. startInterp = math.sin((1-t)*theta)*invSinTheta
  332. finishInterp = math.sin(t*theta)*invSinTheta
  333. else
  334. startInterp = 1-t
  335. finishInterp = t
  336. end
  337. else
  338. if (1+cosTheta) > 0.0001 then
  339. local theta = math.acos(-cosTheta)
  340. local invSinTheta = 1/math.sin(theta)
  341. startInterp = math.sin((t-1)*theta)*invSinTheta
  342. finishInterp = math.sin(t*theta)*invSinTheta
  343. else
  344. startInterp = t-1
  345. finishInterp = t
  346. end
  347. end
  348. 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
  349. end
  350.  
  351. function hideanim()
  352. equipped=false
  353. for i=0,1,0.1 do
  354. swait()
  355. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4)
  356. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0),.4)
  357. Torso.Neck.C1=clerp(Torso.Neck.C1,necko2*euler(0,0,0),.4)
  358. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,0),.4)
  359. RW.C1=clerp(RW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  360. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,0),.4)
  361. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4)
  362. RH.C0=clerp(RH.C0,RHC0,.2)
  363. RH.C1=clerp(RH.C1,RHC1,.2)
  364. LH.C0=clerp(LH.C0,LHC0,.2)
  365. LH.C1=clerp(LH.C1,LHC1,.2)
  366. end
  367. end
  368.  
  369. function equipanim()
  370. equipped=true
  371. for i=0,1,0.1 do
  372. swait()
  373. Neck.C0=clerp(Neck.C0,necko*euler(0,0,0),.3)
  374. Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.3)
  375. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.3)
  376. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,0.1),.3)
  377. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  378. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-0.1),.3)
  379. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  380. end
  381. end
  382.  
  383. function MagniDamage(Part,magni,mindam,maxdam,knock,Type)
  384. for _,c in pairs(workspace:children()) do
  385. local hum=c:findFirstChild("Humanoid")
  386. if hum~=nil then
  387. local head=c:findFirstChild("Torso")
  388. if head~=nil then
  389. local targ=head.Position-Part.Position
  390. local mag=targ.magnitude
  391. if mag<=magni and c.Name~=Player.Name then
  392. Damagefunc(head,mindam,maxdam,knock,Type,RootPart,.2,1,nil,1)
  393. end
  394. end
  395. end
  396. end
  397. end
  398.  
  399. function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  400. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  401. end
  402.  
  403. local Effects={}
  404. local Point=Torso.CFrame*cf(0,Torso.Size.Y,0)
  405. LastPoint=Point
  406. function effect(Color,Ref,LP,P1,returnn)
  407. local effectsmsh=Instance.new("CylinderMesh")
  408. effectsmsh.Scale=Vector3.new(0.2,1,0.2)
  409. effectsmsh.Name="Mesh"
  410. local effectsg=Instance.new("Part")
  411. effectsg.formFactor=3
  412. effectsg.CanCollide=false
  413. effectsg.Name="Eff"
  414. effectsg.Locked=true
  415. effectsg.Anchored=true
  416. effectsg.Size=Vector3.new(0.5,1,0.5)
  417. effectsg.Parent=workspace
  418. effectsmsh.Parent=effectsg
  419. effectsg.BrickColor=Color1
  420. effectsg.Reflectance=Ref
  421. local point1=P1
  422. local mg=(LP.p - point1.p).magnitude
  423. effectsg.Size=Vector3.new(0.5,mg,0.5)
  424. effectsg.CFrame=cf((LP.p+point1.p)/2,point1.p) * CFrame.Angles(math.rad(90),0,0)
  425. effectsmsh.Scale=Vector3.new(0.4,1,0.4)
  426. game:GetService("Debris"):AddItem(effectsg,2)
  427. if returnn then return effectsg end
  428. if not returnn then
  429. table.insert(Effects,{effectsg,"Cylinder",0.05,0.01,0,0.01})
  430. end
  431. end
  432.  
  433. function MagicBlock(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay,Type,parent)
  434. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt())
  435. prt.Anchored=true
  436. prt.CFrame=cframe
  437. msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  438. game:GetService("Debris"):AddItem(prt,5)
  439. table.insert(Effects,{prt,"Block1",delay,x3,y3,z3,msh})
  440. end
  441.  
  442. function MagicCircle(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  443. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt())
  444. prt.Anchored=true
  445. prt.CFrame=cframe
  446. local msh=mesh("SpecialMesh",prt,"Sphere","",vt(0,0,0),vt(x1,y1,z1))
  447. game:GetService("Debris"):AddItem(prt,2)
  448. table.insert(Effects,{prt,"Cylinder2",delay,x3,y3,z3,msh})
  449. end
  450.  
  451. function MagicWave(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  452. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt())
  453. prt.Anchored=true
  454. prt.CFrame=cframe
  455. local msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=20329976",vt(0,0,0),vt(x1,y1,z1))
  456. game:GetService("Debris"):AddItem(prt,5)
  457. table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3})
  458. end
  459.  
  460. Damagefunc=function(hit,minim,maxim,knockback,Type,Property,Delay,KnockbackType,decreaseblock,Slash)
  461. if hit.Parent==nil then
  462. return
  463. end
  464. h=hit.Parent:FindFirstChild("Humanoid")
  465. for _,v in pairs(hit.Parent:children()) do
  466. if v:IsA("Humanoid") then
  467. h=v
  468. end
  469. end
  470. if hit.Parent.Parent:FindFirstChild("Torso")~=nil then
  471. h=hit.Parent.Parent:FindFirstChild("Humanoid")
  472. end
  473. if hit.Parent.className=="Hat" then
  474. hit=hit.Parent.Parent:findFirstChild("Head")
  475. end
  476. if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then
  477. if hit.Parent:findFirstChild("DebounceHit")~=nil then if hit.Parent.DebounceHit.Value==true then return end end
  478. --[[ if game.Players:GetPlayerFromCharacter(hit.Parent)~=nil then
  479. return
  480. end]]
  481. -- hs(hit,1.2)
  482. if Slash==1 then
  483. so("http://www.roblox.com/asset/?id=10209590",hit,1,1)
  484. MagicCircle(Color1,hit.CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50)),.2,2,.2,.2,6,.2,0.1)
  485. end
  486. c=Instance.new("ObjectValue")
  487. c.Name="creator"
  488. c.Value=game:service("Players").LocalPlayer
  489. c.Parent=h
  490. game:GetService("Debris"):AddItem(c,.5)
  491. Damage=math.random(minim,maxim)
  492. -- h:TakeDamage(Damage)
  493. blocked=false
  494. block=hit.Parent:findFirstChild("Block")
  495. if block~=nil then
  496. print(block.className)
  497. if block.className=="NumberValue" then
  498. if block.Value>0 then
  499. blocked=true
  500. if decreaseblock~=nil then
  501. block.Value=block.Value-decreaseblock
  502. end
  503. end
  504. end
  505. if block.className=="IntValue" then
  506. if block.Value>0 then
  507. blocked=true
  508. if decreaseblock~=nil then
  509. block.Value=block.Value-decreaseblock
  510. end
  511. end
  512. end
  513. end
  514. if blocked==false then
  515. -- h:TakeDamage(Damage)
  516. h.Health=h.Health-Damage
  517. showDamage(hit.Parent,Damage,.5,BrickColor:Red())
  518. else
  519. h.Health=h.Health-(Damage/2)
  520. showDamage(hit.Parent,Damage/2,.5,BrickColor.new("Bright blue"))
  521. end
  522. if Type=="Knockdown" then
  523. hum=hit.Parent.Humanoid
  524. hum.PlatformStand=true
  525. coroutine.resume(coroutine.create(function(HHumanoid)
  526. swait(1)
  527. HHumanoid.PlatformStand=false
  528. end),hum)
  529. local angle=(hit.Position-(Property.Position+Vector3.new(0,0,0))).unit
  530. --hit.CFrame=cf(hit.Position,Vector3.new(angle.x,hit.Position.y,angle.z))*CFrame.fromEulerAnglesXYZ(math.pi/4,0,0)
  531. local bodvol=Instance.new("BodyVelocity")
  532. bodvol.velocity=angle*knockback
  533. bodvol.P=5000
  534. bodvol.maxForce=Vector3.new(8e+003, 8e+003, 8e+003)
  535. bodvol.Parent=hit
  536. rl=Instance.new("BodyAngularVelocity")
  537. rl.P=3000
  538. rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000
  539. rl.angularvelocity=Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  540. rl.Parent=hit
  541. game:GetService("Debris"):AddItem(bodvol,.5)
  542. game:GetService("Debris"):AddItem(rl,.5)
  543. elseif Type=="Normal" then
  544. vp=Instance.new("BodyVelocity")
  545. vp.P=500
  546. vp.maxForce=Vector3.new(math.huge,0,math.huge)
  547. -- vp.velocity=Character.Torso.CFrame.lookVector*Knockback
  548. if KnockbackType==1 then
  549. vp.velocity=Property.CFrame.lookVector*knockback+Property.Velocity/1.05
  550. elseif KnockbackType==2 then
  551. vp.velocity=Property.CFrame.lookVector*knockback
  552. end
  553. if knockback>0 then
  554. vp.Parent=hit.Parent.Torso
  555. end
  556. game:GetService("Debris"):AddItem(vp,.5)
  557. elseif Type=="Up" then
  558. local bodyVelocity=Instance.new("BodyVelocity")
  559. bodyVelocity.velocity=vt(0,30,0)
  560. bodyVelocity.P=5000
  561. bodyVelocity.maxForce=Vector3.new(8e+003, 8e+003, 8e+003)
  562. bodyVelocity.Parent=hit
  563. game:GetService("Debris"):AddItem(bodyVelocity,1)
  564. rl=Instance.new("BodyAngularVelocity")
  565. rl.P=3000
  566. rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000
  567. rl.angularvelocity=Vector3.new(math.random(-2,2),math.random(-2,2),math.random(-2,2))
  568. rl.Parent=hit
  569. game:GetService("Debris"):AddItem(rl,.5)
  570. elseif Type=="Snare" then
  571. bp=Instance.new("BodyPosition")
  572. bp.P=2000
  573. bp.D=100
  574. bp.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  575. bp.position=hit.Parent.Torso.Position
  576. bp.Parent=hit.Parent.Torso
  577. game:GetService("Debris"):AddItem(bp,1)
  578. end
  579. debounce=Instance.new("BoolValue")
  580. debounce.Name="DebounceHit"
  581. debounce.Parent=hit.Parent
  582. debounce.Value=true
  583. game:GetService("Debris"):AddItem(debounce,Delay)
  584. c=Instance.new("ObjectValue")
  585. c.Name="creator"
  586. c.Value=Player
  587. c.Parent=h
  588. game:GetService("Debris"):AddItem(c,.5)
  589. CRIT=false
  590. end
  591. end
  592.  
  593. showDamage=function(Char,Dealt,du,Color)
  594. m=Instance.new("Model")
  595. m.Name=tostring(math.floor(Dealt))
  596. h=Instance.new("Humanoid")
  597. h.Health=0
  598. h.MaxHealth=0
  599. h.Parent=m
  600. c=Instance.new("Part")
  601. c.Transparency=0
  602. c.BrickColor=Color
  603. c.Name="Head"
  604. c.TopSurface=0
  605. c.BottomSurface=0
  606. c.formFactor="Plate"
  607. c.Size=Vector3.new(1,.4,1)
  608. ms=Instance.new("CylinderMesh")
  609. ms.Scale=Vector3.new(.8,.8,.8)
  610. if CRIT==true then
  611. ms.Scale=Vector3.new(1,1.25,1)
  612. end
  613. ms.Parent=c
  614. c.Reflectance=0
  615. Instance.new("BodyGyro").Parent=c
  616. c.Parent=m
  617. if Char:findFirstChild("Head")~=nil then
  618. c.CFrame=cf(Char["Head"].CFrame.p+Vector3.new(0,1.5,0))
  619. elseif Char.Parent:findFirstChild("Head")~=nil then
  620. c.CFrame=cf(Char.Parent["Head"].CFrame.p+Vector3.new(0,1.5,0))
  621. end
  622. f=Instance.new("BodyPosition")
  623. f.P=2000
  624. f.D=100
  625. f.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  626. f.position=c.Position+Vector3.new(0,3,0)
  627. f.Parent=c
  628. game:GetService("Debris"):AddItem(m,.5+du)
  629. c.CanCollide=false
  630. m.Parent=workspace
  631. c.CanCollide=false
  632. end
  633.  
  634. combo=0
  635. function ob1d(mouse)
  636. if attack==true then return end
  637. hold=true
  638. if combo==0 then
  639. combo=1
  640. --attackone()
  641. elseif combo==1 then
  642. combo=2
  643. --attacktwo()
  644. elseif combo==2 then
  645. combo=0
  646. --attackthree()
  647. end
  648. coroutine.resume(coroutine.create(function()
  649. for i=1,50 do
  650. if attack==false then
  651. swait()
  652. end
  653. end
  654. if attack==false then
  655. combo=0
  656. end
  657. end))
  658. end
  659.  
  660. function ob1u(mouse)
  661. hold = false
  662. end
  663.  
  664. buttonhold = false
  665.  
  666. eul=0
  667. holdx=false
  668. equipped=false
  669. function key(key)
  670. if attack==true then return end
  671. if key=="f" then
  672. attack=true
  673. if equipped==false then
  674. equipped=true
  675. RSH=ch.Torso["Right Shoulder"]
  676. LSH=ch.Torso["Left Shoulder"]
  677. --
  678. RSH.Parent=nil
  679. LSH.Parent=nil
  680. --
  681. RW.Name="Right Shoulder"
  682. RW.Part0=ch.Torso
  683. RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  684. RW.C1=cf(0, 0.5, 0)
  685. RW.Part1=ch["Right Arm"]
  686. RW.Parent=ch.Torso
  687. --
  688. LW.Name="Left Shoulder"
  689. LW.Part0=ch.Torso
  690. LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  691. LW.C1=cf(0, 0.5, 0)
  692. LW.Part1=ch["Left Arm"]
  693. LW.Parent=ch.Torso
  694. --
  695. equipanim()
  696. else
  697. equipped=false
  698. hideanim()
  699. swait(0)
  700. RW.Parent=nil
  701. LW.Parent=nil
  702. RSH.Parent=player.Character.Torso
  703. LSH.Parent=player.Character.Torso
  704. end
  705. attack=false
  706. end
  707. if equipped==false then return end
  708. end
  709.  
  710. function key2(key)
  711. end
  712.  
  713. function s(mouse)
  714. mouse.Button1Down:connect(function() ob1d(mouse) end)
  715. mouse.Button1Up:connect(function() ob1u(mouse) end)
  716. mouse.KeyDown:connect(key)
  717. mouse.KeyUp:connect(key2)
  718.  
  719. player=Player
  720. ch=Character
  721. MMouse=mouse
  722. end
  723.  
  724. function ds(mouse)
  725. end
  726.  
  727. Bin.Selected:connect(s)
  728. Bin.Deselected:connect(ds)
  729. print("Cyber Bruiser loaded.")
  730.  
  731. local mananum=0
  732. while true do
  733. swait()
  734. local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
  735. local velderp=RootPart.Velocity.y
  736. hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,4,Character)
  737. if equipped==true then
  738. if attack==false then
  739. idle=idle+1
  740. else
  741. idle=0
  742. end
  743. if idle>=500 then
  744. if attack==false then
  745. --Sheath()
  746. end
  747. end
  748. if RootPart.Velocity.y > 1 and hitfloor==nil then
  749. Anim="Jump"
  750. if attack==false then
  751. Neck.C0=clerp(Neck.C0,necko*euler(-0.2,0,0),.3)
  752. Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.3)
  753. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.3)
  754. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.5,0,0.5),.3)
  755. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  756. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.5,0,-0.5),.3)
  757. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  758. RH.C0=clerp(RH.C0,cf(1,-1,-.3)*euler(-0.5,1.57,0)*euler(-.2,0,0),.2)
  759. LH.C0=clerp(LH.C0,cf(-1,-1,-.3)*euler(-0.5,-1.57,0)*euler(-.2,0,0),.2)
  760. end
  761. elseif RootPart.Velocity.y < -1 and hitfloor==nil then
  762. Anim="Fall"
  763. if attack==false then
  764. Neck.C0=clerp(Neck.C0,necko*euler(0.4,0,0),.3)
  765. Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.3)
  766. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.3)
  767. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0.3,0,0.2),.3)
  768. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  769. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0.3,0,-0.2),.3)
  770. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  771. RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0.4,1.57,0),.2)
  772. LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(-0.2,-1.57,0),.2)
  773. end
  774. elseif torvel<1 and hitfloor~=nil then
  775. Anim="Idle"
  776. if attack==false then
  777. wld14.C0=clerp(wld14.C0,cf(0,.8,0)*euler(0,0,1),.3)
  778. wld15.C0=clerp(wld15.C0,euler(1.5,-.7,0)*cf(0,1.2,0.2),.3)
  779. wld16.C0=clerp(wld16.C0,cf(0,1.2,0)*euler(1.57,-.8,0),.3)
  780. wld17.C0=clerp(wld17.C0,cf(0,1.2,0)*euler(0,0,0.5)*cf(0,.7,0),.3)
  781. wld18.C0=clerp(wld18.C0,euler(0,0,0)*cf(0,1.8,0),.3)
  782. Neck.C0=clerp(Neck.C0,necko*euler(0,0,0),.3)
  783. Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.3)
  784. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.3)
  785. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,0.1),.3)
  786. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  787. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-0.1),.3)
  788. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  789. RH.C0=clerp(RH.C0,RHC0,.3)
  790. RH.C1=clerp(RH.C1,RHC1,.3)
  791. LH.C0=clerp(LH.C0,LHC0,.3)
  792. LH.C1=clerp(LH.C1,LHC1,.3)
  793. end
  794. elseif torvel>2 and torvel<22 and hitfloor~=nil then
  795. Anim="Walk"
  796. if attack==false then
  797. wld14.C0=clerp(wld14.C0,cf(0,.8,0)*euler(0,0,.5),.3)
  798. wld15.C0=clerp(wld15.C0,euler(1.2,-.1,.2)*cf(0,1.2,0.2),.3)
  799. wld16.C0=clerp(wld16.C0,cf(0,1.2,0)*euler(1.57,-.8,0),.3)
  800. wld17.C0=clerp(wld17.C0,cf(0,1.2,0)*euler(0,0,0.2)*cf(0,.7,0),.3)
  801. wld18.C0=clerp(wld18.C0,euler(0,0,0)*cf(0,1.8,0),.3)
  802. Neck.C0=clerp(Neck.C0,necko*euler(0,0,0),.3)
  803. Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.3)
  804. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0.1,0,0),.3)
  805. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-0.2,0,0.3),.3)
  806. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  807. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-0.2,0,-0.3),.3)
  808. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  809. end
  810. elseif torvel>=22 and hitfloor~=nil then
  811. Anim="Run"
  812. if attack==false then
  813. Neck.C0=clerp(Neck.C0,necko*euler(0,0,0),.3)
  814. Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.3)
  815. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0.2,0,0),.3)
  816. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-0.5,0,0.5),.3)
  817. RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  818. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-0.5,0,-0.5),.3)
  819. LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3)
  820. end
  821. end
  822. end
  823. if #Effects>0 then
  824. --table.insert(Effects,{prt,"Block1",delay})
  825. for e=1,#Effects do
  826. if Effects[e]~=nil then
  827. --for j=1,#Effects[e] do
  828. local Thing=Effects[e]
  829. if Thing~=nil then
  830. local Part=Thing[1]
  831. local Mode=Thing[2]
  832. local Delay=Thing[3]
  833. local IncX=Thing[4]
  834. local IncY=Thing[5]
  835. local IncZ=Thing[6]
  836. if Thing[1].Transparency<=1 then
  837. if Thing[2]=="Block1" then
  838. Thing[1].CFrame=Thing[1].CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  839. Mesh=Thing[1].Mesh
  840. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  841. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  842. elseif Thing[2]=="Cylinder" then
  843. Mesh=Thing[1].Mesh
  844. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  845. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  846. elseif Thing[2]=="Blood" then
  847. Mesh=Thing[7]
  848. Thing[1].CFrame=Thing[1].CFrame*cf(0,.5,0)
  849. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  850. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  851. elseif Thing[2]=="Elec" then
  852. Mesh=Thing[1].Mesh
  853. Mesh.Scale=Mesh.Scale+vt(Thing[7],Thing[8],Thing[9])
  854. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  855. elseif Thing[2]=="Disappear" then
  856. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  857. end
  858. else
  859. Part.Parent=nil
  860. table.remove(Effects,e)
  861. end
  862. end
  863. --end
  864. end
  865. end
  866. end
  867. fenbarmana2:TweenSize(UDim2.new(4*mana/100,0,0.2,0),nil,1,0.4,true)
  868. fenbarmana4.Text="Energy("..mana..")"
  869. if mana>=100 then
  870. mana=100
  871. else
  872. if mananum<=12 then
  873. mananum=mananum+1
  874. else
  875. mananum=0
  876. mana=mana+1
  877. end
  878. end
  879. end
  880. --[[
  881. Copyrighted (C) Fenrier 2014
  882. ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement