Advertisement
knowyourmom12

Sword template (local)

Jul 21st, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. Player = game:GetService("Players").LocalPlayer
  2.  
  3. Cha = Player.Character
  4.  
  5. RShoulder = Cha.Torso['Right Shoulder']
  6.  
  7. Tool = Instance.new("HopperBin",Player.Backpack)
  8.  
  9. Tool.Name = "DACKHEAD"
  10.  
  11.  
  12. function onClicked(mouse)
  13.  
  14. if (not vDebounce) then
  15.  
  16. vDebounce = true
  17.  
  18. wa = Instance.new("Part",Char)
  19.  
  20. wa.Transparency=1
  21.  
  22. wa.CanCollide = false
  23.  
  24. wa.Size = Vector3.new(1, 1, 1)
  25.  
  26. wa:BreakJoints()
  27.  
  28. Weld3 = Instance.new("Weld",wa)
  29.  
  30. Weld3.Part0 = Blade
  31.  
  32. Weld3.Part1 = wa
  33.  
  34. Weld3.C0 = CFrame.new(0, 0, -2) * CFrame.Angles(0, 0, 0)
  35.  
  36. function touch(hit)
  37.  
  38. if hit.Parent:findFirstChild("Humanoid") ~= nil then
  39.  
  40. hit.Parent.Humanoid.Health=hit.Parent.Humanoid.Health-5
  41.  
  42. end end wa.Touched:connect(touch)
  43.  
  44. animation = Instance.new("Animation")
  45.  
  46. animation.Name = "SlashAnim"
  47.  
  48. animation.AnimationId = "http://www.roblox.com/Asset?ID=94161088"
  49.  
  50. animTrack = Cha.Humanoid:LoadAnimation(animation)
  51.  
  52. animTrack:Play()
  53.  
  54. for i = 1,26 do wait()
  55.  
  56. --[[p = Instance.new("Part",workspace)
  57.  
  58. p.FormFactor="Custom"
  59.  
  60. p.Size=Vector3.new(.5,.5,.5)
  61.  
  62. p.TopSurface = 0
  63.  
  64. p.BottomSurface = 0
  65.  
  66. p.BrickColor=BrickColor.new("Toothpaste")
  67.  
  68. p.Transparency=.3
  69.  
  70. p.CanCollide=false
  71.  
  72. p.Anchored=true
  73.  
  74. p.CFrame =(Blade.CFrame*CFrame.new(0,0,-2))*CFrame.Angles(math.random(-3,3),math.random(-3,3),math.random(-3,3))
  75.  
  76. game.Debris:AddItem(p,.1)]]--
  77.  
  78. end
  79.  
  80. wa:remove()
  81.  
  82. vDebounce = false
  83.  
  84. end
  85.  
  86. end
  87.  
  88.  
  89. Tool.Selected:connect(function(mouse)
  90.  
  91. mouse.Button1Down:connect(function() onClicked(mouse) end)
  92.  
  93. mouse.KeyDown:connect(onKeyDown)
  94.  
  95. --==Wep==--
  96.  
  97.  
  98. Char=Instance.new("Model",Cha) -- CHA not CHAR
  99.  
  100.  
  101. --==End==--
  102.  
  103. end)
  104.  
  105. Tool.Deselected:connect(function(mouse)
  106.  
  107. Char:remove()
  108.  
  109. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement