anuisud1

Untitled

Mar 1st, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.71 KB | None | 0 0
  1. spawn (function()
  2. -- Objects
  3.  
  4. local Sword = Instance.new("Model")
  5. local Player = game.Players.LocalPlayer
  6. local Char = Player.Character
  7. local BaseAttachment = Instance.new("Attachment")
  8. local BladeAttackment = Instance.new("Attachment")
  9. local Blade = Instance.new("Part")
  10. local Mouse = Player:GetMouse()
  11. local Trail = Instance.new("Trail")
  12. local RunService = game:GetService("RunService")
  13. local Handle = Instance.new("Part")
  14. local HandleToBlade = Instance.new("Weld")
  15. local HandToTorso = Instance.new("Weld")
  16. local HandleToHand = Instance.new("Weld")
  17. local BladeToSharp = Instance.new("Weld")
  18. local Sharp = Instance.new("WedgePart")
  19. local Slash = false
  20. local Blood = Instance.new("Part")
  21. local BloodCont = Instance.new("Model")
  22. local Smoothner = Instance.new("BlockMesh")
  23. local Attacking = false
  24. local HitSound = Instance.new("Sound")
  25. local SlashSound = Instance.new("Sound")
  26. local CFrames =
  27. {
  28. t_HandToTorso =
  29. {
  30. BackClick = CFrame.new(-1.5, 1, 0) * CFrame.Angles(3.5, 0, 0),
  31. BackStab = CFrame.new(-1.5, 0.5, -0.5) * CFrame.Angles(1.5, 0, 0),
  32. FrontClick = CFrame.new(-1.5, 0, 0) * CFrame.Angles(0, 0, 0),
  33. FrontStab = CFrame.new(-1.5, 0.5, 0.5) * CFrame.Angles(-1.5, 0, 0)
  34. },
  35. t_HandleToHand =
  36. {
  37. BackClick = CFrame.new(0, 0, 0) * CFrame.Angles(-5, 0.2, 1),
  38. BackStab = CFrame.new(0, 0, 0) * CFrame.Angles(0.3, 0, 0),
  39. FrontClick = CFrame.new(0, 0, 0) * CFrame.Angles(1.5, 0, 0),
  40. FrontStab = CFrame.new(0, 0, 0) * CFrame.Angles(3, 0, 0)
  41. }
  42. }
  43.  
  44. -- Assets
  45.  
  46. game.ContentProvider:Preload("rbxassetid://196969716") -- Trail Texutre
  47. game.ContentProvider:Preload("rbxassetid://158037267") -- Slash Sound
  48. game.ContentProvider:Preload("rbxassetid://186311262") -- Hit Sound
  49.  
  50. -- Properties
  51.  
  52. Sword.Parent = Char
  53. Sword.Name = "Sword"
  54.  
  55. Handle.BrickColor = BrickColor.new("Dark orange")
  56. Handle.Material = "Marble"
  57. Handle.Name = "Handle"
  58. Handle.Anchored = false
  59. Handle.CanCollide = false
  60. Handle.Size = Vector3.new(0.1, 1, 0.35)
  61. Handle.BackSurface = "SmoothNoOutlines"
  62. Handle.BottomSurface = "SmoothNoOutlines"
  63. Handle.FrontSurface = "SmoothNoOutlines"
  64. Handle.LeftSurface = "SmoothNoOutlines"
  65. Handle.RightSurface = "SmoothNoOutlines"
  66. Handle.TopSurface = "SmoothNoOutlines"
  67.  
  68.  
  69. Blade.BrickColor = BrickColor.new("Fossil")
  70. Blade.Material = "Neon"
  71. Blade.Name = "Blade"
  72. Blade.Anchored = false
  73. Blade.CanCollide = false
  74. Blade.Size = Vector3.new(0.1, 4.84, 0.35)
  75. Blade.BackSurface = "SmoothNoOutlines"
  76. Blade.BottomSurface = "SmoothNoOutlines"
  77. Blade.FrontSurface = "SmoothNoOutlines"
  78. Blade.LeftSurface = "SmoothNoOutlines"
  79. Blade.RightSurface = "SmoothNoOutlines"
  80. Blade.TopSurface = "SmoothNoOutlines"
  81.  
  82. Sharp.BrickColor = BrickColor.new("Fossil")
  83. Sharp.Material = "Neon"
  84. Sharp.Name = "Sharp"
  85. Sharp.Anchored = false
  86. Sharp.CanCollide = false
  87. Sharp.Size = Vector3.new(0.1, 1, 0.35)
  88. Sharp.BackSurface = "SmoothNoOutlines"
  89. Sharp.BottomSurface = "SmoothNoOutlines"
  90. Sharp.FrontSurface = "SmoothNoOutlines"
  91. Sharp.LeftSurface = "SmoothNoOutlines"
  92. Sharp.RightSurface = "SmoothNoOutlines"
  93. Sharp.TopSurface = "SmoothNoOutlines"
  94.  
  95. Blood.BrickColor = BrickColor.new("Really red")
  96. Blood.Size = Vector3.new(0.5, 0.3, 0.6)
  97.  
  98. BloodCont.Name = "BloodCont"
  99.  
  100. Smoothner.Parent = Blood
  101.  
  102. BaseAttachment.Parent = Sharp
  103. BladeAttackment.Parent = Blade
  104.  
  105. Trail.Attachment0 = BaseAttachment
  106. Trail.Attachment1 = BladeAttackment
  107. Trail.Parent = Sharp
  108. Trail.Enabled = false
  109. Trail.Transparency = NumberSequence.new(0, 1)
  110. Trail.Texture = "rbxassetid://196969716"
  111. Trail.Lifetime = 0.15
  112.  
  113. SlashSound.Parent = Handle
  114. SlashSound.Name = "SlashSound"
  115. SlashSound.Volume = 0.4
  116. SlashSound.SoundId = "rbxassetid://158037267"
  117.  
  118. HitSound.Parent = Handle
  119. HitSound.Name = "HitSound"
  120. HitSound.Volume = 0.4
  121. HitSound.PlaybackSpeed = 2.4
  122. HitSound.SoundId = "rbxassetid://186311262"
  123.  
  124. -- Welds
  125.  
  126. HandleToBlade.Part0 = Handle
  127. HandleToBlade.C0 = CFrame.new(0, 2.92, 0)
  128. HandleToBlade.Part1 = Blade
  129. HandleToBlade.Name = "HandleToBlade"
  130. HandleToBlade.Parent = Handle
  131.  
  132. BladeToSharp.Part0 = Sharp
  133. BladeToSharp.C0 = CFrame.new(0, -2.92, 0)
  134. BladeToSharp.Part1 = Blade
  135. BladeToSharp.Parent = Handle
  136. BladeToSharp.Name = "BladeToSharp"
  137.  
  138. HandleToHand.Part0 = Handle
  139. HandleToHand.Name = "HandleToHand"
  140. HandleToHand.C0 = CFrame.Angles(1.5, 0, 0)
  141. HandleToHand.C1 = CFrame.new(0, -1, 0)
  142. HandleToHand.Part1 = Char["Right Arm"]
  143. HandleToHand.Parent = Handle
  144.  
  145. HandToTorso.Part0 = Char["Right Arm"]
  146. HandToTorso.Part1 = Char.Torso
  147. HandToTorso.Name = "HandToTorso"
  148. HandToTorso.Parent = Handle
  149. HandToTorso.C0 = CFrame.new(-1.5, 0, 0)
  150.  
  151. Handle.Parent = Sword
  152. Blade.Parent = Sword
  153. Sharp.Parent = Sword
  154.  
  155. -- Functions
  156.  
  157.  
  158. Mouse.Button1Down:Connect(function()
  159. if Slash == false then
  160. CFrames.t_HandleToHand.Back = CFrame.new(0, 0, 0) * CFrame.Angles(-5, math.random(-1, 1.2), 1)
  161. Trail.Enabled = true
  162. Slash = true
  163.  
  164. for Back = 0, 1, 0.05 do
  165. HandleToHand.C0 = HandleToHand.C0:lerp(CFrames.t_HandleToHand.BackClick, Back)
  166. HandToTorso.C0 = HandToTorso.C0:lerp(CFrames.t_HandToTorso.BackClick, Back)
  167. RunService.Stepped:wait()
  168. end
  169.  
  170. SlashSound:Play()
  171.  
  172. for Front = 0, 1, 0.1 do
  173. HandleToHand.C0 = HandleToHand.C0:lerp(CFrames.t_HandleToHand.FrontClick, Front)
  174. HandToTorso.C0 = HandToTorso.C0:lerp(CFrames.t_HandToTorso.FrontClick, Front)
  175. RunService.Stepped:wait()
  176. end
  177.  
  178. Slash = false
  179. Trail.Enabled = false
  180. end
  181. end)
  182.  
  183. Mouse.KeyDown:Connect(function(key)
  184. if key == "q" and Slash == false then
  185. Slash = true
  186. Trail.Enabled = true
  187.  
  188. for Back = 0, 1, 0.025 do
  189. HandleToHand.C0 = HandleToHand.C0:lerp(CFrames.t_HandleToHand.BackStab, Back)
  190. HandToTorso.C0 = HandToTorso.C0:lerp(CFrames.t_HandToTorso.BackStab, Back)
  191. RunService.Stepped:wait()
  192. end
  193.  
  194. SlashSound:Play()
  195.  
  196. for Front = 0, 1, 0.1 do
  197. HandleToHand.C0 = HandleToHand.C0:lerp(CFrames.t_HandleToHand.FrontStab, Front)
  198. HandToTorso.C0 = HandToTorso.C0:lerp(CFrames.t_HandToTorso.FrontStab, Front)
  199. RunService.Stepped:wait()
  200. end
  201.  
  202. for Def = 0, 1, 0.1 do
  203. HandleToHand.C0 = HandleToHand.C0:lerp(CFrames.t_HandleToHand.FrontClick, Def)
  204. HandToTorso.C0 = HandToTorso.C0:lerp(CFrames.t_HandToTorso.FrontClick, Def)
  205. RunService.Stepped:wait()
  206. end
  207.  
  208. Slash = false
  209. Trail.Enabled = false
  210. end
  211. end)
  212.  
  213. Blade.Touched:Connect(function(hit)
  214. if Slash == true and hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= game.Players.LocalPlayer.Character and Attacking == false then
  215. hit.Parent.Humanoid:TakeDamage(math.random(10, 20))
  216. Handle.HitSound.Playing = true
  217. Attacking = true
  218. BloodCont.Parent = hit.Parent.Torso
  219. for i = 1, math.random(4, 7) do
  220. local CBlood = Blood:Clone()
  221. CBlood.Parent = BloodCont
  222. CBlood.CFrame = hit.Parent.Torso.CFrame
  223. end
  224. wait(0.5)
  225. BloodCont:Remove()
  226. Attacking = false
  227. end
  228. end)
  229. end)
Add Comment
Please, Sign In to add comment