Hey everyone, ive been working on a weapon that shows entities starting with k_ through walls for 10 seconds in a range of x units. I have a few things already, any help would be greatly appreciated!
hook.Add( "PreDrawHalos", "AddHalos", function()
halo.Add( ents.FindByClass( "item_*" ), Color( 0, 255, 0 ), 0, 0, 2, true, true )
end )
I tried adding it to the SWEP:PrimaryAttack() function but no dice.
SWEP.PrintName = "Entity Scanner"
SWEP.Author = "sleepy"
SWEP.Contact = ""
SWEP.Purpose = "Scan bases for contraband!"
SWEP.Instructions = "Left click to scan!"
SWEP.Category = "sleepys addons"
SWEP.Spawnable = true
SWEP.ViewModel = ""
SWEP.WorldModel = ""
SWEP.Primary.Clipsize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "none"
SWEP.Secondary.Clipsize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Slot = 1
SWEP.SlotPos = 5
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = true
function SWEP:Initialize()
self:SetWeaponHoldType( "normal" )
end
function SWEP:PrimaryAttack()
halo.Add( ents.FindByClass( "k_*" ), Color( 0, 255, 0 ), 0, 0, 2, true, true )
end
i cant figure out how to have it draw only in a certain range, and i want the swep to take 5 seconds for the entities to begin being drawn, and then have the entities stay drawn for 10 seconds, visible through walls and all surfaces. And if it cannot find entities in the range, then it does nothing.