Advertisement
trickawsome

Sword Script (RARE)

Mar 7th, 2018
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.87 KB | None | 0 0
  1. Player = game:GetService("Players").LocalPlayer
  2. Character = Player.Character
  3. PlayerGui = Player.PlayerGui
  4. Backpack = Player.Backpack
  5. Torso = Character.Torso
  6. Head = Character.Head
  7. Humanoid = Character.Humanoid
  8. LeftArm = Character["Left Arm"]
  9. LeftLeg = Character["Left Leg"]
  10. RightArm = Character["Right Arm"]
  11. RightLeg = Character["Right Leg"]
  12. LS = Torso["Left Shoulder"]
  13. LH = Torso["Left Hip"]
  14. RS = Torso["Right Shoulder"]
  15. RH = Torso["Right Hip"]
  16. Neck = Torso.Neck
  17. it=Instance.new
  18. vt=Vector3.new
  19. cf=CFrame.new
  20. euler=CFrame.fromEulerAnglesXYZ
  21. angles=CFrame.Angles
  22. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  23. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  24. attack = false
  25. attacktype = 1
  26. damage = 26
  27. oridamage = 50
  28. attackdebounce = false
  29. ssdebounce=false
  30. MMouse=nil
  31. combo=0
  32. --player
  33. player = nil
  34. --save shoulders
  35. RSH, LSH = nil, nil
  36. --welds
  37. RW, LW = Instance.new("Weld"), Instance.new("Weld")
  38. RW.Name="Right Shoulder" LW.Name="Left Shoulder"
  39.  
  40. if Character:findFirstChild("Sword",true) ~= nil then
  41. Character:findFirstChild("Sword",true).Parent = nil
  42. end
  43.  
  44. function part(formfactor,parent,reflectance,transparency,brickcolor,name,size)
  45. local fp = it("Part")
  46. fp.formFactor = formfactor
  47. fp.Parent = parent
  48. fp.Reflectance = reflectance
  49. fp.Transparency = transparency
  50. fp.CanCollide = false
  51. fp.Locked=true
  52. fp.BrickColor = brickcolor
  53. fp.Name = name
  54. fp.Size = size
  55. fp.Position = Torso.Position
  56. fp.BottomSurface="Smooth"
  57. fp.TopSurface="Smooth"
  58. fp:BreakJoints()
  59. return fp
  60. end
  61. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  62. local mesh = it(Mesh)
  63. mesh.Parent = part
  64. if Mesh=="SpecialMesh" then
  65. mesh.MeshType = meshtype
  66. mesh.MeshId = meshid
  67. end
  68. mesh.Offset=offset
  69. mesh.Scale=scale
  70. return mesh
  71. end
  72. function weld(parent,part0,part1,c0)
  73. local weld = it("Weld")
  74. weld.Parent = parent
  75. weld.Part0 = part0
  76. weld.Part1 = part1
  77. weld.C0 = c0
  78. return weld
  79. end
  80. local modelzorz = Instance.new("Model")
  81. modelzorz.Parent = Character
  82. modelzorz.Name = "Sword"
  83. local prt1=part(3,modelzorz,0,0,BrickColor.new("Really black"),"Part2",vt(1,1,1))
  84. local prt2=part(3,modelzorz,0,0,BrickColor.new("Really blue"),"Part2",vt(1,1,1))
  85. local prt3=part(3,modelzorz,0,0,BrickColor.new("Really blue"),"Part3",vt(1,1,1))
  86. local prt4=part(3,modelzorz,0,0,BrickColor.new("Really blue"),"Part4",vt(1,1,1))
  87. local prt5=part(3,modelzorz,0,0,BrickColor.new("Really blue"),"Part5",vt(1,1,1))
  88. local prt6=part(3,modelzorz,0.3,0,BrickColor.new("Really blue"),"Part6",vt(1,2,1))
  89. local prt7=part(3,modelzorz,0.3,0,BrickColor.new("Really blue"),"Part7",vt(1,2,1))
  90. local prt8=part(3,modelzorz,0.3,0,BrickColor.new("Really blue"),"Part8",vt(1,1,1))
  91. local prt9=part(3,modelzorz,0.3,0,BrickColor.new("Really blue"),"Part9",vt(1,1,1))
  92. local prt10=part(3,modelzorz,0,0.5,BrickColor.new("Really blue"),"Part10",vt(1,1,1))
  93. coroutine.resume(coroutine.create(function()
  94. while true do
  95. wait(0)
  96. for i=0.5,0.9,0.01 do
  97. wait()
  98. prt10.Transparency=i
  99. end
  100. for i=0.9,0.5,-0.01 do
  101. wait()
  102. prt10.Transparency=i
  103. end
  104. end
  105. end))
  106. local msh1=mesh("CylinderMesh",prt1,"","",vt(0,0,0),vt(0.3,1,0.3))
  107. local msh2=mesh("BlockMesh",prt2,"","",vt(0,0,0),vt(0.1,0.5,0.1))
  108. local msh3=mesh("BlockMesh",prt3,"","",vt(0,0,0),vt(0.1,0.5,0.1))
  109. local msh4=mesh("BlockMesh",prt4,"","",vt(0,0,0),vt(0.6,0.1,0.3))
  110. local msh5=mesh("BlockMesh",prt5,"","",vt(0,0,0),vt(0.4,0.1,0.5))
  111. local msh6=mesh("BlockMesh",prt6,"","",vt(0,0,0),vt(0.4,1.5,0.05))
  112. local msh7=mesh("BlockMesh",prt7,"","",vt(0,0,0),vt(0.21,1.5,0.06))
  113. local msh8=mesh("SpecialMesh",prt8,"Wedge","",vt(0,0,0),vt(0.05,0.4,0.4))
  114. local msh9=mesh("SpecialMesh",prt9,"Wedge","",vt(0,0,0),vt(0.06,0.21,0.4))
  115. local msh10=mesh("SpecialMesh",prt10,"Sphere","",vt(0,0,0),vt(1.5,1.5,1.5))
  116. local wld1=weld(prt1,prt1,Torso,euler(0,0,0)*cf(-0.5,-2,-0.5))
  117. local wld2=weld(prt2,prt2,prt1,euler(0,0,0)*cf(0,-0.7,0))
  118. local wld3=weld(prt3,prt3,prt1,euler(0,0,1.57)*cf(0,-0.7,0))
  119. local wld4=weld(prt4,prt4,prt1,euler(0,0,0)*cf(0,0.5,0))
  120. local wld5=weld(prt5,prt5,prt4,euler(0,0,0)*cf(0,0,0))
  121. local wld6=weld(prt6,prt6,prt5,euler(0,0,0)*cf(0,1.5,0))
  122. local wld7=weld(prt7,prt7,prt6,euler(0,0,0)*cf(-0.1,0,0))
  123. local wld8=weld(prt8,prt8,prt6,euler(1.57,-1.57,0)*cf(0,1.7,0))
  124. local wld9=weld(prt9,prt9,prt7,euler(1.57,-1.57,0)*cf(0,1.7,0))
  125. local wld10=weld(prt10,prt10,LeftArm,euler(0,0,0)*cf(0,1,0))
  126. derp=-0.4
  127. for i=1,5 do
  128. local prt=part(3,modelzorz,0,0,BrickColor.new("Really blue"),"Part",vt(1,1,1))
  129. local msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(0.25,0.1,0.25))
  130. local wld=weld(prt,prt,prt1,euler(0,0.785,0)*cf(0,derp,0))
  131. derp=derp+0.2
  132. end
  133. if (script.Parent.className ~= "HopperBin") then
  134. Tool = Instance.new("HopperBin")
  135. Tool.Parent = Backpack
  136. Tool.Name = "Sword"
  137. script.Parent = Tool
  138. end
  139. Bin = script.Parent
  140. local bg = it("BodyGyro")
  141. bg.maxTorque = Vector3.new(4e+005,4e+005,4e+005)*math.huge
  142. bg.P = 20e+003
  143. bg.Parent = nil
  144. so = function(id,par,vol,pit)
  145. coroutine.resume(coroutine.create(function()
  146. local sou = Instance.new("Sound",par or workspace)
  147. sou.Volume=vol
  148. sou.Pitch=pit or 1
  149. sou.SoundId=id
  150. wait()
  151. sou:play()
  152. wait(6)
  153. sou:Remove()
  154. end))
  155. end
  156. function unequipweld()
  157. wld1.Part1=Torso
  158. wld1.C0=euler(0,0,0)*cf(-0.5,-2,-0.5)
  159. end
  160. function equipweld()
  161. wld1.Part1=RightArm
  162. wld1.C0=euler(-1.57,0,-1.57)*cf(0,1,0)
  163. end
  164. function hideanim()
  165. equipped=false
  166. wait(0.1)
  167. bg.Parent=nil
  168. unequipweld()
  169. end
  170. function equipanim()
  171. equipped=true
  172. wait(0.1)
  173. equipweld()
  174. RW.C0=cf(1.5, 0.5, 0) * euler(1,0,0)
  175. RW.C1=cf(0, 0.5, 0) * euler(0,-0.4,-0.2)
  176. LW.C0=cf(-1.5, 0.5, 0) * euler(0,0,-0.2)
  177. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  178. end
  179. function Charge()
  180. attack=true
  181. SpecialEffect()
  182. for i=0,1,0.1 do
  183. wait()
  184. eul=1*i
  185. Torso.Neck.C0=necko*euler(0,0,-1*i)
  186. RW.C0=cf(1.5-1*i, 0.5, -1*i) * euler(1+0.2*i,0,0)
  187. RW.C1=cf(0, 0.5, 0) * euler(0,-0.4-2*i,-0.2+1.77*i)
  188. LW.C0=cf(-1.5, 0.5, 0) * euler(-0.5*i,0,-0.2-0.5*i)
  189. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  190. end
  191. wait(0.3)
  192. local vel2 = Instance.new("BodyVelocity")
  193. vel2.Parent = Torso
  194. vel2.maxForce = vt(4e+005,4e+005,4e+005)*1
  195. vel2.velocity = Head.CFrame.lookVector*100
  196. local LastPoint = prt7.CFrame * CFrame.new(0,-prt7.Size.Y,0)
  197. con1=prt7.Touched:connect(function(hit) Damagefunc2(hit,10000,10000) end)
  198. so("http://roblox.com/asset/?id=10209640",LeftArm,1,1)
  199. for i=0,1,0.2 do
  200. wait()
  201. wld1.C0=euler(-1.57,-1.57*i,-1.57)*cf(0,1,0)
  202. RW.C0=cf(0.5+1*i, 0.5, -1+1*i) * euler(1.2,0,0)
  203. RW.C1=cf(0, 0.5, 0) * euler(0,-2.4+1.5*i,1.57-3.14*i)
  204. local Point = prt7.CFrame * CFrame.new(0,-prt7.Size.Y,0)
  205. effect("Really blue ",0.5,LastPoint,Point)
  206. LastPoint = Point
  207. end
  208. con1:disconnect()
  209. vel2.Parent=nil
  210. wait(1)
  211. eul=0
  212. Torso.Neck.C0=necko*euler(0,0,0)
  213. wld1.C0=euler(-1.57,0,-1.57)*cf(0,1,0)
  214. RW.C0=cf(1.5, 0.5, 0) * euler(1,0,0)
  215. RW.C1=cf(0, 0.5, 0) * euler(0,-0.4,-0.2)
  216. LW.C0=cf(-1.5, 0.5, 0) * euler(0,0,-0.2)
  217. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  218. attack=false
  219. end
  220. function spintowin()
  221. attack=true
  222. SpecialEffect()
  223. for i=0,1,0.1 do
  224. wait()
  225. wld1.C0=euler(-1.57,-1.57*i,-1.57)*cf(0,1,0)
  226. RW.C0=cf(1.5-0.5*i, 0.5, -0.5*i) * euler(1,0,-0.5*i)
  227. RW.C1=cf(0, 0.5, 0) * euler(0,-0.4-1.57*i,-0.2)
  228. LW.C0=cf(-1.5, 0.5, 0) * euler(0.3*i,0,-0.2-0.2*i)
  229. end
  230. --[[local vel2 = Instance.new("BodyVelocity")
  231. vel2.Parent = Torso
  232. vel2.maxForce = vt(4e+005,4e+005,4e+005)*1
  233. vel2.velocity = Head.CFrame.lookVector*20]]
  234. bg.Parent=Torso
  235. CF = Torso.CFrame
  236. local LastPoint = prt7.CFrame * CFrame.new(0,-prt7.Size.Y,0)
  237. con1=prt7.Touched:connect(function(hit) Damagefunc1(hit,10000,0.1) end)
  238. so("http://roblox.com/asset/?id=10209640",LeftArm,1,1.1)
  239. for i = 0 , 1 , 0.1 do
  240. wait(0)
  241. RW.C0=cf(1.5-0.5+0.5*i, 0.5, -0.5+0.5*i) * euler(1-1*i,0,-0.5+2.07*i)
  242. RW.C1=cf(0, 0.5, 0) * euler(0,-1.97+1.97*i,-0.2+0.2*i)
  243. LW.C0=cf(-1.5, 0.5, 0) * euler(0.3+1.27*i,0,-0.4+0.4*i)
  244. bg.cframe=CF*euler(0,-6.283*i,0)
  245. local Point = prt7.CFrame * CFrame.new(0,-prt7.Size.Y,0)
  246. effect("Really blue ",0.5,LastPoint,Point)
  247. LastPoint = Point
  248. end
  249. for i=1,5 do
  250. so("http://roblox.com/asset/?id=10209640",LeftArm,1,1.1)
  251. for i = 0 , 1 , 0.1 do
  252. wait(0)
  253. bg.cframe=CF*euler(0,-6.283*i,0)
  254. local Point = prt7.CFrame * CFrame.new(0,-prt7.Size.Y,0)
  255. effect("Really blue",0.5,LastPoint,Point)
  256. LastPoint = Point
  257. end
  258. end
  259. --vel2.Parent=nil
  260. con1:disconnect()
  261. wait(0.5)
  262. for i = 0 , 1 , 0.1 do
  263. wait(0)
  264. wld1.C0=euler(-1.57,-1.57+1.57*i,-1.57)*cf(0,1,0)
  265. RW.C0=cf(1.5, 0.5, 0) * euler(1*i,0,1.57-1.57*i)
  266. RW.C1=cf(0, 0.5, 0) * euler(0,-0.4*i,-0.2*i)
  267. LW.C0=cf(-1.5, 0.5, 0) * euler(1.57-1.57*i,0,-0.2*i)
  268. end
  269. attack=false
  270. end
  271. function CombatCharge()
  272. attack=true
  273. SpecialEffect()
  274. for i=0,1,0.1 do
  275. wait()
  276. RW.C0=cf(1.5, 0.5, 0) * euler(1+2*i,0,0)
  277. RW.C1=cf(0, 0.5, 0) * euler(0,-0.4+0.4*i,-0.2+0.2*i)
  278. LW.C0=cf(-1.5, 0.5, 0) * euler(-0.5*i,0,-0.2)
  279. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  280. end
  281. local LastPoint = prt7.CFrame * CFrame.new(0,-prt7.Size.Y,0)
  282. con1=prt7.Touched:connect(function(hit) Damagefunc1(hit,10000,10000) end)
  283. so("http://roblox.com/asset/?id=10209640",LeftArm,1,1)
  284. for i=0,1,0.2 do
  285. wait()
  286. RW.C0=cf(1.5, 0.5, 0) * euler(3-3.5*i,0,0)
  287. RW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  288. LW.C0=cf(-1.5, 0.5, 0) * euler(-0.5,0,-0.2)
  289. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  290. local Point = prt7.CFrame * CFrame.new(0,-prt7.Size.Y,0)
  291. effect("Really blue",0.5,LastPoint,Point)
  292. LastPoint = Point
  293. end
  294. for i=1,10 do
  295. numb=math.random(-180,180)
  296. RW.C0=cf(1.5, 0.5, 0) * euler(3,0,math.rad(numb))
  297. RW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  298. local LastPoint = prt7.CFrame * CFrame.new(0,-prt7.Size.Y,0)
  299. so("http://roblox.com/asset/?id=10209640",LeftArm,1,1)
  300. for i=0,1,0.2 do
  301. wait()
  302. RW.C0=cf(1.5, 0.5, 0) * euler(3,0,math.rad(numb))
  303. RW.C1=cf(0, 0.5, 0) * euler(3.5*i,0,0)
  304. LW.C0=cf(-1.5, 0.5, 0) * euler(-0.5,0,-0.2)
  305. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  306. local Point = prt7.CFrame * CFrame.new(0,-prt7.Size.Y,0)
  307. effect("Really blue",0.5,LastPoint,Point)
  308. LastPoint = Point
  309. end
  310. end
  311. con1:disconnect()
  312. wait(0.3)
  313. for i=0,1,0.1 do
  314. wait()
  315. RW.C0=cf(1.5, 0.5, 0) * euler(3-2*i,0,math.rad(numb)-math.rad(numb)*i)
  316. RW.C1=cf(0, 0.5, 0) * euler(3.5-3.5*i,-0.4*i,-0.2*i)
  317. LW.C0=cf(-1.5, 0.5, 0) * euler(-0.5+0.5*i,0,-0.2)
  318. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  319. end
  320. attack=false
  321. end
  322. function Despair()
  323. attack=true
  324. Humanoid.WalkSpeed=0
  325. print("Warrior SS initiated.")
  326. SpecialEffect()
  327. bg.Parent=Head
  328. CF = Head.CFrame
  329. bg.cframe=CF
  330. for i=0,1,0.2 do
  331. wait()
  332. Neck.C0=necko*euler(0,0,1.57*i)
  333. RW.C0=cf(1.5, 0.5, 0) * euler(1,0,0)
  334. RW.C1=cf(0, 0.5, 0) * euler(0,-0.4,-0.2-1.37*i)
  335. LW.C0=cf(-1.5, 0.5, 0) * euler(0,0,-0.2-1.37*i)
  336. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  337. end
  338. wait(0.2)
  339. partCFrame=Head.CFrame*cf(0,0,-20)
  340. local hit,pos = rayCast(LeftArm.Position,Head.CFrame.lookVector,100,Character)
  341. if hit~=nil then
  342. partCFrame=hit.CFrame
  343. print("HITTED")
  344. end
  345. prt10.Parent=nil
  346. local basepart=part(3,workspace,0,0,Torso.BrickColor,"Base Part",vt(1,1,1))
  347. basepart.CFrame=partCFrame
  348. basepart.Anchored=true
  349. so("http://roblox.com/asset/?id=2101144",basepart,1,2)
  350. MagicCircle(BrickColor.new("Really blue"),basepart.CFrame,3,3,3,0,0,0,7,7,7)
  351. MagicCircle(BrickColor.new("Really blue"),basepart.CFrame,5,1,1,0,0,0,9,1,1)
  352. MagicCircle(BrickColor.new("Really blue"),basepart.CFrame,1,5,1,0,0,0,1,9,1)
  353. MagicCircle(BrickColor.new("Really blue"),basepart.CFrame,1,1,5,0,0,0,1,1,9)
  354. local c = game.Workspace:GetChildren()
  355. for i = 1, #c do
  356. local hum = c[i]:findFirstChild("Humanoid")
  357. if hum ~= nil and hum.Health ~= 0 then
  358. local head = c[i]:findFirstChild("Head")
  359. if head ~= nil then
  360. local targ = head.Position - basepart.Position
  361. local mag = targ.magnitude
  362. if mag <= 20 and c[i].Name ~= Player.Name then
  363. fb=Instance.new("BodyPosition")
  364. coroutine.resume(coroutine.create(function(Part,BodPos)
  365. Part.Parent.Humanoid.Health=Part.Parent.Humanoid.Health-5
  366. showDamage(Part.Parent,"Stunned!",10)
  367. walkspeed=Part.Parent.Humanoid.WalkSpeed
  368. Part.Parent.Humanoid.WalkSpeed=0.01
  369. BodPos.P=20000
  370. BodPos.D=1000
  371. BodPos.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  372. BodPos.position=Part.Position
  373. BodPos.Parent=Part
  374. wait(10)
  375. BodPos.Parent=nil
  376. Part.Parent.Humanoid.WalkSpeed=walkspeed
  377. end),head,fb)
  378. end
  379. end
  380. end
  381. end
  382. wait(1)
  383. Clone()
  384. Torso.CFrame=partCFrame*cf(0,15,0)
  385. basepart.Parent=nil
  386. bg.Parent=nil
  387. Neck.C0=necko
  388. RW.C0=cf(1.5, 0.5, 0) * euler(1,0,0)
  389. RW.C1=cf(0, 0.5, 0) * euler(0,-0.4,-0.2)
  390. LW.C0=cf(-1.5, 0.5, 0) * euler(0,0,-0.2)
  391. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  392. Humanoid.WalkSpeed=16
  393. attack=false
  394. end
  395. function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  396. return game.Workspace:FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  397. end
  398. function Clone()
  399. for _,v in pairs(Torso.Parent:children()) do
  400. if v.className=="Part" then
  401. n=v:clone()
  402. n.archivable=true
  403. n.Anchored=true
  404. n.CanCollide=false
  405. n.Name="TRAILER"
  406. n.BrickColor=v.BrickColor
  407. n.Parent=workspace
  408. coroutine.resume(coroutine.create(function(ne) for i=1, 80 do ne.Transparency=i/80 wait() end ne.Parent=nil end),n)
  409. elseif v.className=="Hat" then
  410. n=v.Handle:clone()
  411. n.archivable=true
  412. n.Anchored=true
  413. n.CanCollide=false
  414. n.Name="TRAILER"
  415. n.BrickColor=v.Handle.BrickColor
  416. n.Parent=workspace
  417. coroutine.resume(coroutine.create(function(ne) for i=1, 80 do ne.Transparency=i/80 wait() end ne.Parent=nil end),n)
  418. end
  419. end
  420. for _,v in pairs(modelzorz:children()) do
  421. if v.className=="Part" then
  422. n=v:clone()
  423. n.archivable=true
  424. n.Anchored=true
  425. n.CanCollide=false
  426. n.Name="TRAILER"
  427. n.BrickColor=v.BrickColor
  428. n.Parent=workspace
  429. coroutine.resume(coroutine.create(function(ne) for i=1, 80 do ne.Transparency=i/80 wait() end ne.Parent=nil end),n)
  430. end
  431. end
  432. end
  433. function MagicCircle(brickcolor,cframe,x1,y1,z1,x2,y2,z2,x3,y3,z3)
  434. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  435. prt.Anchored=true
  436. prt.CFrame=cframe*cf(x2,y2,z2)
  437. local msh=mesh("SpecialMesh",prt,"Sphere","",vt(0,0,0),vt(x1,y1,z1))
  438. coroutine.resume(coroutine.create(function()
  439. for i=0,1,0.1 do
  440. wait()
  441. prt.CFrame=prt.CFrame
  442. prt.Transparency=i
  443. msh.Scale=msh.Scale+vt(x3,y3,z3)
  444. end
  445. prt.Parent=nil
  446. end))
  447. end
  448. function SpecialEffect()
  449. local prt=part(3,workspace,1,0,BrickColor.new("Really blue"),"Part",vt(1,1,1))
  450. prt.Anchored=true
  451. prt.CFrame=Torso.CFrame
  452. local msh=mesh("SpecialMesh",prt,"Sphere","",vt(0,0,0),vt(0.5,0.5,0.5))
  453. coroutine.resume(coroutine.create(function(Part,Mesh)
  454. for i=0,1,0.2 do
  455. wait(0)
  456. Part.Transparency=i
  457. Mesh.Scale=Mesh.Scale+vt(10,10,10)
  458. end
  459. prt.Parent=nil
  460. end),prt,msh)
  461. end
  462. function effect(Color,Ref,LP,P1,returnn)
  463. local effectsmsh = Instance.new("BlockMesh")
  464. effectsmsh.Scale = Vector3.new(1,1,1)
  465. effectsmsh.Name = "Mesh"
  466. local effectsg = Instance.new("Part")
  467. effectsg.formFactor = 3
  468. effectsg.CanCollide = false
  469. effectsg.Name = "Eff"
  470. effectsg.Locked = true
  471. effectsg.Anchored = true
  472. effectsg.Size = Vector3.new(0.2,1,0.2)
  473. effectsg.Parent = workspace
  474. effectsmsh.Parent = effectsg
  475. effectsg.BrickColor = BrickColor.new(Color)
  476. effectsg.Reflectance = Ref
  477. local point1 = P1
  478. local mg = (LP.p - point1.p).magnitude
  479. effectsg.Size = Vector3.new(0.2,mg,0.2)
  480. effectsg.CFrame = CFrame.new((LP.p+point1.p)/2,point1.p) * CFrame.Angles(math.rad(90),0,0)
  481. if returnn then return effectsg end
  482. coroutine.resume(coroutine.create(function()
  483. if not returnn then
  484. for i = 0 , 1 , 0.05 do
  485. wait()
  486. effectsg.Transparency = 1*i
  487. effectsmsh.Scale = Vector3.new(0.5-0.5*i,1,0.5-0.5*i)
  488. end
  489. wait()
  490. effectsg.Parent = nil
  491. end
  492. end))
  493. end
  494. Damagefunc1=function(hit,Damage,Knockback)
  495. if hit.Parent==nil then
  496. return
  497. end
  498. CPlayer=Bin
  499. h=hit.Parent:FindFirstChild("Humanoid")
  500. if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then
  501. if attackdebounce == false then
  502. attackdebounce = true
  503. coroutine.resume(coroutine.create(function()
  504. wait(0.2)
  505. attackdebounce = false
  506. end))
  507. Damage=Damage
  508. --[[ if game.Players:GetPlayerFromCharacter(hit.Parent)~=nil then
  509. return
  510. end]]
  511. -- hs(hit,1.2)
  512. c=Instance.new("ObjectValue")
  513. c.Name="creator"
  514. c.Value=game.Players.LocalPlayer
  515. c.Parent=h
  516. game:GetService("Debris"):AddItem(c,.5)
  517. Damage=Damage+math.random(0,10)
  518. -- h:TakeDamage(Damage)
  519. blocked=false
  520. block=hit.Parent:findFirstChild("Block")
  521. if block~=nil then
  522. print("herp")
  523. if block.Value>0 then
  524. blocked=true
  525. block.Value=block.Value-1
  526. print(block.Value)
  527. end
  528. end
  529. if blocked==false then
  530. -- h:TakeDamage(Damage)
  531. h.Health=h.Health-Damage
  532. showDamage(hit.Parent,Damage,.5)
  533. else
  534. h:TakeDamage(1)
  535. showDamage(hit.Parent,1,.5)
  536. end
  537. vp=Instance.new("BodyVelocity")
  538. vp.P=500
  539. vp.maxForce=Vector3.new(math.huge,0,math.huge)
  540. -- vp.velocity=Character.Torso.CFrame.lookVector*Knockback
  541. vp.velocity=Torso.CFrame.lookVector*Knockback+Torso.Velocity/1.05
  542. if Knockback>0 then
  543. vp.Parent=hit.Parent.Torso
  544. end
  545. game:GetService("Debris"):AddItem(vp,.25)
  546. game:GetService("Debris"):AddItem(r,.5)
  547. c=Instance.new("ObjectValue")
  548. c.Name="creator"
  549. c.Value=Player
  550. c.Parent=h
  551. game:GetService("Debris"):AddItem(c,.5)
  552. CRIT=false
  553. hitDeb=true
  554. AttackPos=6
  555. end
  556. end
  557. end
  558. Damagefunc2=function(hit,Damage,Knockback)
  559. if attackdebounce == false then
  560. attackdebounce = true
  561. coroutine.resume(coroutine.create(function()
  562. wait(0.1)
  563. attackdebounce = false
  564. end))
  565. if hit.Parent==nil then
  566. return
  567. end
  568. CPlayer=Bin
  569. blocked=false
  570. h=hit.Parent:FindFirstChild("Humanoid")
  571. if h~=nil and hit.Parent:FindFirstChild("Torso")~=nil then
  572. Damage=Damage
  573. c=it("ObjectValue")
  574. c.Name="creator"
  575. c.Value=game.Players.LocalPlayer
  576. c.Parent=h
  577. game:GetService("Debris"):AddItem(c,.5)
  578. -- print(c.Value)
  579. --[[ if math.random(0,99)+math.random()<=7.8 then
  580. CRIT=true
  581. Damage=Damage*2
  582. s=it("Sound")
  583. s.SoundId="http://www.roblox.com/asset/?id=2801263"
  584. s.Volume=1
  585. s.Pitch=2
  586. s.Parent=hit
  587. s.PlayOnRemove=true
  588. s.Parent=nil
  589.  
  590. end]]
  591. Damage=Damage+math.random(0,10)
  592. -- Blood(hit.CFrame*cf(math.random(-10,10)/10,math.random(-10,10)/10,0),math.floor(Damage/2))
  593. blocked=false
  594. block=hit.Parent:findFirstChild("Block")
  595. if block~=nil then
  596. print("herp")
  597. if block.Value>0 then
  598. blocked=true
  599. block.Value=block.Value-3
  600. print(block.Value)
  601. end
  602. end
  603. if blocked==false then
  604. -- h:TakeDamage(Damage)
  605. h.Health=h.Health-Damage
  606. showDamage(hit.Parent,Damage,.5)
  607. else
  608. h:TakeDamage(1)
  609. showDamage(hit.Parent,1,.5)
  610. end
  611. --if blocked==false then
  612. local angle = (hit.Position-(Torso.Position+Vector3.new(0,0,0))).unit
  613. print(angle)
  614. --hit.CFrame=CFrame.new(hit.Position,Vector3.new(angle.x,hit.Position.y,angle.z))*CFrame.fromEulerAnglesXYZ(math.pi/4,0,0)
  615. rl=Instance.new("BodyAngularVelocity")
  616. rl.P=3000
  617. rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000
  618. rl.angularvelocity=Vector3.new(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  619. rl.Parent=hit
  620. coroutine.resume(coroutine.create(function(vel)
  621. wait(1)
  622. vel:Remove()
  623. end),rl)
  624. --end
  625. local bodyVelocity=Instance.new("BodyVelocity")
  626. bodyVelocity.velocity=angle*40+Vector3.new(0,0,0)
  627. bodyVelocity.P=5000
  628. bodyVelocity.maxForce=Vector3.new(8e+003, 8e+003, 8e+003)
  629. bodyVelocity.Parent=hit
  630. coroutine.resume(coroutine.create(function(Vel)
  631. wait(0.7)
  632. Vel:Remove()
  633. end),bodyVelocity)
  634. game:GetService("Debris"):AddItem(vp,1)
  635. c=it("ObjectValue")
  636. c.Name="creator"
  637. c.Value=Player
  638. c.Parent=h
  639. game:GetService("Debris"):AddItem(c,.5)
  640. CRIT=false
  641. hitDeb=true
  642. AttackPos=6
  643. end
  644. end
  645. end
  646. showDamage=function(Char,Dealt,du)
  647. m=Instance.new("Model")
  648. m.Name=tostring(Dealt)
  649. h=Instance.new("Humanoid")
  650. h.Health=0
  651. h.MaxHealth=0
  652. h.Parent=m
  653. c=Instance.new("Part")
  654. c.Transparency=0
  655. c.BrickColor=BrickColor:Red()
  656. if CRIT==true then
  657. c.BrickColor=BrickColor.new("Really blue")
  658. end
  659. c.Name="Head"
  660. c.TopSurface=0
  661. c.BottomSurface=0
  662. c.formFactor="Plate"
  663. c.Size=Vector3.new(1,.4,1)
  664. ms=Instance.new("CylinderMesh")
  665. ms.Scale=Vector3.new(.8,.8,.8)
  666. if CRIT==true then
  667. ms.Scale=Vector3.new(1,1.25,1)
  668. end
  669. ms.Parent=c
  670. c.Reflectance=0
  671. Instance.new("BodyGyro").Parent=c
  672. c.Parent=m
  673. c.CFrame=CFrame.new(Char["Head"].CFrame.p+Vector3.new(0,1.5,0))
  674. f=Instance.new("BodyPosition")
  675. f.P=2000
  676. f.D=100
  677. f.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  678. f.position=c.Position+Vector3.new(0,3,0)
  679. f.Parent=c
  680. game:GetService("Debris"):AddItem(m,.5+du)
  681. c.CanCollide=false
  682. m.Parent=workspace
  683. c.CanCollide=false
  684. end
  685. function oneslash()
  686. attack=true
  687. combo=1
  688. for i=0,1,0.1 do
  689. wait(0)
  690. RW.C0=cf(1.5, 0.5, 0) * euler(1+3*i,0,0)
  691. RW.C1=cf(0, 0.5, 0) * euler(0,-0.4+0.4*i,-0.2+0.2*i)
  692. LW.C0=cf(-1.5, 0.5, 0) * euler(0,0,-0.2)
  693. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  694. end
  695. local LastPoint = prt7.CFrame * CFrame.new(0,-prt7.Size.Y,0)
  696. con1=prt7.Touched:connect(function(hit) Damagefunc1(hit,10000,10000) end)
  697. so("http://roblox.com/asset/?id=10209640",LeftArm,1,1)
  698. for i=0,1,0.2 do
  699. wait(0)
  700. RW.C0=cf(1.5, 0.5, 0) * euler(4-4.7*i,0,0)
  701. RW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  702. LW.C0=cf(-1.5, 0.5, 0) * euler(-0.5*i,0,-0.2)
  703. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  704. local Point = prt7.CFrame * CFrame.new(0,-prt7.Size.Y,0)
  705. effect("Really blue",0.5,LastPoint,Point)
  706. LastPoint = Point
  707. end
  708. for i=0,1,0.2 do
  709. wait(0)
  710. RW.C0=cf(1.5, 0.5, 0) * euler(-0.7-0.2*i,0,0)
  711. RW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  712. LW.C0=cf(-1.5, 0.5, 0) * euler(-0.5-0.1*i,0,-0.2)
  713. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  714. end
  715. con1:disconnect()
  716. attack=false
  717. end
  718. function twoslash()
  719. attack=true
  720. combo=2
  721. for i=0,1,0.1 do
  722. wait(0)
  723. RW.C0=cf(1.5, 0.5, 0) * euler(-0.9+2.47*i,0,0)
  724. RW.C1=cf(0, 0.5, 0) * euler(0,-1.57*i,0)
  725. LW.C0=cf(-1.5, 0.5, 0) * euler(-0.6+0.6*i,0,-0.2-1.37*i)
  726. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  727. end
  728. bg.Parent=Torso
  729. CF = Torso.CFrame
  730. local LastPoint = prt7.CFrame * CFrame.new(0,-prt7.Size.Y,0)
  731. con1=prt7.Touched:connect(function(hit) Damagefunc1(hit,10000,10000) end)
  732. so("http://roblox.com/asset/?id=10209640",LeftArm,1,0.9)
  733. for i = 0 , 1 , 0.1 do
  734. wait(0)
  735. wld1.C0=euler(-1.57,-1.57*i,-1.57)*cf(0,1,0)
  736. RW.C0=cf(1.5, 0.5, 0) * euler(1.57,0,0)
  737. RW.C1=cf(0, 0.5, 0) * euler(0,-1.57,-1.57*i)
  738. bg.cframe=CF*euler(0,-6.283*i,0)
  739. local Point = prt7.CFrame * CFrame.new(0,-prt7.Size.Y,0)
  740. effect("Really blue",0.5,LastPoint,Point)
  741. LastPoint = Point
  742. end
  743. con1:disconnect()
  744. wait(0.1)
  745. bg.Parent=nil
  746. attack=false
  747. end
  748. function threeslash()
  749. attack=true
  750. combo=3
  751. for i = 0 , 1 , 0.1 do
  752. wait(0)
  753. wld1.C0=euler(-1.57,-1.57+1.57*i,-1.57-0.6*i)*cf(0,1,0)
  754. RW.C0=cf(1.5-0.7*i, 0.5+0.2*i, -0.5*i) * euler(1.57+0.43*i,0,0)
  755. RW.C1=cf(0, 0.5, 0) * euler(0,-1.57+1.57*i,-1.57+2.17*i)
  756. LW.C0=cf(-1.5+0.7*i, 0.5+0.2*i, -0.5*i) * euler(2*i,0,-1.57+1.57*i)
  757. LW.C1=cf(0, 0.5, 0) * euler(0,0,-0.6*i)
  758. end
  759. local LastPoint = prt7.CFrame * CFrame.new(0,-prt7.Size.Y,0)
  760. con1=prt7.Touched:connect(function(hit) Damagefunc2(hit,10000,10000) end)
  761. so("http://roblox.com/asset/?id=10209640",LeftArm,1,0.7)
  762. for i=0,1,0.2 do
  763. wait()
  764. RW.C0=cf(1.5-0.7, 0.5+0.2-0.4*i, -0.5) * euler(2-1.8*i,0,0)
  765. RW.C1=cf(0, 0.5, 0) * euler(0,0,0.6)
  766. LW.C0=cf(-1.5+0.7, 0.5+0.2-0.4*i, -0.5) * euler(2-1.8*i,0,0)
  767. LW.C1=cf(0, 0.5, 0) * euler(0,0,-0.6)
  768. local Point = prt7.CFrame * CFrame.new(0,-prt7.Size.Y,0)
  769. effect("Really blue",0.5,LastPoint,Point)
  770. LastPoint = Point
  771. end
  772. con1:disconnect()
  773. attack=false
  774. end
  775. function ob1d(mouse)
  776. if attack == true then return end
  777. hold=true
  778. --attack=true
  779. if combo==0 then
  780. oneslash()
  781. elseif combo==1 then
  782. twoslash()
  783. elseif combo==2 then
  784. threeslash()
  785. end
  786. coroutine.resume(coroutine.create(function()
  787. wait(0.5)
  788. if attack==false then
  789. combo=0
  790. wld1.C0=euler(-1.57,0,-1.57)*cf(0,1,0)
  791. RW.C0=cf(1.5, 0.5, 0) * euler(1,0,0)
  792. RW.C1=cf(0, 0.5, 0) * euler(0,-0.4,-0.2)
  793. LW.C0=cf(-1.5, 0.5, 0) * euler(0,0,-0.2)
  794. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  795. end
  796. end))
  797. end
  798. function ob1u(mouse)
  799. hold = false
  800. end
  801. buttonhold = false
  802. eul=0
  803. function key(key)
  804. if attack == true then return end
  805. if key=="x" then
  806. spintowin()
  807. end
  808. if key=="c" then
  809. CombatCharge()
  810. end
  811. if key=="v" and ssdebounce==false then
  812. ssdebounce=true
  813. coroutine.resume(coroutine.create(function()
  814. wait(30)
  815. ssdebounce=false
  816. prt10.Parent=modelzorz
  817. wld10.Parent=prt10
  818. end))
  819. Despair()
  820. end
  821. coroutine.resume(coroutine.create(function(v)
  822. wait()
  823. while attack==true do
  824. wait(0)
  825. bg.Parent = Torso
  826. local pos4 = vt(MMouse.Hit.p.x,Head.Position.Y,MMouse.Hit.p.z)
  827. bg.cframe = cf(Torso.Position,pos4) * euler(0,eul,0) * cf(0,0,0)
  828. end
  829. bg.Parent=nil
  830. end))
  831. if key=="z" then
  832. Charge()
  833. end
  834. combo=0
  835. end
  836. function key2(key)
  837. end
  838. function s(mouse)
  839. mouse.Button1Down:connect(function() ob1d(mouse) end)
  840. mouse.Button1Up:connect(function() ob1u(mouse) end)
  841. mouse.KeyDown:connect(key)
  842. mouse.KeyUp:connect(key2)
  843. unsheathed = true
  844. player = Player
  845. ch = Character
  846. MMouse = mouse
  847. RSH = ch.Torso["Right Shoulder"]
  848. LSH = ch.Torso["Left Shoulder"]
  849. --
  850. RSH.Parent = nil
  851. LSH.Parent = nil
  852. --
  853. RW.Part0 = ch.Torso
  854. RW.C0 = CFrame.new(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  855. RW.C1 = CFrame.new(0, 0.5, 0)
  856. RW.Part1 = ch["Right Arm"]
  857. RW.Parent = ch.Torso
  858. --_G.R = RW
  859. --
  860. LW.Part0 = ch.Torso
  861. LW.C0 = CFrame.new(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  862. LW.C1 = CFrame.new(0, 0.5, 0)
  863. LW.Part1 = ch["Left Arm"]
  864. LW.Parent = ch.Torso
  865. --_G.L = LW
  866. --
  867. equipanim()
  868. end
  869. function ds(mouse)
  870. hideanim()
  871. wait(0)
  872. RW.Parent = nil
  873. LW.Parent = nil
  874. RSH.Parent = player.Character.Torso
  875. LSH.Parent = player.Character.Torso
  876. end
  877. Bin.Selected:connect(s)
  878. Bin.Deselected:connect(ds)
  879. print("Go Kill Them.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement