Advertisement
wulfbawg

HeadBasherSword - RBXLUA

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