SHOW:
|
|
- or go back to the newest paste.
1 | ----- Script made by Pedrorb03 ----- | |
2 | laser = nil | |
3 | laserRot = 0 | |
4 | pos2 = Vector3.new(0,0,0) | |
5 | counter = 0 | |
6 | function chargeLaser() | |
7 | local part = Instance.new("Part") | |
8 | part.Name = "ChargingLaser" | |
9 | game:GetService("Debris"):AddItem(part,1) | |
10 | part.Parent = game.Players.LocalPlayer.Character | |
11 | part.BackSurface = Enum.SurfaceType.SmoothNoOutlines | |
12 | part.FrontSurface = Enum.SurfaceType.SmoothNoOutlines | |
13 | part.TopSurface = Enum.SurfaceType.SmoothNoOutlines | |
14 | part.BottomSurface = Enum.SurfaceType.SmoothNoOutlines | |
15 | part.LeftSurface = Enum.SurfaceType.SmoothNoOutlines | |
16 | part.RightSurface = Enum.SurfaceType.SmoothNoOutlines | |
17 | part.Material = Enum.Material.Neon | |
18 | part.Anchored = true | |
19 | part.CanCollide = false | |
20 | part.Size = Vector3.new(0.5,0.5,0.5) | |
21 | local light = math.random(50,150) | |
22 | local rotx = math.random(-360,360) | |
23 | local roty = math.random(-360,360) | |
24 | local rotz = math.random(-360,360) | |
25 | - | part.Color = Color3.fromRGB(light,light,light) |
25 | + | part.Color = Color3.fromRGB(155,19,150) |
26 | part.Transparency = 0.4 | |
27 | 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)) | |
28 | for i=0.4,1,0.1 do | |
29 | wait() | |
30 | part.Size = Vector3.new(0.5+i,0.5+i,0.5+i) | |
31 | part.Transparency = i | |
32 | 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)) | |
33 | end | |
34 | part:remove() | |
35 | end | |
36 | function chargeLaser2() | |
37 | local part = Instance.new("Part") | |
38 | game:GetService("Debris"):AddItem(part,1) | |
39 | part.Name = "ChargingLaser2" | |
40 | part.Parent = game.Players.LocalPlayer.Character | |
41 | part.BackSurface = Enum.SurfaceType.SmoothNoOutlines | |
42 | part.FrontSurface = Enum.SurfaceType.SmoothNoOutlines | |
43 | part.TopSurface = Enum.SurfaceType.SmoothNoOutlines | |
44 | part.BottomSurface = Enum.SurfaceType.SmoothNoOutlines | |
45 | part.LeftSurface = Enum.SurfaceType.SmoothNoOutlines | |
46 | part.RightSurface = Enum.SurfaceType.SmoothNoOutlines | |
47 | part.Material = Enum.Material.Neon | |
48 | part.Anchored = true | |
49 | part.CanCollide = false | |
50 | part.Size = Vector3.new(2,2,2) | |
51 | local light = math.random(50,150) | |
52 | local rotx = math.random(-360,360) | |
53 | local roty = math.random(-360,360) | |
54 | local rotz = math.random(-360,360) | |
55 | - | part.Color = Color3.fromRGB(light,light,light) |
55 | + | part.Color = Color3.fromRGB(155,19,150) |
56 | part.Transparency = 0.4 | |
57 | part.CFrame = CFrame.new(pos2) *CFrame.Angles(math.rad(rotx),math.rad(roty),math.rad(rotz)) | |
58 | for i=0.4,1,0.1 do | |
59 | wait() | |
60 | part.Size = Vector3.new(2+i,2+i,2+i) | |
61 | part.Transparency = i | |
62 | part.CFrame = CFrame.new(pos2) *CFrame.Angles(math.rad(rotx),math.rad(roty),math.rad(rotz)) | |
63 | end | |
64 | part:remove() | |
65 | end | |
66 | ||
67 | ||
68 | ||
69 | ||
70 | game:GetService("RunService").RenderStepped:connect(function() | |
71 | counter = counter +1 | |
72 | if counter >= 3 then | |
73 | counter = 0 | |
74 | chargeLaser() | |
75 | if laser ~= nil then | |
76 | chargeLaser2(pos2) | |
77 | end | |
78 | end | |
79 | ||
80 | laserRot = laserRot+1 | |
81 | if laser ~= nil then | |
82 | local pos1 = game.Players.LocalPlayer.Character.ChargingLaser.Position | |
83 | pos2 = game.Players.LocalPlayer:GetMouse().Hit.p | |
84 | ||
85 | laser.Size = Vector3.new(0.75,0.75,(pos1-pos2).magnitude) | |
86 | laser.CFrame = CFrame.new((pos1+pos2)/2,pos1)*CFrame.Angles(0,0,math.rad(laserRot)) | |
87 | ||
88 | local ray = Ray.new(pos1,(pos2-pos1).unit*600) | |
89 | local hit,position,normal = game.Workspace:FindPartOnRay(ray,game.Players.LocalPlayer.Character) | |
90 | if hit then | |
91 | ||
92 | ||
93 | hit.Name = "nil" | |
94 | hit.Material = Enum.Material.Concrete | |
95 | ||
96 | local c= hit.Color.r+hit.Color.g+hit.Color.b | |
97 | ||
98 | c = c*255 | |
99 | c = c/3 | |
100 | - | hit.Color = Color3.fromRGB(c,c,c) |
100 | + | hit.Color = Color3.fromRGB(155,19,150) |
101 | ||
102 | ||
103 | for _,child in pairs(hit:GetChildren()) do | |
104 | if child:IsA("BasePart") then | |
105 | ||
106 | ||
107 | child.Name = "nil" | |
108 | child.Material = Enum.Material.Concrete | |
109 | local c= child.Color.r+child.Color.g+child.Color.b | |
110 | ||
111 | c = c*255 | |
112 | c = c/3 | |
113 | - | child.Color = Color3.fromRGB(c,c,c) |
113 | + | child.Color = Color3.fromRGB(155,19,150) |
114 | ||
115 | end | |
116 | if not child:IsA("BasePart") then | |
117 | child:remove() | |
118 | end | |
119 | end | |
120 | end | |
121 | end | |
122 | end) | |
123 | game:GetService("UserInputService").InputBegan:connect(function(key) | |
124 | if key.KeyCode == Enum.KeyCode.F then | |
125 | game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0 = game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0*CFrame.Angles(0,0,math.rad(90)) | |
126 | laser = Instance.new("Part") | |
127 | laser.Name = "Laser" | |
128 | laser.Transparency = 0.25 | |
129 | laser.Parent = game.Players.LocalPlayer.Character | |
130 | laser.BackSurface = Enum.SurfaceType.SmoothNoOutlines | |
131 | laser.FrontSurface = Enum.SurfaceType.SmoothNoOutlines | |
132 | laser.TopSurface = Enum.SurfaceType.SmoothNoOutlines | |
133 | laser.BottomSurface = Enum.SurfaceType.SmoothNoOutlines | |
134 | laser.LeftSurface = Enum.SurfaceType.SmoothNoOutlines | |
135 | laser.RightSurface = Enum.SurfaceType.SmoothNoOutlines | |
136 | laser.Material = Enum.Material.Neon | |
137 | laser.Anchored = true | |
138 | laser.CanCollide = false | |
139 | laser.Size = Vector3.new(0.75,0.75,0.75) | |
140 | - | laser.Color = Color3.fromRGB(100,100,100) |
140 | + | laser.Color = Color3.fromRGB(155,19,150) |
141 | ||
142 | end | |
143 | end) | |
144 | game:GetService("UserInputService").InputEnded:connect(function(key) | |
145 | if key.KeyCode == Enum.KeyCode.F then | |
146 | game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0 = game.Players.LocalPlayer.Character.Torso["Right Shoulder"].C0*CFrame.Angles(0,0,math.rad(-90)) | |
147 | laser:remove() | |
148 | laser = nil | |
149 | end | |
150 | end) |