Advertisement
ZKiller

Katana Script V. 0.5.0

Nov 23rd, 2017
18,759
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.92 KB | None | 0 0
  1. local la = Instance.new("Weld")
  2. la.Parent = script.Parent["Left Arm"]
  3. la.Part0 = script.Parent.HumanoidRootPart
  4. la.Part1 = script.Parent["Left Arm"]
  5. la.C1 = CFrame.new(1,.3,.35) * CFrame.fromEulerAnglesXYZ(-1.5,.9,0)
  6.  
  7. local ra = Instance.new("Weld")
  8. ra.Parent = script.Parent["Right Arm"]
  9. ra.Part0 = script.Parent.HumanoidRootPart
  10. ra.Part1 = script.Parent["Right Arm"]
  11. ra.C1 = CFrame.new(-1,.4,.7) * CFrame.fromEulerAnglesXYZ(-1.5,-.2,.15)
  12.  
  13. local attack = false
  14. local mouse = game.Players[script.Parent.Name]:GetMouse()
  15. local d = false
  16. function damage(hit)
  17. local h = hit.Parent:findFirstChildOfClass("Humanoid")
  18. if h ~= nil and attack == true then
  19. h.Health = h.Health - math.random(10,20)
  20. end
  21. end
  22. local katana = Instance.new("Model")
  23. katana.Parent = script.Parent
  24. katana.Name = "Katana"
  25. local handle = Instance.new("Part")
  26. handle.Parent = katana
  27. handle.BrickColor = BrickColor.new('Really black')
  28. handle.Name = "Handle"
  29. handle.Size = Vector3.new(.5,2,.5)
  30. handle.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  31. handle.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  32. handle.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  33. handle.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  34. handle.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  35. handle.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  36. handle.CanCollide = false
  37. local hw = Instance.new("Weld")
  38. hw.Parent = handle
  39. hw.Part0 = handle
  40. hw.Part1 = script.Parent["Right Arm"]
  41. hw.C1 = CFrame.new(0,-1,.4) * CFrame.fromEulerAnglesXYZ(1.6,0,0)
  42.  
  43. local part = Instance.new("Part")
  44. part.Parent = katana
  45. part.BrickColor = BrickColor.new('Dark stone grey')
  46. part.Name = "KatanaPart"
  47. part.Size = Vector3.new(.5,.2,1)
  48. part.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  49. part.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  50. part.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  51. part.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  52. part.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  53. part.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  54. part.CanCollide = false
  55. local pw = Instance.new("Weld")
  56. pw.Parent = part
  57. pw.Part0 = part
  58. pw.Part1 = handle
  59. pw.C1 = CFrame.new(0,-1,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  60.  
  61. local part = Instance.new("Part")
  62. part.Parent = katana
  63. part.BrickColor = BrickColor.new('Dark stone grey')
  64. part.Name = "KatanaPart"
  65. part.Size = Vector3.new(.2,.2,.7)
  66. part.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  67. part.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  68. part.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  69. part.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  70. part.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  71. part.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  72. part.CanCollide = false
  73. local pw = Instance.new("Weld")
  74. pw.Parent = part
  75. pw.Part0 = part
  76. pw.Part1 = handle
  77. pw.C1 = CFrame.new(.35,-1,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  78.  
  79. local part = Instance.new("Part")
  80. part.Parent = katana
  81. part.BrickColor = BrickColor.new('Dark stone grey')
  82. part.Name = "KatanaPart"
  83. part.Size = Vector3.new(.2,.2,.7)
  84. part.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  85. part.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  86. part.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  87. part.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  88. part.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  89. part.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  90. part.CanCollide = false
  91. local pw = Instance.new("Weld")
  92. pw.Parent = part
  93. pw.Part0 = part
  94. pw.Part1 = handle
  95. pw.C1 = CFrame.new(-.35,-1,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  96.  
  97. local blade = Instance.new("Part")
  98. blade.Parent = katana
  99. blade.BrickColor = BrickColor.new('White')
  100. blade.Name = "DamagingBlade"
  101. blade.Size = Vector3.new(.1,3,.4)
  102. blade.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  103. blade.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  104. blade.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  105. blade.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  106. blade.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  107. blade.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  108. blade.CanCollide = false
  109. local bw = Instance.new("Weld")
  110. bw.Parent = blade
  111. bw.Part0 = blade
  112. bw.Part1 = handle
  113. bw.C1 = CFrame.new(0,-2.5,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  114.  
  115. local blade2 = Instance.new("Part")
  116. blade2.Parent = katana
  117. blade2.BrickColor = BrickColor.new('White')
  118. blade2.Name = "Blade"
  119. blade2.Size = Vector3.new(.1,.4,.2)
  120. blade2.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  121. blade2.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  122. blade2.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  123. blade2.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  124. blade2.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  125. blade2.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  126. blade2.CanCollide = false
  127. local bw2 = Instance.new("Weld")
  128. bw2.Parent = blade2
  129. bw2.Part0 = blade2
  130. bw2.Part1 = handle
  131. bw2.C1 = CFrame.new(0,-4.2,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  132.  
  133. local a0 = Instance.new("Attachment")
  134. a0.Parent = blade
  135. a0.Position = Vector3.new(0,1.5,0)
  136.  
  137. local a1 = Instance.new("Attachment")
  138. a1.Parent = blade
  139. a1.Position = Vector3.new(0,-2,0)
  140.  
  141. local trail = Instance.new("Trail")
  142. trail.Parent = blade
  143. trail.Transparency = NumberSequence.new(.5,1)
  144. trail.Attachment0 = a0
  145. trail.Attachment1 = a1
  146. trail.Lifetime = .1
  147. function attack()
  148. if d == false then
  149. local attackID = 0
  150. attackID = math.random(1,2)
  151. attack = true
  152. d = true
  153. if attackID == 1 then
  154.  
  155. la.C1 = CFrame.new(1,.3,.35) * CFrame.fromEulerAnglesXYZ(-1.5,.9,0)
  156. ra.C1 = CFrame.new(-1,.4,.7) * CFrame.fromEulerAnglesXYZ(-1.5,-.2,.15)
  157. wait(.01)
  158. la.C1 = CFrame.new(1,.3,.35) * CFrame.fromEulerAnglesXYZ(-1.5,.9,0)
  159. ra.C1 = CFrame.new(-1,.4,.7) * CFrame.fromEulerAnglesXYZ(-1.5,-.2,.4)
  160. wait(.05)
  161. la.C1 = CFrame.new(1,-.1,.35) * CFrame.fromEulerAnglesXYZ(-1,.9,0)
  162. ra.C1 = CFrame.new(-1,0,.7) * CFrame.fromEulerAnglesXYZ(-1,-.2,.4)
  163. wait(.05)
  164. la.C1 = CFrame.new(1,.1,.2) * CFrame.fromEulerAnglesXYZ(-.5,.9,0)
  165. ra.C1 = CFrame.new(-1,.2,.5) * CFrame.fromEulerAnglesXYZ(-.5,-.2,.4)
  166. wait(.05)
  167. la.C1 = CFrame.new(1,.1,.1) * CFrame.fromEulerAnglesXYZ(0,.9,0)
  168. ra.C1 = CFrame.new(-1,.2,.3) * CFrame.fromEulerAnglesXYZ(0,-.2,.4)
  169. wait(.05)
  170. la.C1 = CFrame.new(1,.1,.2) * CFrame.fromEulerAnglesXYZ(-.5,.9,0)
  171. ra.C1 = CFrame.new(-1,.2,.5) * CFrame.fromEulerAnglesXYZ(-.5,-.2,.4)
  172. wait(.05)
  173. la.C1 = CFrame.new(1,-.1,.35) * CFrame.fromEulerAnglesXYZ(-1,.9,0)
  174. ra.C1 = CFrame.new(-1,0,.7) * CFrame.fromEulerAnglesXYZ(-1,-.2,.4)
  175. wait(.01)
  176. la.C1 = CFrame.new(1,.3,.35) * CFrame.fromEulerAnglesXYZ(-1.5,.9,0)
  177. ra.C1 = CFrame.new(-1,.4,.7) * CFrame.fromEulerAnglesXYZ(-1.5,-.2,.4)
  178. wait(.01)
  179. la.C1 = CFrame.new(1,.3,.35) * CFrame.fromEulerAnglesXYZ(-1.5,.9,0)
  180. ra.C1 = CFrame.new(-1,.4,.7) * CFrame.fromEulerAnglesXYZ(-1.5,-.2,.15)
  181. end
  182. if attackID == 2 then
  183. la.C1 = CFrame.new(1,.3,.35) * CFrame.fromEulerAnglesXYZ(-1.5,.9,0)
  184. ra.C1 = CFrame.new(-1,.4,.7) * CFrame.fromEulerAnglesXYZ(-1.5,-.2,.15)
  185. wait(.01)
  186. la.C1 = CFrame.new(1,.3,.35) * CFrame.fromEulerAnglesXYZ(-1.5,.9,.3)
  187. ra.C1 = CFrame.new(-1,.4,.7) * CFrame.fromEulerAnglesXYZ(-1.5,-.2,.5)
  188. wait(.01)
  189. la.C1 = CFrame.new(1,.3,.35) * CFrame.fromEulerAnglesXYZ(-1.5,.9,.6)
  190. ra.C1 = CFrame.new(-1,.4,.7) * CFrame.fromEulerAnglesXYZ(-1.5,-.2,.8)
  191. wait(.05)
  192. la.C1 = CFrame.new(1,.3,.35) * CFrame.fromEulerAnglesXYZ(-1,.9,.6)
  193. ra.C1 = CFrame.new(-1,.4,.7) * CFrame.fromEulerAnglesXYZ(-1,-.2,.8)
  194. wait(.05)
  195. la.C1 = CFrame.new(1,.3,.35) * CFrame.fromEulerAnglesXYZ(-.5,.9,.6)
  196. ra.C1 = CFrame.new(-1,.4,.7) * CFrame.fromEulerAnglesXYZ(-.5,-.2,.8)
  197. wait(.05)
  198. la.C1 = CFrame.new(1,.3,.35) * CFrame.fromEulerAnglesXYZ(-1,.9,.6)
  199. ra.C1 = CFrame.new(-1,.4,.7) * CFrame.fromEulerAnglesXYZ(-1,-.2,.8)
  200. wait(.1)
  201. la.C1 = CFrame.new(1,.3,.35) * CFrame.fromEulerAnglesXYZ(-1.5,.9,0)
  202. ra.C1 = CFrame.new(-1,.4,.7) * CFrame.fromEulerAnglesXYZ(-1.5,-.2,.15)
  203. end
  204. attack = false
  205. d = false
  206. end
  207. end
  208. mouse.Button1Down:connect(attack)
  209. blade.Touched:connect(damage)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement