View difference between Paste ID: 6MwhxmUi and gmdT9zTp
SHOW: | | - or go back to the newest paste.
1
----------------------------------------
2
 -- Originally made by Alfederate :D -- 
3
----------------------------------------
4
5
 -- there's no time to explain! --
6
7
local new=Instance.new
8
local rad=math.rad
9
local cf=CFrame.new
10
local v3=Vector3.new
11
local ang=function(x,y,z)
12
return CFrame.Angles(rad(x),rad(y),rad(z))
13
end
14
local player=game:service'Players'.LocalPlayer
15
local char=player.Character
16
local cam=workspace.Camera
17
local mouse=player:GetMouse()
18
local weld=function(a,b,c0,c1)
19
m=Instance.new('Motor',a)
20
m.Part0=a
21
m.Part1=b
22
m.C0=c0
23
m.C1=c1
24
return m
25
end
26
27
snd='rbxassetid://283166091'
28
beamm=Instance.new('Model',workspace)
29
beamm.Name='beam'
30
31
laser=false
32
33
rs=Instance.new('Part',char)
34
rs.Transparency=1
35
rs.CanCollide=false
36
rs.TopSurface,rs.BottomSurface=0,0
37
rs.FormFactor=3
38
rs.Size=Vector3.new(.5,.5,.5)
39
40
ls=rs:Clone()
41
ls.Parent=char
42
43
rsw=weld(rs,char.Torso,cf(-1,-.5,0),cf())
44
lsw=weld(ls,char.Torso,cf(1,-.5,0),cf())
45
raw=weld(char['Right Arm'],rs,cf(-.5,.6,-.14),ang(90,0,-8))
46
law=weld(char['Left Arm'],ls,cf(-.3,1.5,-.14),ang(90,0,43))
47
48
s1=Instance.new('Sound',char)
49
s1.Volume=1
50
s1.Pitch=1
51
s1.Looped=true
52
s1.SoundId=snd
53
54
particles={}
55
56
local wep=new('Part',char)
57
wep.FormFactor=3
58
wep.CanCollide=false
59
wep.Size=v3(1,3,1)
60
wep.TopSurface,wep.BottomSurface=0,0
61
local wepw=weld(wep,char['Right Arm'],cf(.26,.4,.7),ang(0,0,8))
62
63
local beam=wep:Clone()
64
beam:ClearAllChildren()
65
beam.Material='Neon'
66
beam.BrickColor=BrickColor.new('Toothpaste')
67
beam.Size=Vector3.new(3,3,1)
68
beam.Transparency=.5
69
beam.Anchored=true
70
local ms=Instance.new('BlockMesh',beam)
71
local inner=beam:Clone()
72
inner.Transparency=0
73
inner.Material='SmoothPlastic'
74
inner.BrickColor=BrickColor.new('Navy blue')
75
local ms2=inner.Mesh
76
77
local expl=inner:Clone()
78
expl.Mesh:Destroy()
79
expl.Material='Neon'
80
expl.BrickColor=BrickColor.new('Toothpaste')
81
expl.Size=Vector3.new(11,11,11)
82
expl.Transparency=.55
83
pl=Instance.new('PointLight',expl)
84
pl.Color=expl.BrickColor.Color
85
pl.Range=pl.Range*2
86
pl.Name='light'
87
local br=pl.Range
88
89
local exa=expl:Clone()
90
exa.Size=Vector3.new(4,4,4)
91
pl2=exa.light
92
93
local part=exa:Clone()
94
part.Size=Vector3.new(1.5,1.5,1.5)
95
pl3=part.light
96
pms=Instance.new('BlockMesh',part)
97
98
char.Humanoid.Died:connect(function()
99
laser=false
100
beam.Parent=nil
101
inner.Parent=nil
102
expl.Parent=nil
103
exa.Parent=nil
104
s1:stop()
105
end)
106
107
mouse.Button1Down:connect(function() if char.Humanoid.Health~=0 then
108
laser=true
109
s1.Volume=1
110
s1:play()
111
end end)
112
mouse.Button1Up:connect(function()
113
laser=false
114
beam.Parent=nil
115
inner.Parent=nil
116
expl.Parent=nil
117
exa.Parent=nil
118
s1:stop()
119
end)
120
121
parti=0
122
game:service'RunService'.Stepped:connect(function()
123
parti=parti+1
124
for i,v in pairs(particles) do
125
v.CFrame=v.CFrame*CFrame.new(0,0,-.3)
126
v.Transparency=v.Transparency+.08
127
if v.Transparency >= 1 then
128
v:Destroy()
129
table.remove(particles,i)
130
else
131
v.Parent=beamm
132
end
133
end
134
a=cam.CoordinateFrame.p
135
b=mouse.Hit.p
136
mhitr=Ray.new(a,(b-a).unit*999)
137
mhit,ps=workspace:FindPartOnRayWithIgnoreList(mhitr,{char,beamm})
138
raw.C1=ang(90+(mouse.Hit.lookVector.y*90),0,-8)
139
law.C1=ang(90+(mouse.Hit.lookVector.y*90),0,43)
140
if not char.Humanoid.Sit and not char.Humanoid.PlatformStand then
141
char.Torso.CFrame=CFrame.new(char.Torso.CFrame.p,Vector3.new(ps.x,char.Torso.CFrame.p.y,ps.z))
142
end
143
if laser then
144
beamm.Parent=workspace
145
beam.Parent=beamm
146
inner.Parent=beamm
147
expl.Parent=beamm
148
exa.Parent=beamm
149
s1.Volume=s1.Volume-.002
150
151
ray=Ray.new((wep.CFrame*cf(0,-1.5,0)).p,((wep.CFrame*cf(0,-10,0)).p-(wep.CFrame*cf(0,-1.5,0)).p).unit*999)
152
hit,pos=workspace:FindPartOnRayWithIgnoreList(ray,{char,beamm})
153
154
if hit and hit.Parent:findFirstChild('Humanoid') and s1.Volume > .3 and parti/8==math.floor(parti/8) then
155
Instance.new('Explosion',workspace).Position=pos
156
end
157
if hit and hit.Parent==workspace.Terrain or hit==workspace.Terrain and parti/8==math.floor(parti/8) then
158
e=Instance.new('Explosion',workspace)
159
e.Position=pos
160
e.BlastRadius=14
161
e.BlastPressure=1e4
162
end
163
if hit and not hit.Anchored and not (hit:GetMass()>1e4) then
164
hit.Velocity=hit.Velocity+beam.CFrame.lookVector*(1*s1.Volume*hit:GetMass())
165
end
166
167
if parti==math.floor(parti) then
168
par=part:Clone()
169
table.insert(particles,par)
170
par.Parent=beamm
171
par.Transparency=1-s1.Volume
172
par.light.Range=br*s1.Volume
173
par.CFrame=cf(pos)*ang(math.random(-180,180),math.random(-180,180),math.random(-180,180))*cf(0,0,-10)
174
end
175
176
mag=((wep.CFrame*cf(0,-1.5,0)).p-pos).magnitude
177
ms.Scale=v3(s1.Volume,s1.Volume,mag)
178
ms2.Scale=v3(ms.Scale.x/2,ms.Scale.y/2,mag-(.1/mag))
179
beam.CFrame=cf((wep.CFrame*cf(0,-1.5,0)).p,pos)*cf(0,0,-mag/2)*ang(0,0,math.random(0,180))
180
inner.CFrame=beam.CFrame
181
pl.Range=br*s1.Volume
182
pl2.Range=br*s1.Volume
183
expl.Size=v3(math.random(9,13),math.random(9,13),math.random(9,13))*s1.Volume
184
expl.Transparency=math.random(40,60)/100
185
expl.CFrame=cf(pos)*ang(math.random(0,180),math.random(0,180),math.random(0,180))
186
exa.Size=v3(4,4,4)*s1.Volume
187
exa.CFrame=wep.CFrame*cf(0,-1.5,0)*ang(math.random(0,180),math.random(0,180),math.random(0,180))
188
char.Torso.Velocity=char.Torso.Velocity-beam.CFrame.lookVector*(7*s1.Volume)
189
end
190
end)
191
192
----------------------------------------
193
 -- Originally made by Alfederate :D -- 
194
----------------------------------------
195
196
 -- there's no time to explain! --
197
198
local new=Instance.new
199
local rad=math.rad
200
local cf=CFrame.new
201
local v3=Vector3.new
202
local ang=function(x,y,z)
203
return CFrame.Angles(rad(x),rad(y),rad(z))
204
end
205
local player=game:service'Players'.LocalPlayer
206
local char=player.Character
207
local cam=workspace.Camera
208
local mouse=player:GetMouse()
209
local weld=function(a,b,c0,c1)
210
m=Instance.new('Motor',a)
211
m.Part0=a
212
m.Part1=b
213
m.C0=c0
214
m.C1=c1
215
return m
216
end
217
218
snd='rbxassetid://283166091'
219
beamm=Instance.new('Model',workspace)
220
beamm.Name='beam'
221
222
laser=false
223
224
rs=Instance.new('Part',char)
225
rs.Transparency=1
226
rs.CanCollide=false
227
rs.TopSurface,rs.BottomSurface=0,0
228
rs.FormFactor=3
229
rs.Size=Vector3.new(.5,.5,.5)
230
231
ls=rs:Clone()
232
ls.Parent=char
233
234
rsw=weld(rs,char.Torso,cf(-1,-.5,0),cf())
235
lsw=weld(ls,char.Torso,cf(1,-.5,0),cf())
236
raw=weld(char['Right Arm'],rs,cf(-.5,.6,-.14),ang(90,0,-8))
237
law=weld(char['Left Arm'],ls,cf(-.3,1.5,-.14),ang(90,0,43))
238
239
s1=Instance.new('Sound',char)
240
s1.Volume=1
241
s1.Pitch=1
242
s1.Looped=true
243
s1.SoundId=snd
244
245
particles={}
246
247
local wep=new('Part',char)
248
wep.FormFactor=3
249
wep.CanCollide=false
250
wep.Size=v3(1,3,1)
251
wep.TopSurface,wep.BottomSurface=0,0
252
local wepw=weld(wep,char['Right Arm'],cf(.26,.4,.7),ang(0,0,8))
253
254
local beam=wep:Clone()
255
beam:ClearAllChildren()
256
beam.Material='Neon'
257
beam.BrickColor=BrickColor.new('Toothpaste')
258
beam.Size=Vector3.new(3,3,1)
259
beam.Transparency=.5
260
beam.Anchored=true
261
local ms=Instance.new('BlockMesh',beam)
262
local inner=beam:Clone()
263
inner.Transparency=0
264
inner.Material='SmoothPlastic'
265
inner.BrickColor=BrickColor.new('Navy blue')
266
local ms2=inner.Mesh
267
268
local expl=inner:Clone()
269
expl.Mesh:Destroy()
270
expl.Material='Neon'
271
expl.BrickColor=BrickColor.new('Toothpaste')
272
expl.Size=Vector3.new(11,11,11)
273
expl.Transparency=.55
274
pl=Instance.new('PointLight',expl)
275
pl.Color=expl.BrickColor.Color
276
pl.Range=pl.Range*2
277
pl.Name='light'
278
local br=pl.Range
279
280
local exa=expl:Clone()
281
exa.Size=Vector3.new(4,4,4)
282
pl2=exa.light
283
284
local part=exa:Clone()
285
part.Size=Vector3.new(1.5,1.5,1.5)
286
pl3=part.light
287
pms=Instance.new('BlockMesh',part)
288
289
char.Humanoid.Died:connect(function()
290
laser=false
291
beam.Parent=nil
292
inner.Parent=nil
293
expl.Parent=nil
294
exa.Parent=nil
295
s1:stop()
296
end)
297
298
mouse.Button1Down:connect(function() if char.Humanoid.Health~=0 then
299
laser=true
300
s1.Volume=1
301
s1:play()
302
end end)
303
mouse.Button1Up:connect(function()
304
laser=false
305
beam.Parent=nil
306
inner.Parent=nil
307
expl.Parent=nil
308
exa.Parent=nil
309
s1:stop()
310
end)
311
312
parti=0
313
game:service'RunService'.Stepped:connect(function()
314
parti=parti+1
315
for i,v in pairs(particles) do
316
v.CFrame=v.CFrame*CFrame.new(0,0,-.3)
317
v.Transparency=v.Transparency+.08
318
if v.Transparency >= 1 then
319
v:Destroy()
320
table.remove(particles,i)
321
else
322
v.Parent=beamm
323
end
324
end
325
a=cam.CoordinateFrame.p
326
b=mouse.Hit.p
327
mhitr=Ray.new(a,(b-a).unit*999)
328
mhit,ps=workspace:FindPartOnRayWithIgnoreList(mhitr,{char,beamm})
329
raw.C1=ang(90+(mouse.Hit.lookVector.y*90),0,-8)
330
law.C1=ang(90+(mouse.Hit.lookVector.y*90),0,43)
331
if not char.Humanoid.Sit and not char.Humanoid.PlatformStand then
332
char.Torso.CFrame=CFrame.new(char.Torso.CFrame.p,Vector3.new(ps.x,char.Torso.CFrame.p.y,ps.z))
333
end
334
if laser then
335
beamm.Parent=workspace
336
beam.Parent=beamm
337
inner.Parent=beamm
338
expl.Parent=beamm
339
exa.Parent=beamm
340
s1.Volume=s1.Volume-.002
341
342
ray=Ray.new((wep.CFrame*cf(0,-1.5,0)).p,((wep.CFrame*cf(0,-10,0)).p-(wep.CFrame*cf(0,-1.5,0)).p).unit*999)
343
hit,pos=workspace:FindPartOnRayWithIgnoreList(ray,{char,beamm})
344
345
if hit and hit.Parent:findFirstChild('Humanoid') and s1.Volume > .3 and parti/8==math.floor(parti/8) then
346
Instance.new('Explosion',workspace).Position=pos
347
end
348
if hit and hit.Parent==workspace.Terrain or hit==workspace.Terrain and parti/8==math.floor(parti/8) then
349
e=Instance.new('Explosion',workspace)
350
e.Position=pos
351
e.BlastRadius=14
352
e.BlastPressure=1e4
353
end
354
if hit and not hit.Anchored and not (hit:GetMass()>1e4) then
355
hit.Velocity=hit.Velocity+beam.CFrame.lookVector*(1*s1.Volume*hit:GetMass())
356
end
357
358
if parti==math.floor(parti) then
359
par=part:Clone()
360
table.insert(particles,par)
361
par.Parent=beamm
362
par.Transparency=1-s1.Volume
363
par.light.Range=br*s1.Volume
364
par.CFrame=cf(pos)*ang(math.random(-180,180),math.random(-180,180),math.random(-180,180))*cf(0,0,-10)
365
end
366
367
mag=((wep.CFrame*cf(0,-1.5,0)).p-pos).magnitude
368
ms.Scale=v3(s1.Volume,s1.Volume,mag)
369
ms2.Scale=v3(ms.Scale.x/2,ms.Scale.y/2,mag-(.1/mag))
370
beam.CFrame=cf((wep.CFrame*cf(0,-1.5,0)).p,pos)*cf(0,0,-mag/2)*ang(0,0,math.random(0,180))
371
inner.CFrame=beam.CFrame
372
pl.Range=br*s1.Volume
373
pl2.Range=br*s1.Volume
374
expl.Size=v3(math.random(9,13),math.random(9,13),math.random(9,13))*s1.Volume
375
expl.Transparency=math.random(40,60)/100
376
expl.CFrame=cf(pos)*ang(math.random(0,180),math.random(0,180),math.random(0,180))
377
exa.Size=v3(4,4,4)*s1.Volume
378
exa.CFrame=wep.CFrame*cf(0,-1.5,0)*ang(math.random(0,180),math.random(0,180),math.random(0,180))
379
char.Torso.Velocity=char.Torso.Velocity-beam.CFrame.lookVector*(7*s1.Volume)
380
end
381
end)