Weapon Documentation

This page will serve as documentation for certain functions that can be used/overrided by weapons. For generic documentation, check the WeaponDocumentation.lua file in the project.

OnDamage
OnDamage is used to change what happens when the player takes damage. This function needs to be overloaded by the weapon, and looks like this: function Weapon:OnDamage(event) --Code goes here return event end The event that gets passed in is the same event that is passed to the player when they take damage. For instance, event.Damage is the amount of damage the player is going to take, and event.Knockback is a vector of the knockback the player will take. The fields of the event can be modified, and the event is returned from the function so the new values will be read by the player.