Skip to content

Miscellaneous Settings & Functions

Vuthakral edited this page Aug 28, 2019 · 2 revisions

Miscellaneous Settings & Functions

Miscellaneous Functions


DoCustomThink

function SWEP:DoCustomThink()
end

Just a blank function called on think in the Draconic SWEP Base. It is included for people who may need to add some custom calls to their SWEPs. In your weapon's lua/shared lua simply add the above code to utilize this.


DoCustomInitialize

function SWEP:DoCustomInitialize()
end

Pretty much the same thing as above, but for the SWEP:Initialize() function.


Miscellaneous Settings

Here you can find the settings/functions for a few minor things that aren't set in the example SWEPs which can be utilized.


Health Regeneration

SWEP.HealthRegen 			= false
SWEP.HealAmount				= 1
SWEP.HealInterval			= 1
  • SWEP.HealthRegen // Whether or not this weapon, while equipped, should regenerate the user's health per interval.
  • SWEP.HealAmount // How much health should be regenerated per interval
  • SWEP.HealInterval // How often (in seconds) should the user be healed.

Taunt Sounds

SWEP.TauntCooldown = 1
SWEP.TauntSounds = {"Zombie.Idle"}
  • SWEP.TauntCooldown // How long (in seconds) between each taunt
  • SWEP.TauntSounds // Table of sounds to pick from at random when doing a taunt.

By default this feature is nil, and will not do anything on any sweps.


Remove Fall Damage

SWEP.FallDamage				= true
SWEP.NoFallDamageCrouchOnly = true
  • SWEP.FallDamage // whether or not the user takes fall damage. False = no fall damage. True = takes fall damage.
  • SWEP.FallDamageCrouchOnly // if SWEP.FallDamage == true, then should only do fall damage when NOT crouching. E.g. crouching will stop fall damage, but standing will result in fall damage still being taken.

(This feature might be buggy.)


Idle Loop Sound

SWEP.WeaponIdleLoopSound 	= ("your/sound/here.wav")
Clone this wiki locally