HenloMyDude

bad sword buts no blood

Feb 24th, 2020
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.42 KB | None | 0 0
  1. plr = owner
  2. char = plr.Character
  3. tors = char.Torso
  4. ra = char["Right Arm"]
  5. la = char["Left Arm"]
  6. rl = char["Right Leg"]
  7. ll = char["Left Leg"]
  8. hed = char.Head
  9. root = char.HumanoidRootPart
  10. hum = char.Humanoid
  11.  
  12. clerp = function(toclerp, cf, number)
  13. local joint = toclerp
  14. joint.C0 = joint.C0:Lerp(cf, number)
  15. end
  16.  
  17. clerp2 = function(toclerp, cf)
  18. local joint = toclerp
  19. joint.C0 = cf
  20. end
  21.  
  22. clerp3 = function(toclerp, cf, number)
  23. local joint = toclerp
  24. joint.C1 = joint.C1:Lerp(cf, number)
  25. end
  26.  
  27. Swait,swait = function(number)
  28. if number == 0 or number == nil then
  29. game:GetService("RunService").Heartbeat:Wait()
  30. else
  31. for i = 1,number do
  32. game:GetService("RunService").Heartbeat:Wait()
  33. end
  34. end
  35. end
  36.  
  37. ezweld = function(p, a, b, cf)
  38. local weld = Instance.new("Weld",p)
  39. weld.Part0 = a
  40. weld.Part1 = b
  41. weld.C0 = cf
  42. return weld
  43. end
  44.  
  45. NewSound = function(p, id, pit, vol, loop)
  46. local Sound = Instance.new("Sound",p)
  47. Sound.Pitch = pit
  48. Sound.Volume = vol
  49. Sound.SoundId = "rbxassetid://" ..id
  50. Sound.Looped = loop
  51. Sound:Play()
  52. return Sound
  53. end
  54.  
  55. IT = Instance.new
  56. Rad = math.rad
  57. Cos = math.cos
  58. Sin = math.sin
  59. BrickC = BrickColor.new
  60. C3 = Color3.new
  61. VT = Vector3.new
  62.  
  63. anim = "Idle"
  64. attack = false
  65. local RS = char.Torso["Right Shoulder"]
  66. local LS = char.Torso["Left Shoulder"]
  67. local RH = char.Torso["Right Hip"]
  68. local LH = char.Torso["Left Hip"]
  69. local neck = char.Torso["Neck"]
  70. local anim = "Idle"
  71. local animate = char.Animate
  72. local root = char.HumanoidRootPart
  73. local rootj = root.RootJoint
  74. local timepos = 0
  75. local sine = 0
  76. local RSnor = RS.C0
  77. local LSnor = LS.C0
  78. local RHnor = RH.C0
  79. local LHnor = LH.C0
  80. local RSnor2 = RS.C1
  81. local LSnor2 = LS.C1
  82. local RHnor2 = RH.C1
  83. local LHnor2 = LH.C1
  84. local rootjnor = rootj.C0
  85. local necknor = neck.C0
  86. local tors = char.Torso
  87. mouse = plr:GetMouse()
  88. hold = false
  89. Debris = game:GetService("Debris")
  90. attack = false
  91. lunge = false
  92.  
  93. local tool = Instance.new("Tool", plr.Backpack)
  94. tool.Name = "osrwd"
  95. tool.GripForward = VT(-1, 0, 0)
  96. tool.GripPos = VT(0, 0, -1.5)
  97. tool.GripRight = VT(0, 1, 0)
  98. tool.GripUp = VT(0, 0, 1)
  99. local handle = Instance.new("Part", tool)
  100. handle.Size = Vector3.new(1, 0.8, 4)
  101. handle.CanCollide = false
  102. handle.Name = "Handle"
  103. local mesh = Instance.new("SpecialMesh", handle)
  104. mesh.MeshId = "rbxasset://fonts/sword.mesh"
  105. mesh.TextureId = "rbxassetid://323591032"
  106. nl = false
  107.  
  108. Grips = {
  109. Up = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0),
  110. Out = CFrame.new(0, 0, -1.70000005, 0, 1, 0, 1, -0, 0, 0, 0, -1)
  111. }
  112.  
  113. function thread(f)
  114. return coroutine.resume(coroutine.create(f))
  115. end
  116.  
  117. function damage(model, dmg, bl, cf, vel)
  118. for i,v in pairs (model:children()) do
  119. if model ~= char and model ~= workspace then
  120. if v:IsA("Humanoid") then
  121. v.Health = v.Health - dmg
  122. end
  123. end
  124. end
  125. end
  126.  
  127. function slash()
  128. tool.Grip = Grips.Up
  129. attack = true
  130. nl = true
  131. thread(function()
  132. wait(0.3)
  133. nl = false
  134. end)
  135. local hitbox = handle.Touched:connect(function(hit)
  136. local dud = hit.Parent
  137. if dud ~= char then
  138. if not dud:FindFirstChild"cool" then
  139. damage(dud, 15, true, hit.CFrame, 60)
  140. for i = 1,5 do
  141. bled(hit.CFrame, 60)
  142. end
  143. local cool = Instance.new("NumberValue", dud) cool.Name = "cool" Debris:AddItem(cool, 0.15)
  144. end
  145. end
  146. end)
  147. for i = 1,17 do
  148. Swait()
  149. if lunge == false then
  150. clerp(RS, RSnor * CFrame.Angles(0, 0, Rad(-90)), 0.35)
  151. end
  152. end
  153. hitbox:disconnect()
  154. attack = false
  155. end
  156.  
  157. function lungi()
  158. tool.Grip = Grips.Out
  159. attack = true
  160. lunge = true
  161. local hitbox = handle.Touched:connect(function(hit)
  162. local dud = hit.Parent
  163. if dud ~= char then
  164. if not dud:FindFirstChild"cool" then
  165. damage(dud, 30, true, hit.CFrame, 60)
  166. for i = 1,3 do
  167. bled(hit.CFrame, 60)
  168. end
  169. local cool = Instance.new("NumberValue", dud) cool.Name = "cool" Debris:AddItem(cool, 0.15)
  170. end
  171. end
  172. end)
  173. for i = 1,30 do
  174. Swait()
  175. if lunge == true then
  176. clerp(RS, RSnor * CFrame.Angles(0, 0, Rad(0)), 0.35)
  177. end
  178. end
  179. hitbox:disconnect()
  180. lunge = false
  181. attack = false
  182. tool.Grip = Grips.Up
  183. end
  184.  
  185. tool.Activated:connect(function()
  186. if attack == false and lunge == false then
  187. slash()
  188. elseif attack == true and lunge == false and nl == true then
  189. lungi()
  190. end
  191. end)
  192.  
  193. while true do
  194. Swait()
  195. if attack == false then
  196. clerp(RS, RSnor, 0.35)
  197. end
  198. end
Add Comment
Please, Sign In to add comment