-
Notifications
You must be signed in to change notification settings - Fork 1
Miscellaneous Settings & Functions
Vuthakral edited this page Aug 28, 2019
·
2 revisions
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.
function SWEP:DoCustomInitialize()
end
Pretty much the same thing as above, but for the SWEP:Initialize() function.
Here you can find the settings/functions for a few minor things that aren't set in the example SWEPs which can be utilized.
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.
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.
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.)
SWEP.WeaponIdleLoopSound = ("your/sound/here.wav")
- SWEP.WeaponIdleLoopSound // Can be either a soundscript sound, or a direct sound. The sound must have audio cues set up to loop.