Advertisement
FuZe_Bleed

X

Sep 13th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. --==[(:" Prison Life RayGun ":)]==--
  2. --[[ By intromake ]]--
  3. --==[(:"Change Remi To any":)]==--
  4. local Client = game.Players.LocalPlayer
  5. local Gun = Client.Character["Remington 870"] -- Gun name here
  6. local Mouse = Client:GetMouse()
  7. local Step = game:GetService("RunService").Stepped
  8. local Event = game:GetService("ReplicatedStorage").ShootEvent
  9. local Enabled = false
  10.  
  11. -- DON'T TOUCH NOTHING --
  12. function CreateRay(Point_A, Point_B)
  13. local Ray = Ray.new(Point_A, (Point_B - Point_A).Unit * (2 ^ 31 - 1))
  14. local Part, Pos = workspace:FindPartOnRay(Ray)
  15. local Dist = (Point_A - Pos).Magnitude
  16. local CFrame = CFrame.new(Point_A, Pos) * CFrame.new(0, 0, -Dist / 2)
  17.  
  18. return CFrame, Dist, Part, Ray
  19. end
  20.  
  21. local Shoot = function(Target)
  22. local C, D, P, R = CreateRay(Gun.Muzzle.Position, Target)
  23. local Bullet = Instance.new("Part")
  24. local BT = {}
  25.  
  26. Bullet.CanCollide = false
  27. Bullet.Anchored = true
  28. Bullet.BrickColor = BrickColor.Red()
  29. Bullet.Material = Enum.Material.Neon
  30. Bullet.Size = Vector3.new(0.2, 0.2, D)
  31. Bullet.CFrame = C
  32. Bullet.Parent = workspace
  33.  
  34. table.insert(BT, {
  35. Hit = P,
  36. Distance = D,
  37. Cframe = C,
  38. RayObject = R
  39. })
  40. Event:FireServer(BT, Gun)
  41. Step:wait()
  42. Bullet:Remove()
  43. end
  44.  
  45. Mouse.Button1Down:Connect(function() Enabled = true end)
  46. Mouse.Button1Up:Connect(function() Enabled = false end)
  47.  
  48. while Step:wait() do
  49. Shoot(Mouse.Target.Position)
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement