TheUnknownDiscord

shotgun

Nov 8th, 2021 (edited)
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local debris = game:GetService("Debris")
  2. Bullet = Instance.new("SpawnLocation", owner.Character)
  3. Bullet.Position = Vector3.new(1000000,1000000,1000000)
  4. Bullet.Anchored = true
  5. Bullet.CanCollide = false
  6. Bullet.Enabled = false
  7. Tool = Instance.new("Tool")
  8. Tool.Name = "Shotgun"
  9. Part = Instance.new("Part")
  10. Part.Name = "Handle"
  11. Part.Parent = Tool
  12. Part.Size = Vector3.new(0.47466666666,1.67733333333,3.77766666667)
  13. Tool.GripPos = Vector3.new(0,0,1.63883333334)
  14. Tool.Parent = owner.Character
  15. local E = Instance.new("RemoteEvent", owner.Character)
  16. E.Name = "The"
  17. Bullet.BrickColor = BrickColor.new("Bright yellow")
  18. Mesh = Instance.new("SpecialMesh")
  19. Mesh.Parent = Part
  20. Mesh.MeshId = "http://www.roblox.com/asset/?id=553398821"
  21. Mesh.TextureId = "http://www.roblox.com/asset/?id=553398915"
  22. Mesh.Scale = Vector3.new(0.333333333333, 0.333333333333, 0.333333333333)
  23. local Pow = Instance.new("Sound", owner.character.Head)
  24. Pow.SoundId = "rbxassetid://3810328903"
  25. Pow.Volume = 2
  26. NLS([[
  27. Tool = owner.Character:WaitForChild("Shotgun")
  28. local E = owner.Character:WaitForChild("The")
  29. local toolout = false
  30. Tool.Equipped:Connect(function()
  31. toolout = true
  32. end)
  33.  
  34. Tool.Unequipped:Connect(function()
  35. toolout = false
  36. end)
  37. mouse = owner:GetMouse()
  38. mouse.Button1Down:Connect(function()
  39. if toolout then
  40. local pos = mouse.Hit.Position
  41. E:FireServer(pos)
  42. end
  43. end)
  44. ]],owner.PlayerGui)
  45. E.OnServerEvent:Connect(function(player, pos)
  46. Pow:Play()
  47. for i = 1, 5 do
  48. position = pos + Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1))
  49. local params = RaycastParams.new()
  50. params.FilterDescendantsInstances = {owner.Character}
  51. params.FilterType = Enum.RaycastFilterType.Blacklist
  52. local origin = Part.Position
  53. local direction = (position - origin).Unit*300
  54. local result = game.Workspace:Raycast(origin, direction, params)
  55.  
  56. local intersection = result and result.Position or origin + direction
  57. local distance = (origin - intersection).Magnitude + 5
  58.  
  59. local bullet_clone = Bullet:Clone()
  60. bullet_clone.Size = Vector3.new(0.1, 0.1, distance)
  61. bullet_clone.CFrame = CFrame.new(origin, intersection)*CFrame.new(0, 0, -distance/2)
  62. bullet_clone.Parent = game.Workspace
  63. game:GetService("Debris"):AddItem(bullet_clone,0.25)
  64. if result then
  65. local part = result.Instance
  66. local humanoid = part.Parent:FindFirstChild("Humanoid") or part.Parent.Parent:FindFirstChild("Humanoid")
  67.  
  68. if humanoid then
  69. if humanoid ~= owner.Character.Humanoid then
  70. humanoid.BreakJointsOnDeath = false
  71. humanoid.Health = humanoid.Health - 17.5
  72. local velocity = Instance.new("BodyVelocity", part)
  73. velocity.Velocity = bullet_clone.CFrame.lookVector * 20
  74. velocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  75. wait(0.125)
  76. velocity:Destroy()
  77. velocity = nil
  78. end
  79. end
  80. end
  81. end
  82. end)
  83.  
Add Comment
Please, Sign In to add comment