Marlingaming

Portable Radio

Mar 14th, 2022 (edited)
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. SWEP.PrintName = "M_Portable_Radio"
  2. SWEP.Author = "jamiemarlin"
  3. SWEP.Instructions = "hold on inventory and stand by transmitter to broadcast, press left click to get distance"
  4.  
  5. SWEP.Spawnable = true
  6. SWEP.AdminOnly = true
  7.  
  8. SWEP.Primary.ClipSize = -1
  9. SWEP.Primary.DefaultClip = -1
  10. SWEP.Primary.Automatic = false
  11. SWEP.Primary.Ammo = "none"
  12.  
  13. SWEP.Secondary.ClipSize = -1
  14. SWEP.Secondary.DefaultClip = -1
  15. SWEP.Secondary.Automatic = false
  16. SWEP.Secondary.Ammo = "none"
  17.  
  18. SWEP.Weight = 10
  19. SWEP.AutoSwitchTo = false
  20. SWEP.AutoSwitchFrom = false
  21.  
  22. SWEP.Slot = 2
  23. SWEP.SlotPos = 2
  24. SWEP.DrawAmmo = false
  25. SWEP.DrawCrosshair = false
  26.  
  27. SWEP.ViewModel = "models/weapons/v_pistol.mdl"
  28. SWEP.WorldModel = "models/weapons/w_pistol.mdl"
  29.  
  30.  
  31. function SWEP:PrimaryAttack()
  32. self:SetNextPrimaryFire( CurTime() + 0.5 )
  33. FindTransmitter()
  34. end
  35.  
  36. local function FindTransmitter()
  37. local NeRad = nil
  38. local Rads = Ents:FindByName("M_Transmittion_Radio")
  39. for i = 1, #Rads do
  40. if NeRad == nil or LocalPlayer():GetPos():DistToSqr( NeRad:GetPos() ) > LocalPlayer():GetPos():DistToSqr( Rads[i]:GetPos() ) then NeRad = Rads[i] end
  41. end
  42. print( LocalPlayer():GetPos():DistToSqr( NeRad:GetPos() ) )
  43. end
  44.  
Add Comment
Please, Sign In to add comment