Hi, I have the TTT cloaking device on my server: http://steamcommunity.com/sharedfiles/filedetails/?id=278890424
I find it a bit too OP so I thought it would be better if the weapon would play a constant sound. I’m not the best with lua but i guess it would require editing the SWEP.Think function, but that runs every tick as far as I know, so it would cause lag I guess. The weapon works by just equipping it i.e. no left/right clicking. So I need the weapon to emit a sound every time the weapon is equipped. The sound would also need to be heard by others so they know that a player is cloaked and is able to find them using the direction of the sound.
This part is off-topic but if anyone has suggestions on how I can make this weapon less OP that would be cool. I did think of using a cooldown feature but that is was out of my coding capability.
–edit-- fixed, here is my code:
timer.Create(“timer_name”, 5, 0, function()
local sound= Sound( your_sound.wav" )
replace timer_name with a suitable name and 5 with the length of the sound file.
function SWEP:Holster( wep )
replace timer_name with the name you used in SWEP:Deploy