2much4Us

Untitled

Jun 3rd, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. if !timer.Exists( "earthquake" ) then
  2.  
  3. timer.Create( "earthquake", 0.5, 500, function()
  4.  
  5. for _, p in pairs(player.GetAll()) do
  6.  
  7. p:SetPos( p:GetPos() + Vector( 0, 0, 1 ) )
  8.  
  9. p:SetVelocity( Vector( math.random( -50, 50 ), math.random( -50, 50 ), math.random( 100, 150 ) ) )
  10.  
  11. util.ScreenShake( p:GetPos(), 20, 1, 1, 100 )
  12.  
  13. p:EmitSound( "ambient/explosions/exp1.wav", 100, math.random( 60, 100 ) )
  14.  
  15. end
  16.  
  17.  
  18.  
  19. for _, e in pairs(ents.GetAll()) do
  20.  
  21. if e:GetPhysicsObject() and e:GetPhysicsObject():IsValid() then e:GetPhysicsObject():AddVelocity( Vector( math.random( -50, 50 ), math.random( -50, 50 ), math.random( 100, 150 ) ) ) end
  22.  
  23. end
  24.  
  25.  
  26.  
  27.  
  28.  
  29. end)
  30.  
  31. else
  32.  
  33. timer.Remove( "earthquake" )
  34.  
  35. end
Advertisement
Add Comment
Please, Sign In to add comment