Advertisement
Guest User

ah

a guest
Feb 25th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. local tool = script.Parent
  2. local player = game.Players.LocalPlayer
  3. local mouse = player:GetMouse()
  4. local char = player.Character
  5. local barrel = tool:WaitForChild("Barel")
  6. local attachment0 = Instance.new("Attachment",barrel)
  7. attachment0.Name = 'Attachment0'
  8. local shot = tool.Barel.Fire
  9. wait()
  10.  
  11.  
  12. local beam = Instance.new("Beam",workspace)
  13. beam.Attachment0 = attachment0
  14. beam.Width0 = 0.2
  15. beam.Width1 = 0.2
  16. beam.Color = ColorSequence.new(Color3.fromRGB(200, 200, 60))
  17. canShoot = true
  18.  
  19.  
  20. tool.Equipped:Connect(function()
  21. local animation = Instance.new("Animation")
  22. animation.AnimationId = 'rbxassetid://1457042677'
  23. ting = player.Character.Humanoid:LoadAnimation(animation)
  24. ting:Play()
  25.  
  26. tool.Activated:Connect(function()
  27. if canShoot then
  28. canShoot = false
  29.  
  30. if mouse.Target.Name == 'Head' then
  31. if mouse.Target.Parent:FindFirstChild("Humanoid") then
  32. local person = mouse.Target.Parent
  33. person.Humanoid:TakeDamage(40)
  34. end
  35. end
  36. if mouse.Target.Name == 'Torso' or mouse.Target.Name == 'HumanoidRootPart' then
  37. if mouse.Target.Parent:FindFirstChild("Humanoid") then
  38. local person = mouse.Target.Parent
  39. person.Humanoid:TakeDamage(30)
  40. end
  41. end
  42. if mouse.Target.Name == 'Left Arm' or mouse.Target.Name == 'Right Arm' or mouse.Target.Name == 'Right Leg' or mouse.Target.Name == 'Left Leg' then
  43. if mouse.Target.Parent:FindFirstChild("Humanoid") then
  44. local person = mouse.Target.Parent
  45. person.Humanoid:TakeDamage(20)
  46. end
  47. end
  48.  
  49. local fire = Instance.new("Animation")
  50. fire.AnimationId = 'rbxassetid://1457187786'
  51. local recoil = player.Character.Humanoid:LoadAnimation(fire)
  52. recoil:Play()
  53.  
  54. print(mouse.Target.Name)
  55. shot:Play()
  56. local marker = Instance.new("Part",workspace)
  57. marker.CanCollide = false
  58. marker.Anchored = true
  59. marker.Transparency = 1
  60. marker.Size =Vector3.new(0.05,0.05,0.05)
  61. marker.Position = mouse.Hit.p
  62. local attachment1 = Instance.new("Attachment",marker)
  63. beam.Attachment1 = attachment1
  64.  
  65. wait()
  66. marker:Destroy()
  67. wait(0.5)
  68. canShoot = true
  69.  
  70. end
  71. end)
  72. end)
  73.  
  74. tool.Unequipped:Connect(function()
  75. ting:Stop()
  76. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement