urabigfatnoob

OLD DUAL SWORD

Aug 16th, 2017
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 66.05 KB | None | 0 0
  1. --[[
  2. sdfsdfsdfsd
  3. --VARIABLES AND STUFF--
  4. sdfsdfsdfsdf
  5. ]]
  6. --charge attck maybe?
  7. --certain part of sword lights a different color and particles go to it
  8. --next sword just make it a black/white particle sword with 1 part
  9. --shooting thing like move q in first fly script. when touching a wall just bullet effect like cor (bubble)
  10. --grass or particle spin around me to defend me
  11. --a bunch or one circle where parts randomly come out from the ground and hurt ppl
  12. plr = game.Players.LocalPlayer
  13. chr = plr.Character or plr.Character:wait()
  14. mouse = plr:GetMouse()
  15. renderstepped = game:GetService('RunService').RenderStepped
  16. userinput = game:GetService('UserInputService')
  17. torso = chr.Torso
  18. head = chr.Head
  19. hrp = chr.HumanoidRootPart
  20. myhumanoid = chr.Humanoid
  21. terrain = workspace.Terrain
  22. rightarm = chr['Right Arm']
  23. leftarm = chr['Left Arm']
  24. rightleg = chr['Right Leg']
  25. leftleg = chr['Left Leg']
  26. myhumanoid.JumpPower = 0
  27. myhumanoid.MaxHealth = 1000
  28. pi = math.pi
  29. huge = math.huge
  30. part = Instance.new('Part')
  31. part.TopSurface = 'Smooth'
  32. part.BottomSurface = 'Smooth'
  33. cylmesh = Instance.new('CylinderMesh')
  34. specialmesh = Instance.new('SpecialMesh')
  35. attacking = false
  36. defending = false
  37. typing = false
  38. swordweldA = Instance.new('Weld')
  39. swordweldB = Instance.new('Weld')
  40. rightweld = nil
  41. leftweld = nil
  42. damage = 0
  43. --[[
  44. dfsdfsdfsdfs
  45. BLOODPART
  46. asdasdasda
  47. ]]
  48. bloodpart = part:Clone()
  49. bloodpart.CanCollide = false
  50. bloodpart.Anchored = true
  51. bloodpart.Shape = Enum.PartType.Ball
  52. bloodpart.Size = Vector3.new(.4,.4,.4)
  53. bloodpart.Transparency = .8
  54. bloodpart.Material = Enum.Material.Neon
  55. bloodpart.BrickColor = BrickColor.Red()
  56. local bbgui = Instance.new('BillboardGui',bloodpart)
  57. bbgui.StudsOffset = Vector3.new(0,.5,0)
  58. bbgui.Enabled = true
  59. bbgui.Size = UDim2.new(0,50,0,25)
  60. local tlabel = Instance.new('TextLabel',bbgui)
  61. tlabel.BackgroundTransparency = 0
  62. tlabel.BackgroundColor3 = Color3.fromRGB(192, 57, 43)
  63. tlabel.BorderSizePixel = 0
  64. tlabel.TextColor3 = Color3.new(1,1,1)
  65. tlabel.Font = Enum.Font.Legacy
  66. tlabel.Size = UDim2.new(0,50,0,25)
  67. --[[
  68. SGFSDGSDGS
  69. FUNCTIONS
  70. SDFSDFSDFSDF
  71. ]]
  72. function plerp(part,startpoint,endpoint,speed,canclone,clonepart,clonepartcframe,transpeed)
  73.     for i = 0,1,speed do
  74.         renderstepped:wait()
  75.         part.CFrame = startpoint:lerp(endpoint,i)
  76.         if canclone then
  77.             local clone = clonepart:Clone()
  78.             clone.CFrame = clone.CFrame*CFrame.Angles(math.random(-180,180),math.random(-180,180),math.random(-180,180))
  79.             clone:ClearAllChildren()
  80.             clone.Anchored = true
  81.             clone.CanCollide = false
  82.             clone.Parent = workspace
  83.             local function tran()
  84.                 for i = 0,1,transpeed do
  85.                     renderstepped:wait()
  86.                     clone.Transparency = i
  87.                 end
  88.                 clone:Destroy()
  89.             end
  90.             spawn(tran)
  91.         end
  92.     end
  93. end
  94.  
  95. function get_joints(a,b)
  96.     local joint = torso:FindFirstChild('Right Shoulder')
  97.     a = joint:Clone()
  98.     joint = torso:FindFirstChild('Left Shoulder')
  99.     b = joint:Clone()
  100. end
  101.  
  102. function heal()
  103.     local bf = chr:FindFirstChild('BodyForce',true)
  104.     local bv = chr:FindFirstChild('BodyAngularVelocity',true)
  105.     if bf then
  106.         bf:Destroy()
  107.     elseif bv then
  108.         bv:Destroy()
  109.     else
  110.        
  111.         myhumanoid.Sit = false
  112.         myhumanoid.PlatformStand = false
  113.     end
  114.     myhumanoid:TakeDamage(math.random(-20,0))
  115. end
  116.  
  117. function get_rightweld()
  118.     rightweld = Instance.new('Weld')
  119.     rightweld.Part0 = rightarm
  120.     rightweld.Part1 = torso
  121. end
  122.  
  123. function get_leftweld()
  124.     leftweld = Instance.new('Weld')
  125.     leftweld.Part0 = leftarm
  126.     leftweld.Part1 = torso
  127. end
  128.  
  129. function weldlerp(weld,speed,startpoint,endpoint,clone,clonepart,clonepartcframe,transpeed)
  130.     for i = 0,1,speed do
  131.         renderstepped:wait()
  132.         weld.C0 = startpoint:lerp(endpoint,i)
  133.         if clone == true then
  134.             local clone = clonepart:Clone()
  135.             clone:ClearAllChildren()
  136.             clone.Anchored = true
  137.             clone.CFrame = clonepart.CFrame
  138.             clone.Parent = workspace
  139.             local function tran()
  140.                 for i = 0,1,transpeed do
  141.                     renderstepped:wait()
  142.                     clone.Transparency = i
  143.                 end
  144.                 clone:Destroy()
  145.             end
  146.             spawn(tran)
  147.         end
  148.     end
  149. end
  150. --
  151. function new_weld(parent,part0,part1,C0)
  152.     local weld = Instance.new('Weld',parent)
  153.     weld.Part0 = part0
  154.     weld.Part1 = part1
  155.     weld.C0 = C0
  156. end
  157. --
  158. function bloodcframe(random,torso,humanoid)
  159.     if random ~= 0 then
  160.         local clone = bloodpart:Clone()
  161.         clone.BillboardGui.TextLabel.Text = random
  162.         clone.CFrame = torso.Parent:FindFirstChild('Torso').CFrame*CFrame.new(math.random(-3,3),math.random(-3,3),math.random(-3,3))
  163.         clone.Parent = workspace
  164.         humanoid:TakeDamage(random)
  165.         damage = 0
  166.         for i = 1,.5,-.01 do
  167.             renderstepped:wait()
  168.             clone.Transparency = i
  169.             clone.BillboardGui.TextLabel.Transparency = i
  170.             clone.CFrame = clone.CFrame*CFrame.new(0,.01,0)
  171.         end
  172.         wait(1)
  173.         for i = .5,1,.01 do
  174.             renderstepped:wait()
  175.             clone.Transparency = i
  176.             clone.BillboardGui.TextLabel.Transparency = i
  177.             clone.CFrame = clone.CFrame*CFrame.new(0,.01,0)
  178.         end
  179.         clone:Destroy()
  180.     end
  181. end
  182.  
  183. function bloodcframeB(random,torso,humanoid)
  184.     if random ~= 0 then
  185.         local clone = bloodpart:Clone()
  186.         clone.BillboardGui.TextLabel.Text = random
  187.         clone.CFrame = torso.Parent:FindFirstChild('Torso').CFrame*CFrame.new(math.random(-3,3),math.random(-3,3),math.random(-3,3))
  188.         clone.Parent = workspace
  189.         humanoid:TakeDamage(random)
  190.         for i = 1,.5,-.01 do
  191.             renderstepped:wait()
  192.             clone.Transparency = i
  193.             clone.BillboardGui.TextLabel.Transparency = i
  194.             clone.CFrame = clone.CFrame*CFrame.new(0,.01,0)
  195.         end
  196.         wait(1)
  197.         for i = .5,1,.01 do
  198.             renderstepped:wait()
  199.             clone.Transparency = i
  200.             clone.BillboardGui.TextLabel.Transparency = i
  201.             clone.CFrame = clone.CFrame*CFrame.new(0,.01,0)
  202.         end
  203.         clone:Destroy()
  204.     end
  205. end
  206. --[[
  207. SDFSDFSDFSDF
  208. MAKING OF THY SWORD
  209. SDFSDFDSFSF
  210. ]]
  211.  
  212. swordmodel = Instance.new('Model')
  213. swordmodel.Name = 'Sword'
  214. --
  215. swordHandle = part:Clone()
  216. --swordHandle.Anchored = true
  217. swordHandle.Parent = swordmodel
  218. swordHandle.Name = 'SHandle'
  219. swordHandle.BrickColor = BrickColor.new(0,0,0)
  220. swordHandle.Material = Enum.Material.Neon
  221. swordHandle.CanCollide = false
  222. swordHandle.Size = Vector3.new(0.2, 2, 0.4)
  223. swordHandle.CFrame = CFrame.new(0,0,0)
  224. --
  225. swordHitBox = swordHandle:Clone()
  226. swordHitBox.Size = Vector3.new(0.2, 6.6, 1)
  227. swordHitBox.CFrame = CFrame.new(0, -2.1, 0)
  228. swordHitBox.Parent = swordmodel
  229. swordHitBox.Transparency = 1
  230. swordHitBox.Name = 'HitBox'
  231. --
  232. swordTip = swordHandle:Clone()
  233. swordTip.Name = 'STip'
  234. swordTip.Size = Vector3.new(0.2, 0.2, 0.2)
  235. swordTip.CFrame = CFrame.new(0, -5.5, 0)
  236. swordTip.Parent = swordmodel
  237. swordTip.Transparency = 1
  238. --
  239. swordbladeRight = swordHandle:Clone()
  240. swordbladeRight.Name = 'Part'
  241. swordbladeRight.Parent = swordmodel
  242. swordbladeRight.Size = Vector3.new(0.2, 4, 0.4)
  243. swordbladeRight.CFrame = CFrame.new(0, -3, -0.3)
  244. --
  245. swordbladeLeft = swordbladeRight:Clone()
  246. swordbladeLeft.Name = 'Part'
  247. swordbladeLeft.Parent = swordmodel
  248. swordbladeLeft.CFrame = CFrame.new(0, -3, 0.3)
  249. --
  250. swordbladeMiddle = swordbladeLeft:Clone()
  251. swordbladeMiddle.Parent = swordmodel
  252. swordbladeMiddle.Name = 'Part'
  253. swordbladeMiddle.Size = Vector3.new(0.2, 0.5, 0.4)
  254. swordbladeMiddle.CFrame = CFrame.new(0, -1.05, 0)
  255. --
  256. swordcylRight = swordHandle:Clone()
  257. swordcylRight.Parent = swordmodel
  258. swordcylRight.Name = 'Part'
  259. cmeshA = specialmesh:Clone()
  260. cmeshA.MeshType = Enum.MeshType.Cylinder
  261. cmeshA.Parent = swordcylRight
  262. swordcylRight.Size = Vector3.new(0.2, 0.6, 0.6)
  263. swordcylRight.CFrame = CFrame.new(0, -1, -0.2)
  264. --
  265. swordcylLeft = swordcylRight:Clone()
  266. swordcylLeft.Name = 'Part'
  267. swordcylLeft.Parent = swordmodel
  268. swordcylLeft.CFrame = CFrame.new(0, -1, 0.2)
  269. --
  270. swordcylUp = swordcylLeft:Clone()
  271. swordcylUp.Name = 'Part'
  272. swordcylUp.Parent = swordmodel
  273. swordcylUp.Size = Vector3.new(0.2, 0.6, 0.4)
  274. swordcylUp.CFrame = CFrame.new(0, 1, 0)
  275. --
  276. swordwedgeRight = Instance.new('WedgePart',swordmodel)
  277. swordwedgeRight.Name = 'Part'
  278. swordwedgeRight.Size = Vector3.new(0.2, 0.4, 0.4)
  279. swordwedgeRight.CFrame = CFrame.new(0, -5.2, -0.3)*CFrame.Angles(math.rad(-90), 0, 0)
  280. swordwedgeRight.BrickColor = BrickColor.new(0,0,0)
  281. swordwedgeRight.Material = Enum.Material.Neon
  282. swordwedgeRight.CanCollide = false
  283. --
  284. swordwedgeLeft = swordwedgeRight:Clone()
  285. swordwedgeLeft.Name = 'Part'
  286. swordwedgeLeft.Parent = swordmodel
  287. swordwedgeLeft.CFrame = CFrame.new(0, -5.2, 0.3)*CFrame.Angles(math.rad(-90), 0, math.rad(-180))
  288. --
  289. swordA = nil
  290. swordB = nil
  291. --
  292. all,last = {}
  293. function scan(p)
  294.     for i,v in pairs(p:GetChildren()) do
  295.         if (v:IsA("BasePart")) then
  296.             v.CanCollide = false
  297.             if (last) then
  298.                 local w = Instance.new("Weld")
  299.                 w.Part0,w.Part1 = last,v
  300.                 w.C0 = v.CFrame:toObjectSpace(last.CFrame):inverse()
  301.                 w.Parent = last
  302.                 if v == swordHandle then
  303.                     print(w.C0)
  304.                 end
  305.             end
  306.             table.insert(all,v)
  307.             last = v
  308.         end
  309.         scan(v)
  310.     end
  311. end
  312. scan(swordmodel)
  313. for i,v in pairs(all) do v.Anchored = false end
  314.  
  315. function get_Swords()
  316.     for i = 1,2 do
  317.         wait(.4)
  318.         if i == 1 then
  319.             local clone = swordmodel:Clone()
  320.             for i,v in pairs(clone:GetChildren()) do
  321.                 v.BrickColor = BrickColor.new(0,0,0)
  322.             end
  323.             swordA = clone
  324.             swordweldA.Parent = clone.SHandle
  325.             swordweldA.Part0 = clone.SHandle
  326.             swordweldA.Part1 = rightarm
  327.             swordweldA.C0 = CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0)
  328.             clone.Parent = chr
  329.         else
  330.             local clone = swordmodel:Clone()
  331.             for i,v in pairs(clone:GetChildren()) do
  332.                 v.BrickColor = BrickColor.new(1,1,1)
  333.             end
  334.             swordB = clone
  335.             swordweldB.Parent = clone.SHandle
  336.             swordweldB.Part0 = clone.SHandle
  337.             swordweldB.Part1 = leftarm
  338.             swordweldB.C0 = CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0)
  339.             clone.Parent = chr
  340.         end
  341.     end
  342.     swordA.HitBox.Touched:connect(function(p)
  343.         if p.Parent then
  344.             local h = p.Parent:FindFirstChild('Humanoid')
  345.             if h and h~=myhumanoid and damage~=0 then
  346.                 bloodcframe(damage,h.Parent.Head,h)
  347.             end
  348.         end
  349.     end)
  350.     swordB.HitBox.Touched:connect(function(p)
  351.         if p.Parent then
  352.         local h = p.Parent:FindFirstChild('Humanoid')
  353.             if h and h~=myhumanoid and damage~=0 then
  354.                 bloodcframe(damage,h.Parent.Head,h)
  355.             end
  356.         end
  357.     end)
  358. end
  359. get_Swords()
  360.  
  361. --[[
  362. SDFGSDFSDFS
  363. KEYS
  364. SDFSDFSD
  365. ]]
  366. myhumanoid.Health = 1000
  367. mouse.Button1Down:connect(function()
  368.     if typing then
  369.         typing = false
  370.     elseif not attacking and not typing then
  371.         attacking = true       
  372.         damage = math.random(20,40)
  373.         local joint = torso:FindFirstChild('Right Shoulder')
  374.         local jointA = joint:Clone()
  375.         get_rightweld()
  376.         rightweld.Parent = rightarm
  377.         weldlerp(rightweld,.1,CFrame.new(-1.5,0,0),CFrame.new(-1.5,1.5,0)*CFrame.Angles(math.rad(180),0,0),true,swordA.Part,swordA.Part.CFrame,.05)
  378.         weldlerp(rightweld,.1,CFrame.new(-1.5,1.5,0)*CFrame.Angles(math.rad(180),0,0),CFrame.new(-1.5,0,.5)*CFrame.Angles(math.rad(-0),math.rad(-45),0),true,swordA.Part,swordA.Part.CFrame,.05)
  379.         weldlerp(rightweld,.1,CFrame.new(-1.5,0,.5)*CFrame.Angles(math.rad(-0),math.rad(-45),0),CFrame.new(-1.5,0,0),true,swordA.Part,swordA.Part.CFrame,.05)
  380.         rightweld:Destroy()
  381.         jointA.Parent = torso
  382.         attacking = false
  383.         damage = 0
  384.     end
  385. end)
  386.  
  387. mouse.Button2Down:connect(function()
  388.     if not attacking and not typing then
  389.         attacking = true       
  390.         damage = math.random(20,40)
  391.         local joint = torso:FindFirstChild('Left Shoulder')
  392.         local jointA = joint:Clone()
  393.         get_leftweld()
  394.         leftweld.Parent = leftarm
  395.         weldlerp(leftweld,.1,CFrame.new(1.5,0,0),CFrame.new(1.5,1.5,.5)*CFrame.Angles(180,0,0),true,swordB.Part,swordB.Part.CFrame,.05)
  396.         weldlerp(leftweld,.1,CFrame.new(1.5,1.5,0)*CFrame.Angles(math.rad(180),0,0),CFrame.new(1.5,0,.5)*CFrame.Angles(math.rad(-0),math.rad(45),0),true,swordB.Part,swordB.Part.CFrame,.05)
  397.         weldlerp(leftweld,.1,CFrame.new(1.5,0,.5)*CFrame.Angles(math.rad(-0),math.rad(45),0),CFrame.new(1.5,0,0),true,swordB.Part,swordB.Part.CFrame,.05)
  398.         leftweld:Destroy() 
  399.         jointA.Parent = torso
  400.         attacking = false
  401.         damage = 0
  402.     end
  403. end)
  404. --weld,speed,startpoint,endpoint,clone,clonepart,clonepartcframe,transpeed
  405. userinput.InputBegan:connect(function(keycode)
  406.     local k = keycode.KeyCode
  407.     if k == Enum.KeyCode.Slash then
  408.         typing = true
  409.     elseif k == Enum.KeyCode.Return then
  410.         typing = false
  411.     elseif not typing then
  412.         if k == Enum.KeyCode.Q and not defending then
  413.             defending = true
  414.             local model = Instance.new('Model',workspace)
  415.             local trail = part:Clone()
  416.             local cframeval = CFrame.new()
  417.             trail.BrickColor = BrickColor.new(1,1,1)
  418.             trail.Material = Enum.Material.Neon
  419.             trail.CanCollide = false
  420.             trail.Anchored = true
  421.             trail.Size = Vector3.new(2,5,.2)
  422.             trail.Transparency = .5
  423.             local cframeval = hrp.CFrame*CFrame.new(0,1.7,0)
  424.             local endpoint = cframeval+(cframeval.rightVector*-40)
  425.             for i = 0,1,.05 do
  426.                 renderstepped:wait()
  427.                 myhumanoid.WalkSpeed = 0
  428.                 local clone = trail:Clone()
  429.                 local function tran()
  430.                     for i = .5,1.01,.01 do
  431.                         renderstepped:wait()
  432.                         clone.Transparency = i
  433.                     end
  434.                 end
  435.                 spawn(tran)
  436.                 clone.CFrame = hrp.CFrame
  437.                 clone.Parent = model
  438.                 chr:SetPrimaryPartCFrame(cframeval:lerp(endpoint,i))
  439.             end
  440.             myhumanoid.WalkSpeed = 16
  441.             defending = false
  442.             wait(1)
  443.             model:Destroy()
  444.         elseif k == Enum.KeyCode.E and not defending then
  445.             defending = true
  446.             local model = Instance.new('Model',workspace)
  447.             local trail = part:Clone()
  448.             local cframeval = CFrame.new()
  449.             trail.BrickColor = BrickColor.new(1,1,1)
  450.             trail.Material = Enum.Material.Neon
  451.             trail.CanCollide = false
  452.             trail.Anchored = true
  453.             trail.Size = Vector3.new(2,5,.2)
  454.             trail.Transparency = .5
  455.             local cframeval = hrp.CFrame*CFrame.new(0,1.7,0)
  456.             local endpoint = cframeval+(cframeval.rightVector*40)
  457.             for i = 0,1,.05 do
  458.                 renderstepped:wait()
  459.                 myhumanoid.WalkSpeed = 0
  460.                 local clone = trail:Clone()
  461.                 local function tran()
  462.                     for i = .5,1.01,.01 do
  463.                         renderstepped:wait()
  464.                         clone.Transparency = i
  465.                     end
  466.                 end
  467.                 spawn(tran)
  468.                 clone.CFrame = hrp.CFrame
  469.                 clone.Parent = model
  470.                 chr:SetPrimaryPartCFrame(cframeval:lerp(endpoint,i))
  471.             end
  472.             myhumanoid.WalkSpeed = 16
  473.             defending = false
  474.             wait(1)
  475.             model:Destroy()
  476.         elseif k == Enum.KeyCode.Space and not defending then
  477.             defending = true
  478.             local model = Instance.new('Model',workspace)
  479.             local trail = part:Clone()
  480.             local cframeval = CFrame.new()
  481.             trail.BrickColor = BrickColor.new(1,1,1)
  482.             trail.Material = Enum.Material.Neon
  483.             trail.CanCollide = false
  484.             trail.Anchored = true
  485.             trail.Size = Vector3.new(.2,5,2)
  486.             trail.Transparency = .5
  487.             local cframeval = hrp.CFrame*CFrame.new(0,1.7,0)
  488.             local endpoint = cframeval+(cframeval.lookVector*40)
  489.             for i = 0,1,.05 do
  490.                 renderstepped:wait()
  491.                 myhumanoid.WalkSpeed = 0
  492.                 local clone = trail:Clone()
  493.                 local function tran()
  494.                     for i = .5,1.01,.01 do
  495.                         renderstepped:wait()
  496.                         clone.Transparency = i
  497.                     end
  498.                 end
  499.                 spawn(tran)
  500.                 clone.CFrame = hrp.CFrame
  501.                 clone.Parent = model
  502.                 chr:SetPrimaryPartCFrame(cframeval:lerp(endpoint,i))
  503.             end
  504.             myhumanoid.WalkSpeed = 16
  505.             defending = false
  506.             wait(1)
  507.             model:Destroy()
  508.         elseif k == Enum.KeyCode.Two and not defending then
  509.             defending = true
  510.             local model = Instance.new('Model',workspace)
  511.             local trail = part:Clone()
  512.             local cframeval = CFrame.new()
  513.             trail.BrickColor = BrickColor.new(1,1,1)
  514.             trail.Material = Enum.Material.Neon
  515.             trail.CanCollide = false
  516.             trail.Anchored = true
  517.             trail.Size = Vector3.new(.2,5,2)
  518.             trail.Transparency = .5
  519.             local cframeval = hrp.CFrame*CFrame.new(0,1.7,0)
  520.             local endpoint = cframeval+(cframeval.lookVector*-40)
  521.             for i = 0,1,.05 do
  522.                 renderstepped:wait()
  523.                 myhumanoid.WalkSpeed = 0
  524.                 local clone = trail:Clone()
  525.                 local function tran()
  526.                     for i = .5,1.01,.01 do
  527.                         renderstepped:wait()
  528.                         clone.Transparency = i
  529.                     end
  530.                 end
  531.                 spawn(tran)
  532.                 clone.CFrame = hrp.CFrame
  533.                 clone.Parent = model
  534.                 chr:SetPrimaryPartCFrame(cframeval:lerp(endpoint,i))
  535.             end
  536.             myhumanoid.WalkSpeed = 16
  537.             defending = false
  538.             wait(1)
  539.             model:Destroy()
  540.         elseif k == Enum.KeyCode.One then
  541.             get_Swords()
  542.         elseif k == Enum.KeyCode.R and not defending and not attacking then
  543.             defending = true
  544.             attacking = true
  545.             local model = Instance.new('Model',terrain)
  546.             model.Name = 'Circle'
  547.             local shield = part:Clone()
  548.             shield.Material = Enum.Material.Neon
  549.             shield.BrickColor = BrickColor.new(1,1,1)
  550.             shield.Transparency = 1
  551.             shield.CanCollide = true
  552.             shield.Anchored = true
  553.             shield.Size = Vector3.new(.4,.4,.4)
  554.             torso.Anchored = true
  555.             local tcframe = hrp.CFrame
  556.             local diameter = 8
  557.             local circ = pi*diameter
  558.             local n = circ/.4
  559.             local rot = 360/n
  560.             for i = 0,n/2 do
  561.                 renderstepped:wait()
  562.                 local clone = shield:Clone()
  563.                 clone.Touched:connect(function(p)
  564.                     if p.Parent and p.Parent ~= chr and p.Parent.Parent ~= chr and p.Name ~= 'Base' then
  565.                         p:Destroy()
  566.                     end
  567.                 end)
  568.                 local function tran()
  569.                     local CFrameval = clone.CFrame
  570.                     for i = .4,8,.2 do
  571.                         renderstepped:wait()
  572.                         clone.Size = Vector3.new(.4,i,.4)
  573.                         clone.CFrame = CFrameval
  574.                         clone.Transparency = clone.Transparency - .05
  575.                     end
  576.                 end
  577.                 clone.CFrame = tcframe*CFrame.Angles(0,0,math.rad(i*rot))+tcframe.lookVector*10
  578.                 clone.Parent = model
  579.                 spawn(tran)
  580.             end
  581.         elseif k == Enum.KeyCode.F and not attacking then
  582.             attacking = true
  583.             local joint = torso:FindFirstChild('Right Shoulder')
  584.             local jointA = joint:Clone()
  585.             local joint = torso:FindFirstChild('Left Shoulder')
  586.             local jointB = joint:Clone()
  587.             damage = math.random(30,60)
  588.             get_rightweld()
  589.             rightweld.Parent = rightarm
  590.             get_leftweld()
  591.             leftweld.Parent = leftarm
  592.             local function lerpA()
  593.                 weldlerp(rightweld,.1,CFrame.new(-1.5,0,0),CFrame.new(-1.5,1,.5)*CFrame.Angles(math.rad(-146.31),math.rad(-25.659),math.rad(-16.102)))
  594.             end
  595.             local function lerpB()
  596.                 weldlerp(leftweld,.1,CFrame.new(1.5,0,0),CFrame.new(1.5,1,.5)*CFrame.Angles(math.rad(-146.31),math.rad(25.659),math.rad(16.102)))
  597.             end
  598.             spawn(lerpA)
  599.             spawn(lerpB)
  600.             wait(.2)
  601.             local function lerpA()
  602.                 weldlerp(rightweld,.1,CFrame.new(-1.5,1,.5)*CFrame.Angles(math.rad(-146.31),math.rad(-25.659),math.rad(-16.102)),CFrame.new(-1.5,0,-.5)*CFrame.Angles(math.rad(-0),math.rad(-25),0))
  603.             end
  604.             local function lerpB()
  605.                 weldlerp(leftweld,.1,CFrame.new(1.5,1,.5)*CFrame.Angles(math.rad(-146.31),math.rad(25.659),math.rad(16.102)),CFrame.new(1.5,0,-.5)*CFrame.Angles(math.rad(-0),math.rad(25),0))
  606.             end
  607.             spawn(lerpA)
  608.             spawn(lerpB)
  609.             wait(.2)
  610.             local function lerpA()
  611.                 weldlerp(rightweld,.1,CFrame.new(-1.5,0,-.5)*CFrame.Angles(math.rad(-0),math.rad(-25),0),CFrame.new(-1.5,0,0))
  612.             end
  613.             local function lerpB()
  614.                 weldlerp(leftweld,.1,CFrame.new(1.5,0,-.5)*CFrame.Angles(math.rad(-0),math.rad(25),0),CFrame.new(1.5,0,0))
  615.             end
  616.             spawn(lerpA)
  617.             spawn(lerpB)
  618.             damage = 0
  619.             wait(.21)
  620.             attacking = false
  621.             jointA.Parent = torso
  622.             jointB.Parent = torso
  623.             rightweld:Destroy()
  624.             leftweld:Destroy()
  625.         elseif k == Enum.KeyCode.Z and not attacking and not defending then
  626.             --charged attack?
  627.             attacking = true
  628.             defending = true
  629.             local joint = torso:FindFirstChild('Right Shoulder')
  630.             local jointclone = nil
  631.             if joint then
  632.                 jointclone = joint
  633.             end
  634.             get_rightweld()
  635.             rightweld.Parent = rightarm
  636.             damage = 50
  637.             local model = Instance.new('Model',chr)
  638.             model.Name = 'lol'
  639.             local function lerpA()
  640.                 weldlerp(rightweld,.1,CFrame.new(-1.5,0,0),CFrame.new(-1.5,1.5,0)*CFrame.Angles(math.rad(180),0,0))
  641.             end
  642.             local function lerpB()
  643.                 weldlerp(swordweldA,.1,CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0),CFrame.new(0, 1, 0)*CFrame.Angles(0,0,0))
  644.             end
  645.             spawn(lerpA)
  646.             spawn(lerpB)
  647.             local function particle()
  648.                 wait(math.random())
  649.                 local clone = part:Clone()
  650.                 clone.Size = Vector3.new(.2,.2,.2)
  651.                 clone.Anchored = true
  652.                 clone.Material = Enum.Material.Neon
  653.                 clone.BrickColor = BrickColor.new(0,0,0)
  654.                 clone.Transparency = math.random()
  655.                 clone.CanCollide = false
  656.                 clone.Parent = model
  657.                 clone.CFrame = torso.CFrame*CFrame.new(math.random(-5,5),math.random(-1,5),math.random(-5,5))
  658.                 local CFrameval = clone.CFrame
  659.                 for i = 0,1,.05 do
  660.                     local attckpart = chr:FindFirstChild('ATTCKZ')
  661.                     if attckpart then
  662.                         renderstepped:wait()
  663.                         clone.CFrame = CFrameval:lerp(attckpart.CFrame,i)
  664.                     end
  665.                 end
  666.                 clone:Destroy()
  667.             end
  668.             local function tiprot()
  669.                 local x = 0
  670.                 local y = 0
  671.                 local z = 0
  672.                 local size = .2
  673.                 local add = true
  674.                 local part = part:Clone()
  675.                 part.Name = 'ATTCKZ'
  676.                 if attacking and defending then
  677.                     part.Transparency = .5
  678.                     part.Material = Enum.Material.Neon
  679.                     part.BrickColor = BrickColor.new(0,0,0)
  680.                     part.Anchored = true
  681.                     part.CanCollide = false
  682.                     part.Size = Vector3.new(.2,.2,.2)
  683.                     part.Parent = chr
  684.                 end
  685.                 while renderstepped:wait() and attacking and defending and part~=nil do
  686.                     if x > 360 then
  687.                         x = 0
  688.                     elseif y > 360 then
  689.                         y = 0
  690.                     elseif size > 2 and add == true then
  691.                         add = false
  692.                     elseif size <.4 and add == false then
  693.                         add = true
  694.                     end
  695.                     if add == true then
  696.                         size = size+.1
  697.                     else
  698.                         size = size-.1
  699.                     end
  700.                     x = x+3
  701.                     y = y+2
  702.                     z = z+4
  703.                     damage = damage+(math.random()/math.random(2,4))
  704.                     myhumanoid:TakeDamage(-.1)
  705.                     part.Transparency = size/2
  706.                     part.Size = Vector3.new(size,size,size)
  707.                     part.CFrame = swordA.STip.CFrame*CFrame.Angles(math.rad(x),math.rad(y),math.rad(z))
  708.                     spawn(particle)
  709.                 end
  710.             end
  711.             spawn(tiprot)
  712.             userinput.InputEnded:connect(function(keycode)
  713.                 local k = keycode.KeyCode
  714.                 if k == Enum.KeyCode.Z and attacking and defending then
  715.                     local partattack = chr:FindFirstChild('ATTCKZ')
  716.                     if partattack then
  717.                         defending = false
  718.                         wait(.5)
  719.                         model:Destroy()
  720.                         local model = Instance.new('Model',workspace)
  721.                         partattack:Destroy()
  722.                         damage = math.ceil(damage)
  723.                         print(damage)
  724.                         local lol = part:Clone()
  725.                         lol.Size = Vector3.new(1,500,40)
  726.                         lol.Material = Enum.Material.Neon
  727.                         lol.BrickColor = BrickColor.new(0,0,0)
  728.                         lol.CanCollide = true
  729.                         lol.Anchored = true
  730.                         lol.Transparency = 1
  731.                         local CFrameval = hrp.CFrame
  732.                         local function lerp()
  733.                             weldlerp(rightweld,.1,CFrame.new(-1.5,1.5,0)*CFrame.Angles(math.rad(180),0,0),CFrame.new(-1.5,0,0))
  734.                         end
  735.                         local function lerpB()
  736.                             weldlerp(swordweldA,.1,CFrame.new(0, 1, 0)*CFrame.Angles(0,0,0),CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0))
  737.                         end
  738.                         local function kido()
  739.                             for i = 1,40 do
  740.                                 renderstepped:wait()
  741.                                 local clone = lol:Clone()
  742.                                 local function tran()
  743.                                     for i = 1,0,-.1 do
  744.                                         renderstepped:wait()
  745.                                         clone.Transparency = i
  746.                                     end
  747.                                 end
  748.                                 spawn(tran)
  749.                                 clone.CFrame = CFrameval+CFrameval.lookVector*(i*40)
  750.                                 local debounce = false
  751.                                 clone.Touched:connect(function(p)
  752.                                     if p.Parent then
  753.                                         local h = p.Parent:FindFirstChild('Humanoid')
  754.                                         local w = p.Parent:FindFirstChild('Weld')
  755.                                         if h and h~=myhumanoid and debounce == false then
  756.                                             debounce = true
  757.                                             h:TakeDamage(damage)
  758.                                             local bav = Instance.new("BodyAngularVelocity",h.Parent.Torso)
  759.                                             bav.MaxTorque = Vector3.new(huge,huge,huge)
  760.                                             bav.AngularVelocity = Vector3.new(math.random(0,180),math.random(0,180),math.random(0,180))
  761.                                             local bf = Instance.new('BodyForce',h.Parent.Torso)
  762.                                             local function destroy()
  763.                                                 wait(math.random(2,4))
  764.                                                 bf:Destroy()
  765.                                             end
  766.                                             h.Sit = true
  767.                                             bf.Force = Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  768.                                             spawn(destroy)
  769.                                             wait()
  770.                                             debounce = false
  771.                                         elseif w and w.Parent ~= chr and w.Parent.Parent ~= chr then
  772.                                             w:Destroy()
  773.                                         end
  774.                                     end
  775.                                 end)
  776.                                 clone.Parent = model
  777.                             end
  778.                         end
  779.                         spawn(lerp)
  780.                         spawn(lerpB)
  781.                         spawn(kido)
  782.                         wait(.2)
  783.                         attacking = false
  784.                         defending = false
  785.                         jointclone.Parent = torso
  786.                         wait(2)
  787.                         for i = 0,1,.1 do
  788.                             renderstepped:wait()
  789.                             for n,v in pairs(model:GetChildren()) do
  790.                                 v.Transparency = i
  791.                                 v.CFrame = v.CFrame*CFrame.new(0,1,0)
  792.                             end
  793.                         end
  794.                         model:Destroy()
  795.                         damage = 0
  796.                     end
  797.                 end
  798.             end)
  799.         elseif k == Enum.KeyCode.T and not attacking and not defending then
  800.             attacking = true
  801.             defending = true
  802.             --X with a sword to deflect anything
  803.             --5.4 length
  804.             local jointA = nil
  805.             local jointB = nil
  806.             local joint = torso:FindFirstChild('Right Shoulder')
  807.             jointA = joint:Clone()
  808.             local joint = torso:FindFirstChild('Left Shoulder')
  809.             jointB = joint:Clone()
  810.             local cyl = part:Clone()
  811.             cyl.BrickColor = BrickColor.new(1,1,1)
  812.             cyl.Anchored = true
  813.             cyl.CanCollide = true
  814.             cyl.Size = Vector3.new(.2,.2,.2)
  815.             cyl.Material = Enum.Material.Neon
  816.             cyl.Touched:connect(function(p)
  817.                 if p.Parent then
  818.                     if p.Parent ~= chr and p.Parent.Parent ~= chr and p.Name ~= 'Base' then
  819.                         p:Destroy()
  820.                     end
  821.                 end
  822.             end)
  823.             local cmesh = cylmesh:Clone()
  824.             cmesh.Parent = cyl
  825.             get_rightweld()
  826.             rightweld.Parent = rightarm
  827.             get_leftweld()
  828.             leftweld.Parent = leftarm
  829.             local function lerpA()
  830.                 --54.736, -30, -54.736
  831.                 weldlerp(rightweld,.1,CFrame.new(-1.5,0,0),CFrame.new(-1.5,.5,.5)*CFrame.Angles(math.rad(-90),math.rad(-12),math.rad(0)))
  832.                 weldlerp(swordweldA,.05,CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0),CFrame.new(0,1,0)*CFrame.Angles(math.rad(0),0,0))
  833.             end
  834.             local function lerpB()
  835.                 --125.264, -30, 54.736
  836.                 weldlerp(leftweld,.1,CFrame.new(1.5,0,0),CFrame.new(1.5,.5,.5)*CFrame.Angles(math.rad(-90),math.rad(12),math.rad(0)))
  837.                 weldlerp(swordweldB,.05,CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0),CFrame.new(0,1,0)*CFrame.Angles(math.rad(0),0,0))
  838.             end
  839.             spawn(lerpA)
  840.             spawn(lerpB)
  841.             wait(.4)
  842.             local function defend()
  843.                 local size = 0
  844.                 cyl.Parent = workspace
  845.                 cyl.Name = 'defnd circ'
  846.                 while renderstepped:wait() and attacking and defending do
  847.                     if size > 15 then
  848.                         size = .3
  849.                     end
  850.                     size = size+.4
  851.                     cyl.Size = Vector3.new(size,.2,size)
  852.                     cyl.Transparency = size/15
  853.                     cyl.CFrame = hrp.CFrame*CFrame.new(0,.5,0)*CFrame.Angles(math.rad(90),0,0)+(hrp.CFrame.lookVector*7.4)
  854.                 end
  855.             end
  856.             spawn(defend)
  857.             userinput.InputEnded:connect(function(keycode)
  858.                 if keycode.KeyCode == Enum.KeyCode.T and attacking and defending then
  859.                     defending = false
  860. --                  wait(.4)
  861.                     local circ = workspace:WaitForChild('defnd circ')
  862.                     local size = circ.Size.X
  863.                     for i = size,10.3,.3 do
  864.                         renderstepped:wait()
  865.                         circ.Size = Vector3.new(i,.2,i)
  866.                         circ.Transparency = i/10
  867.                         circ.CFrame = hrp.CFrame*CFrame.new(0,.5,0)*CFrame.Angles(math.rad(90),0,0)+hrp.CFrame.lookVector*7.4
  868.                     end
  869.                     circ:Destroy()
  870.                     local function lerpA()
  871.                         --54.736, -30, -54.736
  872.                         weldlerp(rightweld,.1,CFrame.new(-1.5,.5,.5)*CFrame.Angles(math.rad(-90),math.rad(-12),math.rad(0)),CFrame.new(-1.5,0,0))
  873.                         weldlerp(swordweldA,.05,CFrame.new(0,1,0)*CFrame.Angles(math.rad(0),0,0),CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0))
  874.                     end
  875.                     local function lerpB()
  876.                         --125.264, -30, 54.736
  877.                         weldlerp(leftweld,.1,CFrame.new(1.5,.5,.5)*CFrame.Angles(math.rad(-90),math.rad(12),math.rad(0)),CFrame.new(1.5,0,0))
  878.                         weldlerp(swordweldB,.05,CFrame.new(0,1,0)*CFrame.Angles(math.rad(0),0,0),CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0))
  879.                     end
  880.                     spawn(lerpA)
  881.                     spawn(lerpB)
  882.                     wait(.4)
  883.                     attacking = false
  884.                     jointA.Parent = torso
  885.                     jointB.Parent = torso
  886.                 end
  887.             end)
  888.         elseif k == Enum.KeyCode.Y and not attacking and not defending then
  889.             attacking = true
  890.             defending = true
  891.             local tele = part:Clone()
  892.             tele.BrickColor = BrickColor.new(1,1,1)
  893.             tele.Size = Vector3.new(.2,.2,.2)
  894.             tele.Material = Enum.Material.Neon
  895.             tele.CanCollide = false
  896.             tele.Anchored = true
  897.             tele.Transparency = 1
  898.             heal()
  899.             local function teleport()
  900.                 local CFrameval = hrp.CFrame
  901.                 local clone = tele:Clone()
  902.                 clone.Touched:connect(function(p)
  903.                     if p.Parent then
  904.                         if p.Parent ~= chr and p.Parent.Parent ~= chr and p.Parent.Parent.Parent ~= chr and p.Name ~= 'Base' then
  905.                             local h = p.Parent:FindFirstChild('Humanoid')
  906.                             if not h then
  907.                                 p:Destroy()
  908.                             end
  909.                         end
  910.                     end
  911.                 end)
  912.                 clone.Parent = workspace
  913.                 clone.CFrame = CFrameval
  914.                 local x = 0
  915.                 local y = 0
  916.                 local z = 0
  917.                 for i = .2,10,.25 do
  918.                     renderstepped:wait()
  919.                     x = x + math.random(1,5)
  920.                     y = y + math.random(1,5)
  921.                     z = z + math.random(1,5)
  922.                     clone.Transparency = i/10
  923.                     clone.Size = Vector3.new(i,i,i)
  924.                     clone.CFrame = CFrameval*CFrame.Angles(math.rad(x),math.rad(y),math.rad(z))
  925.                 end
  926.                 clone:Destroy()
  927.             end
  928.             local function find()
  929.                 local CFrameval = hrp.CFrame
  930.                 local clone = tele:Clone()
  931.                 clone.Touched:connect(function(p)
  932.                     if p.Parent then
  933.                         if p.Parent ~= chr and p.Parent.Parent ~= chr and p.Parent.Parent.Parent ~= chr and p.Name ~= 'Base' then
  934.                             local h = p.Parent:FindFirstChild('Humanoid')
  935.                             if not h then
  936.                                 p:Destroy()
  937.                             end
  938.                         end
  939.                     end
  940.                 end)
  941.                 clone.Parent = workspace
  942.                 clone.CFrame = CFrameval
  943.                 local x = 0
  944.                 local y = 0
  945.                 local z = 0
  946.                 for i = 10,.2,-.25 do
  947.                     renderstepped:wait()
  948.                     x = x + math.random(1,5)
  949.                     y = y + math.random(1,5)
  950.                     z = z + math.random(1,5)
  951.                     clone.Transparency = i/10
  952.                     clone.Size = Vector3.new(i,i,i)
  953.                     clone.CFrame = CFrameval*CFrame.Angles(math.rad(x),math.rad(y),math.rad(z))
  954.                 end
  955.                 clone:Destroy()
  956.             end
  957.             while renderstepped:wait() and defending and attacking do
  958.                 spawn(teleport)
  959.                 wait(.1)
  960.                 chr:SetPrimaryPartCFrame(head.CFrame*CFrame.new(math.random(-40,40),0,math.random(-40,40)))
  961.                 spawn(find)
  962.             end
  963.         elseif k == Enum.KeyCode.X and not attacking and not defending then
  964.             --when shot a parade of white bolts scatter in a circular pattern
  965.             attacking = true
  966.             defending = true
  967.             local dmg = 5
  968.             local model = Instance.new('Model',chr)
  969.             model.Name = 'XPARTICLE'
  970.             local joint = torso:FindFirstChild('Right Shoulder')
  971.             local jointA = joint:Clone()
  972.             local joint = torso:FindFirstChild('Left Shoulder')
  973.             local jointB = joint:Clone()
  974.             get_rightweld()
  975.             rightweld.Parent = torso
  976.             get_leftweld()
  977.             leftweld.Parent = torso
  978.             local function lerpA()
  979.                 --54.736, -30, -54.736
  980.                 weldlerp(rightweld,.1,CFrame.new(-1.5,0,0),CFrame.new(-1.5,.5,.5)*CFrame.Angles(math.rad(-90),math.rad(-12),math.rad(0)))
  981.                 weldlerp(swordweldA,.05,CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0),CFrame.new(0,1,0)*CFrame.Angles(math.rad(0),0,0))
  982.             end
  983.             local function lerpB()
  984.                 --125.264, -30, 54.736
  985.                 weldlerp(leftweld,.1,CFrame.new(1.5,0,0),CFrame.new(1.5,.5,.5)*CFrame.Angles(math.rad(-90),math.rad(12),math.rad(0)))
  986.                 weldlerp(swordweldB,.05,CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0),CFrame.new(0,1,0)*CFrame.Angles(math.rad(0),0,0))
  987.             end
  988.             spawn(lerpA)
  989.             spawn(lerpB)
  990.             local function particles()
  991.                 local particle = part:Clone()
  992.                 particle.Material = Enum.Material.Neon
  993.                 particle.Size = Vector3.new(.2,.2,.2)
  994.                 particle.BrickColor = BrickColor.new(1,1,1)
  995.                 particle.CanCollide = false
  996.                 particle.Anchored = true
  997.                 particle.Parent = model
  998.                 local xcharge = chr:FindFirstChild('XCHARGE')
  999.                 local CFrameval = hrp.CFrame*CFrame.new(math.random(-4,4),math.random(-2,4),math.random(-20,-10))
  1000.                 for i = 0,1,.05 do
  1001.                     if xcharge then
  1002.                         renderstepped:wait()
  1003.                         particle.CFrame = CFrameval:lerp(xcharge.CFrame,i)
  1004.                         particle.Transparency = i
  1005.                     end
  1006.                 end
  1007.                 particle:Destroy()
  1008.             end
  1009.             local function charging()
  1010.                 local x = 0
  1011.                 local y = 0
  1012.                 local z = 0
  1013.                 local size = .2
  1014.                 local add = true
  1015.                 local charge = part:Clone()
  1016.                 charge.Size = Vector3.new(.2,.2,.2)
  1017.                 charge.BrickColor = BrickColor.new(1,1,1)
  1018.                 charge.CanCollide = false
  1019.                 charge.Anchored = true
  1020.                 charge.Material = Enum.Material.Neon
  1021.                 charge.Name = 'XCHARGE'
  1022.                 charge.Parent = chr
  1023.                 while attacking and defending and renderstepped:wait() do
  1024.                     if x > 360 then
  1025.                         x = 0
  1026.                     elseif y > 360 then
  1027.                         y = 0
  1028.                     elseif z > 360 then
  1029.                         z = 0
  1030.                     elseif size > 2 and add then
  1031.                         add = false
  1032.                     elseif size < .4 and not add then
  1033.                         add = true
  1034.                     elseif add == true then
  1035.                         size = size + .1
  1036.                     elseif add == false then
  1037.                         size = size - .1
  1038.                     end
  1039.                     x = x + 2
  1040.                     y = y + 3
  1041.                     z = z + 5
  1042.                     dmg = dmg+math.random()/4
  1043.                     charge.Size = Vector3.new(size,size,size)
  1044.                     charge.Transparency = size/2
  1045.                     spawn(particles)
  1046.                     local CFrameval = hrp.CFrame+hrp.CFrame.lookVector*7.4
  1047.                     charge.CFrame = CFrameval*CFrame.new(0,1,0)*CFrame.Angles(math.rad(x),math.rad(y),math.rad(z))
  1048.                 end
  1049.             end
  1050.             spawn(charging)
  1051.             userinput.InputEnded:connect(function(keycode)
  1052.                 if keycode.KeyCode == Enum.KeyCode.X and attacking and defending then
  1053.                     if rightweld.C0 ~= CFrame.new(-1.5,.5,.5)*CFrame.Angles(math.rad(-90),math.rad(-12),math.rad(0)) then
  1054.                         wait(.4)
  1055.                     end
  1056.                     defending = false
  1057.                     model:Destroy()
  1058.                     local xcharge = chr:FindFirstChild('XCHARGE')
  1059.                     if xcharge then
  1060.                         local template = part:Clone()
  1061.                         template.Size = Vector3.new(.2,.2,4)
  1062.                         template.BrickColor = BrickColor.new(1,1,1)
  1063.                         template.CanCollide = false
  1064.                         template.Anchored = true
  1065.                         template.Material = Enum.Material.Neon
  1066.                         template.Name = 'XCHARGE'
  1067.                         local bv = Instance.new('BodyVelocity',template)
  1068.                         bv.MaxForce = Vector3.new(huge,huge,huge)
  1069.                         xcharge:Destroy()
  1070.                         local function lerpA()
  1071.                             --54.736, -30, -54.736
  1072.                             weldlerp(rightweld,.1,CFrame.new(-1.5,.5,.5)*CFrame.Angles(math.rad(-90),math.rad(-12),math.rad(0)),CFrame.new(-1.5,0,0))
  1073.                             weldlerp(swordweldA,.05,CFrame.new(0,1,0)*CFrame.Angles(math.rad(0),0,0),CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0))
  1074.                         end
  1075.                         local function lerpB()
  1076.                             --125.264, -30, 54.736
  1077.                             weldlerp(leftweld,.1,CFrame.new(1.5,.5,.5)*CFrame.Angles(math.rad(-90),math.rad(12),math.rad(0)),CFrame.new(1.5,0,0))
  1078.                             weldlerp(swordweldB,.05,CFrame.new(0,1,0)*CFrame.Angles(math.rad(0),0,0),CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0))
  1079.                         end
  1080.                         spawn(lerpA)
  1081.                         spawn(lerpB)
  1082.                         local function attck()
  1083.                             wait(.2)
  1084.                             attacking = false
  1085.                             defending = false
  1086.                         end
  1087.                         spawn(attck)
  1088.                         for i = 1,10 do
  1089.                             renderstepped:wait()
  1090.                             local clone = template:Clone()
  1091.                             clone.CFrame = hrp.CFrame*CFrame.new(math.random(-2,2),math.random(0,4),-7.4)
  1092.                             clone.BodyVelocity.Velocity = hrp.CFrame.lookVector*math.random(200,400)
  1093.                             clone.Parent = workspace
  1094.                             clone.Anchored = false
  1095.                             clone.Touched:connect(function(p)
  1096.                                 if p.Parent then
  1097.                                     local h = p.Parent:FindFirstChild('Humanoid')
  1098.                                     local function bulleteffect()
  1099.                                         clone:Destroy()
  1100.                                         local sphere = part:Clone()
  1101.                                         sphere.BrickColor = BrickColor.new(1,1,1)
  1102.                                         sphere.Size = Vector3.new(.2,.2,.2)
  1103.                                         sphere.Anchored = true
  1104.                                         sphere.CanCollide = false
  1105.                                         sphere.Material = Enum.Material.Neon
  1106.                                         sphere.Shape = 'Ball'
  1107.                                         sphere.CFrame = clone.CFrame+clone.CFrame.lookVector*-2
  1108.                                         local function grow()
  1109.                                             local CFrameval = sphere.CFrame
  1110.                                             sphere.Parent = workspace
  1111.                                             for i = .2,5,.2 do
  1112.                                                 renderstepped:wait()
  1113.                                                 sphere.Transparency = i/5
  1114.                                                 sphere.Size = Vector3.new(i,i,i)
  1115.                                                 sphere.CFrame = CFrameval
  1116.                                             end
  1117.                                             sphere:Destroy()
  1118.                                         end
  1119.                                         spawn(grow)
  1120.                                     end
  1121.                                     if h and h~=myhumanoid then
  1122.                                         spawn(bulleteffect)
  1123.                                         bloodcframeB(math.floor(dmg+math.random(-5,5)),h.Parent.Torso,h)
  1124.                                     elseif not h then
  1125.                                         spawn(bulleteffect)
  1126.                                     end
  1127.                                 end
  1128.                             end)
  1129.                         end
  1130.                         jointA.Parent = torso
  1131.                         jointB.Parent = torso
  1132.                     end
  1133.                 end
  1134.             end)
  1135.         elseif k == Enum.KeyCode.U and not defending and not attacking then
  1136.             defending = true
  1137.             attacking = true
  1138.             local joint = torso:FindFirstChild('Right Shoulder')
  1139.             local jointA = joint:Clone()
  1140.             local joint = torso:FindFirstChild('Left Shoulder')
  1141.             local jointB = joint:Clone()
  1142.             get_rightweld()
  1143.             rightweld.Parent = rightarm
  1144.             get_leftweld()
  1145.             leftweld.Parent = leftarm
  1146.             --weld,speed,startpoint,endpoint,clone,clonepart,clonepartcframe,transpeed
  1147.             local function lerpA()
  1148.                 weldlerp(rightweld,.1,CFrame.new(-1.5,0,0),CFrame.Angles(math.rad(-15),math.rad(30),math.rad(0))*CFrame.new(-1.5,0,0))
  1149.             end
  1150.             local function lerpB()
  1151.                 weldlerp(leftweld,.1,CFrame.new(1.5,0,0),CFrame.Angles(math.rad(-15),math.rad(-30),math.rad(0))*CFrame.new(1.5,0,0))
  1152.             end
  1153.             spawn(lerpA)
  1154.             spawn(lerpB)
  1155.             local rad = 2
  1156.             local circ = 2*pi*rad
  1157.             local n = circ/.4
  1158.             local rot = 360/n
  1159.             local model = Instance.new('Model',chr)
  1160.             local template = part:Clone()
  1161.             template.Size = Vector3.new(.4,.4,.4)
  1162.             template.Material = Enum.Material.Neon
  1163.             template.BrickColor = BrickColor.new(1,1,1)
  1164.             template.Anchored = true
  1165.             template.CanCollide = false
  1166.             template.Transparency = 1
  1167.             local bv = Instance.new('BodyVelocity',template)
  1168.             bv.MaxForce = Vector3.new(huge,huge,huge)
  1169.             local CFrameval = hrp.CFrame
  1170.             myhumanoid.WalkSpeed = 0
  1171.             for i = 0,n do
  1172.                 renderstepped:wait()
  1173.                 local clone = template:Clone()
  1174.                 local function tran()
  1175.                     for i = 1,0,-.1 do
  1176.                         renderstepped:wait()
  1177.                         clone.Transparency = i
  1178.                     end
  1179. --                  clone.Anchored = false
  1180.                     wait(2)
  1181.                     clone:Destroy()
  1182.                 end
  1183.                 spawn(tran)
  1184.                 clone.Parent = model
  1185.                 clone.CFrame = CFrameval*CFrame.Angles(0,math.rad(i*rot),0)*CFrame.new(0,0,2)
  1186.                 bv.Velocity = clone.CFrame.lookVector*-100
  1187.             end
  1188.             local function thing()
  1189.                 local cyl = part:Clone()
  1190.                 cyl.Material = Enum.Material.Neon
  1191.                 cyl.Size = Vector3.new(.2,200,.2)
  1192.                 cyl.BrickColor = BrickColor.new(1,1,1)
  1193.                 cyl.Anchored = true
  1194.                 cyl.CanCollide = false
  1195.                 local cylmeshp = cylmesh:Clone()
  1196.                 cylmeshp.Parent = cyl
  1197.                 cyl.CFrame = hrp.CFrame
  1198.                 cyl.Parent = workspace
  1199.                 local CFrameval = cyl.CFrame
  1200.                 for i = .2,10,.2 do
  1201.                     renderstepped:wait()
  1202.                     cyl.Transparency = i/10
  1203.                     cyl.Size = Vector3.new(i,200,i)
  1204.                     cyl.CFrame = CFrameval
  1205.                 end
  1206.                 cyl:Destroy()
  1207.             end
  1208.             wait(.2)
  1209.             spawn(thing)
  1210.             spawn(heal)
  1211.             myhumanoid.WalkSpeed = 16
  1212.             for i,v in pairs(model:GetChildren()) do
  1213.                 v.Anchored = false
  1214.             end
  1215.             local function lerpA()
  1216.                 weldlerp(rightweld,.1,CFrame.Angles(math.rad(-15),math.rad(30),math.rad(0))*CFrame.new(-1.5,0,0),CFrame.new(-1.5,0,0))
  1217.             end
  1218.             local function lerpB()
  1219.                 weldlerp(leftweld,.1,CFrame.Angles(math.rad(-15),math.rad(-30),math.rad(0))*CFrame.new(1.5,0,0),CFrame.new(1.5,0,0))
  1220.             end
  1221.             spawn(lerpA)
  1222.             spawn(lerpB)
  1223.             wait(.2)
  1224.             attacking = false
  1225.             defending = false
  1226.             jointA.Parent = torso
  1227.             jointB.Parent = torso
  1228.         elseif k == Enum.KeyCode.C and not attacking and not defending then
  1229.             attacking = true
  1230.             defending = true
  1231.             --kido bleed/4 thing that anchors
  1232.             local joint = torso:FindFirstChild('Right Shoulder')
  1233.             local jointA
  1234.             if joint then
  1235.                 jointA = joint:Clone()
  1236.             end
  1237.             local template = part:Clone()
  1238.             template.Material = Enum.Material.Neon
  1239.             template.BrickColor = BrickColor.new(Color3.fromRGB(41, 128, 185))
  1240.             template.Anchored = true
  1241.             template.CanCollide = false
  1242.             template.Size = Vector3.new(.2,4,.2)
  1243.             local bv = Instance.new('BodyVelocity',template)
  1244.             bv.MaxForce = Vector3.new(huge,huge,huge)
  1245.             bv.Velocity = hrp.CFrame.lookVector*400
  1246.             get_rightweld()
  1247.             rightweld.Parent = torso
  1248. --          local ba = Instance.new('BodyAngularVelocity',template)
  1249. --          ba.MaxTorque = Vector3.new(huge,huge,huge)
  1250. --          ba.AngularVelocity = Vector3.new(0,0,10)
  1251.             local function lerpA()
  1252.                 weldlerp(rightweld,.1,CFrame.new(-1.5,0,0),CFrame.new(-1.5,.5,.5)*CFrame.Angles(math.rad(-90),0,0))
  1253.             end
  1254.             local function lerpB()
  1255.                 weldlerp(swordweldA,.1,CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0),CFrame.new(0,1,0)*CFrame.Angles(math.rad(0),0,0))
  1256.             end
  1257.             spawn(lerpB)
  1258.             spawn(lerpA)
  1259.             wait(.2)
  1260.             local rad = 1
  1261.             local circ = 2*pi*rad
  1262.             local n = circ/.4
  1263.             local rot = 360/n
  1264.             for i = 0,n do
  1265. --              renderstepped:wait()
  1266.                 local clone = template:Clone()
  1267. --              clone.BodyAngularVelocity:Destroy()
  1268.                 clone.CFrame = swordA.STip.CFrame*CFrame.Angles(0,math.rad(i*rot),0)
  1269.                 clone.Parent = workspace
  1270.                 clone.Anchored = false
  1271.                 clone.Size = Vector3.new(.4,.4,.4)
  1272.                 clone.BodyVelocity.Velocity = clone.CFrame.lookVector*50
  1273.                 local function destroy()
  1274.                     wait(2)
  1275.                     clone:Destroy()
  1276.                 end
  1277.                 spawn(destroy)
  1278.             end
  1279.             local clone = template:Clone()
  1280.             local debounce = false
  1281.             clone.Touched:connect(function(p)
  1282.                 if p.Parent then
  1283.                     local h = p.Parent:FindFirstChild('Humanoid')
  1284.                     local t = p.Parent:FindFirstChild('Torso')
  1285.                     if h and h~=myhumanoid and t and t~=torso then
  1286.                         local function thing()
  1287.                             bloodcframeB(math.random(1,5),t,h)
  1288.                         end
  1289.                         local function kido()
  1290.                             t.Anchored = true
  1291.                             while h.Health>1 and t.Anchored == true do
  1292.                                 spawn(thing)
  1293.                                 for i = 1,4 do
  1294.                                     renderstepped:wait()
  1295.                                     local clone = template:Clone()
  1296.                                     clone.Parent = workspace
  1297.                                     clone.Size = Vector3.new(1.5,.2,.2)
  1298.                                     clone.Transparency = 0
  1299.                                     local CFrameval = t.CFrame*CFrame.Angles(0,math.rad(45*i),0)
  1300.                                     local function tran()
  1301.                                         for i = .2,10.2,.2 do
  1302.                                             renderstepped:wait()
  1303.                                             clone.Transparency = i/10
  1304.                                             clone.Size = Vector3.new(1.5,.2,i)
  1305.                                             clone.CFrame = CFrameval
  1306.                                         end
  1307.                                     end
  1308.                                     spawn(tran)
  1309.                                 end
  1310.                                 wait(1)
  1311.                             end
  1312.                         end
  1313.                         spawn(kido)
  1314.                     elseif not h and p.Parent ~= chr and p.Parent.Parent ~=chr and p.Parent.Parent ~= chr and not debounce then
  1315.                         clone.Anchored = true
  1316.                         local CFrameval =  clone.CFrame
  1317.                         debounce = true
  1318.                         clone.Size = Vector3.new(.2,.2,.2)
  1319.                         local x = 0
  1320.                         local y = 0
  1321.                         local z = 0
  1322.                         for i = .2,10,.1 do
  1323.                             if clone then
  1324.                                 x = x+math.random(1,4)
  1325.                                 y = y-math.random(1,4)
  1326.                                 z = z+math.random(1,4)
  1327.                                 renderstepped:wait()
  1328.                                 clone.Size = Vector3.new(i,i,i)
  1329.                                 clone.CFrame = CFrameval*CFrame.Angles(math.rad(x),math.rad(y),math.rad(z))
  1330.                                 clone.Transparency = i/10
  1331.                             end
  1332.                         end
  1333.                         clone:Destroy()
  1334.                         debounce = false
  1335.                     end
  1336.                 end
  1337.             end)
  1338.             clone.Parent = workspace
  1339.             clone.CFrame = swordA.STip.CFrame
  1340.             clone.BodyVelocity.Velocity = hrp.CFrame.lookVector*400
  1341.             clone.Anchored = false
  1342.             local function lerpA()
  1343.                 weldlerp(rightweld,.1,CFrame.new(-1.5,.5,.5)*CFrame.Angles(math.rad(-90),0,0),CFrame.new(-1.5,0,0))
  1344.             end
  1345.             local function lerpB()
  1346.                 weldlerp(swordweldA,.1,CFrame.new(0,1,0)*CFrame.Angles(math.rad(0),0,0),CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0))
  1347.             end
  1348.             spawn(lerpB)
  1349.             spawn(lerpA)
  1350.             wait(.2)
  1351.             attacking = false
  1352.             defending = false
  1353.             jointA.Parent = torso
  1354.         elseif k == Enum.KeyCode.V and not attacking and not defending then
  1355.             attacking = true
  1356.             defending = true
  1357.             local jointA
  1358.             local jointB
  1359.             local joint = torso:FindFirstChild('Right Shoulder')
  1360.             jointA = joint:Clone()
  1361.             joint = torso:FindFirstChild('Left Shoulder')
  1362.             jointB = joint:Clone()
  1363.             get_rightweld()
  1364.             rightweld.Parent = rightarm
  1365.             get_leftweld()
  1366.             leftweld.Parent = leftarm
  1367.             local model = Instance.new('Model',terrain)
  1368.             local grass = part:Clone()
  1369.             grass.Material = Enum.Material.Neon
  1370.             grass.Anchored = false
  1371.             grass.CanCollide = false
  1372. --          local ba = Instance.new('BodyAngularVelocity',grass)
  1373. --          ba.MaxTorque = Vector3.new(huge,huge,huge)
  1374.             local bp = Instance.new('BodyPosition',grass)
  1375.             bp.D = 100
  1376.             bp.MaxForce = Vector3.new(huge,huge,huge)
  1377.             bp.P = 200
  1378.             local function lerpA()
  1379.                 weldlerp(rightweld,.1,CFrame.new(-1.5,0,0),CFrame.Angles(math.rad(-15),math.rad(30),math.rad(0))*CFrame.new(-1.5,0,0))
  1380.             end
  1381.             local function lerpB()
  1382.                 weldlerp(leftweld,.1,CFrame.new(1.5,0,0),CFrame.Angles(math.rad(-15),math.rad(-30),math.rad(0))*CFrame.new(1.5,0,0))
  1383.             end
  1384.             spawn(lerpA)
  1385.             spawn(lerpB)
  1386.             for i = 1,math.random(100,200) do
  1387.                 local color = math.random(1,2)
  1388.                 local random = math.random()
  1389.                 local clone = grass:Clone()
  1390.                 if color == 1 then
  1391.                     clone.BrickColor = BrickColor.new(1,1,1)
  1392.                 else
  1393.                     clone.BrickColor = BrickColor.new(0,0,0)
  1394.                 end
  1395.                 clone.Position = torso.Position+Vector3.new(math.random(-15,15),-10,math.random(-15,15))
  1396.                 clone.Size = Vector3.new(random,random,random)
  1397.                 clone.BodyPosition.Position = torso.Position+Vector3.new(math.random(-15,15),math.random(-1,15),math.random(-15,15))
  1398.                 Instance.new('BodyAngularVelocity',clone)
  1399.                 clone.BodyAngularVelocity.AngularVelocity = Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  1400.                 clone.Parent = model
  1401.             end
  1402.             defending = false
  1403.             for i,v in pairs(model:GetChildren()) do
  1404.                 renderstepped:wait()
  1405.                 local debounce = false
  1406.                 v.Touched:connect(function(p)
  1407.                     if p.Parent and debounce == false then
  1408.                         local function destroy()
  1409.                             local cframeval = v.CFrame
  1410.                             for i = 0,1,.05 do
  1411.                                 renderstepped:wait()
  1412.                                 v.Transparency = i
  1413.                                 v.Size = v.Size+Vector3.new(.3,.3,.3)
  1414.                                 v.CFrame = cframeval
  1415.                             end
  1416.                             v:Destroy()
  1417.                         end
  1418.                         local weld = p.Parent:FindFirstChild('Weld',true)
  1419.                         local h = p.Parent:FindFirstChild('Humanoid')
  1420.                         if h and h~=myhumanoid then
  1421.                             debounce = true
  1422.                             bloodcframeB(math.random(5,20),h.Parent.Torso,h)
  1423.                             destroy()
  1424.                         elseif weld and weld ~= rightweld and weld ~= leftweld and weld.Parent.Parent ~= swordA and weld.Parent.Parent ~= swordB then
  1425.                             debounce = true
  1426.                             weld:Destroy()
  1427.                             destroy()
  1428.                         elseif p.Parent ~= model and p.Parent ~= chr and p.Parent.Parent ~= chr then
  1429.                             debounce = true
  1430.                             destroy()
  1431.                         end
  1432.                     end
  1433.                 end)
  1434.                 local bv = Instance.new('BodyVelocity',v)
  1435.                 v.BodyPosition:Destroy()
  1436.                 bv.MaxForce = Vector3.new(huge,huge,huge)
  1437.                 bv.Velocity = torso.CFrame.lookVector*200
  1438.             end
  1439.             local function lerpA()
  1440.                 weldlerp(rightweld,.1,CFrame.Angles(math.rad(-15),math.rad(30),math.rad(0))*CFrame.new(-1.5,0,0),CFrame.new(-1.5,0,0))
  1441.             end
  1442.             local function lerpB()
  1443.                 weldlerp(leftweld,.1,CFrame.Angles(math.rad(-15),math.rad(-30),math.rad(0))*CFrame.new(1.5,0,0),CFrame.new(1.5,0,0))
  1444.             end
  1445.             spawn(lerpA)
  1446.             spawn(lerpB)
  1447.             wait(.2)
  1448.             jointA.Parent = torso
  1449.             jointB.Parent = torso
  1450.             attacking = false
  1451.             defending = false
  1452.         elseif k == Enum.KeyCode.B and not attacking and not defending then
  1453.             --cero
  1454.             attacking = true
  1455.             defending = true
  1456.             local debounce = false
  1457.             local jointA
  1458.             local jointB
  1459.             local joint = torso:FindFirstChild('Right Shoulder')
  1460.             jointA = joint:Clone()
  1461.             joint = torso:FindFirstChild('Left Shoulder')
  1462.             jointB = joint:Clone()
  1463.             local dmg = 25
  1464.             local model = Instance.new('Model',terrain)
  1465.             get_rightweld()
  1466.             rightweld.Parent = rightarm
  1467.             get_leftweld()
  1468.             leftweld.Parent = leftarm
  1469.             local template = part:Clone()
  1470.             template.BrickColor = BrickColor.new(0,0,0)
  1471.             template.Size = Vector3.new(.2,.2,.2)
  1472.             template.CanCollide = false
  1473.             template.Anchored = true
  1474.             template.Material = Enum.Material.Neon
  1475.             local function lerpA()
  1476.                 weldlerp(rightweld,.1,CFrame.new(-1.5,0,0),CFrame.Angles(math.rad(180),0,math.rad(15))*CFrame.new(-1.5,-1.5,0))
  1477.                 weldlerp(swordweldA,.05,CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0),CFrame.new(0,1,0)*CFrame.Angles(0,0,0))
  1478.             end
  1479.             local function lerpB()
  1480.                 weldlerp(leftweld,.1,CFrame.new(1.5,0,0),CFrame.Angles(math.rad(180),0,math.rad(-15))*CFrame.new(1.5,-1.5,0))
  1481.                 weldlerp(swordweldB,.05,CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0),CFrame.new(0,1,0)*CFrame.Angles(0,0,0))
  1482.             end
  1483.             spawn(lerpA)
  1484.             spawn(lerpB)
  1485.             wait(.4)
  1486.             for i = 1,4 do
  1487.                 wait()
  1488.                 if i > 2 then
  1489.                     local clone = template:Clone()
  1490.                     clone.Parent = model
  1491.                     local function grow()
  1492.                         local randomA = math.random(-5,5)
  1493.                         local randomB = math.random(-5,5)
  1494.                         local randomC = math.random(-5,5)
  1495.                         local x = 1
  1496.                         local y = 1
  1497.                         local z = 1
  1498.                         local size = .1
  1499.                         local adding = true
  1500.                         while attacking and defending and renderstepped:wait() do
  1501.                             dmg = dmg+.001
  1502.                             if adding == true and size > 4 then
  1503.                                 adding = false
  1504.                                 size = size - .1
  1505.                             elseif adding == false and size < .2 then
  1506.                                 adding = true
  1507.                                 size = size + .1
  1508.                             elseif adding == true then
  1509.                                 size = size + .1
  1510.                             elseif adding == false then
  1511.                                 size = size - .1
  1512.                             end
  1513.                             clone.Transparency = size/4
  1514.                             x = x + randomA
  1515.                             y = y - randomB
  1516.                             z = z + randomC
  1517.                             clone.Size = Vector3.new(size,size,size)
  1518.                             clone.CFrame = CFrame.new(head.Position)*CFrame.new(0,7,0)*CFrame.Angles(math.rad(x),math.rad(y),math.rad(z))
  1519.                         end
  1520.                     end
  1521.                     spawn(grow)
  1522.                 else
  1523.                     local clone = template:Clone()
  1524.                     clone.Parent = model
  1525.                     clone.BrickColor = BrickColor.new(1,1,1)
  1526.                     local function grow()
  1527.                         local randomA = math.random(-5,5)
  1528.                         local randomB = math.random(-5,5)
  1529.                         local randomC = math.random(-5,5)
  1530.                         local x = 1
  1531.                         local y = 1
  1532.                         local z = 1
  1533.                         local size = .1
  1534.                         local adding = true
  1535.                         while attacking and defending and renderstepped:wait() do
  1536.                             if adding == true and size > 4 then
  1537.                                 adding = false
  1538.                                 size = size - .1
  1539.                             elseif adding == false and size < .2 then
  1540.                                 adding = true
  1541.                                 size = size + .1
  1542.                             elseif adding == true then
  1543.                                 size = size + .1
  1544.                             elseif adding == false then
  1545.                                 size = size - .1
  1546.                             end
  1547.                             clone.Transparency = size/4
  1548.                             x = x + randomA
  1549.                             y = y - randomB
  1550.                             z = z + randomC
  1551.                             clone.Size = Vector3.new(size,size,size)
  1552.                             clone.CFrame = CFrame.new(head.Position)*CFrame.new(0,7,0)*CFrame.Angles(math.rad(x),math.rad(y),math.rad(z))
  1553.                         end
  1554.                     end
  1555.                     spawn(grow)
  1556.                 end
  1557.                 userinput.InputEnded:connect(function(keycode)
  1558.                     local key = keycode.KeyCode
  1559.                     if key == Enum.KeyCode.B and attacking and defending then
  1560.                         if rightweld.C0 ~= CFrame.Angles(math.rad(180),0,math.rad(15))*CFrame.new(-1.5,-1.5,0) then
  1561.                             wait(.4)
  1562.                         end
  1563.                         defending = false
  1564.                         local CFrameval = model.Part.CFrame
  1565.                         for i = model.Part.Size.X,4,.1 do
  1566.                             renderstepped:wait()
  1567.                             for index,v in pairs(model:GetChildren()) do
  1568.                                 v.Size = Vector3.new(i,i,i)
  1569.                                 v.CFrame = CFrameval
  1570.                                 v.Transparency = .5
  1571.                             end
  1572.                         end
  1573. --                      for i,v in pairs(model:GetChildren()) do
  1574. --                          v.Size = Vector3.new(4,4,200)
  1575. --                          v.CFrame = CFrameval
  1576. --                          v.Touched:connect(function(p)
  1577. --                             
  1578. --                          end)
  1579. --                      end
  1580.                         local rot = 1
  1581.                         local ray = part:Clone()
  1582.                         ray.Material = Enum.Material.Neon
  1583.                         ray.Size = Vector3.new(4,4,200)
  1584.                         ray.BrickColor = BrickColor.new(0,0,0)
  1585.                         ray.Anchored = true
  1586.                         ray.CanCollide = false
  1587.                         ray.Transparency = 0
  1588.                         ray.Touched:connect(function(p)
  1589.                             if p.Parent and p.Parent.Name ~= 'Base' and p.Parent ~= chr and p.Parent.Parent ~= chr and p.Parent.Parent.Parent ~= chr then
  1590.                                 local h = p.Parent:FindFirstChild('Humanoid')
  1591.                                 local function _()
  1592.                                     bloodcframeB(math.ceil(dmg)+math.random(-5,5),h.Parent.Torso,h)
  1593.                                 end
  1594.                                 if h and h~=myhumanoid  and debounce == false then
  1595.                                     debounce = true
  1596.                                     spawn(_)
  1597.                                     renderstepped:wait()
  1598.                                     debounce = false
  1599.                                 elseif debounce == false then
  1600.                                     p:Destroy()
  1601.                                 end
  1602.                             end
  1603.                         end)
  1604.                         ray.Parent = model
  1605.                         mouse.TargetFilter = model
  1606.                         while ceroing == true do
  1607.                             renderstepped:wait()
  1608.                             for i,v in pairs(model:GetChildren()) do
  1609.                                 rot = rot + 2
  1610.                                 v.CFrame = CFrame.new(head.Position+Vector3.new(0,7,0),mouse.Hit.p)*CFrame.Angles(0,0,math.rad(rot))
  1611.                                 ray.CFrame = v.CFrame*CFrame.new(0,0,-100)
  1612.                             end
  1613.                         end
  1614.                         for i = 0,1,.01 do
  1615.                             renderstepped:wait()
  1616.                             for index,v in pairs(model:GetChildren()) do
  1617.                                 v.Transparency = i
  1618.                                 v.CFrame = v.CFrame*CFrame.Angles(0,0,math.rad(rot))
  1619.                             end
  1620.                         end
  1621.                         model:Destroy()
  1622.                         local function lerpA()
  1623.                             weldlerp(rightweld,.1,CFrame.Angles(math.rad(180),0,math.rad(15))*CFrame.new(-1.5,-1.5,0),CFrame.new(-1.5,0,0))
  1624.                             weldlerp(swordweldA,.05,CFrame.new(0,1,0)*CFrame.Angles(0,0,0),CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0))
  1625.                         end
  1626.                         local function lerpB()
  1627.                             weldlerp(leftweld,.1,CFrame.Angles(math.rad(180),0,math.rad(-15))*CFrame.new(1.5,-1.5,0),CFrame.new(1.5,0,0))
  1628.                             weldlerp(swordweldB,.05,CFrame.new(0,1,0)*CFrame.Angles(0,0,0),CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0))
  1629.                         end
  1630.                         spawn(lerpA)
  1631.                         spawn(lerpB)
  1632.                         wait(.4)
  1633.                         jointA.Parent = torso
  1634.                         jointB.Parent = torso
  1635.                         attacking = false
  1636.                     end
  1637.                 end)
  1638.             end
  1639.         elseif k == Enum.KeyCode.P and not defending and not attacking then
  1640.             attacking = true
  1641.             defending = true
  1642.             local model = Instance.new('Model',terrain)
  1643.             local template = part:Clone()
  1644.             template.BrickColor = BrickColor.new('Pastel Blue')
  1645.             template.Transparency = 0
  1646.             template.Material = Enum.Material.Neon
  1647.             template.CanCollide = false
  1648.             template.Anchored = true
  1649.             template.Size = Vector3.new(1,200,1)
  1650.             local shield  = template:Clone()
  1651.             shield.Anchored = true
  1652.             shield.CanCollide = true
  1653.             shield.Size = Vector3.new(87,87,87)
  1654.             shield.Shape = 'Cylinder'
  1655.             shield.Transparency = 1
  1656.             head.Anchored = true
  1657.             local rad = 20
  1658.             local circ = 2*pi*rad
  1659.             local n = circ
  1660.             local rot = 360/n
  1661.             shield.CFrame = torso.CFrame*CFrame.Angles(0,0,math.rad(90))
  1662.             shield.Touched:connect(function(p)
  1663.                 if p.Parent and p.Parent ~= chr and p.Parent.Parent ~= chr and p.Parent.Parent ~= chr and p.Name ~= 'Base' then
  1664.                     local h = p.Parent:FindFirstChild('Humanoid')
  1665.                     if h and h~=myhumanoid then
  1666.                         bloodcframeB(math.ceil(h.MaxHealth/math.random(2,10)),h.Parent.Torso,h)
  1667.                     else
  1668.                         p:Destroy()
  1669.                     end
  1670.                 end
  1671.             end)
  1672.             for i = 0,n/3 do
  1673.                 local clone = template:Clone()
  1674.                 clone.Touched:connect(function(p)
  1675.                     if p.Parent and p.Parent ~= chr and p.Parent.Parent ~= chr and p.Parent.Parent ~= chr and p.Name ~= 'Base' then
  1676.                         local h = p.Parent:FindFirstChild('Humanoid')
  1677.                         if h and h~=myhumanoid then
  1678.                             bloodcframeB(math.ceil(h.MaxHealth/math.random(2,10)),h.Parent.Torso,h)
  1679.                         else
  1680.                             p:Destroy()
  1681.                         end
  1682.                     end
  1683.                 end)
  1684.                 clone.CFrame = torso.CFrame
  1685.                 clone.Parent = model
  1686.                 local function grow()
  1687.                     for index = 0,1,.025 do
  1688.                         renderstepped:wait()
  1689.                         clone.CFrame = torso.CFrame:lerp(torso.CFrame*CFrame.Angles(0,math.rad(i*rot*3),0)*CFrame.new(0,0,rad*2),index)
  1690.                     end
  1691.                 end
  1692.                 spawn(grow)
  1693.             end
  1694.             local function waiting()
  1695.                 wait(.667)
  1696.                 shield.Parent = model
  1697.             end
  1698.             model.PrimaryPart = shield
  1699.             local function healing()
  1700.                 wait(.667)
  1701.                 model.PrimaryPart = shield
  1702.                 while attacking and defending and renderstepped:wait() do
  1703.                     model.PrimaryPart = shield
  1704.                     myhumanoid.Health = myhumanoid.Health + math.random()/10
  1705.                     model:SetPrimaryPartCFrame(shield.CFrame*CFrame.Angles(math.rad(.5),0,0))
  1706.                 end
  1707.             end
  1708.             spawn(healing)
  1709.             userinput.InputEnded:connect(function(keycode)
  1710.                 if keycode.KeyCode == Enum.KeyCode.P and attacking and defending then
  1711.                     defending = false
  1712.                     head.Anchored = false
  1713.                     for i = 0,1,.1 do
  1714.                         renderstepped:wait()
  1715.                         for index,v in pairs(model:GetChildren()) do
  1716.                             v.CanCollide = false
  1717.                             v.CFrame = v.CFrame*CFrame.new(0,.2,0)
  1718.                             v.Transparency = i
  1719.                         end
  1720.                     end
  1721.                     model:Destroy()
  1722.                     attacking = false
  1723.                 end
  1724.             end)
  1725.         elseif k == Enum.KeyCode.N and not attacking and not defending then
  1726.             --grass that lerps to center/circ of circle with ragged rots
  1727.             attacking = true
  1728.             defending = true
  1729.             local model = Instance.new('Model',terrain)
  1730.             local target = mouse.Hit
  1731.             local jointA
  1732.             local jointB
  1733.             local joint = torso:FindFirstChild('Right Shoulder')
  1734.             jointA = joint:Clone()
  1735.             joint = torso:FindFirstChild('Left Shoulder')
  1736.             jointB = joint:Clone()
  1737.             get_rightweld()
  1738.             rightweld.Parent = rightarm
  1739. --          get_leftweld()
  1740. --          leftweld.Parent = leftarm
  1741.             local template = part:Clone()
  1742.             template.Material = Enum.Material.Neon
  1743.             template.CanCollide = false
  1744.             template.BrickColor = BrickColor.new(0,0,0)
  1745.             template.Anchored = false
  1746.             local grass = part:Clone()
  1747.             grass.Material = Enum.Material.Grass
  1748.             grass.BrickColor = BrickColor.Green()
  1749.             grass.CanCollide = true
  1750.             grass.Anchored = true
  1751.             grass.Size = Vector3.new(2,2,2)
  1752.             local rad = 25
  1753.             local circ = 2*pi*rad
  1754.             local n = circ/2
  1755.             local rot = 360/n
  1756.             local function lerpA()
  1757.                 weldlerp(rightweld,.1,CFrame.new(-1.5,0,0),CFrame.Angles(0,0,math.rad(-45))*CFrame.new(-1.3,0,0))
  1758.                 weldlerp(swordweldA,.1,CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0),CFrame.Angles(math.rad(0),0,math.rad(45))*CFrame.new(1,1.75,0))
  1759.             end
  1760.             lerpA()
  1761.             --(part,startpoint,endpoint,speed,canclone,clonepart,clonepartcframe,transpeed)
  1762.             local startpoint = torso.CFrame
  1763.             grass.Parent = terrain
  1764.             plerp(grass,startpoint*CFrame.new(2,-4,0),CFrame.new(target.p),.05,true,grass,grass.CFrame,.1)
  1765.             local grassB = grass:Clone()
  1766.             grass:Destroy()
  1767.             for i = 0,n do
  1768.                 renderstepped:wait()
  1769.                 local clone = grass:Clone()
  1770.                 clone.Parent = model
  1771.                 clone.CFrame = CFrame.new(target.p)*CFrame.Angles(0,math.rad(i*rot),0)*CFrame.new(0,0,rad)
  1772.                 clone.CFrame = clone.CFrame*CFrame.Angles(math.random(-90,90),math.random(-90,90),math.random(-90,90))
  1773.             end
  1774.             defending = false
  1775.             for i = 50,math.random(60,120) do
  1776.                 renderstepped:wait()
  1777.                 local clone = template:Clone()
  1778.                 clone.Touched:connect(function(p)
  1779.                     if p.Parent then
  1780.                         local h = p.Parent:FindFirstChild('Humanoid')
  1781.                         local function remove()
  1782.                             clone.Anchored = false
  1783.                             clone.Size = Vector3.new(.2,.2,.2)
  1784.                             clone.Shape = 'Ball'
  1785.                             clone.Anchored = true
  1786.                             clone.CFrame = clone.CFrame*CFrame.new(0,clone.Size.Y/2,0)
  1787.                             for i = 0,1,.1 do
  1788.                                 renderstepped:wait()
  1789.                                 clone.Transparency = i
  1790.                                 clone.Size = Vector3.new(i*4,i*4,i*4)
  1791.                             end
  1792.                             clone:Destroy()
  1793.                         end
  1794.                         if h and h~=myhumanoid then
  1795.                             spawn(remove)
  1796.                             bloodcframeB(math.ceil(h.MaxHealth/math.random(2,10)),h.Parent.Torso,h)
  1797.                         else
  1798.                             spawn(remove)
  1799.                         end
  1800.                     end
  1801.                 end)
  1802.                 local function tran()
  1803.                     for i = 1,0,.1 do
  1804.                         renderstepped:wait()
  1805.                         clone.Transparency = i
  1806.                     end
  1807.                 end
  1808.                 local bv = Instance.new('BodyVelocity',clone)
  1809.                 bv.Velocity = Vector3.new(0,math.random(-200,-100),0)
  1810.                 clone.Size = Vector3.new(1,math.random(5,10),1)
  1811.                 clone.CFrame = CFrame.new(target.p)*CFrame.new(math.random(-rad/2,rad/2),math.random(100,200),math.random(-rad/2,rad/2))
  1812.                 spawn(tran)
  1813.                 clone.Parent = terrain
  1814.             end
  1815.             local function lerpA()
  1816.                 weldlerp(rightweld,.1,CFrame.Angles(0,0,math.rad(-45))*CFrame.new(-1.3,0,0),CFrame.new(-1.5,0,0))
  1817.                 weldlerp(swordweldA,.1,CFrame.Angles(math.rad(0),0,math.rad(45))*CFrame.new(1,1.75,0),CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0))
  1818.             end
  1819.             lerpA()
  1820.             jointA.Parent = torso
  1821.             attacking = false
  1822.             local function cleanup()
  1823.                 wait(2)
  1824.                 renderstepped:wait()
  1825.                 for i = 0,1,.1 do
  1826.                     renderstepped:wait()
  1827.                     for x,v in pairs(model:GetChildren()) do
  1828.                         v.CFrame = v.CFrame*CFrame.new(0,1,0)
  1829.                         v.Transparency = i
  1830.                     end
  1831. --                  v:Destroy()
  1832.                 end
  1833.                 model:Destroy()
  1834.             end
  1835.             spawn(cleanup)
  1836.         elseif k == Enum.KeyCode.G and not attacking then
  1837.             attacking = true
  1838.             local destroying = true
  1839.             local debounce = false
  1840.             local jointA
  1841.             local jointB
  1842.             local joint = torso:FindFirstChild('Right Shoulder')
  1843.             jointA = joint:Clone()
  1844.             joint = torso:FindFirstChild('Left Shoulder')
  1845.             jointB = joint:Clone()
  1846.             get_rightweld()
  1847.             get_leftweld()
  1848.             local function swordcolor(colorA,colorB)
  1849.                 for i = 1,2 do
  1850.                     local function colorchange(part)
  1851.                         if i == 1 then
  1852.                             part.BrickColor = colorA
  1853.                         else
  1854.                             part.BrickColor = colorB
  1855.                         end
  1856.                     end
  1857.                     if i == 1 then
  1858.                         for i,v in pairs(swordA:GetChildren()) do
  1859.                             colorchange(v)
  1860.                         end
  1861.                     else
  1862.                         for i,v in pairs(swordB:GetChildren()) do
  1863.                             colorchange(v)
  1864.                         end
  1865.                     end
  1866.                 end
  1867.             end
  1868.             local function leedle()
  1869.                 swordcolor(BrickColor.new(Color3.fromRGB(192, 57, 43)),BrickColor.new(Color3.fromRGB(192, 57, 43)))
  1870.             end
  1871.             leedle()
  1872.             rightweld.Parent = rightarm
  1873.             leftweld.Parent = leftarm
  1874.             local function destroy(p)
  1875.                 if p.Parent and destroying then
  1876.                     local h = p.Parent:FindFirstChild('Humanoid')
  1877.                     if not h and p.Parent ~= chr and p.Parent.Parent ~= chr and p.Parent.Parent.Parent ~= chr and p.Parent~=swordA and p.Parent~=swordB and p.Parent.Name ~= 'Base' and not p:FindFirstChild('BillboardGui') then
  1878.                         p:Destroy()
  1879.                     elseif h and debounce == false and h~=myhumanoid then
  1880.                         debounce = true
  1881.                         bloodcframeB(math.ceil(h.MaxHealth/math.random(2,10)),h.Parent.Torso,h)
  1882.                     end
  1883.                 end
  1884.             end
  1885.             swordA.HitBox.Touched:connect(function(p)
  1886.                 destroy(p)
  1887.             end)
  1888.             swordB.HitBox.Touched:connect(function(p)
  1889.                 destroy(p)
  1890.             end)
  1891.             local function lerpA()
  1892.                 weldlerp(rightweld,.1,CFrame.new(-1.5,0,0),CFrame.Angles(math.rad(-90),0,math.rad(-45))*CFrame.new(-1.5,-.5,.5))
  1893.             end
  1894.             spawn(lerpA)
  1895.             weldlerp(leftweld,.1,CFrame.new(1.5,0,0),CFrame.Angles(math.rad(-90),0,math.rad(45))*CFrame.new(1.5,-.5,1))
  1896.             local function lerpA()
  1897.                 weldlerp(rightweld,.15,CFrame.Angles(math.rad(-90),0,math.rad(-45))*CFrame.new(-1.5,-.5,.5),CFrame.Angles(0,0,math.rad(-30))*CFrame.new(-1.5,0,0))
  1898.             end
  1899.             spawn(lerpA)
  1900.             weldlerp(leftweld,.15,CFrame.Angles(math.rad(-90),0,math.rad(45))*CFrame.new(1.5,-.5,1),CFrame.Angles(0,0,math.rad(30))*CFrame.new(1.5,0,0))
  1901.             local function lerpA()
  1902.                 weldlerp(rightweld,.1,CFrame.Angles(0,0,math.rad(-30))*CFrame.new(-1.5,0,0),CFrame.new(-1.5,0,0))
  1903.             end
  1904.             spawn(lerpA)
  1905.             weldlerp(leftweld,.1,CFrame.Angles(0,0,math.rad(30))*CFrame.new(1.5,0,0),CFrame.new(1.5,0,0))
  1906.             local function ledle()
  1907.                 swordcolor(BrickColor.new(0,0,0),BrickColor.new(1,1,1))
  1908.             end
  1909.             spawn(ledle)
  1910.             jointA.Parent = torso
  1911.             jointB.Parent = torso
  1912.             destroying = false
  1913.             attacking = false
  1914.         elseif k == Enum.KeyCode.H and not attacking then
  1915.             attacking = true
  1916.             local debounce = false
  1917.             local poisoning = true
  1918.             local jointA
  1919.             local joint = torso:FindFirstChild('Right Shoulder')
  1920.             jointA = joint:Clone()
  1921.             get_rightweld()
  1922.             local function poison(p)
  1923.                 if p.Parent and poisoning then
  1924.                     local h = p.Parent:FindFirstChild('Humanoid')
  1925.                     if h and debounce == false and h~=myhumanoid then
  1926.                         debounce = true
  1927.                         for i = 1,math.random(5,10) do
  1928.                             wait(math.random())
  1929.                             bloodcframeB(math.ceil(h.MaxHealth/math.random(5,50)),h.Parent.Torso,h)
  1930.                         end
  1931.                     end
  1932.                 end
  1933.             end
  1934.             swordA.HitBox.Touched:connect(function(p)
  1935.                 poison(p)
  1936.             end)
  1937.             rightweld.Parent = rightarm
  1938.             --(weld,speed,startpoint,endpoint,clone,clonepart,clonepartcframe,transpeed)
  1939.             weldlerp(rightweld,.1,CFrame.new(-1.5,0,0),CFrame.Angles(math.rad(-90),0,math.rad(45))*CFrame.new(-1.5,-.5,.5))
  1940.             weldlerp(rightweld,.1,CFrame.Angles(math.rad(-90),0,math.rad(45))*CFrame.new(-1.5,-.5,.5),CFrame.Angles(math.rad(-20),math.rad(0),math.rad(45))*CFrame.new(-1,0,.5))
  1941.             weldlerp(rightweld,.1,CFrame.Angles(math.rad(-20),math.rad(0),math.rad(45))*CFrame.new(-1,0,.5),CFrame.new(-1.5,0,0))
  1942.             jointA.Parent = torso
  1943.             attacking = false
  1944.             poisoning = false
  1945.         elseif k == Enum.KeyCode.LeftControl then
  1946.             ceroing = true
  1947.         end
  1948.     end
  1949. end)
  1950.  
  1951. --
  1952. userinput.InputEnded:connect(function(keycode)
  1953.     local k = keycode.KeyCode
  1954.     if k == Enum.KeyCode.R and attacking and defending and not typing then
  1955.         local model = terrain:FindFirstChild('Circle')
  1956.         if model then
  1957.             defending = false
  1958.             torso.Anchored = false
  1959.             for i = 0,1,.01 do
  1960.                 renderstepped:wait()
  1961.                 for index,v in pairs(model:GetChildren()) do
  1962.                     v.Transparency = i
  1963.                 end
  1964.             end
  1965.             attacking = false
  1966.             model:Destroy()
  1967.         end
  1968.     elseif k == Enum.KeyCode.Y and attacking and defending and not typing then
  1969.         attacking = false
  1970.         defending = false
  1971.     elseif k == Enum.KeyCode.LeftControl then
  1972.         ceroing = false
  1973.     end
  1974. end)
  1975.  
  1976. --weldlerp(rightweld,.1,CFrame.new(-1.5,0,0),CFrame.Angles(math.rad(-90),0,math.rad(45))*CFrame.new(-1.5,-.5,.5))
  1977.  
  1978. --          get_rightweld()
  1979. --          rightweld.Parent = rightarm
  1980. --          get_leftweld()
  1981. --          leftweld.Parent = leftarm
  1982. --          local function lerpA()
  1983. --              weldlerp(rightweld,.05,CFrame.new(-1.5,0,0),CFrame.new(-1.5,0,-.5)*CFrame.Angles(math.rad(30),0,0),false)
  1984. --          end
  1985. --          local function lerpB()
  1986. --              weldlerp(leftweld,.05,CFrame.new(1.5,0,0),CFrame.new(1.5,0,-.5)*CFrame.Angles(math.rad(30),0,0),false)
  1987. --          end
  1988. --          spawn(lerpA)
  1989. --          spawn(lerpB)
  1990. --          wait(.4)
  1991. --          local function lerpA()
  1992. --              weldlerp(rightweld,.1,CFrame.new(-1.5,0,-.5)*CFrame.Angles(math.rad(30),0,0),CFrame.new(-1.5,.5,.5)*CFrame.Angles(math.rad(-90),0,0),false)
  1993. --          end
  1994. --          local function lerpB()
  1995. --              weldlerp(leftweld,.1,CFrame.new(1.5,0,-.5)*CFrame.Angles(math.rad(30),0,0),CFrame.new(1.5,.5,.5)*CFrame.Angles(math.rad(-90),0,0),false)
  1996. --          end
  1997. --          spawn(lerpA)
  1998. --          spawn(lerpB)
  1999. --          wait(.2)
  2000. --          local function lerpA()
  2001. --              weldlerp(swordweldA,.05,CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0),CFrame.new(0,1,1)*CFrame.Angles(math.rad(90),0,0),false)
  2002. --          end
  2003. --          local function lerpB()
  2004. --              weldlerp(swordweldB,.05,CFrame.new(0, 0, -1)*CFrame.Angles(math.rad(-90),0,0),CFrame.new(0,1,1)*CFrame.Angles(math.rad(90),0,0),false)
  2005. --          end
  2006. --          spawn(lerpA)
  2007. --          spawn(lerpB)
  2008. --          local function lerpA()
  2009. --              weldlerp(rightweld,.05,CFrame.new(-1.5,.5,.5)*CFrame.Angles(math.rad(-90),0,0),CFrame.new(-1.5,0,.5)*CFrame.Angles(math.rad(-30),0,0),false)
  2010. --          end
  2011. --          local function lerpB()
  2012. --              weldlerp(leftweld,.05,CFrame.new(1.5,.5,.5)*CFrame.Angles(math.rad(-90),0,0),CFrame.new(1.5,0,.5)*CFrame.Angles(math.rad(-30),0,0),false)
  2013. --          end
  2014. --          spawn(lerpA)
  2015. --          spawn(lerpB)
Advertisement
Add Comment
Please, Sign In to add comment