Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----- Script made by Pedrorb03 -----
- print("Hold E to Shoot")
- laser = nil
- laserRot = 100
- pos2 = Vector3.new(0,0,0)
- counter = 0
- function chargeLaser()
- local part = Instance.new("Part")
- part.Name = "ChargingLaser"
- game:GetService("Debris"):AddItem(part,1)
- part.Parent = game.Players.LocalPlayer.Character
- part.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- part.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- part.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- part.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- part.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- part.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- part.Material = Enum.Material.Neon
- part.Anchored = true
- part.CanCollide = false
- part.Size = Vector3.new(0.5,0.5,0.5)
- local light = math.random(50,150)
- local rotx = math.random(-360,360)
- local roty = math.random(-360,360)
- local rotz = math.random(-360,360)
- part.BrickColor = BrickColor.new('Bright red')
- part.Transparency = 0.4
- part.CFrame = game.Players.LocalPlayer.Character["Right Arm"].CFrame:toWorldSpace(CFrame.new(Vector3.new(0,-1.1,0))) *CFrame.Angles(math.rad(rotx),math.rad(roty),math.rad(rotz))
- for i=0.4,1,0.1 do
- wait()
- part.Size = Vector3.new(0.5+i,0.5+i,0.5+i)
- part.Transparency = i
- part.CFrame = game.Players.LocalPlayer.Character["Right Arm"].CFrame:toWorldSpace(CFrame.new(Vector3.new(0,-1.1,0))) *CFrame.Angles(math.rad(rotx),math.rad(roty),math.rad(rotz))
- end
- part:remove()
- end
- function chargeLaser2()
- local part = Instance.new("Part")
- game:GetService("Debris"):AddItem(part,1)
- part.Name = "ChargingLaser2"
- part.Parent = game.Players.LocalPlayer.Character
- part.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- part.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- part.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- part.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- part.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- part.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- part.Material = Enum.Material.Neon
- part.Anchored = true
- part.CanCollide = false
- part.Size = Vector3.new(2,2,2)
- local light = math.random(50,150)
- local rotx = math.random(-360,360)
- local roty = math.random(-360,360)
- local rotz = math.random(-360,360)
- part.BrickColor = BrickColor.new('Bright red')
- part.Transparency = 0.4
- part.CFrame = CFrame.new(pos2) *CFrame.Angles(math.rad(rotx),math.rad(roty),math.rad(rotz))
- for i=0.4,1,0.1 do
- wait()
- part.Size = Vector3.new(2+i,2+i,2+i)
- part.Transparency = i
- part.CFrame = CFrame.new(pos2) *CFrame.Angles(math.rad(rotx),math.rad(roty),math.rad(rotz))
- end
- part:remove()
- end
- game:GetService("RunService").RenderStepped:connect(function()
- counter = counter +1
- if counter >= 3 then
- counter = 0
- chargeLaser()
- if laser ~= nil then
- chargeLaser2(pos2)
- end
- end
- laserRot = laserRot+1
- if laser ~= nil then
- local pos1 = game.Players.LocalPlayer.Character.ChargingLaser.Position
- pos2 = game.Players.LocalPlayer:GetMouse().Hit.p
- laser.Size = Vector3.new(0.75,0.75,(pos1-pos2).magnitude)
- laser.CFrame = CFrame.new((pos1+pos2)/2,pos1)*CFrame.Angles(0,0,math.rad(laserRot))
- local ray = Ray.new(pos1,(pos2-pos1).unit*600)
- local hit,position,normal = game.Workspace:FindPartOnRay(ray,game.Players.LocalPlayer.Character)
- if hit then
- hit.Name = "nil"
- hit.Material = Enum.Material.Neon
- local c= hit.Color.r+hit.Color.g+hit.Color.b
- c = c*255
- c = c/3
- hit.BrickColor = BrickColor.new('Bright red')
- hit.Anchored = false
- for _,child in pairs(hit:GetChildren()) do
- if child:IsA("BasePart") then
- child.Name = "nil"
- child.Material = Enum.Material.Neon
- local c= child.Color.r+child.Color.g+child.Color.b
- c = c*255
- c = c/3
- child.BrickColor = BrickColor.new('Bright red')
- end
- if not child:IsA("BasePart") then
- child:remove()
- end
- end
- end
- end
- end)
- game:GetService("UserInputService").InputBegan:connect(function(key)
- if key.KeyCode == Enum.KeyCode.E then
- game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0 = game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0*CFrame.Angles(0,0,math.rad(90))
- laser = Instance.new("Part")
- laser.Name = "Laser"
- laser.Transparency = 0.25
- laser.Parent = game.Players.LocalPlayer.Character
- laser.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- laser.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- laser.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- laser.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- laser.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- laser.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- laser.Material = Enum.Material.Neon
- laser.Anchored = true
- laser.CanCollide = false
- laser.Size = Vector3.new(0.75,0.75,0.75)
- laser.BrickColor = BrickColor.new('Bright red')
- end
- end)
- game:GetService("UserInputService").InputEnded:connect(function(key)
- if key.KeyCode == Enum.KeyCode.E then
- game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0 = game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0*CFrame.Angles(0,0,math.rad(-90))
- laser:remove()
- laser = nil
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement