Hooks - IcyStarFrost/Lambda-Players GitHub Wiki
Introduction
Here you will find every hook you can use with hook.Add()
to extend upon any of Lambda's Features
Hooks
LambdaShowNameDisplay( Entity lambda )
$\textsf{\normalsize Client-Side}$
Called when the Local Player hovers over a Lambda to show their name display. Return false to prevent the default name display from rendering
LambdaOnProfileApplied( Entity lambda, Table profileinfo )
$\textsf{\normalsize Server-Side}$
Called when a Lambda Profile is applied onto a Lambda Player.
See function :ExportLambdaInfo()
for profileinfo table structure
LambdaOnStartTyping( Entity lambda, String text, String texttype )
$\textsf{\normalsize Server-Side}$
Called when a Lambda Player is about to type a message. Return a string to override the text
$\textsf{\Largeⓘ\kern{0.2cm}\normalsize Note}$ This is only called when a Lambda Player naturally types a message and not by external means.
LambdaPlayerSay( Entity lambda, String text, Bool teamOnly )
$\textsf{\normalsize Server-Side}$
Called when a Lambda Players sends a message in Text Chat. Return "" to block the message or return a non empty string to replace the text
LambdaGetDisplayColor( Entity lambda, Player ply )
$\textsf{\normalsize Must be Shared!}$
ply is the Player we are getting the Color for
Called when the addon wants to get the Display Color for a specific Lambda Player. Return a Color()
to be used as a override
LambdaOnRealPlayerEndVoice( Player ply )
$\textsf{\normalsize Server-Side}$
Called when a Real Player stops talking in voice chat
LambdaOnDataUpdate
$\textsf{\normalsize Server-Side}$
Called when Lambda's data has been updated via console command
LambdaOnToolUse( Entity lambda, String toolname )
$\textsf{\normalsize Server-Side}$
Called when a Lambda is about to use a tool gun tool. Return true to block the tool from being used
LambdaOnUseBuildFunction( Entity lambda, String buildfuncname )
$\textsf{\normalsize Server-Side}$
Called when a Lambda is about to use a building function such as spawning a prop. Return true to block the function from being used
Lambda Player Addon Hooks
The hooks below can be used to add onto certain features of the lambdas
LambdaOnKilled( Entity lambda, CTakeDamageInfo info, Bool isSilent )
$\textsf{\normalsize Server-Side}$
isSilent is when Lambda dies without creating a ragdoll, weapon prop, killfeed and making a death sound
Called after the LambdaOnPreKilled
hook when a Lambda Player is killed. This hook can be used to add onto the ENT:OnKilled() hook each Lambda Player has
LambdaOnPreKilled( Entity lambda, CTakeDamageInfo info, Bool isSilent )
$\textsf{\normalsize Server-Side}$
isSilent is when Lambda dies without creating a ragdoll, weapon prop, killfeed and making a death sound
Called before the LambdaOnKilled
hook when a Lambda Player is killed. Returning true will prevent Lambda from dying
LambdaOnInjured( Entity lambda, CTakeDamageInfo info )
$\textsf{\normalsize Server-Side}$
Called when a Lambda Player takes damage. Return true to completely block damage.
LambdaOnOtherKilled( Entity lambda, Entity victim, CTakeDamageInfo info )
$\textsf{\normalsize Server-Side}$
Called when someone that is not the Lambda Player dies. This hook can be used to add onto the ENT:OnOtherKilled() hook each Lambda Player has
LambdaOnOtherInjured( Entity lambda, Entity victim, CTakeDamageInfo info, Bool tookdamage )
$\textsf{\normalsize Server-Side}$
Called when someone that is not the Lambda Player takes damage.
LambdaOnThink( Entity lambda, Entity lambdaWeaponEntity, Bool isDead )
$\textsf{\normalsize Server-Side and Client-Side}$
Called when a Lambda's ENT:Think() hook runs. This hook can be used to add onto the ENT:Think() hook each Lambda Player has
LambdaOnInitialize( Entity lambda, Entity lambdaWeaponEntity )
$\textsf{\normalsize Server-Side and Client-Side}$
Called when a Lambda Player initializes. This hook can be used to add onto the ENT:Initialize() hook each Lambda Player has
LambdaAIInitialize( Entity lambda )
$\textsf{\normalsize Server-Side}$
This is called by the ENT:RunBehaviour()
hook
Called when a Lambda Player's AI Initializes and begins to run their states. Called after LambdaOnInitialize
LambdaOnStuck( Entity lambda, Number stucktimes )
$\textsf{\normalsize Server-Side}$
stucktimes is a variable that holds how many times the Lambda Player got stuck within the last 10 seconds + now
Called when a Lambda Player gets stuck. This hook can be used to make a custom unstuck function. Return "stop" to make the Lambda Player give up in their path or return "continue" to make the Lambda Player continue down their path
LambdaOnNoclip( Entity lambda, Bool DesiredState )
$\textsf{\normalsize Server-Side}$
Called when a Lambda Player wants to change their NoClip state. If DesiredState = true, the Lambda Player wants to noclip. If false, the Lambda Player wants to exit noclip. Return true to completely block the event
LambdaOnRemove( Entity lambda )
$\textsf{\normalsize Server-Side and Client-Side}$
Called when a Lambda Player is removed from the game.
LambdaCanTarget( Entity Lambda, Entity Target )
$\textsf{\normalsize Server-Side}$
Called when a Lambda Player wants to know if they can attack someone. Return true to make them not attack the target
LambdaCanSwitchWeapon( Entity lambda, String weaponclass, Table weapondata )
$\textsf{\normalsize Server-Side}$
Called when a Lambda Player wants to switch to a certain weapon. Return true to prevent them from switching to the provided weaponclass.
$\textsf{\Largeⓘ\kern{0.2cm}\normalsize Note}$ This is only called by
:SwitchToRandomWeapon()
and:SwitchToLethalWeapon()
LambdaOnBeginMove( Entity lambda, Vector goalposition, Bool isonnavmesh )
$\textsf{\normalsize Server-Side}$
Called when a Lambda Player starts moving to a position
LambdaOnLandOnGround( Entity lambda, Entity ent )
$\textsf{\normalsize Server-Side}$
ent is the entity we landed on
Called when a Lambda Player lands on the ground
LambdaOnLeaveGround( Entity lambda, Entity ent )
$\textsf{\normalsize Server-Side}$
ent is the entity the Lambda "jumped" from
Called when a Lambda Player leaves the ground
LambdaPreRecreated( Entity lambda )
$\textsf{\normalsize Server-Side}$
Called before a Lambda Player is gonna be removed and recreated. Return true to prevent a copy of the lambda from spawning. Called before LambdaPostRecreated
LambdaPostRecreated( Entity newlambda )
$\textsf{\normalsize Server-Side}$
Called after a Lambda Player is recreated. Called after LambdaPreRecreated
LambdaFootStep( Entity lambda, Vector steppos, Number mattype )
$\textsf{\normalsize Server-Side}$
for mattype, see https://wiki.facepunch.com/gmod/Enums/MAT
Called before a Lambda Player plays their footstep sound. Return true to block the default footstep sounds
LambdaOnRespawn( Entity lambda )
$\textsf{\normalsize Server-Side}$
Called when a Lambda player respawns
LambdaOnPickupEnt( Entity lambda, Entity pickupent )
$\textsf{\normalsize Server-Side}$
Called when a Lambda picks up a entity such as picking up a medkit and healing or picking up a armor battery and gaining armor
LambdaOnSwitchWeapon( Entity lambda, Entity wepent, Table weapondata )
$\textsf{\normalsize Server-Side}$
Called when a Lambda switches to a new weapon
LambdaOnAttackTarget( Entity lambda, Entity target )
$\textsf{\normalsize Server-Side}$
Called when a Lambda begins to attack someone. Return true to prevent Lambda from attacking
LambdaOnJump( Entity lambda )
$\textsf{\normalsize Server-Side}$
Called when a Lambda is attempting to jump. Return true to prevent Lambda from jumping
LambdaOnChangeState( Entity lambda, String oldState, String newState )
$\textsf{\normalsize Server-Side}$
oldState is a state Lambda is currently in; newState is a state Lambda is changing to
Called when a Lambda is trying to change its state. Return true to prevent Lambda from changing state