AndrewTheMaster

Subsitutional Sword

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