Recent Posts
None | 2 sec ago
None | 16 sec ago
None | 20 sec ago
None | 31 sec ago
PHP | 40 sec ago
None | 42 sec ago
None | 57 sec ago
None | 1 min ago
JavaScript | 1 min ago
Java | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By steve on the 9th of Feb 2010 09:52:29 PM Download | Raw | Embed | Report
  1. SWEP.Author = "WhiTAkeR"
  2. SWEP.Contact = ""
  3. SWEP.Purpose = "Insta-Shield"
  4. SWEP.Instructions = ""
  5.  
  6. SWEP.Spawnable = true
  7. SWEP.AdminSpawnable = true
  8. SWEP.ViewModelFlip = true
  9. SWEP.ViewModel = "models/weapons/v_rif_ak47.mdl"
  10. SWEP.WorldModel = "models/weapons/w_rif_ak47.mdl"
  11. SWEP.Primary.ClipSize = -1
  12. SWEP.Primary.DefaultClip = -1
  13. SWEP.Primary.Automatic = false
  14. SWEP.Primary.Ammo = "none"
  15.  
  16. local ShootSound = Sound("weapons/stunstick/spark1.wav")
  17. function SWEP:Reload()
  18. end
  19.  
  20. function SWEP:PrimaryAttack()
  21.  
  22.         self.Weapon:EmitSound (ShootSound)
  23.         self.BaseClass.ShootEffects (self)
  24.         if(!SERVER) then return end
  25.        
  26.         self.Prop = ents.Create ("prop_physics")
  27.         local tr1 = util.QuickTrace ( self.Owner:EyePos(),self.Owner:GetAimVector()*250,self.Owner)
  28.         tr2 = util.QuickTrace ( tr1.HitPos,Vector(0,0,-1e9))
  29.         local ang = (tr2.HitPos - self.Owner:GetPos()):Angle()
  30.         self.Prop:SetModel ("models/props_doors/door03_slotted_left.mdl")
  31.         self.Prop:SetAngles (Angle(0,ang.y,0))
  32.         self.Prop:SetPos (tr2.HitPos - Vector(50,0,50))
  33.         self.Prop:Spawn()
  34.        
  35.                 cleanup.Add (self.Owner, "props", ent)
  36.                 undo.Create ("Wall")
  37.                 undo.AddEntity (ent)
  38.                 undo.SetPlayer (self.Owner)
  39.                 undo.Finish()
  40.        
  41. end
  42.  
  43. function SWEP:Think()
  44.         if ValidEntity(self.Prop) then
  45.                 pos = self.Prop:GetPos()
  46.                 local Origin = tr2.HitPos
  47.                         if pos.z < Origin.z + 50 then
  48.                                 self.Prop:SetPos(pos + (Origin  - pos + Vector(-50,0,50)) * FrameTime()* 50)
  49.                         end
  50.         end
  51. end
  52.  
  53. function SWEP:SecondaryAttack()
  54. end
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: