Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hold Q to Shoot")
- laser = nil
- laserRot = 100
- pos3 = Vector3.new(0,0,0)
- counter = 0
- function chargeLaser3()
- local part = Instance.new("Part")
- part.Name = "ChargingLaser3"
- 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 blue')
- 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 chargeLaser4()
- local part = Instance.new("Part")
- game:GetService("Debris"):AddItem(part,1)
- part.Name = "ChargingLaser4"
- 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 blue')
- part.Transparency = 0.4
- part.CFrame = CFrame.new(pos4) *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(pos4) *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
- chargeLaser3()
- if laser ~= nil then
- chargeLaser4(pos4)
- end
- end
- laserRot = laserRot+1
- if laser ~= nil then
- local pos3 = game.Players.LocalPlayer.Character.ChargingLaser3.Position
- pos4 = game.Players.LocalPlayer:GetMouse().Hit.p
- laser.Size = Vector3.new(0.75,0.75,(pos3-pos4).magnitude)
- laser.CFrame = CFrame.new((pos3+pos4)/2,pos3)*CFrame.Angles(0,0,math.rad(laserRot))
- local ray = Ray.new(pos3,(pos4-pos3).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 blue')
- hit.Anchored = true
- 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 blue')
- 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.Q 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 = "Laser2"
- 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 blue')
- end
- end)
- game:GetService("UserInputService").InputEnded:connect(function(key)
- if key.KeyCode == Enum.KeyCode.Q 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