Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----- Script made by Pedrorb03 -----
- laser = nil
- laserRot = 0
- 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.Color = Color3.fromRGB(light,light,light)
- 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.Color = Color3.fromRGB(light,light,light)
- 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.Concrete
- local c= hit.Color.r+hit.Color.g+hit.Color.b
- c = c*255
- c = c/3
- hit.Color = Color3.fromRGB(c,c,c)
- for _,child in pairs(hit:GetChildren()) do
- if child:IsA("BasePart") then
- child.Name = "nil"
- child.Material = Enum.Material.Concrete
- local c= child.Color.r+child.Color.g+child.Color.b
- c = c*255
- c = c/3
- child.Color = Color3.fromRGB(c,c,c)
- 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.F 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.Color = Color3.fromRGB(100,100,100)
- end
- end)
- game:GetService("UserInputService").InputEnded:connect(function(key)
- if key.KeyCode == Enum.KeyCode.F 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