Advertisement
Guest User

Untitled

a guest
Sep 1st, 2014
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. if SERVER then
  2. AddCSLuaFile( "shared.lua" )
  3. resource.AddFile("materials/VGUI/ttt/lykrast/icon_cloak.vmt")
  4. end
  5.  
  6. if( CLIENT ) then
  7. SWEP.PrintName = "Cloaking Device";
  8. SWEP.Slot = 7;
  9. SWEP.DrawAmmo = false;
  10. SWEP.DrawCrosshair = false;
  11. SWEP.Icon = "VGUI/ttt/lykrast/icon_cloak";
  12.  
  13. SWEP.EquipMenuData = {
  14. type = "item_weapon",
  15. desc = "Hold it to become nearly invisible.\n\nDoesn't hide your name, shadow or\nbloodstains on your body."
  16. };
  17.  
  18. end
  19.  
  20. SWEP.Author= "Lykrast"
  21.  
  22.  
  23. SWEP.Base = "weapon_tttbase"
  24. SWEP.Spawnable= false
  25. SWEP.AdminSpawnable= true
  26. SWEP.HoldType = "slam"
  27.  
  28. SWEP.Kind = WEAPON_EQUIP2
  29. SWEP.CanBuy = {ROLE_TRAITOR}
  30.  
  31. SWEP.ViewModelFOV= 60
  32. SWEP.ViewModelFlip= false
  33. SWEP.ViewModel = "models/weapons/c_slam.mdl"
  34. SWEP.WorldModel = "models/weapons/w_slam.mdl"
  35. SWEP.UseHands = true
  36.  
  37. --- PRIMARY FIRE ---
  38. SWEP.Primary.Delay= 0.5
  39. SWEP.Primary.Recoil= 0
  40. SWEP.Primary.Damage= 0
  41. SWEP.Primary.NumShots= 1
  42. SWEP.Primary.Cone= 0
  43. SWEP.Primary.ClipSize= -1
  44. SWEP.Primary.DefaultClip= -1
  45. SWEP.Primary.Automatic = false
  46. SWEP.Primary.Ammo = "none"
  47. SWEP.NoSights = true
  48.  
  49. function SWEP:PrimaryAttack()
  50. return false
  51. end
  52.  
  53. function SWEP:Cloak()
  54. self.Owner:SetColor( Color(255, 255, 255, 3) )
  55. self.Owner:SetMaterial( "sprites/heatwave" )
  56. -- self.Weapon:SetMaterial("sprites/heatwave")
  57. self:EmitSound( "AlyxEMP.Charge" )
  58. self.Owner:DrawWorldModel( false )
  59. self.conceal = true
  60. end
  61.  
  62. function SWEP:UnCloak()
  63. self.Owner:SetMaterial("models/glass")
  64. -- self.Weapon:SetMaterial("models/glass")
  65. self:EmitSound( "AlyxEMP.Discharge" )
  66. self.Owner:DrawWorldModel( true )
  67. self.conceal = false
  68. end
  69.  
  70. function SWEP:Deploy()
  71. self:Cloak()
  72. end
  73.  
  74. function SWEP:Holster()
  75.  
  76. if ( self.conceal ) then
  77. self:UnCloak()
  78. end
  79.  
  80. return true
  81.  
  82. end
  83.  
  84. function SWEP:PreDrop()
  85.  
  86. if ( self.conceal ) then
  87. self:UnCloak()
  88. end
  89.  
  90. end
  91.  
  92. hook.Add("TTTPrepareRound", "UnCloakAll",function()
  93. for k, v in pairs(player.GetAll()) do
  94. v:SetMaterial("models/glass")
  95. end
  96. end
  97. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement