Team Fortress 2/Scripting/Script Functions
< Team Fortress 2 | Scripting
Jump to navigation
Jump to search
This list contains the engine-related Squirrel classes, functions and variables available for VScript in Template:Game name. The official documentation can be printed in the console by setting
developer
to non-zero, loading a map, and executing script_help
.
Variables
Instance | Type | Description |
---|---|---|
Entities
|
CEntities
|
Provides access to spawned entities in the server. |
Classes
CBasePlayer
Extends CBaseAnimating
Methods
Function | Signature | Description |
---|---|---|
IsNoclipping
|
bool IsNoclipping()
|
Returns true if the player is in noclip mode. |
CTFPlayer
Script handle class for TF2 player entities.
Methods
Function | Signature | Description |
---|---|---|
AddCond
|
void AddCond(string classname)
|
|
AddCondEx
|
void AddCondEx(string, float, handle)
|
|
AddCustomAttribute
|
void AddCondEx(string, float, float)
|
Add a custom attribute to the player |
ApplyAbsVelocityImpulse
|
void ApplyAbsVelocityImpulse(Vector)
|
|
ApplyPunchImpulseX
|
bool ApplyPunchImpulseX(float)
|
|
CanAirDash
|
bool CanAirDash()
|
|
CanBeDebuffed
|
bool CanBeDebuffed()
|
|
CanBreatheUnderwater
|
bool CanBreatheUnderwater()
|
|
CanDuck
|
bool CanDuck()
|
Can the player duck? |
CanGetWet
|
bool CanGetWet()
|
|
CanJump
|
bool CanJump()
|
Can the player jump? |
CanPlayerMove
|
bool CanPlayerMove()
|
Can the player move? |
DropFlag
|
void DropFlag(bool)
|
Force player to drop the flag. |
DropRune
|
void DropRune(bool, int)
|
Force player to drop mannpower power up. |
FiringTalk
|
void FiringTalk()
|
Makes eg. a heavy go AAAAAAAAAAaAaa like they are firing their minigun. |
ForceChangeTeam
|
void ForceChangeTeam(int, bool)
|
Force player to change their team. |
GetBackstabs
|
int GetBackstabs()
|
|
GetBonusPoints
|
int GetBonusPoints()
|
|
GetBuildingsDestroyed
|
int GetBuildingsDestroyed()
|
|
GetCaptures
|
int GetCaptures()
|
|
GetClassEyeHeight
|
Vector GetClassEyeHeight()
|
Gets the eye height of the player |
GetCondDuration
|
float GetCondDuration(string)
|
|
GetCurrentTauntMoveSpeed
|
float GetCurrentTauntMoveSpeed()
|
|
GetDefenses
|
int GetDefenses()
|
|
GetDisguiseAmmoCount
|
int GetDisguiseAmmoCount()
|
|
GetDisguiseTarget
|
handle GetDisguiseTarget()
|
|
GetDisguiseTeam
|
int GetDisguiseTeam()
|
|
GetDisguiseTeam
|
int GetDisguiseTeam()
|
|
GetDominations
|
int GetDominations()
|
|
GetGrapplingHookTarget
|
handle GetGrapplingHookTarget()
|
What entity is the player grappling? |
GetHeadshots
|
int GetHeadshots()
|
|
GetHealPoints
|
int GetHealPoints()
|
|
GetHealTarget
|
handle GetHealTarget()
|
Who is the medic healing? |
GetInvulns
|
int GetInvulns()
|
|
GetKillAssists
|
int GetKillAssists()
|
|
GetNextChangeClassTime
|
float GetNextChangeClassTime()
|
Get next change class time. |
GetNextChangeTeamTime
|
float GetNextChangeTeamTime()
|
Get next change team time. |
GetNextRegenTime
|
float GetNextRegenTime()
|
Get next health regen time. |
GetRageMeter
|
float GetRageMeter()
|
|
GetResupplyPoints
|
float GetResupplyPoints()
|
|
GetRevenge
|
int GetRevenge()
|
|
GetScoutHypeMeter
|
float GetScoutHypeMeter()
|
|
GetSpyCloakMeter
|
float GetSpyCloakMeter()
|
|
GetTeleports
|
int GetTeleports()
|
|
GetTimeSinceCalledForMedic
|
float GetTimeSinceCalledForMedic()
|
When did the player last call medic |
HasItem
|
bool HasItem()
|
Currently holding an item? Eg. capture flag |
InAirDueToExplosion
|
bool InAirDueToExplosion()
|
|
InAirDueToKnockback
|
bool InAirDueToKnockback()
|
|
IsAirDashing
|
bool IsAirDashing()
|
|
IsAllowedToTaunt
|
bool IsAllowedToTaunt()
|
|
InCond
|
bool IsAllowedToTaunt(string)
|
|
IsCallingForMedic
|
bool IsCallingForMedic()
|
Is this player calling for medic? |
IsCarryingRune
|
bool IsCarryingRune()
|
Is this player carrying mannpower power up? |
IsControlStunned
|
bool IsControlStunned()
|
|
IsCritBoosted
|
bool IsCritBoosted()
|
|
IsFireproof
|
bool IsFireproof()
|
|
IsFullyInvisible
|
bool IsFullyInvisible()
|
|
IsHypeBuffed
|
bool IsHypeBuffed()
|
|
IsImmuneToPushback
|
bool IsImmuneToPushback()
|
|
IsInspecting
|
bool IsInspecting()
|
|
IsInvulnerable
|
bool IsInvulnerable()
|
|
IsJumping
|
bool IsJumping()
|
|
IsMiniBoss
|
bool IsMiniBoss()
|
Is this player an MvM mini-boss? |
IsParachuteEquipped
|
bool IsParachuteEquipped()
|
|
IsPlacingSapper
|
bool IsPlacingSapper()
|
Returns true if we placed a sapper in the last few moments |
IsRageDraining
|
bool IsRageDraining()
|
|
IsRegenerating
|
bool IsRegenerating()
|
|
IsSapping
|
bool IsSapping()
|
Returns true if we are currently sapping |
IsSnared
|
bool IsSnared()
|
|
IsStealthed
|
bool IsStealthed()
|
|
IsUsingActionSlot
|
bool IsUsingActionSlot()
|
|
IsViewingCYOAPDA
|
bool IsViewingCYOAPDA()
|
|
RemoveAllCond
|
void RemoveAllCond()
|
|
RemoveAllObjects
|
void RemoveAllObjects(bool)
|
Remove all player objects. Eg. dispensers/sentries. |
RemoveCond
|
void RemoveCond(string)
|
|
RemoveCondEx
|
void RemoveCondEx(string, bool)
|
|
RemoveCustomAttribute
|
void RemoveCustomAttribute(string)
|
Remove a custom attribute to the player |
RemoveDisguise
|
void RemoveDisguise()
|
Undisguise a spy. |
RemoveInvisibility
|
void RemoveInvisibility()
|
Un-invisible a spy. |
ResetScores
|
void ResetScores()
|
|
SetCondDuration
|
void SetCondDuration(string, float)
|
|
SetCurrentTauntMoveSpeed
|
void SetCurrentTauntMoveSpeed(float)
|
|
SetDisguiseAmmoCount
|
void SetDisguiseAmmoCount(int)
|
|
SetGrapplingHookTarget
|
void SetGrapplingHookTarget(handle, bool)
|
Set the player's target grapple entity |
SetIsMiniBoss
|
void SetIsMiniBoss(bool)
|
Make this player an MvM mini-boss. |
SetNextChangeClassTime
|
void SetNextChangeClassTime(float)
|
Set next change class time. |
SetNextChangeTeamTime
|
void SetNextChangeTeamTime(float)
|
Set next change team time. |
SetNextRegenTime
|
void SetNextRegenTime(float)
|
Set next health regen time. |
SetRageMeter
|
void SetRageMeter(float)
|
|
SetScoutHypeMeter
|
void SetScoutHypeMeter(float)
|
|
SetSpyCloakMeter
|
void SetSpyCloakMeter(float)
|
|
SetUseBossHealthBar
|
void SetUseBossHealthBar(bool)
|
|
TryToPickupBuilding
|
bool TryToPickupBuilding()
|
Make the player attempt to pick up a building in front of them |
WasInCond
|
bool WasInCond(string)
|