Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. SWEP.Category = "Adecya - SCP Weapon"
  2. SWEP.PrintName = "IA SWEP"
  3. SWEP.Author = "[HLλ]John Oakman"
  4. SWEP.Instructions = "Clique gauche pour ouvrir et clique droit pour fermer un porte | Reload pour changer de mode | Clique droit pour unlocker et Clique gauche pour locker"
  5. SWEP.ViewModelFOV = 56
  6. SWEP.Spawnable = true
  7. SWEP.AdminOnly = false
  8. SWEP.Primary.ClipSize = -1
  9. SWEP.Primary.DefaultClip = -1
  10. SWEP.Primary.Delay = 2
  11. SWEP.Primary.Automatic = false
  12. SWEP.Primary.Ammo = "None"
  13. SWEP.Secondary.ClipSize = -1
  14. SWEP.Secondary.DefaultClip = -1
  15. SWEP.Secondary.Automatic = false
  16. SWEP.Secondary.Ammo = "None"
  17. SWEP.Weight = 1
  18. SWEP.AutoSwitchTo = false
  19. SWEP.AutoSwitchFrom = false
  20. SWEP.Slot = 0
  21. SWEP.SlotPos = 2
  22. SWEP.DrawAmmo = false
  23. SWEP.DrawCrosshair = true
  24. SWEP.IdleAnim = true
  25. SWEP.ViewModel = "models/weapons/v_pistol.mdl"
  26. SWEP.WorldModel = "models/weapons/w_pistol.mdl"
  27.  
  28. SWEP.HoldType = "pistol"
  29. local Mode = "Open/Close"
  30.  
  31. function SWEP:Initialize()
  32. self:SetWeaponHoldType( self.HoldType )
  33. self.Weapon:SetMaterial("models/props_combine/stasisshield_sheet")
  34. end
  35.  
  36.  
  37.  
  38. function SWEP:PrimaryAttack()
  39. if not SERVER then return end
  40. self.Weapon:SetNextPrimaryFire( CurTime() + 0.1 )
  41. local trace = self.Owner:GetEyeTrace()
  42.  
  43. if Mode == "Open/Close" then
  44. if trace.Entity:GetClass() == "func_door" or trace.Entity:GetClass() == "prop_door_rotating" or trace.Entity:GetClass() == "func_door_rotating" then
  45. trace.Entity:Fire("open")
  46. end
  47. elseif Mode == "Lock/Unlock" then
  48. if trace.Entity:GetClass() == "func_door" or trace.Entity:GetClass() == "prop_door_rotating" or trace.Entity:GetClass() == "func_door_rotating" then
  49. trace.Entity:Fire("lock")
  50. end
  51. end
  52. end
  53.  
  54. function SWEP:SecondaryAttack()
  55. if not SERVER then return end
  56. self.Weapon:SetNextPrimaryFire( CurTime() + 0.3 )
  57. local trace = self.Owner:GetEyeTrace()
  58.  
  59. if Mode == "Open/Close" then
  60. if trace.Entity:GetClass() == "func_door" or trace.Entity:GetClass() == "prop_door_rotating" or trace.Entity:GetClass() == "func_door_rotating" then
  61. trace.Entity:Fire("close")
  62. end
  63. elseif Mode == "Lock/Unlock" then
  64. if trace.Entity:GetClass() == "func_door" or trace.Entity:GetClass() == "prop_door_rotating" or trace.Entity:GetClass() == "func_door_rotating" then
  65. trace.Entity:Fire("unlock")
  66. end
  67. end
  68.  
  69. end
  70. local attente = 1
  71. function SWEP:Reload()
  72. if not SERVER then return end
  73. if attente == 0 then return end
  74. attente = 0
  75. if Mode == "Open/Close" then
  76. Mode = "Lock/Unlock" self.Owner:PrintMessage(HUD_PRINTTALK, "Mode change pour Lock/Unlock")
  77. elseif Mode == "Lock/Unlock" then
  78. Mode = "Open/Close" self.Owner:PrintMessage(HUD_PRINTTALK, "Mode change pour Open/Close") end
  79. timer.Simple(0.5, function() attente = 1 end)
  80. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement