Skip to main content

VScript API

IMPORTANT

VScript is currently discontinued and all progress on it has been halted. This documentation is provided as-is and may not be accurate.

⚠️ The current state of VScript ⚠️

As of the mirage update, VScript is intentionally disabled by Valve. This means that the lua runtime is no longer available in the base game. While there are patches that re-enable VScript, we do not recommend using them as they might stop working at any point in time. Valve has been working on a new scripting system (Pulse) for a while now, but it is not yet1 available to the public.

Class Methods

CBaseEntity

FunctionSignatureDescription
AddEffectsvoid AddEffects( int nFlags )Adds the render effect flag.
ApplyAbsVelocityImpulsevoid ApplyAbsVelocityImpulse( Vector vecImpulse )Apply a Velocity Impulse
ApplyLocalAngularVelocityImpulsevoid ApplyLocalAngularVelocityImpulse( Vector angImpulse )Apply an Ang Velocity Impulse
Attribute_GetFloatValuefloat Attribute_GetFloatValue( string pName, float flDefault )Get float value for an entity attribute.
Attribute_GetIntValueint Attribute_GetIntValue( string pName, int nDefault )Get int value for an entity attribute.
Attribute_SetFloatValuevoid Attribute_SetFloatValue( string pName, float flValue )Set float value for an entity attribute.
Attribute_SetIntValuevoid Attribute_SetIntValue( string pName, int nValue )Set int value for an entity attribute.
DeleteAttributevoid DeleteAttribute( string pName )Delete an entity attribute.
EmitSoundvoid EmitSound( string soundname )Plays a sound from this entity.
EmitSoundParamsvoid EmitSoundParams( string soundname, int nPitch, float flVolume, float flDelay )Plays/modifies a sound from this entity. changes sound if nPitch and/or flVol or flSoundTime is > 0.
EyeAnglesQAngle EyeAngles( )Get the qangles that this entity is looking at.
EyePositionVector EyePosition( )Get vector to eye position - absolute coords.
FirstMoveChildhandle FirstMoveChild( )If in hierarchy, get the first move child
FollowEntityvoid FollowEntity( handle hEnt, bool bBoneMerge )hEntity to follow, bool bBoneMerge
FollowEntityMergevoid FollowEntityMerge( handle hEnt, string pszBoneOrAttachName )hEntity to follow, string BoneOrAttachName
GatherCriteriavoid GatherCriteria( handle hResult )Returns a table containing the criteria that would be used for response queries on this entity. This is the same as the table that is passed to response rule script function callbacks.
GetAbsOriginVector GetAbsOrigin( )Returns the world space origin of the entity
GetAbsScalefloat GetAbsScale( )Get the absolute entity scale
GetAnglesQAngle GetAngles( )Get the entity pitch, yaw, roll as QAngle
GetAnglesAsVectorVector GetAnglesAsVector( )Get entity pitch, yaw, roll as a Vector.
GetAngularVelocityVector GetAngularVelocity( )Get the local angular velocity - returns a Vector of pitch,yaw,roll
GetBaseVelocityVector GetBaseVelocity( )Get Base? velocity.
GetBoundingMaxsVector GetBoundingMaxs( )Get a vector containing max bounds, centered on object.
GetBoundingMinsVector GetBoundingMins( )Get a vector containing min bounds, centered on object.
GetBoundstable GetBounds( )Get a table containing the 'Mins' & 'Maxs' vector bounds, centered on object.
GetCenterVector GetCenter( )Get vector to center of object - absolute coords
GetChildrenhandle GetChildren( )Get the entities parented to this entity.
GetContexttable GetContext( string name )Looks up a context and returns it if available. May return string, float, or null (if the context isn't found).
GetForwardVectorVector GetForwardVector( )Get the forward vector of the entity.
GetHealthint GetHealth( )Get the health of this entity.
GetLeftVectorVector GetLeftVector( )Get the left vector of the entity.
GetLocalAnglesQAngle GetLocalAngles( )Get entity local pitch, yaw, roll as a QAngle
GetLocalAngularVelocityQAngle GetLocalAngularVelocity( )Maybe local angvel
GetLocalOriginVector GetLocalOrigin( )Get entity local origin as a Vector
GetLocalScalefloat GetLocalScale( )Get the entity scale relative to that of its parent
GetLocalVelocityVector GetLocalVelocity( )Get Entity relative velocity.
GetMassfloat GetMass( )Get the mass of an entity. (returns 0 if it doesn't have a physics object)
GetMaxHealthint GetMaxHealth( )Get the maximum health of this entity.
GetModelNamestring GetModelName( )Returns the name of the model.
GetMoveParenthandle GetMoveParent( )If in hierarchy, retrieves the entity's parent.
GetOriginVector GetOrigin( )Returns this entity's local origin
GetOwnerhandle GetOwner( )Gets this entity's owner
GetOwnerEntityhandle GetOwnerEntity( )Get the owner entity, if there is one
GetRightVectorVector GetRightVector( )Get the right vector of the entity. WARNING: This produces a left-handed coordinate system. Use GetLeftVector instead (which is aligned with the y axis of the entity).
GetRootMoveParenthandle GetRootMoveParent( )If in hierarchy, walks up the hierarchy to find the root parent.
GetSoundDurationfloat GetSoundDuration( string soundname, string actormodel )Returns float duration of the sound. Takes soundname and optional actormodelname.
GetSpawnGroupHandleint GetSpawnGroupHandle( )Returns the spawn group handle of this entity
GetTeamint GetTeam( )Get the team number of this entity.
GetTeamNumberint GetTeamNumber( )Get the team number of this entity.
GetUpVectorVector GetUpVector( )Get the up vector of the entity.
GetVelocityVector GetVelocity( )World space velocity of the entity
HasAttributebool HasAttribute( string pName )See if an entity has a particular attribute.
IsAlivebool IsAlive( )Is this entity alive?
IsNPCbool IsNPC( )Is this entity an CAI_BaseNPC?
IsPlayerControllerbool IsPlayerController( )Is this entity a player controller?
IsPlayerPawnbool IsPlayerPawn( )Is this entity a player pawn?
Killvoid Kill( )Deletes the entity (UTIL_Remove()). If run on a player, this will kick them from the server
NextMovePeerhandle NextMovePeer( )Return the next entity in the same movement hierarchy
OverrideFrictionvoid OverrideFriction( float duration, float friction )Takes duration, value for a temporary override.
PrecacheScriptSoundvoid PrecacheScriptSound( string soundname )Precache a sound for later playing.
RemoveEffectsvoid RemoveEffects( int nFlags )Removes the render effect flag.
SetAbsAnglesvoid SetAbsAngles( float fPitch, float fYaw, float fRoll )Set entity pitch, yaw, roll by component.
SetAbsOriginvoid SetAbsOrigin( Vector origin )Sets the world space entity origin
SetAbsScalevoid SetAbsScale( float flScale )Set the absolute scale of the entity
SetAnglesvoid SetAngles( float fPitch, float fYaw, float fRoll )Set entity pitch, yaw, roll by component.
SetAngularVelocityvoid SetAngularVelocity( float pitchVel, float yawVel, float rollVel )Set the local angular velocity - takes float pitch,yaw,roll velocities
SetConstraintvoid SetConstraint( Vector vPos )Set the position of the constraint.
SetContextvoid SetContext( string pName, string pValue, float duration )Store any key/value pair in this entity's dialog contexts. Value must be a string. Will last for duration (set 0 to mean 'forever').
SetContextNumvoid SetContextNum( string pName, float fValue, float duration )Store any key/value pair in this entity's dialog contexts. Value must be a number (int or float). Will last for duration (set 0 to mean 'forever').
SetContextThinkvoid SetContextThink( string pszContextName, handle hThinkFunc, float flInterval )Set a think function on this entity.
SetEntityNamevoid SetEntityName( string pName )Set the targetname of an entity.
SetForwardVectorvoid SetForwardVector( Vector v )Set the orientation of the entity to have this forward vector.
SetFrictionvoid SetFriction( float flFriction )Set PLAYER friction, ignored for objects.
SetGravityvoid SetGravity( float flGravity )Set PLAYER gravity, ignored for objects.
SetHealthvoid SetHealth( int nHealth )Set the health of this entity.
SetLocalAnglesvoid SetLocalAngles( float fPitch, float fYaw, float fRoll )Set entity local pitch, yaw, roll by component
SetLocalOriginvoid SetLocalOrigin( Vector origin )Set entity local origin from a Vector
SetLocalScalevoid SetLocalScale( float flScale )Set the entity scale relative to the entity's parent
SetMassvoid SetMass( float flMass )Set the mass of an entity. (does nothing if it doesn't have a physics object)
SetMaxHealthvoid SetMaxHealth( int amt )Set the maximum health of this entity.
SetOriginvoid SetOrigin( Vector v )Set entity absolute origin
SetOwnervoid SetOwner( handle pOwner )Sets this entity's owner
SetParentvoid SetParent( handle hParent, string pAttachmentname )Set the parent for this entity.
SetTeamvoid SetTeam( int iTeamNum )Set entity team. If run on a live player, this will set their health to 0
SetVelocityvoid SetVelocity( Vector vecVelocity )Sets the world space velocity of the entity
StopSoundvoid StopSound( string soundname )Stops a named sound playing from this entity.
TakeDamageint TakeDamage( handle hInfo )Apply damage to this entity. Use CreateDamageInfo() to create a damageinfo object.
TransformPointEntityToWorldVector TransformPointEntityToWorld( Vector vPoint )Returns the input Vector transformed from entity to world space
TransformPointWorldToEntityVector TransformPointWorldToEntity( Vector vPoint )Returns the input Vector transformed from world to entity space
Triggervoid Trigger( )Fires off this entity's OnTrigger responses.
ValidatePrivateScriptScopevoid ValidatePrivateScriptScope( )Validates the private script scope and creates it if one doesn't exist.

CBaseEntity Hooks

Adding a function with this signature to the entity script causes it to be called from code at the appropriate moment.

FunctionSignatureDescription
Activatevoid Activate( int activateType )Called on Activate, after the entity has spawned. If the entity is spawned on map load, Activate is called after all entities have spawned. The activateType parameter contains an enumeration.
OnBreakvoid OnBreak( handle inflictor )Called when a breakable entity is broken
OnEntTextstring OnEntText( )Called every frame when ent_text is enabled on the entity. Return a string to be added to the ent_text printout
OnTakeDamagevoid OnTakeDamage( table damageTable )Called when the entity takes damage. Table format: {inflictor = handle, damage_direction = Vector, damage_position = Vector, damage_force = Vector, damage = int, attacker = handle}
Precachevoid Precache( CScriptPrecacheContext context )Called when the entity is precached. Used to precache any additional resources needed by the script using the global Precache family of script functions
Spawnvoid Spawn( CScriptKeyValues spawnkeys)Called on Spawn, just after the entity has been created, but before it has been initialized. Passes a CScriptKeyValues handle that can be used to query the entity spawn keyvalues.
UpdateOnRemovevoid UpdateOnRemove()Called before the entity is killed

CBaseAnimGraph

FunctionSignatureDescription
GetGraphParametertable GetGraphParameter( string pszParam )Get the value of the given animGraph parameter
SetGraphLookTargetvoid SetGraphLookTarget( Vector vValue )Pass the desired look target in world space to the graph
SetGraphParametervoid SetGraphParameter( string pszParam, table svArg )Set the specific param value, type is inferred from the type in script
SetGraphParameterBoolvoid SetGraphParameterBool( string szName, bool bValue )Set the specific param on or off
SetGraphParameterEnumvoid SetGraphParameterEnum( string szName, int nValue )Pass the enum (int) value to the specified param
SetGraphParameterFloatvoid SetGraphParameterFloat( string szName, float flValue )Pass the float value to the specified param
SetGraphParameterIntvoid SetGraphParameterInt( string szName, int nValue )Pass the int value to the specified param
SetGraphParameterVectorvoid SetGraphParameterVector( string szName, Vector vValue )Pass the vector value to the specified param in the graph

CBaseFlex

FunctionSignatureDescription
GetCurrentScenehandle GetCurrentScene( )Returns the instance of the oldest active scene entity (if any).
GetSceneByIndexhandle GetSceneByIndex( int index )Returns the instance of the scene entity at the specified index.
ScriptPlayScenefloat ScriptPlayScene( string pszScene, float flDelay )Play specified vcd file

CBaseModelEntity

FunctionSignatureDescription
GetAttachmentAnglesVector GetAttachmentAngles( int iAttachment )Get the attachment id's angles as a p,y,r vector.
GetAttachmentForwardVector GetAttachmentForward( int iAttachment )Get the attachment id's forward vector.
GetAttachmentOriginVector GetAttachmentOrigin( int iAttachment )Get the attachment id's origin vector.
GetMaterialGroupHashunsigned GetMaterialGroupHash( )Get the material group hash of this entity.
GetMaterialGroupMaskuint64 GetMaterialGroupMask( )Get the mesh group mask of this entity.
GetModelScalefloat GetModelScale( )Get scale of entity's model.
GetRenderAlphaint GetRenderAlpha( )Get the alpha modulation of this entity.
GetRenderColorVector GetRenderColor( )Get the render color of the entity.
ScriptLookupAttachmentint ScriptLookupAttachment( string pAttachmentName )Get the named attachment id.
SetBodygroupvoid SetBodygroup( int iGroup, int iValue )Sets a bodygroup.
SetBodygroupByNamevoid SetBodygroupByName( string pName, int iValue )Sets a bodygroup by name.
SetLightGroupvoid SetLightGroup( string pLightGroup )Sets the light group of the entity.
SetMaterialGroupvoid SetMaterialGroup( string pMaterialGroup )Set the material group of this entity.
SetMaterialGroupHashvoid SetMaterialGroupHash( unsigned nHash )Set the material group hash of this entity.
SetMaterialGroupMaskvoid SetMaterialGroupMask( uint64 nMeshGroupMask )Set the mesh group mask of this entity.
SetModelvoid SetModel( string pModelName )Changes the model of the entity. Make sure the new model is precached before using
SetModelScalevoid SetModelScale( float flScale )Set scale of entity's model.
SetRenderAlphavoid SetRenderAlpha( int nAlpha )Set the alpha modulation of this entity.
SetRenderColorvoid SetRenderColor( int r, int g, int b )Sets the render color of the entity.
SetRenderModevoid SetRenderMode( int nMode )Sets the render mode of the entity.
SetSingleMeshGroupvoid SetSingleMeshGroup( string pMeshGroupName )Set a single mesh group for this entity.
SetSizevoid SetSize( Vector mins, Vector maxs )
SetSkinvoid SetSkin( int iSkin )Set skin

CBasePlayerController

FunctionSignatureDescription
GetPawnhandle GetPawn( )Returns the pawn for this controller

CBasePlayerPawn

FunctionSignatureDescription
GetControllerhandle GetController( )Returns the controller for this pawn
GetEquippedWeaponstable GetEquippedWeapons( )Returns an array of all the equipped weapons
GetWeaponCountint GetWeaponCount( )Gets the number of weapons currently equipped
IsNoclippingbool IsNoclipping( )Returns true if the player is in noclip mode.

CBaseTrigger

FunctionSignatureDescription
Disablevoid Disable( )Disable's the trigger
Enablevoid Enable( )Enable the trigger
IsTouchingbool IsTouching( handle entity )Checks whether the passed entity is touching the trigger.

CBodyComponent

FunctionSignatureDescription
AddImpulseAtPositionvoid AddImpulseAtPosition( Vector Vector_1, Vector Vector_2 )Apply an impulse at a worldspace position to the physics
AddVelocityvoid AddVelocity( Vector linearVelocity, Vector angVelocity )Add linear and angular velocity to the physics object
DetachFromParentvoid DetachFromParent( )Detach from its parent
GetSequenceint GetSequence( )Returns the active sequence
IsAttachedToParentbool IsAttachedToParent( )Is attached to parent
LookupSequenceint LookupSequence( string name )Returns a sequence id given a name
SequenceDurationfloat SequenceDuration( string pSequenceName )Returns the duration in seconds of the specified sequence
SetAngularVelocityvoid SetAngularVelocity( Vector angVelocity )
SetMaterialGroupvoid SetMaterialGroup( utlstringtoken pMaterialGroup )
SetVelocityvoid SetVelocity( Vector velocity )

CCustomGameEventManager

FunctionSignatureDescription
RegisterListenerint RegisterListener( string EventName, function CallbackFunction )Register a callback to be called when a particular custom event arrives. Returns a listener ID that can be used to unregister later.
Send_ServerToAllClientsvoid Send_ServerToAllClients( string EventName, table EventData )
Send_ServerToPlayervoid Send_ServerToPlayer( handle player, string EventName, table EventData )
Send_ServerToTeamvoid Send_ServerToTeam( int TeamNumber, string EventName, table EventData )
UnregisterListenervoid UnregisterListener( int ListnerID )Unregister a specific listener

CDebugOverlayScriptHelper

FunctionSignatureDescription
Axisvoid Axis( Vector Vector_1, Quaternion Quaternion_2, float float_3, bool bool_4, float float_5 )Draws an axis. Specify origin + orientation in world space.
Boxvoid Box( Vector Vector_1, Vector Vector_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8 )Draws a world-space axis-aligned box. Specify bounds in world space.
BoxAnglesvoid BoxAngles( Vector Vector_1, Vector Vector_2, Vector Vector_3, Quaternion Quaternion_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10 )Draws an oriented box at the origin. Specify bounds in local space.
Capsulevoid Capsule( Vector Vector_1, Quaternion Quaternion_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10 )Draws a capsule. Specify base in world space.
Circlevoid Circle( Vector Vector_1, Quaternion Quaternion_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9 )Draws a circle. Specify center in world space.
CircleScreenOrientedvoid CircleScreenOriented( Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8 )Draws a circle oriented to the screen. Specify center in world space.
Conevoid Cone( Vector Vector_1, Vector Vector_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10 )Draws a wireframe cone. Specify endpoint and direction in world space.
Crossvoid Cross( Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8 )Draws a screen-aligned cross. Specify origin in world space.
Cross3Dvoid Cross3D( Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8 )Draws a world-aligned cross. Specify origin in world space.
Cross3DOrientedvoid Cross3DOriented( Vector Vector_1, Quaternion Quaternion_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9 )Draws an oriented cross. Specify origin in world space.
DrawTickMarkedLinevoid DrawTickMarkedLine( Vector Vector_1, Vector Vector_2, float float_3, int int_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10 )Draws a dashed line. Specify endpoints in world space.
EntityAttachmentsvoid EntityAttachments( ehandle ehandle_1, float float_2, float float_3 )Draws the attachments of the entity
EntityAxisvoid EntityAxis( ehandle ehandle_1, float float_2, bool bool_3, float float_4 )Draws the axis of the entity origin
EntityBoundsvoid EntityBounds( ehandle ehandle_1, int int_2, int int_3, int int_4, int int_5, bool bool_6, float float_7 )Draws bounds of an entity
EntitySkeletonvoid EntitySkeleton( ehandle ehandle_1, float float_2 )Draws the skeleton of the entity
EntityTextvoid EntityText( ehandle ehandle_1, int int_2, string string_3, int int_4, int int_5, int int_6, int int_7, float float_8 )Draws text on an entity
FilledRect2Dvoid FilledRect2D( Vector2D Vector2D_1, Vector2D Vector2D_2, int int_3, int int_4, int int_5, int int_6, float float_7 )Draws a screen-space filled 2D rectangle. Coordinates are in pixels.
HorzArrowvoid HorzArrow( Vector Vector_1, Vector Vector_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9 )Draws a horizontal arrow. Specify endpoints in world space.
Linevoid Line( Vector Vector_1, Vector Vector_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8 )Draws a line between two points
Line2Dvoid Line2D( Vector2D Vector2D_1, Vector2D Vector2D_2, int int_3, int int_4, int int_5, int int_6, float float_7 )Draws a line between two points in screenspace
PopDebugOverlayScopevoid PopDebugOverlayScope( )Pops the identifier used to group overlays. Overlays marked with this identifier can be deleted in a big batch.
PushAndClearDebugOverlayScopevoid PushAndClearDebugOverlayScope( utlstringtoken utlstringtoken_1 )Pushes an identifier used to group overlays. Deletes all existing overlays using this overlay id.
PushDebugOverlayScopevoid PushDebugOverlayScope( utlstringtoken utlstringtoken_1 )Pushes an identifier used to group overlays. Overlays marked with this identifier can be deleted in a big batch.
RemoveAllInScopevoid RemoveAllInScope( utlstringtoken utlstringtoken_1 )Removes all overlays marked with a specific identifier, regardless of their lifetime.
SolidConevoid SolidCone( Vector Vector_1, Vector Vector_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10 )Draws a solid cone. Specify endpoint and direction in world space.
Spherevoid Sphere( Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8 )Draws a wireframe sphere. Specify center in world space.
SweptBoxvoid SweptBox( Vector Vector_1, Vector Vector_2, Vector Vector_3, Vector Vector_4, Quaternion Quaternion_5, int int_6, int int_7, int int_8, int int_9, float float_10 )Draws a swept box. Specify endpoints in world space and the bounds in local space.
Textvoid Text( Vector Vector_1, int int_2, string string_3, float float_4, int int_5, int int_6, int int_7, int int_8, float float_9 )Draws 2D text. Specify origin in world space.
Texturevoid Texture( string string_1, Vector2D Vector2D_2, Vector2D Vector2D_3, int int_4, int int_5, int int_6, int int_7, Vector2D Vector2D_8, Vector2D Vector2D_9, float float_10 )Draws a screen-space texture. Coordinates are in pixels.
Trianglevoid Triangle( Vector Vector_1, Vector Vector_2, Vector Vector_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9 )Draws a filled triangle. Specify vertices in world space.
VectorText3Dvoid VectorText3D( Vector Vector_1, Quaternion Quaternion_2, string string_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9 )Draws 3D text. Specify origin + orientation in world space.
VertArrowvoid VertArrow( Vector Vector_1, Vector Vector_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9 )Draws a vertical arrow. Specify endpoints in world space.
YawArrowvoid YawArrow( Vector Vector_1, float float_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10 )Draws a arrow associated with a specific yaw. Specify endpoints in world space.

CEntities

FunctionSignatureDescription
CreateByClassnamehandle CreateByClassname( string classname )Creates an entity by classname
FindAllByClassnametable FindAllByClassname( string classname )Finds all entities by class name. Returns an array containing all the found entities.
FindAllByClassnameWithintable FindAllByClassnameWithin( string classname, Vector origin, float radius )Find entities by class name within a radius.
FindAllByModeltable FindAllByModel( string modelName )Find entities by model name.
FindAllByNametable FindAllByName( string targetname )Find all entities by name. Returns an array containing all the found entities in it.
FindAllByNameWithintable FindAllByNameWithin( string targetname, Vector origin, float radius )Find entities by name within a radius.
FindAllByTargettable FindAllByTarget( string targetname )Find entities by targetname.
FindAllInSpheretable FindAllInSphere( Vector origin, float radius )Find entities within a radius.
FindByClassnamehandle FindByClassname( handle startFrom, string classname )Find entities by class name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByClassnameNearesthandle FindByClassnameNearest( string classname, Vector origin, float maxRadius )Find entities by class name nearest to a point.
FindByClassnameWithinhandle FindByClassnameWithin( handle startFrom, string classname, Vector origin, float radius )Find entities by class name within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByModelhandle FindByModel( handle startFrom, string modelName )Find entities by model name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByModelWithinhandle FindByModelWithin( handle startFrom, string modelName, Vector origin, float radius )Find entities by model name within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByNamehandle FindByName( handle startFrom, string targetname )Find entities by name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByNameNearesthandle FindByNameNearest( string targetname, Vector origin, float maxRadius )Find entities by name nearest to a point.
FindByNameWithinhandle FindByNameWithin( handle startFrom, string targetname, Vector origin, float radius )Find entities by name within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByTargethandle FindByTarget( handle startFrom, string targetname )Find entities by targetname. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindInSpherehandle FindInSphere( handle startFrom, Vector origin, float radius )Find entities within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
Firsthandle First( )Begin an iteration over the list of entities
GetLocalPlayerControllerhandle GetLocalPlayerController( )Get the local player controller.
GetLocalPlayerPawnhandle GetLocalPlayerPawn( )Get the local player pawn.
Nexthandle Next( handle startFrom )Continue an iteration over the list of entities, providing reference to a previously found entity

CEntityInstance

FunctionSignatureDescription
ConnectOutputvoid ConnectOutput( string output, string functionName )Adds an I/O connection that will call the named function on this entity when the specified output fires.
Destroyvoid Destroy( )
DisconnectOutputvoid DisconnectOutput( string output, string functionName )Removes a connected script function from an I/O event on this entity.
DisconnectRedirectedOutputvoid DisconnectRedirectedOutput( string output, string functionName, handle entity )Removes a connected script function from an I/O event on the passed entity.
FireOutputvoid FireOutput( string outputName, handle activator, handle caller, table parameters, float delay )Fire an entity output
GetClassnamestring GetClassname( )
GetDebugNamestring GetDebugName( )Get the entity name w/help if not defined (i.e. classname/etc)
GetEntityHandleehandle GetEntityHandle( )Get the entity as an EHANDLE
GetEntityIndexint GetEntityIndex( )
GetIntAttrint GetIntAttr( string key )Get Integer Attribute
GetNamestring GetName( )
GetOrCreatePrivateScriptScopehandle GetOrCreatePrivateScriptScope( )Retrieve, creating if necessary, the private per-instance script-side data associated with an entity
GetOrCreatePublicScriptScopehandle GetOrCreatePublicScriptScope( )Retrieve, creating if necessary, the public script-side data associated with an entity
GetPrivateScriptScopehandle GetPrivateScriptScope( )Retrieve the private per-instance script-side data associated with an entity
GetPublicScriptScopehandle GetPublicScriptScope( )Retrieve the public script-side data associated with an entity
RedirectOutputvoid RedirectOutput( string output, string functionName, handle entity )Adds an I/O connection that will call the named function on the passed entity when the specified output fires.
RemoveSelfvoid RemoveSelf( )Delete this entity
SetIntAttrvoid SetIntAttr( string key, int value )Set Integer Attribute
entindexint entindex( )

CEnvEntityMaker

FunctionSignatureDescription
SpawnEntityvoid SpawnEntity( )Create an entity at the location of the maker
SpawnEntityAtEntityOriginvoid SpawnEntityAtEntityOrigin( handle hEntity )Create an entity at the location of a specified entity instance
SpawnEntityAtLocationvoid SpawnEntityAtLocation( Vector vecAlternateOrigin, Vector vecAlternateAngles )Create an entity at a specified location and orientaton, orientation is Euler angle in degrees (pitch, yaw, roll)
SpawnEntityAtNamedEntityOriginvoid SpawnEntityAtNamedEntityOrigin( string pszName )Create an entity at the location of a named entity

CEnvProjectedTexture

FunctionSignatureDescription
SetFarRangevoid SetFarRange( float flRange )Set light maximum range
SetLinearAttenuationvoid SetLinearAttenuation( float flAtten )Set light linear attenuation value
SetNearRangevoid SetNearRange( float flRange )Set light minimum range
SetQuadraticAttenuationvoid SetQuadraticAttenuation( float flAtten )Set light quadratic attenuation value
SetVolumetricsvoid SetVolumetrics( bool bOn, float flIntensity, float flNoise, int nPlanes, float flPlaneOffset )Turn on/off light volumetrics: bool bOn, float flIntensity, float flNoise, int nPlanes, float flPlaneOffset

CHostage

FunctionSignatureDescription
IsBeingCarriedbool IsBeingCarried( )Get whether the hostage is currently being carried or not

CInfoData

FunctionSignatureDescription
QueryColorVector QueryColor( utlstringtoken tok, Vector vDefault )Query color data for this key
QueryFloatfloat QueryFloat( utlstringtoken tok, float flDefault )Query float data for this key
QueryIntint QueryInt( utlstringtoken tok, int nDefault )Query int data for this key
QueryNumberfloat QueryNumber( utlstringtoken tok, float flDefault )Query number data for this key
QueryStringstring QueryString( utlstringtoken tok, string pDefault )Query string data for this key
QueryVectorVector QueryVector( utlstringtoken tok, Vector vDefault )Query vector data for this key

CInfoWorldLayer

FunctionSignatureDescription
HideWorldLayervoid HideWorldLayer( )Hides this layer
ShowWorldLayervoid ShowWorldLayer( )Shows this layer

CLogicRelay

FunctionSignatureDescription
Triggervoid Trigger( handle hActivator, handle hCaller )Triggers the logic_relay

CMarkupVolumeTagged

FunctionSignatureDescription
HasTagbool HasTag( string pszTagName )Returns whether this volume have the given tag.

CNativeOutputs

FunctionSignatureDescription
constructorCNativeOutputs( )Creates a new CNativeOutputs object.
AddOutputvoid AddOutput( string outputName, string description )Add an output
Initvoid Init( int numOutputs )Initialize with number of outputs

CPhysicsProp

FunctionSignatureDescription
DisableMotionvoid DisableMotion( )Disable motion for the prop
EnableMotionvoid EnableMotion( )Enable motion for the prop
SetDynamicVsDynamicContinuousvoid SetDynamicVsDynamicContinuous( bool bIsDynamicVsDynamicContinuousEnabled )Enable/disable dynamic vs dynamic continuous collision traces

CPointClientUIWorldPanel

FunctionSignatureDescription
AcceptUserInputvoid AcceptUserInput( )Tells the panel to accept user input.
AddCSSClassesvoid AddCSSClasses( string pszClasses )Adds CSS class(es) to the panel
IgnoreUserInputvoid IgnoreUserInput( )Tells the panel to ignore user input.
IsGrabbablebool IsGrabbable( )Returns whether this entity is grabbable.
RemoveCSSClassesvoid RemoveCSSClasses( string pszClasses )Remove CSS class(es) from the panel

CPointTemplate

FunctionSignatureDescription
DeleteCreatedSpawnGroupsvoid DeleteCreatedSpawnGroups( )Deletes any spawn groups that this point_template has spawned. Note: The point_template will not be deleted by this.
ForceSpawnvoid ForceSpawn( )Spawns all of the entities the point_template is pointing at.
GetSpawnedEntitieshandle GetSpawnedEntities( )Get the list of the most recent spawned entities
SetSpawnCallbackvoid SetSpawnCallback( handle hCallbackFunc, handle hCallbackScope )SetSpawnCallback( hCallbackFunc, hCallbackScope, hCallbackData ) : Set a callback for when the template spawns entities. The spawned entities will be passed in as an array.

CPointWorldText

FunctionSignatureDescription
SetMessagevoid SetMessage( string pMessage )Set the message on this entity.

CSceneEntity

FunctionSignatureDescription
AddBroadcastTeamTargetvoid AddBroadcastTeamTarget( int team )Adds a team (by index) to the broadcast list
Cancelvoid Cancel( )Cancel scene playback
EstimateLengthfloat EstimateLength( )Returns length of this scene in seconds.
FindCamerahandle FindCamera( )Get the camera
FindNamedEntityhandle FindNamedEntity( string reference )Given an entity reference, such as !target, get actual entity from scene object
IsPausedbool IsPaused( )If this scene is currently paused.
IsPlayingBackbool IsPlayingBack( )If this scene is currently playing.
LoadSceneFromStringbool LoadSceneFromString( string sceneName, string vcd )Given a dummy scene name and a vcd string, load the scene
RemoveBroadcastTeamTargetvoid RemoveBroadcastTeamTarget( int team )Removes a team (by index) from the broadcast list
Startvoid Start( handle activator )Start scene playback, takes activatorEntity as param

CScriptKeyValues

FunctionSignatureDescription
GetValuetable GetValue( string key )Reads a spawn key

CScriptParticleManager

FunctionSignatureDescription
CreateParticleint CreateParticle( string particleName, int particleAttach, handle owningEntity )Creates a new particle effect
CreateParticleForPlayerint CreateParticleForPlayer( string particleName, int particleAttach, handle owningEntity, handle owningPlayer )Creates a new particle effect that only plays for the specified player
DestroyParticlevoid DestroyParticle( int particleID, bool bDestroyImmediately )Destroy a particle, if bDestroyImmediately destroy it without playing end caps.
GetParticleReplacementstring GetParticleReplacement( string string_1, handle handle_2 )
ReleaseParticleIndexvoid ReleaseParticleIndex( int particleId )Frees the specified particle index
SetParticleAlwaysSimulatevoid SetParticleAlwaysSimulate( int int_1 )
SetParticleControlvoid SetParticleControl( int particleId, int controlIndex, Vector controlData )Set the control point data for a control on a particle effect
SetParticleControlEntvoid SetParticleControlEnt( int particleId, int controlIndex, handle entity, ParticleAttachment_t attachType, string attachment, Vector origin, bool bool_7 )Attaches the control point to an entity
SetParticleControlOffsetvoid SetParticleControlOffset( int iIndex, int iPoint, Vector vecOffset )Set the linear offset for a control on a particle effect
SetParticleControlTransformvoid SetParticleControlTransform( int iIndex, int iPoint, Vector vOrigin, QAngle qAngles )Set the transform for a control on a particle effect
SetParticleControlTransformForwardvoid SetParticleControlTransformForward( int iIndex, int iPoint, Vector vOrigin, Vector vecForward )Set the origin and forward direction for a control on a particle effect

CScriptPrecacheContext

FunctionSignatureDescription
AddResourcevoid AddResource( string path )Precaches a specific resource
GetValuetable GetValue( string name )Reads a spawn key

Convars

FunctionSignatureDescription
GetBoolbool GetBool( string name )Returns the convar as a boolean flag.
GetCommandClienthandle GetCommandClient( )Returns the player who issued this console command.
GetFloatfloat GetFloat( string name )Returns the convar as a float. May return null if no such convar.
GetIntint GetInt( string name )Returns the convar as an int. May return null if no such convar.
GetStrstring GetStr( string name )Returns the convar as a string. May return null if no such convar.
RegisterCommandvoid RegisterCommand( string name, handle function, string helpString, int flags )Register a console command.
RegisterConvarvoid RegisterConvar( string name, string defaultValue, string helpString, int flags )Register a new console variable.
SetBoolvoid SetBool( string name, bool val )Sets the value of the convar to the bool.
SetFloatvoid SetFloat( string name, float val )Sets the value of the convar to the float.
SetIntvoid SetInt( string name, int val )Sets the value of the convar to the int.
SetStrvoid SetStr( string name, string val )Sets the value of the convar to the string.

GlobalSys

FunctionSignatureDescription
CommandLineChecktable CommandLineCheck( string name )Returns true if the command line param was used, otherwise false.
CommandLineFloattable CommandLineFloat( string name, float float_2 )Returns the command line param as a float.
CommandLineInttable CommandLineInt( string name, int int_2 )Returns the command line param as an int.
CommandLineStrtable CommandLineStr( string name, string string_2 )Returns the command line param as a string.

SteamInfo

FunctionSignatureDescription
IsPublicUniversebool IsPublicUniverse( )Is the script connected to the public Steam universe

CTakeDamageInfo

DamageInfo handle returned by CreateDamageInfo()

FunctionSignatureDescription
AddDamagevoid AddDamage( float flAddAmount )Add flAddAmount to the damage value
AddDamageTypevoid AddDamageType( int bitsDamageType )Add bitsDamageType to damage types
GetAmmoTypeint GetAmmoType( )Returns the ammo type
GetAttackerhandle GetAttacker( )Returns the attacker's entity
GetDamagefloat GetDamage( )Returns the damage value
GetDamageCustomint GetDamageCustom( )
GetDamageForceVector GetDamageForce( )Returns the directional Vector
GetDamagePositionVector GetDamagePosition( )Returns the position Vector of the damage
GetDamageTypeint GetDamageType( )Returns the damage type
GetInflictorhandle GetInflictor( )Returns the inflictor's entity (usually the weapon)
GetOriginalDamagefloat GetOriginalDamage( )
GetReportedPositionVector GetReportedPosition( )
HasDamageTypebool HasDamageType( int bitsToTest )Returns whether or not bitsToTest exists in the damage type
IsNullbool IsNull( )
ScaleDamagevoid ScaleDamage( float flScaleAmount )Scales the damage value by flScaleAmount
SetAmmoTypevoid SetAmmoType( int iAmmoType )Sets the ammo type to iAmmoType
SetAttackervoid SetAttacker( handle hAttacker )Sets the attacker's entity to hAttacker
SetDamagevoid SetDamage( float flDamage )Sets the damage value to flDamage
SetDamageCustomvoid SetDamageCustom( int iDamageCustom )
SetDamageForcevoid SetDamageForce( Vector damageForce )Sets the directional Vector to damageForce
SetDamagePositionvoid SetDamagePosition( Vector damagePosition )Sets the positional Vector to damagePosition
SetDamageTypevoid SetDamageType( int bitsDamageType )Sets the damage type to bitsDamageType
SetOriginalDamagevoid SetOriginalDamage( float flOriginalDamage )
SetReportedPositionvoid SetReportedPosition( Vector reportedPosition )

QAngle

FunctionSignatureDescription
constructorQAngle( float pitch, float yaw, float roll )Creates a new QAngle
__addQAngle __add( QAngle a, QAngle b )Adds two QAngles together. Overloaded with + operator. Use RotateOrientation() instead to properly rotate angles.
__eqbool __eq( QAngle a, QAngle b )Tests for equality. Overloaded with == operator
__tostringstring __tostring( )Converts the QAngle into a string. Overloaded with .. operator
ForwardVector Forward( )Returns the forward Vector
LeftVector Left( )Returns the left Vector
UpVector Up( )Returns the Up Vector

QAngle Members

VariableDescription
xPitch angle
yYaw angle
zRoll angle

Vector

FunctionSignatureDescription
constructorVector( float x, float y, float z )Creates a new Vector
__addVector __add( Vector a, Vector b )Adds two Vectors together. Overloaded with + operator
__divVector __div( Vector a, Vector b )Divides a by b. Overloaded with / operator
__eqbool __eq( Vector a, Vector b )Tests for equality. Overloaded with == operator
__lenfloat __len( )Returns the length of the Vector. Overloaded with # operator
__mulVector __mul( Vector a, Vector/Scalar b )Multiplies a Vector with scalar or another Vector. Overloaded with * operator
__subVector __sub( Vector a, Vector b )Subtracts b from a. Overloaded with - operator
__tostringstring __tostring( )Converts the Vector into a string. Overloaded with .. operator
__unmVector __unm( )Reverse the Vector. Overloaded with unary -
CrossVector Cross( Vector a, Vector b )Cross product of two vectors
Dotfloat Dot( Vector a, Vector b )Dot product of two vectors
Lengthfloat Length( )Length of the Vector
Length2Dfloat Length2D( )Length of the Vector in the XY plane
LerpVector Lerp( Vector target, float time )Linear interpolation between the vector and the passed in target over time = [0,1]
NormalizedVector Normalized( )Returns the unit Vector

Vector Members

VariableDescription
xX-Axis
yY-Axis
zZ-Axis

Global Functions

Debug

FunctionSignatureDescription
DebugBreakvoid DebugBreak( )Breaks in the debugger
DebugDrawBoxvoid DebugDrawBox( Vector center, Vector mins, Vector maxs, int r, int g, int b, int a, float duration )Draw a debug overlay box
DebugDrawBoxDirectionvoid DebugDrawBoxDirection( Vector center, Vector min, Vector max, Vector forward, Vector vRgb, float a, float duration )Draw a debug forward box
DebugDrawCirclevoid DebugDrawCircle( Vector center, Vector vRgb, float a, float rad, bool ztest, float duration )Draw a debug circle
DebugDrawClearvoid DebugDrawClear( )Try to clear all the debug overlay info
DebugDrawLinevoid DebugDrawLine( Vector origin, Vector target, int r, int g, int b, bool ztest, float duration )Draw a debug overlay line
DebugDrawLine_vColvoid DebugDrawLine_vCol( Vector start, Vector end, Vector vRgb, bool ztest, float duration )Draw a debug line using color vec
DebugDrawScreenTextLinevoid DebugDrawScreenTextLine( float x, float y, int lineOffset, string text, int r, int g, int b, int a, float duration )Draw text with a line offset
DebugDrawSpherevoid DebugDrawSphere( Vector center, Vector vRgb, float a, float rad, bool ztest, float duration )Draw a debug sphere
DebugDrawTextvoid DebugDrawText( Vector origin, string text, bool bViewCheck, float duration )Draw text in 3d
DebugScreenTextPrettyvoid DebugScreenTextPretty( float x, float y, int lineOffset, string text, int r, int g, int b, int a, float duration, string font, int size, bool bBold )Draw pretty debug text
DoScriptAssertvoid DoScriptAssert( bool assertion, string message )Asserts the passed in value. Prints out a message and brings up the assert dialog.

Printing

FunctionSignatureDescription
Msgvoid Msg( string message )Print a message
PrintLinkedConsoleMessagevoid PrintLinkedConsoleMessage( string message, string command )Print a console message with a linked console command
Sayvoid Say( handle entity, string message, bool isTeamOnly )Have Entity say string, and isTeamOnly or not
ScriptPrintMessageCenterAllvoid ScriptPrintMessageCenterAll( string message )Prints an alert message in the center print method to all players.
ScriptPrintMessageCenterAllWithParamsvoid ScriptPrintMessageCenterAllWithParams( string message, string string_2, string string_3, string string_4 )Prints an alert message in the center print method to all players. Needs to pass token/message. param1, param2, param3. Can pass null if you need less than 3.
ScriptPrintMessageCenterTeamvoid ScriptPrintMessageCenterTeam( int team, string message )Prints an alert message in the center print method to the specified team. 0 = None. 1 = Spectators. 2 = Terrorists. 3 = Counter-Terrorists
ScriptPrintMessageChatAllvoid ScriptPrintMessageChatAll( string message )Prints a message in chat to all players.
ScriptPrintMessageChatTeamvoid ScriptPrintMessageChatTeam( int team, string message )Prints a message in chat to the specified team. 0 = None. 1 = Spectators. 2 = Terrorists. 3 = Counter-Terrorists
ShowMessagevoid ShowMessage( string message )Print a hud message on all clients
UTIL_MessageTextvoid UTIL_MessageText( int userID, string message, int r, int g, int b, int a )Sends colored text to one client.
UTIL_MessageTextAllvoid UTIL_MessageTextAll( string message, int r, int g, int b, int a )Sends colored text to all clients.
UTIL_MessageTextAll_WithContextvoid UTIL_MessageTextAll_WithContext( string message, int r, int g, int b, int a, table context )Sends colored text to all clients. (Valid context keys: player_id, value, team_id)
UTIL_MessageText_WithContextvoid UTIL_MessageText_WithContext( int userID, string message, int r, int g, int b, int a, table context )Sends colored text to one client. (Valid context keys: player_id, value, team_id)
UTIL_ResetMessageTextvoid UTIL_ResetMessageText( int userID )Clear all message text on one client.
UTIL_ResetMessageTextAllvoid UTIL_ResetMessageTextAll( )Clear all message text from all clients.
Warningvoid Warning( string warning )Print a warning

Training Course

FunctionSignatureDescription
ScriptGetBestTrainingCourseTimeint ScriptGetBestTrainingCourseTime( )Gets the player's best time for completing the timed course.
ScriptGetPlayerCompletedTrainingbool ScriptGetPlayerCompletedTraining( )Returns true if the player has completed the initial portion of the training map.
ScriptGetValveTrainingCourseTimeint ScriptGetValveTrainingCourseTime( )Gets Valve's best time for completing the timed course.
ScriptHighlightAmmoCountervoid ScriptHighlightAmmoCounter( )Sends an event that is just used by the instructor system to show a hint highlighting the ammo counter.
ScriptSetBestTrainingCourseTimevoid ScriptSetBestTrainingCourseTime( int time )Sets the player's best time for completing the timed course.
ScriptSetMiniScoreHiddenvoid ScriptSetMiniScoreHidden( bool isVisible )Toggles the visibility of the miniscoreboard hud element.
ScriptSetPlayerCompletedTrainingvoid ScriptSetPlayerCompletedTraining( bool isCompleted )Sets whether the player has completed the initial portion of the training map.
ScriptSetRadarHiddenvoid ScriptSetRadarHidden( bool isHidden )Toggles the visibility of the radar hud element.
ScriptShowExitDoorMsgvoid ScriptShowExitDoorMsg( )Shows a message box in trainign when the player exits through the exit door
ScriptShowFinishMsgBoxvoid ScriptShowFinishMsgBox( )Shows a message box to let players know what to do next after finishing the training course.
ScriptTrainingGivePlayerAmmovoid ScriptTrainingGivePlayerAmmo( )Refills ammo to max for all weapons the player has (only works in training).

Co-op Strike

FunctionSignatureDescription
ScriptCoopCollectBonusCoinvoid ScriptCoopCollectBonusCoin( )Marks one of the bonus coins as collected.
ScriptCoopExtendRoundDurationTimevoid ScriptCoopExtendRoundDurationTime( float time )Extends the round time after checkpoint during the mission.
ScriptCoopGiveC4sToCTsvoid ScriptCoopGiveC4sToCTs( int c4Count )Will give the number of specified C4s to all alive CT players.
ScriptCoopMissionGetMissionNumberint ScriptCoopMissionGetMissionNumber( )Gets the mission number for the current map - maps can have multiple missions on them.
ScriptCoopMissionRespawnDeadPlayersvoid ScriptCoopMissionRespawnDeadPlayers( )Respawns players only.
ScriptCoopMissionSetDeadPlayerRespawnEnabledvoid ScriptCoopMissionSetDeadPlayerRespawnEnabled( bool isEnabled )Controls whether player respawns can happen.
ScriptCoopMissionSetNextRespawnInvoid ScriptCoopMissionSetNextRespawnIn( float float_1, bool bool_2 )Set the next respawn wave to happen in this many seconds.
ScriptCoopMissionSpawnFirstEnemiesvoid ScriptCoopMissionSpawnFirstEnemies( int int_1 )Spawns the first wave of enemies in coop.
ScriptCoopMissionSpawnNextWavevoid ScriptCoopMissionSpawnNextWave( int int_1 )Tells the next wave of enemies to spawn in coop. Also respawns player.
ScriptCoopResetRoundStartTimevoid ScriptCoopResetRoundStartTime( )Resets the round time and starts the mission.
ScriptCoopSetBotQuotaAndRefreshSpawnsvoid ScriptCoopSetBotQuotaAndRefreshSpawns( int quota )Sets the bot quota considering the # of players connected and refreshes the spawns.
ScriptCoopToggleEntityOutlineHighlightsvoid ScriptCoopToggleEntityOutlineHighlights( bool isEnabled )Highlights all dropped weapons for players, or removes all highlights.

Premier Mode

FunctionSignatureDescription
ScriptLobbyMapVetoFinishedvoid ScriptLobbyMapVetoFinished( string mapName, bool bool_2, bool bool_3, string string_4 )Switch to the selected map after lobby map veto finished.

Sounds

FunctionSignatureDescription
EmitSoundOnvoid EmitSoundOn( string soundName, handle entity )Play named sound on Entity
EmitSoundOnClientvoid EmitSoundOnClient( string soundName, handle client )Play named sound only on the client for the passed in player
StartSoundEventvoid StartSoundEvent( string soundEvent, handle handle_2 )Start a sound event
StartSoundEventFromPositionvoid StartSoundEventFromPosition( string soundEvent, Vector position )Start a sound event from position
StartSoundEventFromPositionReliablevoid StartSoundEventFromPositionReliable( string soundEvent, Vector position )Start a sound event from position with reliable delivery
StartSoundEventFromPositionUnreliablevoid StartSoundEventFromPositionUnreliable( string soundEvent, Vector position )Start a sound event from position with optional delivery
StartSoundEventReliablevoid StartSoundEventReliable( string soundEvent, handle handle_2 )Start a sound event with reliable delivery
StartSoundEventUnreliablevoid StartSoundEventUnreliable( string soundEvent, handle handle_2 )Start a sound event with optional delivery
StopSoundEventvoid StopSoundEvent( string soundEvent, handle handle_2 )Stops a sound event with optional delivery
StopSoundOnvoid StopSoundOn( string soundName, handle playingEntity )Stop named sound on Entity

Utilities

FunctionSignatureDescription
DeepPrintvoid DeepPrint( debugInstance, string prefix )Print out a class/array/instance/table to the console
DeepStringvoid DeepString( debugInstance, string prefix )Print out a class/array/instance/table to a string
DeepPrintTablevoid DeepPrintTable( debugInstance, string prefix, bool isPublicScriptScope )Print out a table (and subtables) to the console
Deg2Radfloat Deg2Rad( float deg )Convert degrees to radians
Rad2Degfloat Rad2Deg( float rad )Convert radians to degrees
Clampfloat Clamp( float val, float min, float max )Clamp the value between the min and max
Lerpfloat Lerp( float time, float float_1, float float_2 )Linear interpolation of float values over time [0,1]
VectorDistanceSqfloat VectorDistanceSq( Vector Vector_1, Vector Vector_2 )Distance between two vectors squared (faster than calculating the plain distance)
VectorDistancefloat VectorDistance( Vector Vector_1, Vector Vector_2 )Distance between two vectors
VectorLerpVector VectorLerp( float time, Vector Vector_1, Vector Vector_2 )Linear interpolation of vector values over [0,1]. The native function LerpVectors performs the same task
VectorIsZerobool VectorIsZero( Vector Vector_1 )Returns whether the vector is a zero vector or not
RemapValfloat RemapVal( float input, float a, float b, float c, float d )Remap a value in the range [a,b] to [c,d].
RemapValClampedfloat RemapValClamped( float input, float a, float b, float c, float d )Remap a value in the range [a,b] to [c,d], clamping the output to the range.
minfloat min( float x, float y )Returns the smallest value of the inputs
maxfloat max( float x, float y )Returns the largest value of the inputs
absfloat abs( float val )Returns the absolute value of a float
Mergetable Merge( table t1, table t2 )Merges two tables into a third, overwriting any matching keys

Other

FunctionSignatureDescription
AngleDifffloat AngleDiff( float angle_1, float angle_2 )Returns the number of degrees difference between two yaw angles
AnglesToVectorVector AnglesToVector( QAngle QAngle_1 )Generate a vector given a QAngles
AppendToLogFilevoid AppendToLogFile( string string_1, string string_2 )AppendToLogFile is deprecated. Print to the console for logging instead. Appends a string to a log file on the server.
AxisAngleToQuaternionQuaternion AxisAngleToQuaternion( Vector axis, float angle )Constructs a quaternion representing a rotation by angle around the specified vector axis
CalcClosestPointOnEntityOBBVector CalcClosestPointOnEntityOBB( handle entity, Vector position )Compute the closest point on the OBB of an entity.
CalcDistanceBetweenEntityOBBfloat CalcDistanceBetweenEntityOBB( handle entity_1, handle entity_2 )Compute the distance between two entity OBB. A negative return value indicates an input error. A return value of zero indicates that the OBBs are overlapping.
CalcDistanceToLineSegment2Dfloat CalcDistanceToLineSegment2D( Vector P, Vector vLineA, Vector vLineB )Get the closest point from P to the (infinite) line through vLineA and vLineB and calculate the shortest distance from P to the line.
CancelEntityIOEventsvoid CancelEntityIOEvents( ehandle entityEhandle )Create all I/O events for a particular entity
CreateDamageInfohandle CreateDamageInfo( handle hInflictor, handle hAttacker, Vector force, Vector hitPos, float flDamage, int damageTypes )Allocate a damageinfo object, used as an argument to TakeDamage(). Call DestroyDamageInfo( hInfo ) to free the object.
CreateEffectbool CreateEffect( table keys )Pass table - Inputs: entity, effect
CreateSceneEntityhandle CreateSceneEntity( string sceneName )Create a scene entity to play the specified scene.
CreateTriggerhandle CreateTrigger( Vector origin, Vector mins, Vector maxs )Creates and returns an AABB trigger
CreateTriggerRadiusApproximatehandle CreateTriggerRadiusApproximate( Vector origin, float radius )Creates and returns an AABB trigger thats bigger than the radius provided
CreateUniformRandomStreamhandle CreateUniformRandomStream( int iSeed )Creates a separate random number stream.
CrossVectorsVector CrossVectors( Vector Vector_1, Vector Vector_2 )Cross product between two vectors
DestroyDamageInfovoid DestroyDamageInfo( CTakeDamageInfo info )Free a damageinfo object that was created with CreateDamageInfo().
DoEntFirevoid DoEntFire( string target, string input, string parameter, float delay, handle activator, handle caller )#EntFire:Generate and entity i/o event
DoEntFireByInstanceHandlevoid DoEntFireByInstanceHandle( handle target, string input, string parameter, float delay, handle activator, handle caller )Generate and entity i/o event
DoIncludeScriptbool DoIncludeScript( string scriptFileName, handle scope )Execute a script (internal)
DoUniqueStringstring DoUniqueString( string root )Generate a string guaranteed to be unique across the life of the script VM, with an optional root string. Useful for adding data to tables when not sure what keys are already in use in that table.
EntIndexToHScripthandle EntIndexToHScript( int entIndex )Turn an entity index integer to an HScript representing that entity's script instance.
ExponentialDecayfloat ExponentialDecay( float decayTo, float decayTime, float dt )Smooth curve decreasing slower as it approaches zero
FireEntityIOInputNameOnlyvoid FireEntityIOInputNameOnly( ehandle entityEhandle, string inputName )Fire Entity's Action Input w/no data
FireEntityIOInputStringvoid FireEntityIOInputString( ehandle entityEhandle, string inputName, string value )Fire Entity's Action Input with passed String - you own the memory
FireEntityIOInputVecvoid FireEntityIOInputVec( ehandle entityEhandle, string inputName, Vector value )Fire Entity's Action Input with passed Vector - you own the memory
FireGameEventvoid FireGameEvent( string eventName, table parameters )Fire a game event.
FireGameEventLocalvoid FireGameEventLocal( string eventName, table parameters )Fire a game event without broadcasting to the client.
FrameTimefloat FrameTime( )Get the time spent on the server in the last frame
GetActiveSpawnGroupHandleint GetActiveSpawnGroupHandle( )Returns the currently active spawn group handle
GetFrameCountint GetFrameCount( )Returns the engines current frame count
GetListenServerHosthandle GetListenServerHost( )Get the local player on a listen server.
GetMapNamestring GetMapName( )Get the name of the map.
GetMaxOutputDelayfloat GetMaxOutputDelay( ehandle entityEhandle, string outputName )Get the longest delay for all events attached to an output
GetPhysAngularVelocityVector GetPhysAngularVelocity( handle entity )Get Angular Velocity for VPHYS or normal object. Returns a vector of the axis of rotation, multiplied by the degrees of rotation per second.
GetPhysVelocityVector GetPhysVelocity( handle entity )Get Velocity for VPHYS or normal object
InitLogFilevoid InitLogFile( string string_1, string string_2 )InitLogFile is deprecated. Print to the console for logging instead. If the given file doesn't exist, creates it with the given contents; does nothing if it exists.
IsClientbool IsClient( )Returns true if this is lua running from the client.dll.
IsDedicatedServerbool IsDedicatedServer( )Returns true if this server is a dedicated server.
IsInToolsModebool IsInToolsMode( )Returns true if this is lua running within tools mode.
IsMarkedForDeletionbool IsMarkedForDeletion( handle entity )Returns true if the entity is valid and marked for deletion.
IsServerbool IsServer( )Returns true if this is lua running from the server.dll.
IsValidEntitybool IsValidEntity( handle entity )Checks to see if the given hScript is a valid entity
LerpVectorsVector LerpVectors( Vector startVector, Vector endVector, float factor )lerp between two vectors by a float factor returning new vector
ListenToGameEventint ListenToGameEvent( string eventname, function callback, table context )Register as a listener for a game event from script.
LoadKeyValuestable LoadKeyValues( string textFile )Creates a table from the specified keyvalues text file
LoadKeyValuesFromStringtable LoadKeyValuesFromString( string keyValues )Creates a table from the specified keyvalues string
LocalTimetable LocalTime( )Get the current local time
MakeStringTokenint MakeStringToken( string string_1 )Checks to see if the given hScript is a valid entity
ManuallyTriggerSpawnGroupCompletionvoid ManuallyTriggerSpawnGroupCompletion( int int_1 )Triggers the creation of entities in a manually-completed spawn group
Plat_FloatTimefloat Plat_FloatTime( )Get the current float time from the engine
PlayerInstanceFromIndexhandle PlayerInstanceFromIndex( int index )Get a script instance of a player by index.
PrecacheEntityFromTablevoid PrecacheEntityFromTable( string classname, handle spawnKeyValues, handle context )Precache an entity from KeyValues in table
PrecacheEntityListFromTablevoid PrecacheEntityListFromTable( table groupSpawnTables, handle context )Precache a list of entity KeyValues tables
PrecacheResourcevoid PrecacheResource( string modelName, handle context )Manually precache a single model
QSlerpQAngle QSlerp( QAngle fromAngle, QAngle toAngle, float time )Spherical lerp of angle from->to based on time
RandomFloatfloat RandomFloat( float min, float max )Get a random float within a range
RandomIntint RandomInt( int min, int max )Get a random int within a range (inclusive)
RegisterSpawnGroupFilterProxyvoid RegisterSpawnGroupFilterProxy( string string_1 )Create a C proxy for a script-based spawn group filter
ReloadMOTDvoid ReloadMOTD( )Reloads the MotD file
RemoveSpawnGroupFilterProxyvoid RemoveSpawnGroupFilterProxy( string string_1 )Remove the C proxy for a script-based spawn group filter
RotateOrientationQAngle RotateOrientation( QAngle QAngle_1, QAngle QAngle_2 )Rotate a QAngle by another QAngle.
RotatePositionVector RotatePosition( Vector rotationOrigin, QAngle rotationAngle, Vector vectorToRotate )Rotate a Vector around a point.
RotateQuaternionByAxisAngleQuaternion RotateQuaternionByAxisAngle( Quaternion Quaternion_1, Vector axis, float angle )Rotates a quaternion by the specified angle around the specified vector axis
RotationDeltaQAngle RotationDelta( QAngle src, QAngle dest )Find the delta between two QAngles.
RotationDeltaAsAngularVelocityVector RotationDeltaAsAngularVelocity( QAngle QAngle_1, QAngle QAngle_2 )Converts delta QAngle to an angular velocity Vector
ScreenShakevoid ScreenShake( Vector vecCenter, float flAmplitude, float flFrequency, float flDuration, float flRadius, int eCommand, bool bAirShake )Start a screenshake. eCommand values: SHAKE_START = 0, SHAKE_STOP = 1
ScriptGetGameModeint ScriptGetGameMode( )Gets the current game mode.
ScriptGetGameTypeint ScriptGetGameType( )Gets the current game type.
ScriptGetRoundsPlayedint ScriptGetRoundsPlayed( )Get the number of rounds played so far.
ScriptIsLocalPlayerUsingControllerbool ScriptIsLocalPlayerUsingController( )Returns whether the player is playing with a controller or not.
ScriptIsWarmupPeriodbool ScriptIsWarmupPeriod( )Is it warmup or not.
SendToConsolevoid SendToConsole( string command )Send a string to the console as a client command
SendToServerConsolevoid SendToServerConsole( string command )Send a string to the console as a server command
SetOpvarFloatAllvoid SetOpvarFloatAll( string string_1, string string_2, string string_3, float float_4 )Sets an opvar value for all players
SetOpvarFloatPlayervoid SetOpvarFloatPlayer( string string_1, string string_2, string string_3, float float_4, handle handle_5 )Sets an opvar value for a single player
SetPhysAngularVelocityvoid SetPhysAngularVelocity( handle entity, Vector angVel )Set Angular Velocity for VPHYS or normal object, from a vector of the axis of rotation, multiplied by the degrees of rotation per second.
SetQuestNamevoid SetQuestName( string string_1 )Set the current quest name.
SetQuestPhasevoid SetQuestPhase( int int_1 )Set the current quest phase.
SetRenderingEnabledvoid SetRenderingEnabled( ehandle entityEhandle, bool isEnabled )Set rendering on/off for an ehandle
SpawnEntityFromTableAsynchronousvoid SpawnEntityFromTableAsynchronous( string classname, table spawnKeyValues, function callback, handle handle_4 )Asynchronously spawns a single entity from a table
SpawnEntityFromTableSynchronoushandle SpawnEntityFromTableSynchronous( string classname, table spawnKeyValues )Synchronously spawns a single entity from a table
SpawnEntityGroupFromTablebool SpawnEntityGroupFromTable( table groupSpawnTables, bool bAsync, function callback )Hierarchically spawn an entity group from a set of spawn tables.
SpawnEntityListFromTableAsynchronousint SpawnEntityListFromTableAsynchronous( table groupSpawnTables, function callback )Asynchronously spawn an entity group from a list of spawn tables. A callback will be triggered when the spawning is complete
SpawnEntityListFromTableSynchronoushandle SpawnEntityListFromTableSynchronous( table groupSpawnTables )Synchronously spawn an entity group from a list of spawn tables.
SplineQuaternionsQuaternion SplineQuaternions( Quaternion q0, Quaternion q1, float t )Very basic interpolation of q0 to q1 over t on [0,1]
SplineVectorsVector SplineVectors( Vector v0, Vector v1, float t )Very basic interpolation of v0 to v1 over t on [0,1]
StopEffectvoid StopEffect( handle entity, string effectName )Pass entity and effect name
StopListeningToAllGameEventsvoid StopListeningToAllGameEvents( table context )Stop listening to all game events within a specific context.
StopListeningToGameEventbool StopListeningToGameEvent( int eventlistener )Stop listening to a particular game event.
Timefloat Time( )Get the current server time
TraceCollideablebool TraceCollideable( table parameters )Pass table - Inputs: start, end, ent, (optional mins, maxs) -- outputs: pos, fraction, hit, startsolid, normal
TraceHullbool TraceHull( table parameters )Pass table - Inputs: start, end, min, max, mask, ignore -- outputs: pos, fraction, hit, enthit, startsolid
TraceLinebool TraceLine( table parameters )Pass table - Inputs: startpos, endpos, mask, ignore -- outputs: pos, fraction, hit, enthit, startsolid
UTIL_Removevoid UTIL_Remove( handle entity )Removes the specified entity
UTIL_RemoveImmediatevoid UTIL_RemoveImmediate( handle entity )Immediately removes the specified entity
UnloadSpawnGroupvoid UnloadSpawnGroup( string name )Unload a spawn group by name
UnloadSpawnGroupByHandlevoid UnloadSpawnGroupByHandle( int int_1 )Unload a spawn group by handle
UserIDToControllerHScripthandle UserIDToControllerHScript( int userid )Turn a userid integer (typically, fields named 'userid' in game events) to an HScript representing the associated player controller's script instance.
VectorToAnglesQAngle VectorToAngles( Vector input )Get Qangles (with no roll) for a Vector.
cvar_getffloat cvar_getf( string cvarName )Gets the value of the given cvar, as a float.
cvar_setfbool cvar_setf( string cvarName, float value )Sets the value of the given cvar, as a float.

  1. It is not confirmed whether Pulse will be available to the public at all.