Dark_EccentricYT

Untitled

Oct 15th, 2018
3,410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.20 KB | None | 0 0
  1. -- the head basher sword
  2. function rand(a)return (math.random()-.5)*2*a end
  3. function q(f,arg)return coroutine.resume(coroutine.create(f),unpack(arg or {}))end
  4. function fade(p,s)q(function(part,start)for i=start,1,.05 do part.Transparency = part.Transparency+0.05 wait(1/30)end end,{p,s})end
  5. function appear(p,s)q(function(part,start)for i=start,0,-.05 do part.Transparency = part.Transparency-0.05 wait(1/30)end end,{p,s})end
  6. function Part(Name,Parent,Size,CFrame,Color,Trans,Anch,Can,Mat,Ref)
  7. local p = Instance.new("Part",Parent)p.Name = Name
  8. p.FormFactor = "Custom"p.Size = Size
  9. p.Anchored = Anch p.CFrame = CFrame
  10. p.BrickColor = BrickColor.new(Color)p.Transparency = Trans
  11. p.TopSurface = 0 p.CanCollide = Can
  12. p.BottomSurface = 0 p.Material = Mat
  13. p.Reflectance = Ref or 0;p:BreakJoints()
  14. p.Locked = true;return p
  15. end
  16. function WedgePart(Name,Parent,Size,CFrame,Color,Trans,Anch,Can,Mat,Ref)
  17. local p = Instance.new("WedgePart",Parent)p.Name = Name
  18. p.FormFactor = "Custom"p.Size = Size
  19. p.Anchored = Anch p.CFrame = CFrame
  20. p.BrickColor = BrickColor.new(Color)p.Transparency = Trans
  21. p.TopSurface = 0 p.CanCollide = Can
  22. p.BottomSurface = 0 p.Material = Mat
  23. p.Reflectance = Ref or 0;p:BreakJoints()
  24. p.Locked = true;return p
  25. end
  26. function CornerWedgePart(Name,Parent,Size,CFrame,Color,Trans,Anch,Can,Mat,Ref)
  27. local p = Instance.new("CornerWedgePart",Parent)p.Name = Name;p.Size = Size
  28. p.Anchored = Anch p.CFrame = CFrame
  29. p.BrickColor = BrickColor.new(Color)p.Transparency = Trans
  30. p.TopSurface = 0 p.CanCollide = Can
  31. p.BottomSurface = 0 p.Material = Mat
  32. p.Reflectance = Ref or 0;p:BreakJoints()
  33. p.Locked = true;return p
  34. end
  35. function Mesh(Parent,Type,Scale,ID,TID)
  36. local m = Instance.new("SpecialMesh",Parent)m.MeshType = Type
  37. m.Scale = Scale or Vector3.new(1,1,1)
  38. if ID then m.MeshId = ID end if TID then m.TextureId = TID end
  39. return m
  40. end
  41. function Weld(p1,p2,c0,c1)
  42. local w = Instance.new("Weld",p1)w.Part0 = p1;w.Part1 = p2
  43. w.C0,w.C1 = c0 or CFrame.new(),c1 or CFrame.new()
  44. return w
  45. end
  46. function cslerp(c1,c2,t)
  47. local function s(a,b,c)return (1-c)*a+(c*b)end
  48. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  49. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  50. for i,v in pairs(com1)do com1[i] = s(v,com2[i],t)end
  51. return CFrame.new(com1[1],com1[2],com1[3])*CFrame.Angles(select(4,unpack(com1)))
  52. end
  53. ---------------------------------------------
  54. player = game:service("Players").LocalPlayer
  55. local char
  56. repeat wait() char = player.Character until char
  57. root = char:WaitForChild("HumanoidRootPart")
  58. torso = char:WaitForChild("Torso")
  59. humanoid = char:WaitForChild("Humanoid")
  60. mouse = player:GetMouse()
  61. step = game:service("RunService").Stepped
  62. asset = "http://www.roblox.com/asset/?id="
  63. meshes = {["blast"] = 20329976,["ring"] = 3270017,["spike"] = 1033714,["cone"] = 1082802,["crown"] = 20329976,["cloud"] = 1095708,["diamond"] = 9756362}
  64. sounds = {}
  65. Mode = ""
  66. c0 = {
  67. ls = CFrame.new(-1,0.5,0),
  68. rs = CFrame.new(1,0.5,0),
  69. lh = CFrame.new(-1,-1,0),
  70. rh = CFrame.new(1,-1,0),
  71. nk = CFrame.new(0,1,0),
  72. tw = CFrame.new(0,0,0),
  73. }
  74. c1 = {
  75. ls = CFrame.new(0.5,0.5,0),
  76. rs = CFrame.new(-0.5,0.5,0),
  77. lh = CFrame.new(-.5,1,0),
  78. rh = CFrame.new(.5,1,0),
  79. nk = CFrame.new(0,-.5,0),
  80. tw = CFrame.new(0,0,0),
  81. }
  82. rh = Weld(torso,char:WaitForChild("Right Leg"),c0.rh,c1.rh)
  83. rs = Weld(torso,char:WaitForChild("Right Arm"),c0.rs,c1.rs)
  84. lh = Weld(torso,char:WaitForChild("Left Leg"),c0.lh,c1.lh)
  85. ls = Weld(torso,char:WaitForChild("Left Arm"),c0.ls,c1.ls)
  86. ne = Weld(torso,char:WaitForChild("Head"),c0.nk,c1.nk)
  87. rw = Weld(root,torso,c0.tw,c1.tw)
  88. cWalkS = 20
  89. lastpulse = tick()
  90. pulsetime = 2.25
  91. Attacking = false
  92. colour = {"Black","Bright yellow"}
  93. Idles = {"FAB"}
  94. lastIdle = tick()
  95. curIdle = ""
  96. isIdlePosing = false
  97. startedIdle = 0
  98. bIdleTime = 10
  99. ---------------------------------------------
  100. function Smoke(origin,color)
  101. local p = Part("Effect",workspace,Vector3.new(2,2,2),origin*CFrame.new(rand(5),-1,rand(5)),color or "Black",.1,false,false,"SmoothPlastic")
  102. local m = Mesh(p,"Sphere",Vector3.new(1.25,1.25,1.25))
  103. local bp = Instance.new("BodyPosition",p)bp.D = 100 bp.P = 100 bp.position = p.Position+Vector3.new(0,7,0)
  104. q(function(pa,me)
  105. fade(pa,.1)
  106. for i=25,100 do
  107. me.Scale = me.Scale+Vector3.new(0.15,0.1,0.15)
  108. wait(1/30)
  109. end
  110. pa:Destroy()
  111. end,{p,m})
  112. end
  113. function brickMagic(origin,color,size)
  114. local p = Part("Effect",workspace,Vector3.new(size,size,size),origin*CFrame.Angles(rand(5),rand(5),rand(5)),color,.2,true,false,"SmoothPlastic")
  115. local m = Mesh(p,"Brick")
  116. q(function(pa,me)
  117. fade(pa,.2)
  118. for i=20,100 do
  119. me.Scale = me.Scale-Vector3.new(0.05,0.05,0.05)
  120. wait(1/30)
  121. end
  122. pa:Destroy()
  123. end,{p,m})
  124. end
  125. function spikeMagic(origin,size,color)
  126. local p = Part("Effect",workspace,Vector3.new(1,1,1),origin*CFrame.new(0,-size,0),color,1,true,false,"SmoothPlastic")
  127. local m = Mesh(p,"FileMesh",Vector3.new(size/2,size*2,size/2),asset..meshes["spike"])
  128. q(function(pa,me)
  129. appear(pa,1)
  130. for i=1,size,.5 do
  131. wait(1/30)
  132. pa.CFrame = pa.CFrame*CFrame.new(0,.5,0)
  133. end
  134. wait(math.random(2,3))fade(pa,0)
  135. Delay(3,function()pa:Destroy()end)
  136. end,{p,m})
  137. end
  138. function placePart(origin,size,color,material)
  139. local p = Part("Effect",workspace,Vector3.new(size,size,size),origin*CFrame.Angles(rand(5),rand(5),rand(5)),color,0,true,true,material)
  140. local m = Mesh(p,"Brick")
  141. q(function(pa,me)
  142. wait(5)
  143. fade(pa,0)
  144. Delay(1.25,function()pa:Destroy()end)
  145. end,{p,m})
  146. end
  147. function crater(origin,dist)
  148. local b = workspace.Base
  149. local bc = b and tostring(b.BrickColor) or "Bright green"
  150. local m = b and b.Material or "Grass"
  151. for i=0,360,30 do
  152. local cf = origin*CFrame.Angles(0,math.rad(i),0)*CFrame.new(0,0,dist)*CFrame.Angles(math.rad(i/30),0,rand(5))
  153. placePart(cf,math.random(10,12),bc,m)
  154. end
  155. end
  156. function cylinderExplode(origin,color,size,ysize)
  157. local p = Part("Effect",workspace,Vector3.new(size,ysize or size,size),origin,color,.2,true,false,"SmoothPlastic")
  158. local m = Instance.new("CylinderMesh",p)
  159. q(function(pa,me)
  160. for i=.2,1,.0075 do
  161. me.Scale = me.Scale+Vector3.new(.1,0,.1)
  162. pa.Transparency = i
  163. wait(1/30)
  164. end
  165. pa:Destroy()
  166. end,{p,m})
  167. end
  168. function ringExplode(origin,color,size)
  169. local p = Part("Effect",workspace,Vector3.new(size,size,1),origin,color,.2,true,false,"SmoothPlastic")
  170. local m = Mesh(p,"FileMesh",Vector3.new(),asset..meshes["ring"])
  171. q(function(pa,me)
  172. for i=.2,1,.0075 do
  173. me.Scale = me.Scale-Vector3.new(0.5,0.5,0)
  174. pa.Transparency = i
  175. wait(1/30)
  176. end
  177. pa:Destroy()
  178. end,{p,m})
  179. end
  180. function crownExplode(origin,color,size)
  181. local p = Part("Effect",workspace,Vector3.new(size,size,size),origin,color,.2,true,false,"SmoothPlastic")
  182. local m = Mesh(p,"FileMesh",Vector3.new(size/2,size/2,size/2),asset..meshes["crown"])
  183. q(function(pa,me)
  184. for i=.2,1,.025 do
  185. me.Scale = me.Scale+Vector3.new(0.75,0.75,0.75)
  186. pa.Transparency = i
  187. wait(1/30)
  188. end
  189. pa:Destroy()
  190. end,{p,m})
  191. end
  192. function glitter(origin,color)
  193. local p = Part("Effect",workspace,Vector3.new(0.75,0.75,0.75),origin*CFrame.new(rand(5),rand(5),rand(5))*CFrame.Angles(rand(5),rand(5),rand(5)),color,0,true,false,"SmoothPlastic")
  194. local m = Mesh(p,"Brick",Vector3.new(1,1,1))
  195. q(function(pa,me)
  196. fade(pa,0)
  197. for i=0,1,.05 do
  198. me.Scale = me.Scale-Vector3.new(0.05,0.05,0.05)
  199. wait(1/30)
  200. end
  201. pa:Destroy()
  202. end,{p,m})
  203. end
  204. function quickSound(id,v)
  205. local s = Instance.new("Sound",workspace)
  206. s.SoundId = id
  207. s.PlayOnRemove = true
  208. s.Volume = v or 1
  209. delay(0.025,function()s:remove()end)
  210. end
  211. function checkDmgArea(origin,dmg,d)
  212. for i,v in pairs(workspace:children())do
  213. if v~=char and v:FindFirstChild("Torso") then
  214. local h;
  215. for _,k in pairs(v:children())do if k:IsA("Humanoid") then h = k end end
  216. local dist = (origin.p - v:FindFirstChild("Torso").CFrame.p).magnitude
  217. if dist < d and h~=nil then
  218. h.Health = h.Health - dmg
  219. end
  220. end
  221. end
  222. end
  223. function findClosestPlayer(origin,d)
  224. local bdist,plr = d,nil
  225. for i,v in pairs(workspace:children())do
  226. if v~=char and v:FindFirstChild("Torso") then
  227. local h;
  228. for _,k in pairs(v:children())do if k:IsA("Humanoid") then h = k end end
  229. local dist = (origin.p - v:FindFirstChild("Torso").CFrame.p).magnitude
  230. if dist < bdist and h~=nil and h.Health~=0 then
  231. bdist,plr = dist,v
  232. end
  233. end
  234. end
  235. return bdist,plr
  236. end
  237. function Shoot(start)
  238. ringExplode(CFrame.new(start.p,start.p-(start.lookVector*-4)),colour[2],.25)
  239. local vel = start.lookVector
  240. local p = Part("Bullet",workspace,Vector3.new(1,1,5),start,colour[2],0.4,true,false,"SmoothPlastic")
  241. local m = Mesh(p,"Sphere")
  242. local num = 0
  243. local ign = sword:children()
  244. local connect
  245. connect = step:connect(function()
  246. num = num + 1
  247. local pp = p.Position
  248. local h,po
  249. repeat
  250. local r = Ray.new(pp,vel.unit*math.min(999.5,vel.magnitude/30+9))
  251. h,po = workspace:FindPartOnRayWithIgnoreList(r,ign)
  252. if h then
  253. if h.CanCollide then
  254. break
  255. else
  256. table.insert(ign,h)
  257. h = nil
  258. end
  259. else
  260. break
  261. end
  262. until false
  263. p.CFrame = CFrame.new(po,po+vel)
  264. if h or num > 300 then
  265. local cf = p.CFrame
  266. q(function(cfz)
  267. for i=1,math.random(1,3)do
  268. Smoke(cfz,colour[2])
  269. end
  270. if h~=nil then
  271. local obj = h.CFrame:pointToObjectSpace(po)
  272. local siz = h.Size/2
  273. local svec = obj/siz
  274. svec = Vector3.new(math.floor(math.abs(svec.X)+.01)*svec.X/math.abs(svec.X),
  275. math.floor(math.abs(svec.Y))*svec.Y/math.abs(svec.Y) ,
  276. math.floor(math.abs(svec.Z))*svec.Z/math.abs(svec.Z))
  277. if svec.magnitude ~= 1 then return end
  278. local dir = h.CFrame:vectorToWorldSpace(svec)
  279. end
  280. end,{cf})
  281. if h and h.Parent~=char then
  282. local hum;
  283. for i,v in pairs(h.Parent:children())do if v:IsA("Humanoid")then hum = v end end
  284. if hum then hum:TakeDamage(25)end
  285. end
  286. p:Destroy()
  287. connect:disconnect()
  288. end
  289. end)
  290. end
  291. function headSmash(victim)
  292. if victim==nil then return end
  293. Attacking = true
  294. Mode = "Custom"
  295. cWalkS = 0
  296. r,e = pcall(function()
  297. local t = victim:FindFirstChild("Torso")
  298. local tcf = t.CFrame
  299. local bg = Instance.new("BodyGyro",torso)
  300. bg.maxTorque = Vector3.new(4e5,4e5,4e5)*20e45
  301. bg.cframe = CFrame.new(root.CFrame.p,CFrame.new(tcf.p.x,root.CFrame.p.y,tcf.p.z).p)
  302. local bp = Instance.new("BodyPosition",t)
  303. bp.maxForce = Vector3.new(4e5,4e5,4e5)*20e45
  304. bp.position = tcf.p
  305. for i=1,3 do
  306. local cf = CFrame.new(t.CFrame.x+rand(5),t.CFrame.y,t.CFrame.z+rand(5))
  307. spikeMagic(cf,4,colour[2])
  308. end
  309. for i=1,50 do
  310. wait(1/30)
  311. local speed = i/50
  312. local mpos = torso.CFrame * CFrame.new(1.5,0.5,0)
  313. local cf = CFrame.new(mpos.p,t.CFrame.p) * CFrame.Angles(math.pi/2,0,0)
  314. local x,y,z = torso.CFrame:toObjectSpace(cf):toEulerAnglesXYZ()
  315. rs.C0 = cslerp(rs.C0,c0.rs*CFrame.Angles(x,y,z),speed)
  316. ls.C0 = cslerp(ls.C0,c0.ls*CFrame.Angles(0,0,-math.pi/4),speed)
  317. handlew.C0 = cslerp(handlew.C0,ohw*CFrame.Angles(0,0,math.pi/2),speed)
  318. rh.C0 = cslerp(rh.C0,c0.rh*CFrame.Angles(0,0,0),speed)
  319. lh.C0 = cslerp(lh.C0,c0.lh*CFrame.Angles(0,0,0),speed)
  320. ne.C0 = cslerp(ne.C0,c0.nk*CFrame.Angles(-y,0,0),speed)
  321. rw.C0 = cslerp(rw.C0,c0.tw*CFrame.Angles(0,math.pi/4,0),speed)
  322. bp.position = bp.position + Vector3.new(0,1,0)
  323. end
  324. Shoot(blade.CFrame*CFrame.Angles(math.pi/2,0,0))
  325. victim:BreakJoints()
  326. bg:Destroy()
  327. end)if not r then print(e) end
  328. Attacking = false
  329. Mode = ""
  330. cWalkS = 20
  331. end
  332. function Swing1()
  333. Attacking = true
  334. Mode = "Custom"
  335. r,e = pcall(function()
  336. --[[for i=1,25 do
  337. wait(1/30)
  338. local speed = i/25
  339. rs.C0 = cslerp(rs.C0,c0.rs*CFrame.Angles(x,y,z),speed)
  340. ls.C0 = cslerp(ls.C0,c0.ls*CFrame.Angles(0,0,-math.pi/4),speed)
  341. handlew.C0 = cslerp(handlew.C0,ohw*CFrame.Angles(0,0,math.pi/2),speed)
  342. rh.C0 = cslerp(rh.C0,c0.rh*CFrame.Angles(0,0,0),speed)
  343. lh.C0 = cslerp(lh.C0,c0.lh*CFrame.Angles(0,0,0),speed)
  344. ne.C0 = cslerp(ne.C0,c0.nk*CFrame.Angles(-y,0,0),speed)
  345. rw.C0 = cslerp(rw.C0,c0.tw*CFrame.Angles(0,math.pi/4,0),speed)
  346. end]]
  347. end)if not r then print(e) end
  348. Attacking = false
  349. Mode = ""
  350. cWalkS = 20
  351. end
  352. function charge()
  353. Attacking = true
  354. Mode = "Custom"
  355. cWalkS = 0
  356. r,e = pcall(function()
  357. for i=1,75 do
  358. wait(1/30)
  359. glitter(torso.CFrame,colour[2])
  360. local speed = i/100
  361. rs.C0 = cslerp(rs.C0,c0.rs*CFrame.Angles(math.pi/1.75,0,-math.pi/8),speed)
  362. ls.C0 = cslerp(ls.C0,c0.ls*CFrame.Angles(math.pi/8,0,math.pi/4),speed)
  363. handlew.C0 = cslerp(handlew.C0,ohw*CFrame.Angles(0,0,math.pi*2.5),speed)
  364. rh.C0 = cslerp(rh.C0,c0.rh*CFrame.new(0,1,-.5)*CFrame.Angles(-math.pi/8,0,0),speed)
  365. lh.C0 = cslerp(lh.C0,c0.lh*CFrame.new(0,0,-.5)*CFrame.Angles(-math.pi/2,0,0),speed)
  366. ne.C0 = cslerp(ne.C0,c0.nk*CFrame.Angles(-math.pi/6,0,0),speed)
  367. rw.C0 = cslerp(rw.C0,c0.tw*CFrame.new(0,-1.5,0)*CFrame.Angles(0,0,0),speed)
  368. end
  369. end)if not r then print(e)end
  370. Attacking = false
  371. Mode = ""
  372. cWalkS = 20
  373. end
  374. ---------------------------------------------
  375. pcall(function()char:FindFirstChild("Sword"):Destroy()end)
  376. sword = Instance.new("Model",char)
  377. sword.Name = "Sword"
  378. handle = Part("Handle",sword,Vector3.new(.25,2,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  379. handlew = Weld(char:WaitForChild("Right Arm"),handle,CFrame.new(0,-1.1,0)*CFrame.Angles(-math.pi/2,-math.pi/2,0))
  380. p1 = WedgePart("P",sword,Vector3.new(.25,.75,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  381. p1w = Weld(handle,p1,CFrame.new(0.25,-.625,0)*CFrame.Angles(0,-math.pi/2,0))
  382. p2 = WedgePart("P",sword,Vector3.new(.25,.75,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  383. p2w = Weld(handle,p2,CFrame.new(-0.25,-.625,0)*CFrame.Angles(0,math.pi/2,0))
  384. p3 = Part("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  385. p3w = Weld(handle,p3,CFrame.new(.25,.75,0))
  386. p4 = Part("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  387. p4w = Weld(handle,p4,CFrame.new(-.25,.75,0))
  388. p5 = WedgePart("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  389. p5w = Weld(p3,p5,CFrame.new(0.25,0,0)*CFrame.Angles(math.pi,-math.pi/2,0))
  390. p6 = WedgePart("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  391. p6w = Weld(p4,p6,CFrame.new(-0.25,0,0)*CFrame.Angles(math.pi,math.pi/2,0))
  392. p7 = CornerWedgePart("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  393. p7m = Mesh(p7,"FileMesh",Vector3.new(.5,1,.4),"http://www.roblox.com/asset/?id=11294911")
  394. p7w = Weld(p5,p7,CFrame.new(-.225,0,0)*CFrame.Angles(0,-math.pi/2,0))
  395. p8 = WedgePart("P",sword,Vector3.new(.75,.5,0),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  396. p8w = Weld(handle,p8,CFrame.new(0,.75,.225)*CFrame.Angles(math.pi,0,0))
  397. p9 = CornerWedgePart("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  398. p9m = Mesh(p9,"FileMesh",Vector3.new(.4,1,.5),"http://www.roblox.com/asset/?id=11294911")
  399. p9w = Weld(p5,p9,CFrame.new(.225,0,0)*CFrame.Angles(0,-math.pi,0))
  400. p10 = CornerWedgePart("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  401. p10m = Mesh(p10,"FileMesh",Vector3.new(.4,1,.5),"http://www.roblox.com/asset/?id=11294911")
  402. p10w = Weld(p6,p10,CFrame.new(.225,0,0)*CFrame.Angles(0,-math.pi,0))
  403. p11 = CornerWedgePart("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  404. p11m = Mesh(p11,"FileMesh",Vector3.new(.5,1,.4),"http://www.roblox.com/asset/?id=11294911")
  405. p11w = Weld(p6,p11,CFrame.new(-.225,0,0)*CFrame.Angles(0,-math.pi/2,0))
  406. p12 = WedgePart("P",sword,Vector3.new(.75,.5,0),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  407. p12w = Weld(handle,p12,CFrame.new(0,.75,-.225)*CFrame.Angles(-math.pi*2,0,math.pi))
  408. blade = Part("Blade",sword,Vector3.new(.75,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  409. bladew = Weld(handle,blade,CFrame.new(0,7.5/2+1,0))
  410. p13 = WedgePart("P",sword,Vector3.new(.25,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  411. p13w = Weld(blade,p13,CFrame.new(-.5,0,0)*CFrame.Angles(math.pi,math.pi/2,0))
  412. p14 = WedgePart("P",sword,Vector3.new(.25,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  413. p14w = Weld(blade,p14,CFrame.new(.5,0,0)*CFrame.Angles(math.pi,-math.pi/2,0))
  414. p15 = WedgePart("P",sword,Vector3.new(.25,1.5,1.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  415. p15w = Weld(blade,p15,CFrame.new(0,7.5/2+.75,0)*CFrame.Angles(0,math.pi/2,0))
  416. p16 = WedgePart("P",sword,Vector3.new(.75,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  417. p16w = Weld(blade,p16,CFrame.new(0,0,-.25)*CFrame.Angles(math.pi,math.pi,0))
  418. p17 = CornerWedgePart("P",sword,Vector3.new(.25,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  419. p17m = Mesh(p17,"FileMesh",Vector3.new(.5,7.5*2,.5),"http://www.roblox.com/asset/?id=11294911")
  420. p17w = Weld(p16,p17,CFrame.new(-.5,0,0)*CFrame.Angles(0,-math.pi/2,0))
  421. p18 = CornerWedgePart("P",sword,Vector3.new(.25,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  422. p18m = Mesh(p18,"FileMesh",Vector3.new(.5,7.5*2,.5),"http://www.roblox.com/asset/?id=11294911")
  423. p18w = Weld(p16,p18,CFrame.new(.5,0,0)*CFrame.Angles(0,math.pi,0))
  424. p19 = CornerWedgePart("P",sword,Vector3.new(.25,1.5,1.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  425. p19m = Mesh(p19,"FileMesh",Vector3.new(.5,1.5*2,1.25*2),"http://www.roblox.com/asset/?id=11294911")
  426. p19w = Weld(p15,p19,CFrame.new(0.25,0,0)*CFrame.Angles(0,math.pi,0))
  427. p20 = WedgePart("P",sword,Vector3.new(.75,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  428. p20w = Weld(blade,p20,CFrame.new(0,0,.25)*CFrame.Angles(math.pi,math.pi*2,0))
  429. p21 = CornerWedgePart("P",sword,Vector3.new(.25,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  430. p21m = Mesh(p21,"FileMesh",Vector3.new(.5,7.5*2,.5),"http://www.roblox.com/asset/?id=11294911")
  431. p21w = Weld(p20,p21,CFrame.new(-.5,0,0)*CFrame.Angles(0,-math.pi/2,0))
  432. p22 = CornerWedgePart("P",sword,Vector3.new(.25,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  433. p22m = Mesh(p22,"FileMesh",Vector3.new(.5,7.5*2,.5),"http://www.roblox.com/asset/?id=11294911")
  434. p22w = Weld(p20,p22,CFrame.new(.5,0,0)*CFrame.Angles(0,math.pi,0))
  435. p23 = CornerWedgePart("P",sword,Vector3.new(1.25,1.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  436. p23m = Mesh(p23,"FileMesh",Vector3.new(1.25*2,1.5*2,.5),"http://www.roblox.com/asset/?id=11294911")
  437. p23w = Weld(p15,p23,CFrame.new(-.25,0,0)*CFrame.Angles(0,-math.pi/2,0))
  438. p24 = Part("P",sword,Vector3.new(1.25,1,.75),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
  439. p24m = Mesh(p24,"Torso",Vector3.new(1,1,.875))
  440. p24w = Weld(handle,p24,CFrame.new(0,1.5,0))
  441. ------ effect
  442. parts = {}
  443. for i=1,6 do
  444. local p = Part(tostring(i),sword,Vector3.new(.25,.25,.25),torso.CFrame,colour[2],1,false,false,"SmoothPlastic")
  445. local pm = Mesh(p,"FileMesh",Vector3.new(.5+i/25,1,.375+i/25),asset..meshes.diamond)
  446. local pw = Weld(blade,p,CFrame.new(0,-4+i+1,0))
  447. table.insert(parts,p)
  448. end
  449. ---------------------------------------------
  450. ohw = handlew.C0
  451. ---------------------------------------------
  452. mouse.Button1Down:connect(function()
  453. end)
  454. mouse.KeyDown:connect(function(key)
  455. key:lower()
  456. local d,p = findClosestPlayer(torso.CFrame,5)
  457. if key=="q" and not Attacking then headSmash(p)
  458. elseif key=="e" and not Attacking then charge()end
  459. end)
  460. mouse.KeyUp:connect(function(key)
  461. end)
  462. ---------------------------------------------
  463. count = 0
  464. angle = 0
  465. counttime = 70
  466. countspeed = 1
  467. speed = .3
  468. perc = 0
  469. increment = 1/#parts
  470. step:connect(function()
  471. count = (count%counttime)+countspeed
  472. angle = math.pi*math.sin((math.pi*2)/counttime*count)
  473. perc = (perc%1)+0.02
  474. rootVel = Vector3.new(root.Velocity.x,0,root.Velocity.z)
  475. -----------------------------
  476. for i,v in pairs(parts)do v.Transparency = math.sin(math.pi*((perc+increment*i)%1))end
  477. humanoid.WalkSpeed = cWalkS
  478. if (tick()-lastpulse) > pulsetime then
  479. lastpulse = tick()
  480. ringExplode(CFrame.new(torso.CFrame.x,1,torso.CFrame.z)*CFrame.Angles(math.pi/2,0,0),colour[1],4)
  481. end
  482. -----------------------------
  483. if Mode=="Custom"or rootVel.magnitude > 2 then
  484. --- debug
  485. isIdlePosing,curIdle,lastIdle = false,"",tick()
  486. --- end debug
  487. end
  488. if rootVel.magnitude < 2 and Mode~="Custom" then
  489. counttime = 50
  490. countspeed = .5
  491. speed = .1
  492. if (tick()-lastIdle) > bIdleTime and not isIdlePosing then curIdle = Idles[math.random(1,#Idles)] startedIdle = tick() isIdlePosing = true end
  493. if isIdlePosing and (tick()-startedIdle) > bIdleTime/2 then isIdlePosing = false curIdle = "" lastIdle = tick() end
  494. if curIdle=="" then
  495. rs.C0 = cslerp(rs.C0,c0.rs*CFrame.Angles(math.pi/3+angle*speed*.1,0,-.1),speed)
  496. ls.C0 = cslerp(ls.C0,c0.ls*CFrame.Angles(-angle*speed*.2,0,0),speed)
  497. handlew.C0 = cslerp(handlew.C0,ohw*CFrame.new(1,.6,0.3)*CFrame.Angles(0,-math.pi/9,-math.pi/2),speed)
  498. rh.C0 = cslerp(rh.C0,c0.rh*CFrame.Angles(-angle*speed*.2,0,0),speed)
  499. lh.C0 = cslerp(lh.C0,c0.lh*CFrame.Angles(angle*speed*.2,0,0),speed)
  500. ne.C0 = cslerp(ne.C0,c0.nk,speed)
  501. rw.C0 = cslerp(rw.C0,c0.tw,speed)
  502. elseif curIdle=="FAB" then
  503. rs.C0 = cslerp(rs.C0,c0.rs*CFrame.new(0,.5,0)*CFrame.Angles(-math.pi,0,math.pi/6),speed)
  504. ls.C0 = cslerp(ls.C0,c0.ls*CFrame.Angles(0,0,-math.pi/8),speed)
  505. handlew.C0 = cslerp(handlew.C0,ohw*CFrame.Angles(0,0,math.pi*2.5),speed)
  506. rh.C0 = cslerp(rh.C0,c0.rh*CFrame.Angles(0,0,math.pi/10),speed)
  507. lh.C0 = cslerp(lh.C0,c0.lh*CFrame.Angles(0,0,-math.pi/10),speed)
  508. ne.C0 = cslerp(ne.C0,c0.nk*CFrame.Angles(math.pi/6,-math.pi/4,0),speed)
  509. rw.C0 = cslerp(rw.C0,c0.tw,speed)
  510. end
  511. elseif rootVel.magnitude > 2 and Mode~="Custom" then
  512. counttime = 25
  513. countspeed = 1.5
  514. speed = .4
  515. rs.C0 = cslerp(rs.C0,c0.rs*CFrame.Angles(math.pi/3+angle*speed*.1,0,-.1),speed)
  516. ls.C0 = cslerp(ls.C0,c0.ls*CFrame.Angles(math.pi/8+angle*speed,0,math.pi/8*angle*speed),speed)
  517. handlew.C0 = cslerp(handlew.C0,ohw*CFrame.new(1,.6,0.3)*CFrame.Angles(0,-math.pi/9,-math.pi/2),speed)
  518. lh.C0 = cslerp(lh.C0,c0.lh*CFrame.new(0,-angle*speed*.3,0)*CFrame.Angles(-angle*speed*.75,0,-angle*speed*.1),speed)
  519. rh.C0 = cslerp(rh.C0,c0.rh*CFrame.new(0,angle*speed*.3,0)*CFrame.Angles(angle*speed*.75,0,-angle*speed*.1),speed)
  520. ne.C0 = cslerp(ne.C0,c0.nk*CFrame.Angles(math.pi/17,angle*speed*.025,0),speed)
  521. rw.C0 = cslerp(rw.C0,c0.tw*CFrame.Angles(-math.pi/20,angle*speed*.05,0),speed)
  522. end
  523. end)
Add Comment
Please, Sign In to add comment