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://1651045062' | |
| 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=1 | |
| 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=10 | |
| 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=1 | |
| 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('Hot white')
| |
| 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('New Yeller')
| |
| 75 | local ms2=inner.Mesh | |
| 76 | ||
| 77 | local expl=inner:Clone() | |
| 78 | expl.Mesh:Destroy() | |
| 79 | expl.Material='Neon' | |
| 80 | expl.BrickColor=BrickColor.new('Hot pink')
| |
| 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-.0 | |
| 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 | ||
| 194 | ||
| 195 | local new=Instance.new | |
| 196 | local rad=math.rad | |
| 197 | local cf=CFrame.new | |
| 198 | local v3=Vector3.new | |
| 199 | local ang=function(x,y,z) | |
| 200 | return CFrame.Angles(rad(x),rad(y),rad(z)) | |
| 201 | end | |
| 202 | local player=game:service'Players'.LocalPlayer | |
| 203 | local char=player.Character | |
| 204 | local cam=workspace.Camera | |
| 205 | local mouse=player:GetMouse() | |
| 206 | local weld=function(a,b,c0,c1) | |
| 207 | m=Instance.new('Motor',a)
| |
| 208 | m.Part0=a | |
| 209 | m.Part1=b | |
| 210 | m.C0=c0 | |
| 211 | m.C1=c1 | |
| 212 | return m | |
| 213 | end | |
| 214 | ||
| 215 | snd='rbxassetid://1651045062' | |
| 216 | beamm=Instance.new('Model',workspace)
| |
| 217 | beamm.Name='beam' | |
| 218 | ||
| 219 | laser=false | |
| 220 | ||
| 221 | rs=Instance.new('Part',char)
| |
| 222 | rs.Transparency=1 | |
| 223 | rs.CanCollide=false | |
| 224 | rs.TopSurface,rs.BottomSurface=0,0 | |
| 225 | rs.FormFactor=1 | |
| 226 | rs.Size=Vector3.new(.5,.5,.5) | |
| 227 | ||
| 228 | ls=rs:Clone() | |
| 229 | ls.Parent=char | |
| 230 | ||
| 231 | rsw=weld(rs,char.Torso,cf(-1,-.5,0),cf()) | |
| 232 | lsw=weld(ls,char.Torso,cf(1,-.5,0),cf()) | |
| 233 | raw=weld(char['Right Arm'],rs,cf(-.5,.6,-.14),ang(90,0,-8)) | |
| 234 | law=weld(char['Left Arm'],ls,cf(-.3,1.5,-.14),ang(90,0,43)) | |
| 235 | ||
| 236 | s1=Instance.new('Sound',char)
| |
| 237 | s1.Volume=1 | |
| 238 | s1.Pitch=1 | |
| 239 | s1.Looped=true | |
| 240 | s1.SoundId=snd | |
| 241 | ||
| 242 | particles={}
| |
| 243 | ||
| 244 | local wep=new('Part',char)
| |
| 245 | wep.FormFactor=1 | |
| 246 | wep.CanCollide=false | |
| 247 | wep.Size=v3(1,3,1) | |
| 248 | wep.TopSurface,wep.BottomSurface=0,0 | |
| 249 | local wepw=weld(wep,char['Right Arm'],cf(.99,.4,1.5),ang(0,0,8)) | |
| 250 | ||
| 251 | local beam=wep:Clone() | |
| 252 | beam:ClearAllChildren() | |
| 253 | beam.Material='Neon' | |
| 254 | beam.BrickColor=BrickColor.new('Hot white')
| |
| 255 | beam.Size=Vector3.new(3,3,1) | |
| 256 | beam.Transparency=.5 | |
| 257 | beam.Anchored=true | |
| 258 | local ms=Instance.new('BlockMesh',beam)
| |
| 259 | local inner=beam:Clone() | |
| 260 | inner.Transparency=0 | |
| 261 | inner.Material='SmoothPlastic' | |
| 262 | inner.BrickColor=BrickColor.new('New Yeller')
| |
| 263 | local ms2=inner.Mesh | |
| 264 | ||
| 265 | local expl=inner:Clone() | |
| 266 | expl.Mesh:Destroy() | |
| 267 | expl.Material='Neon' | |
| 268 | expl.BrickColor=BrickColor.new('Bright blue')
| |
| 269 | expl.Size=Vector3.new(11,11,11) | |
| 270 | expl.Transparency=.55 | |
| 271 | pl=Instance.new('PointLight',expl)
| |
| 272 | pl.Color=expl.BrickColor.Color | |
| 273 | pl.Range=pl.Range*2 | |
| 274 | pl.Name='light' | |
| 275 | local br=pl.Range | |
| 276 | ||
| 277 | local exa=expl:Clone() | |
| 278 | exa.Size=Vector3.new(4,4,4) | |
| 279 | pl2=exa.light | |
| 280 | ||
| 281 | local part=exa:Clone() | |
| 282 | part.Size=Vector3.new(1.5,1.5,1.5) | |
| 283 | pl3=part.light | |
| 284 | pms=Instance.new('BlockMesh',part)
| |
| 285 | ||
| 286 | char.Humanoid.Died:connect(function() | |
| 287 | laser=false | |
| 288 | beam.Parent=nil | |
| 289 | inner.Parent=nil | |
| 290 | expl.Parent=nil | |
| 291 | exa.Parent=nil | |
| 292 | s1:stop() | |
| 293 | end) | |
| 294 | ||
| 295 | mouse.Button1Down:connect(function() if char.Humanoid.Health~=0 then | |
| 296 | laser=true | |
| 297 | s1.Volume=1 | |
| 298 | s1:play() | |
| 299 | end end) | |
| 300 | mouse.Button1Up:connect(function() | |
| 301 | laser=false | |
| 302 | beam.Parent=nil | |
| 303 | inner.Parent=nil | |
| 304 | expl.Parent=nil | |
| 305 | exa.Parent=nil | |
| 306 | s1:stop() | |
| 307 | end) | |
| 308 | ||
| 309 | parti=0 | |
| 310 | game:service'RunService'.Stepped:connect(function() | |
| 311 | parti=parti+1 | |
| 312 | for i,v in pairs(particles) do | |
| 313 | v.CFrame=v.CFrame*CFrame.new(0,0,-.3) | |
| 314 | v.Transparency=v.Transparency+.08 | |
| 315 | if v.Transparency >= 1 then | |
| 316 | v:Destroy() | |
| 317 | table.remove(particles,i) | |
| 318 | else | |
| 319 | v.Parent=beamm | |
| 320 | end | |
| 321 | end | |
| 322 | a=cam.CoordinateFrame.p | |
| 323 | b=mouse.Hit.p | |
| 324 | mhitr=Ray.new(a,(b-a).unit*999) | |
| 325 | mhit,ps=workspace:FindPartOnRayWithIgnoreList(mhitr,{char,beamm})
| |
| 326 | raw.C1=ang(90+(mouse.Hit.lookVector.y*90),0,-8) | |
| 327 | law.C1=ang(90+(mouse.Hit.lookVector.y*90),0,43) | |
| 328 | if not char.Humanoid.Sit and not char.Humanoid.PlatformStand then | |
| 329 | char.Torso.CFrame=CFrame.new(char.Torso.CFrame.p,Vector3.new(ps.x,char.Torso.CFrame.p.y,ps.z)) | |
| 330 | end | |
| 331 | if laser then | |
| 332 | beamm.Parent=workspace | |
| 333 | beam.Parent=beamm | |
| 334 | inner.Parent=beamm | |
| 335 | expl.Parent=beamm | |
| 336 | exa.Parent=beamm | |
| 337 | s1.Volume=s1.Volume-.0 | |
| 338 | ||
| 339 | 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) | |
| 340 | hit,pos=workspace:FindPartOnRayWithIgnoreList(ray,{char,beamm})
| |
| 341 | ||
| 342 | if hit and hit.Parent:findFirstChild('Humanoid') and s1.Volume > .3 and parti/8==math.floor(parti/8) then
| |
| 343 | Instance.new('Explosion',workspace).Position=pos
| |
| 344 | end | |
| 345 | if hit and hit.Parent==workspace.Terrain or hit==workspace.Terrain and parti/8==math.floor(parti/8) then | |
| 346 | e=Instance.new('Explosion',workspace)
| |
| 347 | e.Position=pos | |
| 348 | e.BlastRadius=14 | |
| 349 | e.BlastPressure=1e4 | |
| 350 | end | |
| 351 | if hit and not hit.Anchored and not (hit:GetMass()>1e4) then | |
| 352 | hit.Velocity=hit.Velocity+beam.CFrame.lookVector*(1*s1.Volume*hit:GetMass()) | |
| 353 | end | |
| 354 | ||
| 355 | if parti==math.floor(parti) then | |
| 356 | par=part:Clone() | |
| 357 | table.insert(particles,par) | |
| 358 | par.Parent=beamm | |
| 359 | par.Transparency=1-s1.Volume | |
| 360 | par.light.Range=br*s1.Volume | |
| 361 | par.CFrame=cf(pos)*ang(math.random(-180,180),math.random(-180,180),math.random(-180,180))*cf(0,0,-10) | |
| 362 | end | |
| 363 | ||
| 364 | mag=((wep.CFrame*cf(0,-1.5,0)).p-pos).magnitude | |
| 365 | ms.Scale=v3(s1.Volume,s1.Volume,mag) | |
| 366 | ms2.Scale=v3(ms.Scale.x/2,ms.Scale.y/2,mag-(.1/mag)) | |
| 367 | beam.CFrame=cf((wep.CFrame*cf(0,-1.5,0)).p,pos)*cf(0,0,-mag/2)*ang(0,0,math.random(0,180)) | |
| 368 | inner.CFrame=beam.CFrame | |
| 369 | pl.Range=br*s1.Volume | |
| 370 | pl2.Range=br*s1.Volume | |
| 371 | expl.Size=v3(math.random(9,13),math.random(9,13),math.random(9,13))*s1.Volume | |
| 372 | expl.Transparency=math.random(40,60)/100 | |
| 373 | expl.CFrame=cf(pos)*ang(math.random(0,180),math.random(0,180),math.random(0,180)) | |
| 374 | exa.Size=v3(4,4,4)*s1.Volume | |
| 375 | exa.CFrame=wep.CFrame*cf(0,-1.5,0)*ang(math.random(0,180),math.random(0,180),math.random(0,180)) | |
| 376 | char.Torso.Velocity=char.Torso.Velocity-beam.CFrame.lookVector*(7*s1.Volume) | |
| 377 | end | |
| 378 | end) | |
| 379 | ||
| 380 | ||
| 381 | ||
| 382 | ||
| 383 | --3-- | |
| 384 | ||
| 385 | local new=Instance.new | |
| 386 | local rad=math.rad | |
| 387 | local cf=CFrame.new | |
| 388 | local v3=Vector3.new | |
| 389 | local ang=function(x,y,z) | |
| 390 | return CFrame.Angles(rad(x),rad(y),rad(z)) | |
| 391 | end | |
| 392 | local player=game:service'Players'.LocalPlayer | |
| 393 | local char=player.Character | |
| 394 | local cam=workspace.Camera | |
| 395 | local mouse=player:GetMouse() | |
| 396 | local weld=function(a,b,c0,c1) | |
| 397 | m=Instance.new('Motor',a)
| |
| 398 | m.Part0=a | |
| 399 | m.Part1=b | |
| 400 | m.C0=c0 | |
| 401 | m.C1=c1 | |
| 402 | return m | |
| 403 | end | |
| 404 | ||
| 405 | snd='rbxassetid://326396715' | |
| 406 | beamm=Instance.new('Model',workspace)
| |
| 407 | beamm.Name='beam' | |
| 408 | ||
| 409 | laser=false | |
| 410 | ||
| 411 | rs=Instance.new('Part',char)
| |
| 412 | rs.Transparency=1 | |
| 413 | rs.CanCollide=false | |
| 414 | rs.TopSurface,rs.BottomSurface=0,0 | |
| 415 | rs.FormFactor=3 | |
| 416 | rs.Size=Vector3.new(.5,.5,.5) | |
| 417 | ||
| 418 | ls=rs:Clone() | |
| 419 | ls.Parent=char | |
| 420 | ||
| 421 | rsw=weld(rs,char.Torso,cf(-1,-.5,0),cf()) | |
| 422 | lsw=weld(ls,char.Torso,cf(1,-.5,0),cf()) | |
| 423 | raw=weld(char['Right Arm'],rs,cf(-.5,.6,-.14),ang(90,0,-8)) | |
| 424 | law=weld(char['Left Arm'],ls,cf(-.3,1.5,-.14),ang(90,0,43)) | |
| 425 | ||
| 426 | s1=Instance.new('Sound',char)
| |
| 427 | s1.Volume=1 | |
| 428 | s1.Pitch=1 | |
| 429 | s1.Looped=true | |
| 430 | s1.SoundId=snd | |
| 431 | ||
| 432 | particles={}
| |
| 433 | ||
| 434 | local wep=new('Part',char)
| |
| 435 | wep.FormFactor=3 | |
| 436 | wep.CanCollide=false | |
| 437 | wep.Size=v3(1,3,1) | |
| 438 | wep.TopSurface,wep.BottomSurface=0,0 | |
| 439 | local wepw=weld(wep,char['Right Arm'],cf(-.48,.4,1.5),ang(0,0,8)) | |
| 440 | ||
| 441 | local beam=wep:Clone() | |
| 442 | beam:ClearAllChildren() | |
| 443 | beam.Material='Neon' | |
| 444 | beam.BrickColor=BrickColor.new('Hot white')
| |
| 445 | beam.Size=Vector3.new(3,3,1) | |
| 446 | beam.Transparency=.5 | |
| 447 | beam.Anchored=true | |
| 448 | local ms=Instance.new('BlockMesh',beam)
| |
| 449 | local inner=beam:Clone() | |
| 450 | inner.Transparency=0 | |
| 451 | inner.Material='SmoothPlastic' | |
| 452 | inner.BrickColor=BrickColor.new('New Yeller')
| |
| 453 | local ms2=inner.Mesh | |
| 454 | ||
| 455 | local expl=inner:Clone() | |
| 456 | expl.Mesh:Destroy() | |
| 457 | expl.Material='Neon' | |
| 458 | expl.BrickColor=BrickColor.new('Bright blue')
| |
| 459 | expl.Size=Vector3.new(11,11,11) | |
| 460 | expl.Transparency=.55 | |
| 461 | pl=Instance.new('PointLight',expl)
| |
| 462 | pl.Color=expl.BrickColor.Color | |
| 463 | pl.Range=pl.Range*2 | |
| 464 | pl.Name='light' | |
| 465 | local br=pl.Range | |
| 466 | ||
| 467 | local exa=expl:Clone() | |
| 468 | exa.Size=Vector3.new(4,4,4) | |
| 469 | pl2=exa.light | |
| 470 | ||
| 471 | local part=exa:Clone() | |
| 472 | part.Size=Vector3.new(1.5,1.5,1.5) | |
| 473 | pl3=part.light | |
| 474 | pms=Instance.new('BlockMesh',part)
| |
| 475 | ||
| 476 | char.Humanoid.Died:connect(function() | |
| 477 | laser=false | |
| 478 | beam.Parent=nil | |
| 479 | inner.Parent=nil | |
| 480 | expl.Parent=nil | |
| 481 | exa.Parent=nil | |
| 482 | s1:stop() | |
| 483 | end) | |
| 484 | ||
| 485 | mouse.Button1Down:connect(function() if char.Humanoid.Health~=0 then | |
| 486 | laser=true | |
| 487 | s1.Volume=1 | |
| 488 | s1:play() | |
| 489 | end end) | |
| 490 | mouse.Button1Up:connect(function() | |
| 491 | laser=false | |
| 492 | beam.Parent=nil | |
| 493 | inner.Parent=nil | |
| 494 | expl.Parent=nil | |
| 495 | exa.Parent=nil | |
| 496 | s1:stop() | |
| 497 | end) | |
| 498 | ||
| 499 | parti=0 | |
| 500 | game:service'RunService'.Stepped:connect(function() | |
| 501 | parti=parti+1 | |
| 502 | for i,v in pairs(particles) do | |
| 503 | v.CFrame=v.CFrame*CFrame.new(0,0,-.3) | |
| 504 | v.Transparency=v.Transparency+.08 | |
| 505 | if v.Transparency >= 1 then | |
| 506 | v:Destroy() | |
| 507 | table.remove(particles,i) | |
| 508 | else | |
| 509 | v.Parent=beamm | |
| 510 | end | |
| 511 | end | |
| 512 | a=cam.CoordinateFrame.p | |
| 513 | b=mouse.Hit.p | |
| 514 | mhitr=Ray.new(a,(b-a).unit*999) | |
| 515 | mhit,ps=workspace:FindPartOnRayWithIgnoreList(mhitr,{char,beamm})
| |
| 516 | raw.C1=ang(90+(mouse.Hit.lookVector.y*90),0,-8) | |
| 517 | law.C1=ang(90+(mouse.Hit.lookVector.y*90),0,43) | |
| 518 | if not char.Humanoid.Sit and not char.Humanoid.PlatformStand then | |
| 519 | char.Torso.CFrame=CFrame.new(char.Torso.CFrame.p,Vector3.new(ps.x,char.Torso.CFrame.p.y,ps.z)) | |
| 520 | end | |
| 521 | if laser then | |
| 522 | beamm.Parent=workspace | |
| 523 | beam.Parent=beamm | |
| 524 | inner.Parent=beamm | |
| 525 | expl.Parent=beamm | |
| 526 | exa.Parent=beamm | |
| 527 | s1.Volume=s1.Volume-.0 | |
| 528 | ||
| 529 | 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) | |
| 530 | hit,pos=workspace:FindPartOnRayWithIgnoreList(ray,{char,beamm})
| |
| 531 | ||
| 532 | if hit and hit.Parent:findFirstChild('Humanoid') and s1.Volume > .3 and parti/8==math.floor(parti/8) then
| |
| 533 | Instance.new('Explosion',workspace).Position=pos
| |
| 534 | end | |
| 535 | if hit and hit.Parent==workspace.Terrain or hit==workspace.Terrain and parti/8==math.floor(parti/8) then | |
| 536 | e=Instance.new('Explosion',workspace)
| |
| 537 | e.Position=pos | |
| 538 | e.BlastRadius=14 | |
| 539 | e.BlastPressure=1e4 | |
| 540 | end | |
| 541 | if hit and not hit.Anchored and not (hit:GetMass()>1e4) then | |
| 542 | hit.Velocity=hit.Velocity+beam.CFrame.lookVector*(1*s1.Volume*hit:GetMass()) | |
| 543 | end | |
| 544 | ||
| 545 | if parti==math.floor(parti) then | |
| 546 | par=part:Clone() | |
| 547 | table.insert(particles,par) | |
| 548 | par.Parent=beamm | |
| 549 | par.Transparency=1-s1.Volume | |
| 550 | par.light.Range=br*s1.Volume | |
| 551 | par.CFrame=cf(pos)*ang(math.random(-180,180),math.random(-180,180),math.random(-180,180))*cf(0,0,-10) | |
| 552 | end | |
| 553 | ||
| 554 | mag=((wep.CFrame*cf(0,-1.5,0)).p-pos).magnitude | |
| 555 | ms.Scale=v3(s1.Volume,s1.Volume,mag) | |
| 556 | ms2.Scale=v3(ms.Scale.x/2,ms.Scale.y/2,mag-(.1/mag)) | |
| 557 | beam.CFrame=cf((wep.CFrame*cf(0,-1.5,0)).p,pos)*cf(0,0,-mag/2)*ang(0,0,math.random(0,180)) | |
| 558 | inner.CFrame=beam.CFrame | |
| 559 | pl.Range=br*s1.Volume | |
| 560 | pl2.Range=br*s1.Volume | |
| 561 | expl.Size=v3(math.random(9,13),math.random(9,13),math.random(9,13))*s1.Volume | |
| 562 | expl.Transparency=math.random(40,60)/100 | |
| 563 | expl.CFrame=cf(pos)*ang(math.random(0,180),math.random(0,180),math.random(0,180)) | |
| 564 | exa.Size=v3(4,4,4)*s1.Volume | |
| 565 | exa.CFrame=wep.CFrame*cf(0,-1.5,0)*ang(math.random(0,180),math.random(0,180),math.random(0,180)) | |
| 566 | char.Torso.Velocity=char.Torso.Velocity-beam.CFrame.lookVector*(7*s1.Volume) | |
| 567 | end | |
| 568 | end) |