Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --==[(:" Prison Life RayGun ":)]==--
- --[[ By intromake ]]--
- --==[(:"Change Remi To any":)]==--
- local Client = game.Players.LocalPlayer
- local Gun = Client.Character["Remington 870"] -- Gun name here
- local Mouse = Client:GetMouse()
- local Step = game:GetService("RunService").Stepped
- local Event = game:GetService("ReplicatedStorage").ShootEvent
- local Enabled = false
- -- DON'T TOUCH NOTHING --
- function CreateRay(Point_A, Point_B)
- local Ray = Ray.new(Point_A, (Point_B - Point_A).Unit * (2 ^ 31 - 1))
- local Part, Pos = workspace:FindPartOnRay(Ray)
- local Dist = (Point_A - Pos).Magnitude
- local CFrame = CFrame.new(Point_A, Pos) * CFrame.new(0, 0, -Dist / 2)
- return CFrame, Dist, Part, Ray
- end
- local Shoot = function(Target)
- local C, D, P, R = CreateRay(Gun.Muzzle.Position, Target)
- local Bullet = Instance.new("Part")
- local BT = {}
- Bullet.CanCollide = false
- Bullet.Anchored = true
- Bullet.BrickColor = BrickColor.Red()
- Bullet.Material = Enum.Material.Neon
- Bullet.Size = Vector3.new(0.2, 0.2, D)
- Bullet.CFrame = C
- Bullet.Parent = workspace
- table.insert(BT, {
- Hit = P,
- Distance = D,
- Cframe = C,
- RayObject = R
- })
- Event:FireServer(BT, Gun)
- Step:wait()
- Bullet:Remove()
- end
- Mouse.Button1Down:Connect(function() Enabled = true end)
- Mouse.Button1Up:Connect(function() Enabled = false end)
- while Step:wait() do
- Shoot(Mouse.Target.Position)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement